', '[foo
bar]'],
michael@0: ['
', '[foo
bar]'],
michael@0: ['', '[foo
bar]'],
michael@0: ['
', '[foo
bar]'],
michael@0: ['
', '[foo
bar]'],
michael@0: ['', '[foo
bar]'],
michael@0:
michael@0: ['p', '
[foobar]
'],
michael@0:
michael@0: '[foo] bar ',
michael@0:
michael@0: ['', '
[foo] bar '],
michael@0: ['', '
foo [bar] '],
michael@0: ['', '
[foo bar] '],
michael@0: ['', '[foo] bar '],
michael@0: ['', 'foo [bar] '],
michael@0: ['', '[foo bar] '],
michael@0: ['', '[foo] bar '],
michael@0: ['', 'foo [bar] '],
michael@0: ['', '[foo bar] '],
michael@0: ['', '[foo] bar '],
michael@0: ['', 'foo [bar] '],
michael@0: ['', '[foo bar] '],
michael@0:
michael@0: ['', ' [foo] bar
'],
michael@0: ['', ' foo [bar]
'],
michael@0: ['', ' [foo bar]
'],
michael@0: ['', '[foo] bar
'],
michael@0: ['', 'foo [bar]
'],
michael@0: ['', '[foo bar]
'],
michael@0: ['', '[foo] bar
'],
michael@0: ['', 'foo [bar]
'],
michael@0: ['', '[foo bar]
'],
michael@0:
michael@0: ['', '
[foo] bar '],
michael@0: ['', '
foo [bar] '],
michael@0: ['', '
[foo bar] '],
michael@0: ['', '[foo] bar '],
michael@0: ['', 'foo [bar] '],
michael@0: ['', '[foo bar] '],
michael@0: ['', '[foo] bar '],
michael@0: ['', 'foo [bar] '],
michael@0: ['', '[foo bar] '],
michael@0:
michael@0: [' ', '
[foo] bar '],
michael@0: ['', '
foo [bar] '],
michael@0: ['', '
[foo bar] '],
michael@0: ['', '[foo] bar '],
michael@0: ['', 'foo [bar] '],
michael@0: ['', '[foo bar] '],
michael@0: ['', '[foo] bar '],
michael@0: ['', 'foo [bar] '],
michael@0: ['', '[foo bar] '],
michael@0:
michael@0: ['', ' [foo
bar]'],
michael@0: ['', '[foo bar]
'],
michael@0: ['', '
'],
michael@0: ['', '
[foo] '],
michael@0: ['', '
[foo] '],
michael@0:
michael@0: '
',
michael@0: '
',
michael@0: '
[foo
bar] ',
michael@0: '
[foo bar] ',
michael@0: '
[foo
bar]',
michael@0:
michael@0: // https://bugs.webkit.org/show_bug.cgi?id=47054
michael@0: ['
', '
[foo]
'],
michael@0: // https://bugs.webkit.org/show_bug.cgi?id=47574
michael@0: ['
', '{ foo
ba]r'],
michael@0: ['
', '
[foobar]
'],
michael@0: // From https://bugs.webkit.org/show_bug.cgi?id=47300
michael@0: // http://www.w3.org/Bugs/Public/show_bug.cgi?id=14009
michael@0: ['!', '{
foo
bar
}'],
michael@0: ],
michael@0: //@}
michael@0: forwarddelete: [
michael@0: //@{
michael@0: // Collapsed selection
michael@0: 'foo[]',
michael@0: 'foo[] ',
michael@0: 'foo[]
',
michael@0: 'foo[]bar',
michael@0: 'foo {}bar ',
michael@0: 'foo[ ]bar ',
michael@0: 'foo[]bar baz',
michael@0: 'foo[]baz',
michael@0: 'fo[]öbar',
michael@0: 'fo[]öbar',
michael@0: 'fo[]ö̧bar',
michael@0: '[]öbar',
michael@0: '[]öbar',
michael@0: '[]ö̧bar',
michael@0:
michael@0: '[]שָׁלוֹם',
michael@0: 'שָׁל[]וֹם',
michael@0:
michael@0: 'foo[]
bar
',
michael@0: 'foo[]
bar',
michael@0: 'foo[]bar
',
michael@0: 'foo[]
bar
',
michael@0: 'foo[]
bar',
michael@0: 'foo[]bar
',
michael@0:
michael@0: '{}
foo',
michael@0: '{}
foo',
michael@0: 'foo{} ',
michael@0: 'foo{}
',
michael@0: 'foo{}
',
michael@0: 'foo{}
',
michael@0: 'foo{}
',
michael@0: 'foo{}
',
michael@0: 'foo{}
',
michael@0: '
foo',
michael@0: '
foo',
michael@0: '
foo',
michael@0:
michael@0: '
bar
',
michael@0: '
foo[]
',
michael@0: '
',
michael@0: '
bar',
michael@0: 'foo[]
',
michael@0:
michael@0: '
foo[]
bar
',
michael@0: '
foo[] bar',
michael@0:
michael@0: 'foo[]
bar',
michael@0: '
foo[] bar',
michael@0: 'foo[]
bar',
michael@0: '
foo[]
bar',
michael@0: '
foo[]
bar
',
michael@0: '
foo[]
bar
',
michael@0: '
foo[]
bar',
michael@0: 'foo[] bar',
michael@0:
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar ',
michael@0: 'foo[] bar',
michael@0: 'foo[] bar',
michael@0: 'foo[] bar',
michael@0: 'foo[] bar',
michael@0:
michael@0: 'foo [] ',
michael@0: '[] foo',
michael@0: 'foo[] bar',
michael@0: 'foo[] bar',
michael@0: 'foo[] bar',
michael@0: 'foo[] bar',
michael@0: 'foo[] bar',
michael@0: 'foo [] bar',
michael@0: 'foo [] bar',
michael@0: 'foo[] bar',
michael@0: 'foo [] bar',
michael@0: 'foo [] bar',
michael@0: 'foo[] bar',
michael@0: 'foo[] bar',
michael@0: 'foo[] bar',
michael@0: 'foo[] bar',
michael@0:
michael@0: '
foo [] ',
michael@0: '
[] foo ',
michael@0: '
foo[] bar ',
michael@0: '
foo[] bar ',
michael@0: '
foo[] bar ',
michael@0:
michael@0: '
foo []
',
michael@0: '
[] foo
',
michael@0: '
foo[] bar
',
michael@0: '
foo[] bar
',
michael@0: '
foo[] bar
',
michael@0:
michael@0: '
foo []
',
michael@0: '
[] foo
',
michael@0: '
foo[] bar
',
michael@0: '
foo[] bar
',
michael@0: '
foo[] bar
',
michael@0:
michael@0: '
foo []
',
michael@0: '
[] foo
',
michael@0: '
foo[] bar
',
michael@0: '
foo[] bar
',
michael@0: '
foo[] bar
',
michael@0:
michael@0: '
foo []
',
michael@0: '
[] foo
',
michael@0: '
foo[] bar
',
michael@0: '
foo[] bar
',
michael@0: '
foo[] bar
',
michael@0:
michael@0: // Tables with collapsed selection
michael@0: 'foo[]
baz',
michael@0: 'foo
baz',
michael@0: '
foo[]
baz',
michael@0: '
',
michael@0: '
',
michael@0:
michael@0: 'foo[]
baz',
michael@0: 'foo
baz',
michael@0: '
foo[]
baz',
michael@0: '
foo
baz',
michael@0: '
',
michael@0: '
',
michael@0:
michael@0: 'foo
baz',
michael@0: 'foo[]
baz',
michael@0: '
',
michael@0: '
',
michael@0:
michael@0: // Lists with collapsed selection
michael@0: 'foo[]
bar baz ',
michael@0: 'foo[]
bar baz ',
michael@0: '
foo[] bar ',
michael@0: '
foo[] bar ',
michael@0: '
foo[] bar baz ',
michael@0:
michael@0: '
foo[]
bar ',
michael@0: '
foo[] bar
',
michael@0: '
foo[]
bar
',
michael@0:
michael@0: '
foo[] ',
michael@0: 'foo[]
bar ',
michael@0: 'foo[]
',
michael@0:
michael@0: 'foo[]
bar baz ',
michael@0: 'foo[]
bar ',
michael@0: '
foo[] bar ',
michael@0: '
foo[]bar baz ',
michael@0: '
foo bar[]baz ',
michael@0:
michael@0: '
foo[] bar',
michael@0: '
foo[] bar',
michael@0: '
{} bar',
michael@0: '
foo {} bar',
michael@0:
michael@0: '
foo[] bar',
michael@0: '
foo[] bar',
michael@0: '
{} bar',
michael@0: '
foo {} bar',
michael@0:
michael@0: '
foo[] ',
michael@0: '
foo[] ',
michael@0: '
{} ',
michael@0: '
foo {} ',
michael@0:
michael@0: '
foo[] ',
michael@0: '
foo[] ',
michael@0: '
{} ',
michael@0: '
foo {} ',
michael@0:
michael@0: // Indented stuff with collapsed selection
michael@0: 'foo[]
bar ',
michael@0: 'foo[]
bar ',
michael@0: 'foo[]
bar
',
michael@0: 'foo[]
bar ',
michael@0:
michael@0: 'foo[]
bar
baz
',
michael@0: 'foo[]
',
michael@0: 'foo[]
bar
baz
',
michael@0:
michael@0: 'foo[]
bar
baz
',
michael@0: 'foo[]
bar
baz
',
michael@0: 'foo[]
bar
baz
',
michael@0:
michael@0: 'foo[]
bar extra',
michael@0: 'foo[]
barbaz quz extra',
michael@0: 'foo
bar[] baz quz extra',
michael@0:
michael@0: // Invisible stuff with collapsed selection
michael@0: 'foo[] bar',
michael@0: 'foo[] bar',
michael@0: 'foo[] bar',
michael@0: 'foo[] bar',
michael@0: 'foo[] bar',
michael@0: 'foo[]bar ',
michael@0: 'foo[]
',
michael@0: 'foo[]
',
michael@0: 'foo[]
',
michael@0: 'foo[]
',
michael@0: 'foo[]
',
michael@0: '
bar',
michael@0: '
bar',
michael@0: '
bar',
michael@0: '
bar',
michael@0: '
bar',
michael@0: '
',
michael@0: '
',
michael@0: '
',
michael@0: '
',
michael@0: '
',
michael@0: '
',
michael@0: '
',
michael@0: '
',
michael@0:
michael@0: // Styled stuff with collapsed selection
michael@0: '
foo[]
bar',
michael@0: '
foo[]
bar',
michael@0: '
foo[]
bar',
michael@0: '
foo[]
bar',
michael@0: '
foo[]
bar ',
michael@0: '
foo[]
bar ',
michael@0: '
foo[]bar',
michael@0: '
foo[]bar',
michael@0: 'foo[]
bar',
michael@0:
michael@0: 'foo[]
bar',
michael@0: '
foo[]
bar',
michael@0: '
foo[]
bar',
michael@0: '
foo[]bar',
michael@0: '
foo[]bar',
michael@0: 'foo[]
bar',
michael@0:
michael@0: 'foo[]
bar',
michael@0: '
foo[]
bar',
michael@0: '
foo[]
bar',
michael@0: '
foo[]
bar',
michael@0: '
foo[]
bar ',
michael@0: '
foo[]
bar ',
michael@0:
michael@0: '
foo[]
bar',
michael@0: 'foo[]bar',
michael@0: '
bar',
michael@0: 'bar',
michael@0: '
foo[]
bar',
michael@0:
michael@0: // Uncollapsed selection (should be same as delete command)
michael@0: 'foo[bar]baz',
michael@0: '
foo[bar] baz',
michael@0: '
foo{bar} baz',
michael@0: '
foo{bar }baz',
michael@0: '
[foobar] baz',
michael@0: '
{foobar} baz',
michael@0: '
foo[bar baz]',
michael@0: '
foo{bar baz}',
michael@0: '
foo[bar baz] quz',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foo{bar} baz',
michael@0: 'foo{bar }baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo{bar} baz',
michael@0: 'foo{bar }baz',
michael@0: 'foo[bar baz]quz ',
michael@0: '
foo
[bar]
baz
',
michael@0: '
foo
{bar}
baz
',
michael@0: '
foo
{bar
}
baz
',
michael@0: '
foo
{
bar}
baz
',
michael@0: '
foo
{
bar
}
baz
',
michael@0:
michael@0: '
foo[bar
baz]quz',
michael@0: '
foo[bar
baz]quz
',
michael@0: '
foo[bar
baz]quz ',
michael@0: '
foo[bar
baz]quz',
michael@0: '
foo[bar baz]quz ',
michael@0:
michael@0: '
foo[bar
baz]quz',
michael@0: '
baz]quz',
michael@0: '
foo[bar
baz]quz
qoz
foo[bar
baz]quz',
michael@0: '
foo[bar
baz]quz ',
michael@0:
michael@0: '
',
michael@0:
michael@0: 'foo[
]bar',
michael@0: '
foo[
]bar
',
michael@0: '
foo[
]bar baz
',
michael@0: 'foo[
]bar
',
michael@0: 'foo{
}bar
',
michael@0: 'foo[
]bar baz
',
michael@0: 'foo[
]bar
baz',
michael@0: 'foo{
bar
}baz',
michael@0: 'foo
{bar
}baz',
michael@0: 'foo{
bar}
baz',
michael@0: '
foo[
]bar',
michael@0: '
foo{
}bar',
michael@0: '
foo[
]bar
baz',
michael@0: '
foo[
]bar
baz
',
michael@0: 'foo[
',
michael@0: '
]bar',
michael@0: 'foo[
',
michael@0: 'foo[
',
michael@0: '
]baz',
michael@0: '
]baz',
michael@0:
michael@0: '
foo {
]bar',
michael@0: '
foo {
]bar',
michael@0: 'foo
{
]bar
',
michael@0: 'foo
{
]bar
',
michael@0: '
foo {
}bar
',
michael@0: '
foo {
}bar
',
michael@0:
michael@0: '
',
michael@0: '
',
michael@0: '
',
michael@0: '
',
michael@0: '
',
michael@0: '
',
michael@0: '{
}',
michael@0: '
',
michael@0: '
fo[o
baz',
michael@0: '
foo
b]az',
michael@0: '
fo[o
b]az',
michael@0:
michael@0: '
foo
ba[r b]az quz',
michael@0: '
foo
bar [baz] quz',
michael@0: '
fo[o
b]ar baz quz',
michael@0: '
foo
bar ba[z q]uz',
michael@0: '
fo[o
bar b]az quz',
michael@0: '
fo[o
bar baz q]uz',
michael@0:
michael@0: '
fo[o b]ar ',
michael@0: '
fo[o ',
michael@0:
michael@0: 'foo[
]bar ',
michael@0: '
foo[ ]bar ',
michael@0: 'foo[
]bar baz ',
michael@0: 'foo[
]bar ',
michael@0: '
foo[ ]bar ',
michael@0: '
foo[]bar baz ',
michael@0: '
foo bar[]baz ',
michael@0:
michael@0: // https://bugs.webkit.org/show_bug.cgi?id=35281
michael@0: // http://www.w3.org/Bugs/Public/show_bug.cgi?id=13976
michael@0: '
foo {}
bar ',
michael@0: '
foo {}
bar ',
michael@0: '
foo
{}
bar ',
michael@0: '
foo {}
bar ',
michael@0: '
foo {}
bar ',
michael@0: '
foo {}
bar ',
michael@0: '
foo {}
bar ',
michael@0: '
foo {}bar ',
michael@0: '
foo {} bar ',
michael@0: '
foo[ bar]
baz ',
michael@0: '
foo[ bar]
baz ',
michael@0: '
foo[
bar]
baz ',
michael@0: '
fo[]o bar ',
michael@0: '
foo [bar
]baz ',
michael@0: '
foo [bar
]baz ',
michael@0: '
foo [bar
]baz
',
michael@0: '
foo []bar ',
michael@0: '
foo[ bar baz]
quz ',
michael@0: '
{}
',
michael@0: '
{}
',
michael@0: '
foo[ bar] baz quz ',
michael@0: '
foo {}
',
michael@0: '
foo {}
',
michael@0: '
{}
bar ',
michael@0: '
{}
bar ',
michael@0:
michael@0: // http://www.w3.org/Bugs/Public/show_bug.cgi?id=13831
michael@0: '
[foo] ',
michael@0: '
[foo] ',
michael@0: '
[foo] ',
michael@0: '
{foo} ',
michael@0: '
{foo }',
michael@0: '
[]f ',
michael@0: '[foo] ',
michael@0: '
[foo]
',
michael@0: ],
michael@0: //@}
michael@0: hilitecolor: [
michael@0: //@{
michael@0: 'foo[]bar',
michael@0: '
[foo
bar]
',
michael@0: '
[foo bar] ',
michael@0: '
[foo
bar
baz]
',
michael@0: '
[foo
bar]',
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar ',
michael@0: 'foo {}bar ',
michael@0: 'foo[ ]bar ',
michael@0: 'foo[bar]baz',
michael@0: 'foo[barbaz]qoz quz',
michael@0: 'foo[barbaz]qoz quz',
michael@0: '{
foo
}',
michael@0:
michael@0: '
',
michael@0: '
',
michael@0: '
',
michael@0: '
',
michael@0: '
',
michael@0: '{
}',
michael@0:
michael@0: '
foo[bar]baz
',
michael@0: '
foo[bar]baz
',
michael@0: '
foo[bar]baz
',
michael@0: '{
foo
bar
}',
michael@0: '
foo[bar] baz ',
michael@0: '
foo[bar] baz ',
michael@0: '
foo[bar] baz ',
michael@0: '
foo[bar] baz ',
michael@0: '
foob[ar] baz ',
michael@0: '
foob[ar] baz
',
michael@0: '
',
michael@0: '
b[ar] ',
michael@0:
michael@0: // Tests for queryCommandIndeterm() and queryCommandState()
michael@0: 'fo[o
b]ar baz',
michael@0: 'foo
ba[r b]az',
michael@0: 'fo[o
bar b]az',
michael@0: 'foo[
b]ar baz',
michael@0: 'foo
ba[r ]baz',
michael@0: 'foo[
bar ]baz',
michael@0: 'foo
[bar] baz',
michael@0: 'foo{
bar }baz',
michael@0: '
fo[o b]ar ',
michael@0: '
fo[o b]ar ',
michael@0: '
fo[ob]ar ',
michael@0:
michael@0: // http://www.w3.org/Bugs/Public/show_bug.cgi?id=13829
michael@0: '!
[foo] ',
michael@0: '!
[foo] ',
michael@0: '!
foo[bar]baz ',
michael@0: '!
foo[bar]baz ',
michael@0: '![foo
bar baz]',
michael@0: '![foo
bar baz]',
michael@0: ],
michael@0: //@}
michael@0: indent: [
michael@0: //@{
michael@0: // All these have a trailing unselected paragraph, because otherwise
michael@0: // Gecko is unhappy: it throws exceptions in non-CSS mode, and in CSS
michael@0: // mode it adds the indentation invisibly to the wrapper div in many
michael@0: // cases.
michael@0: 'foo[]bar
extra',
michael@0: 'foo {}bar
extra',
michael@0: 'foo[ ]bar
extra',
michael@0: 'foo[bar]baz
extra',
michael@0: '
פו[בר]בז
נוםף',
michael@0: '
פו[ברבז
Foobar]baz
Extra',
michael@0: '
Foo[barbaz
פובר]בז
Extra',
michael@0: '
Extra',
michael@0: 'foo]bar[baz
extra',
michael@0: '{
foo
}
extra',
michael@0: 'foo[barbaz]qoz quz
extra',
michael@0: '[]foo
extra',
michael@0: 'foo[]
extra',
michael@0: '
[]foo
extra',
michael@0: '
foo[]
extra',
michael@0: '
{} foo
extra',
michael@0: '
foo {}
extra',
michael@0: '{} foo bar
extra',
michael@0: 'foo {} bar
extra',
michael@0: '
foo
{}
bar
',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '{
}
extra',
michael@0:
michael@0: '
foo[bar]
baz
extra',
michael@0: '
[foobar
ba]z
extra',
michael@0: 'foo[bar] baz
extra',
michael@0: 'foo[bar] baz
extra',
michael@0: 'foobar [ba]z
extra',
michael@0: 'foobar [ba]z
extra',
michael@0: 'foo[bar ba]z
extra',
michael@0: '
extra',
michael@0:
michael@0: // These mimic existing indentation in various browsers, to see how
michael@0: // they cope with indenting twice. This is spec, Gecko non-CSS, and
michael@0: // Opera:
michael@0: '
foo[bar]
baz
extra',
michael@0: '
foo[bar
b]az
extra',
michael@0: '
foo[bar]
baz
extra',
michael@0: '
foo[bar
b]az
extra',
michael@0: '
[foo]
bar
extra',
michael@0: '
[foo
b]ar
extra',
michael@0: '
foo
bar
[baz]
extra',
michael@0: '
foo
[bar
baz]
extra',
michael@0: '
[foo
bar
baz]
extra',
michael@0: '
foo
[bar]
baz
extra',
michael@0:
michael@0: '
foo[bar] baz extra',
michael@0: '
foo[bar b]az extra',
michael@0: '
foo[bar] baz
extra',
michael@0: '
foo[bar b]az
extra',
michael@0: '[foo]
bar extra',
michael@0: '[foo
b]ar extra',
michael@0: 'foo
bar [baz]
extra',
michael@0: '[foo
bar baz]
extra',
michael@0: '
foo [bar]
baz extra',
michael@0:
michael@0: // IE:
michael@0: '
foo[bar]
baz
extra',
michael@0: '
foo[bar
b]az
extra',
michael@0: '
foo[bar]
baz
extra',
michael@0: '
foo[bar
b]az
extra',
michael@0: '
[foo]
bar
extra',
michael@0: '
[foo
b]ar
extra',
michael@0: '
foo
bar
[baz]
extra',
michael@0: '
foo
[bar
baz]
extra',
michael@0: '
[foo
bar
baz]
extra',
michael@0: '
foo
[bar]
baz
extra',
michael@0:
michael@0: // Firefox CSS mode:
michael@0: '
foo[bar]
baz
extra',
michael@0: '
foo[bar
b]az
extra',
michael@0: '
foo[bar]
baz
extra',
michael@0: '
foo[bar
b]az
extra',
michael@0: '
[foo]
bar
extra',
michael@0: '
[foo
b]ar
extra',
michael@0: '
foo
bar
[baz]
extra',
michael@0: '
foo
[bar
baz]
extra',
michael@0: '
[foo
bar
baz]
extra',
michael@0: '
foo
[bar]
baz
extra',
michael@0:
michael@0: // WebKit:
michael@0: '
foo[bar]
baz
extra',
michael@0: '
foo[bar
b]az
extra',
michael@0: '
foo[bar]
baz
extra',
michael@0: '
foo[bar
b]az
extra',
michael@0: '
[foo]
bar
extra',
michael@0: '
[foo
b]ar
extra',
michael@0: '
foo
bar
[baz]
extra',
michael@0: '
foo
[bar
baz]
extra',
michael@0: '
[foo
bar
baz]
extra',
michael@0: '
foo
[bar]
baz
extra',
michael@0:
michael@0: // MDC says "In Firefox, if the selection spans multiple lines at
michael@0: // different levels of indentation, only the least indented lines in
michael@0: // the selection will be indented." Let's test that.
michael@0: '
f[oob]ar extra',
michael@0:
michael@0: // Lists!
michael@0: '
foo [bar] baz ',
michael@0: '
foo bar baz ',
michael@0: '
foo [bar]',
michael@0: '
[foo] bar baz ',
michael@0: '
foo [bar] baz ',
michael@0: '
[foo]
barbaz ',
michael@0: '
foo[bar] baz quz ',
michael@0: '
foobar [baz] quz ',
michael@0: '
foo [bar] baz quz ',
michael@0: '
foo bar baz quz ',
michael@0: '
foo bar [baz] quz ',
michael@0: '
foo bar baz quz ',
michael@0: '
foob[a]r baz ',
michael@0: '
foo b[a]r baz ',
michael@0: '
foo{bar } baz ',
michael@0: '
foo {bar }baz ',
michael@0: '
[foo]bar baz ',
michael@0: '
[foo] bar baz ',
michael@0: '
foo [bar]baz quz ',
michael@0: '
foo [bar] baz quz ',
michael@0: '
foobar baz [quz] ',
michael@0: '
foo bar baz [quz] ',
michael@0:
michael@0: // Lists with id's:
michael@0: // http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-July/020721.html
michael@0: '
foo [bar] baz ',
michael@0: '
foo [bar] baz ',
michael@0: '
foo [bar] baz ',
michael@0: '
[bar] baz ',
michael@0: '
foo [bar] ',
michael@0:
michael@0: // Try indenting multiple items at once.
michael@0: '
foo b[ar baz] ',
michael@0: '
[foobar] baz ',
michael@0: '
[foo bar] baz ',
michael@0: '
foob[ar b]az ',
michael@0: '
foo b[ar b]az ',
michael@0: '
[foobar baz] extra',
michael@0: '
[foo bar baz] extra',
michael@0:
michael@0: // We probably can't actually get this DOM . . .
michael@0: '
[foo]bar baz ',
michael@0: '
foo[bar] baz ',
michael@0: '
foobar [baz] ',
michael@0: '
[foobar] baz ',
michael@0:
michael@0: 'foo[baz]
extra',
michael@0: '[foo]baz
extra',
michael@0: '
foo{}
extra',
michael@0: '
{}bar
extra',
michael@0:
michael@0: // Whitespace nodes
michael@0: '
foo
[bar]',
michael@0: '
[foo]
bar
',
michael@0: '
foo
[bar]
baz
',
michael@0: '
foo bar [baz] ',
michael@0: '
foo bar [baz] ',
michael@0: '
foo bar [baz] ',
michael@0: '
foobar [baz] ',
michael@0: '
foobar [baz] ',
michael@0: '
foobar [baz] ',
michael@0: '
foo [bar] baz ',
michael@0: '
foo [bar] baz ',
michael@0: '
foo [bar] baz ',
michael@0: '
foo [bar] baz ',
michael@0: '
foo [bar] baz ',
michael@0: '
foo [bar] baz ',
michael@0:
michael@0: // https://bugs.webkit.org/show_bug.cgi?id=32003
michael@0: '
',
michael@0: ],
michael@0: //@}
michael@0: inserthorizontalrule: [
michael@0: //@{
michael@0: 'foo[]bar',
michael@0: '
foo {}
bar ',
michael@0: '
foo[ ]bar ',
michael@0: '
foo[bar
baz]quz',
michael@0: '
foo {}bar
',
michael@0: '
foo[ ]bar
',
michael@0: '
foo {bar }baz
',
michael@0: '
foo[]bar ',
michael@0: '
foo[]bar ',
michael@0: ["abc", 'foo[bar]baz'],
michael@0: 'foo[bar]baz',
michael@0:
michael@0: 'foo
[bar] baz',
michael@0: 'foo
{bar} baz',
michael@0: 'foo{
bar }baz',
michael@0: '
foo
[bar]
baz',
michael@0: '
foo
{bar}
baz',
michael@0: '
foo{
bar
}
baz',
michael@0:
michael@0: '
foo[bar]baz
',
michael@0: '
foo[bar]baz
',
michael@0: '
foo[bar]baz ',
michael@0: '
foob[a]r baz
',
michael@0:
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz
',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz
',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz quz',
michael@0: '
foo[bar]baz ',
michael@0: '
',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz
',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]bazquz ',
michael@0: '
foobar[baz]quz ',
michael@0: '
foobar[baz]quz qoz qiz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
',
michael@0: '
',
michael@0: '
foo[bar]baz ',
michael@0: '
',
michael@0: '
foo[bar]baz ',
michael@0:
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0: '
foo[bar]baz ',
michael@0:
michael@0: '
foo[bar]baz ',
michael@0:
michael@0: '
',
michael@0: 'fo[o
bar b]az',
michael@0: ],
michael@0: //@}
michael@0: inserthtml: [
michael@0: //@{
michael@0: 'foo[]bar',
michael@0: 'foo[bar]baz',
michael@0: 'foo
[bar] baz',
michael@0: 'foo
{bar} baz',
michael@0: 'foo{
bar }baz',
michael@0: '[foo
bar] baz',
michael@0: '{foo
bar} baz',
michael@0: 'foo
[bar baz]',
michael@0: 'foo
{bar baz}',
michael@0: 'foo
[bar baz] quz',
michael@0:
michael@0: ['', 'foo[bar]baz'],
michael@0: ['\0', 'foo[bar]baz'],
michael@0: ['\x07', 'foo[bar]baz'],
michael@0: // The following line makes Firefox 7.0a2 go into an infinite loop on
michael@0: // my machine.
michael@0: //['\ud800', 'foo[bar]baz'],
michael@0:
michael@0: ['
', 'foo[bar]baz'],
michael@0: ['abc', 'foo[bar]baz'],
michael@0: [' abc', '
foo[bar]baz'],
michael@0: ['
abc', 'foo[bar]baz'],
michael@0: ['
abc', '
{foo }bar '],
michael@0: ['abc', '
foo {bar }baz '],
michael@0: ['abc', '
[foo] bar '],
michael@0:
michael@0: ['abc', 'f[o]o '],
michael@0: ['abc ', 'f[o]o '],
michael@0: ['abc', 'bar'],
michael@0: ['abc ', 'bar'],
michael@0:
michael@0: ['abc ', 'f[o]o '],
michael@0: ['abc ', 'f[o]o '],
michael@0: [' ', 'f[o]o'],
michael@0: ['
', 'f[o]o '],
michael@0: ['abc ', 'f[o]o '],
michael@0: ['abc ', ''],
michael@0: ['abc ', 'f[o]o'],
michael@0:
michael@0: ['abc ', 'f[o]o bar '],
michael@0: ['abc ', 'foo b[a]r '],
michael@0: ['abc ', 'f[o]o bar '],
michael@0: ['abc ', 'foo b[a]r '],
michael@0: ['abc ', 'f[o]o'],
michael@0: ['abc ', 'f[o]o '],
michael@0: ['abc ', 'f[o]o'],
michael@0: ['abc ', 'f[o]o '],
michael@0:
michael@0: [' abc ', '
f[o]o '],
michael@0: ['
abc ', '
f[o]o '],
michael@0: ['
abc ', '
'],
michael@0: ['
abc ', '
f[o]o '],
michael@0: ['
abc ', '
f[o]o '],
michael@0: ['
abc ', '
'],
michael@0: ['
abc ', '
f[o]o '],
michael@0: ['
abc ', '
f[o]o '],
michael@0: ['
abc ', '
'],
michael@0: ['
', '
f[o]o '],
michael@0: ['
', '
f[o]o '],
michael@0: ['
', '
'],
michael@0: ['
abc ', 'f[o]o'],
michael@0:
michael@0: ['
abc ', '
f[o]o '],
michael@0: ['
abc ', 'f[o]o'],
michael@0:
michael@0: ['
abc', 'foo[]bar '],
michael@0: ['
abc', 'foo[]bar '],
michael@0: ['
abc', 'foo[]bar '],
michael@0: [' ', '
[foo]
'],
michael@0: ['
', '
[foo]
'],
michael@0: ['', '
[foo]
'],
michael@0:
michael@0: ['abc', '
{}
'],
michael@0: ['', '
{}
'],
michael@0: ['abc', '
{}
'],
michael@0: ['', '
{}
'],
michael@0: ['abc', '
{}
'],
michael@0: ['', '
{}
'],
michael@0:
michael@0: ['abc', '
{}
'],
michael@0: ['', '
{}
'],
michael@0: ['abc', '
{}
'],
michael@0: ['', '
{}
'],
michael@0: ['abc', '
{}
'],
michael@0: ['', '
{}
'],
michael@0: ],
michael@0: //@}
michael@0: insertimage: [
michael@0: //@{
michael@0: 'foo[]bar',
michael@0: '
foo {}
bar ',
michael@0: '
foo[ ]bar ',
michael@0: ["", 'foo[bar]baz'],
michael@0: 'foo[bar]baz',
michael@0: 'foo
[bar] baz',
michael@0: 'foo
{bar} baz',
michael@0: 'foo{
bar }baz',
michael@0: '[foo
bar] baz',
michael@0: '{foo
bar} baz',
michael@0: 'foo
[bar baz]',
michael@0: 'foo
{bar baz}',
michael@0: 'foo
[bar baz] quz',
michael@0:
michael@0: 'foo
[bar] baz',
michael@0: 'foo
{bar} baz',
michael@0: 'foo{
bar }baz',
michael@0: 'foo
[bar] baz',
michael@0: 'foo
{bar} baz',
michael@0: 'foo{
bar }baz',
michael@0: '
foo[bar baz]quz ',
michael@0: '
foo
[bar]
baz
',
michael@0: '
foo
{bar}
baz
',
michael@0: '
foo
{
bar
}
baz
',
michael@0:
michael@0: '
foo[bar
baz]quz',
michael@0: '
foo[bar
baz]quz
',
michael@0: '
foo[bar
baz]quz ',
michael@0: '
foo[bar
baz]quz',
michael@0: '
foo[bar baz]quz ',
michael@0:
michael@0: '
foo[bar
baz]quz',
michael@0: '
baz]quz',
michael@0: '
foo[bar
baz]quz
qoz
foo[bar
baz]quz',
michael@0: '
foo[bar
baz]quz ',
michael@0:
michael@0: '
',
michael@0:
michael@0: 'foo[
]bar',
michael@0: '
foo[
]bar
',
michael@0: '
foo[
]bar baz
',
michael@0: 'foo[
]bar
',
michael@0: 'foo[
]bar baz
',
michael@0: 'foo[
]bar
baz',
michael@0: '
foo[
]bar',
michael@0: '
foo[
]bar
baz',
michael@0: '
foo[
]bar
baz
',
michael@0: 'foo[
',
michael@0: '
]bar',
michael@0: 'foo[
',
michael@0: 'foo[
',
michael@0: '
]baz',
michael@0: '
]baz',
michael@0: ],
michael@0: //@}
michael@0: insertlinebreak: [
michael@0: //@{ Same as insertparagraph (set below)
michael@0: ],
michael@0: //@}
michael@0: insertorderedlist: [
michael@0: //@{
michael@0: 'foo[]bar',
michael@0: 'foo[bar]baz',
michael@0: 'foo
[bar]',
michael@0: 'f[oo
b]ar
baz',
michael@0: '
[foo] bar
',
michael@0: '[foo
bar] baz',
michael@0: 'foo
[bar baz]',
michael@0: '[foo
baz',
michael@0: 'foo
baz]',
michael@0: 'foo
baz] quz',
michael@0: 'foo
[bar quz',
michael@0:
michael@0: '
',
michael@0: '
',
michael@0: '{
}',
michael@0:
michael@0: '
foo
[bar]
baz',
michael@0: '
foo
[bar] baz',
michael@0: '
foo [bar] baz quz ',
michael@0: '
foo bar [baz] quz ',
michael@0:
michael@0: '
[foo
bar]
baz',
michael@0: '
[foo
bar] baz',
michael@0: '
[foo bar] baz quz ',
michael@0: '
foo [bar baz] quz ',
michael@0:
michael@0: '
[foo
bar]
baz
',
michael@0:
michael@0:
michael@0: // Various
stuff
michael@0: 'foo [bar] baz ',
michael@0: 'foo [bar]',
michael@0: '[foo]bar ',
michael@0: 'foo [bar]baz ',
michael@0: '[foo] ',
michael@0: '[foo] bar baz ',
michael@0: 'foo [bar] baz ',
michael@0: '[foo]
barbaz ',
michael@0: 'foo[bar] baz quz ',
michael@0: 'foobar [baz] quz ',
michael@0: 'foo [bar] baz quz ',
michael@0: 'foo bar [baz] quz ',
michael@0: '[foo]bar baz ',
michael@0: '[foo] bar baz ',
michael@0: 'foo [bar]baz quz ',
michael@0: 'foo [bar] baz quz ',
michael@0: 'foobar baz [quz] ',
michael@0: 'foo bar baz [quz] ',
michael@0:
michael@0: // Multiple items at once.
michael@0: 'foo [bar baz] ',
michael@0: '[foobar] baz ',
michael@0: 'foob[ar b]az ',
michael@0: '[foobar baz] extra',
michael@0:
michael@0: // We probably can't actually get this DOM . . .
michael@0: '
[foo]bar baz ',
michael@0: 'foo[bar] baz ',
michael@0: 'foobar [baz] ',
michael@0: '[foobar] baz ',
michael@0:
michael@0:
michael@0: // Same stuff but with
michael@0: '',
michael@0: '[bar]',
michael@0: '[foo]',
michael@0: '[bar]',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0:
michael@0: // Multiple items at once.
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: 'extra',
michael@0:
michael@0: // We probably can't actually get this DOM . . .
michael@0: '
',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0:
michael@0:
michael@0: // Mix of and
michael@0: 'foobar quz',
michael@0: 'foobar quz]',
michael@0: 'foobaz quz',
michael@0: '[foobaz quz',
michael@0:
michael@0: // Interaction with indentation
michael@0: '[foo]bar baz',
michael@0: 'foo[bar] baz',
michael@0: '[foobar] baz',
michael@0: 'foo [bar] baz',
michael@0: '[foo]bar baz',
michael@0: 'foo[bar] baz ',
michael@0: '[foobar] baz ',
michael@0: 'foo [bar] baz ',
michael@0:
michael@0: '[foo]
bar
baz',
michael@0: '
foo
[bar]
baz',
michael@0: '
[foo
bar]
baz',
michael@0: '
foo [bar]
baz',
michael@0:
michael@0: // Attributes
michael@0: '
',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0:
michael@0: // Whitespace nodes
michael@0: 'foo [bar]',
michael@0: '
[foo]
bar ',
michael@0: 'foo [bar]
baz ',
michael@0:
michael@0: // This caused an infinite loop at one point due to a bug in "fix
michael@0: // disallowed ancestors". Disabled because I'm not sure how we want it
michael@0: // to behave:
michael@0: // http://www.w3.org/Bugs/Public/show_bug.cgi?id=14578
michael@0: '!foo[] ',
michael@0: ],
michael@0: //@}
michael@0: insertparagraph: [
michael@0: //@{
michael@0: 'foo[bar]baz',
michael@0: 'fo[o',
michael@0: '',
michael@0: '',
michael@0: 'b]ar',
michael@0: '',
michael@0: '{}',
michael@0: '',
michael@0: '[foo] bar ',
michael@0: 'f[o]o bar ',
michael@0:
michael@0: '[]foo',
michael@0: 'foo[]',
michael@0: 'foo[] ',
michael@0: 'foo[] ',
michael@0: 'foo[]bar',
michael@0: ' []foo ',
michael@0: 'foo[] ',
michael@0: 'foo[] ',
michael@0: 'foo[]bar ',
michael@0: '[]foo
',
michael@0: 'foo[]
',
michael@0: 'foo[]
',
michael@0: 'foo[]bar
',
michael@0: '[]foo bar ',
michael@0: 'foo[] bar ',
michael@0: 'foo[] bar ',
michael@0: 'foo[]bar baz ',
michael@0: 'foo []bar ',
michael@0: 'foo bar[] ',
michael@0: 'foo bar[] ',
michael@0: 'foo bar[]baz ',
michael@0: '[]foo ',
michael@0: 'foo[] ',
michael@0: 'foo[] ',
michael@0: 'foo[]bar ',
michael@0: '[]foo ',
michael@0: 'foo[] ',
michael@0: 'foo[] ',
michael@0: 'foo[]bar ',
michael@0: '[]foo
',
michael@0: 'foo[]
',
michael@0: 'foo[]
',
michael@0: 'foo[]bar
',
michael@0: '[]foo ',
michael@0: 'foo[] ',
michael@0: 'foo[] ',
michael@0: 'foo[]bar ',
michael@0:
michael@0: 'foo[] ',
michael@0: 'foo {} ',
michael@0: 'foo
[] ',
michael@0: 'foo[]
',
michael@0: 'foo
[]
',
michael@0:
michael@0: 'foo[]bar ',
michael@0: 'baz',
michael@0: 'foo[]bar
baz',
michael@0: 'foo[]bar ',
michael@0:
michael@0: '{} ',
michael@0: 'foo{} ',
michael@0: '{} foo',
michael@0: 'foo {} ',
michael@0: '{} bar ',
michael@0: 'foo ',
michael@0:
michael@0: '{} ',
michael@0: 'foo {} ',
michael@0: '{} bar ',
michael@0: 'foo bar{} baz ',
michael@0: 'foo barbaz {} ',
michael@0:
michael@0: 'foo[bar baz]quz
',
michael@0: 'foo[bar
baz]quz ',
michael@0: 'foo
{} ',
michael@0: '{}foo
',
michael@0: 'foo
{}bar ',
michael@0: 'foo {}bar
',
michael@0: 'foo {}bar ',
michael@0: 'foo
[bar] baz
',
michael@0: 'foo
{bar }baz
',
michael@0:
michael@0: '',
michael@0: '',
michael@0:
michael@0: '[]foo ',
michael@0: 'foo[] ',
michael@0: 'foo[] ',
michael@0: 'foo[]bar ',
michael@0: '[]foo
',
michael@0: 'foo[]
',
michael@0: 'foo[]bar
',
michael@0: 'foo[]
bar
',
michael@0: 'foo[]bar
baz
',
michael@0:
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar baz',
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar baz',
michael@0: 'foo[] bar',
michael@0: 'foo[]bar ',
michael@0: 'foo[] bar ',
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar baz ',
michael@0:
michael@0: 'foo[]bar
',
michael@0: '[]foo
',
michael@0: 'foo[]bar
',
michael@0: 'foo[]bar
',
michael@0:
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar baz',
michael@0: 'foo[] bar',
michael@0: 'foo[]bar ',
michael@0:
michael@0: 'foo[]',
michael@0: '
[]bar',
michael@0:
michael@0: '
foo[bar] baz',
michael@0: '
foo{bar} baz',
michael@0: '
foo{bar }baz',
michael@0: '
[foobar] baz',
michael@0: '
{foobar} baz',
michael@0: '
foo[bar baz]',
michael@0: '
foo{bar baz}',
michael@0: '
foo[bar baz] quz',
michael@0:
michael@0: // https://bugs.webkit.org/show_bug.cgi?id=5036
michael@0: '
',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0:
michael@0: // http://www.w3.org/Bugs/Public/show_bug.cgi?id=13841
michael@0: // https://bugs.webkit.org/show_bug.cgi?id=23507
michael@0: 'foo[]
',
michael@0: 'foo[]
',
michael@0: 'foo[]
',
michael@0: 'foo[]
',
michael@0: '',
michael@0: 'foo[]',
michael@0: '
foo[]',
michael@0: '
foo[]',
michael@0: '
foo[]',
michael@0: '
foo[]',
michael@0: '
',
michael@0: '
foo[]
',
michael@0:
michael@0: '
[]foo
',
michael@0: '
[]foo
',
michael@0: '
[]foo
',
michael@0: '
[]foo
',
michael@0: '
',
michael@0: '
[]foo',
michael@0: '
[]foo',
michael@0: '
[]foo',
michael@0: '
[]foo',
michael@0: '
[]foo',
michael@0: '
',
michael@0: '
[]foo
',
michael@0:
michael@0: '
foo[]bar
',
michael@0: '
foo[]bar
',
michael@0: '
foo[]bar
',
michael@0: '
foo[]bar
',
michael@0: '
',
michael@0: '
foo[]bar',
michael@0: '
foo[]bar',
michael@0: '
foo[]bar',
michael@0: '
foo[]bar',
michael@0: '
foo[]bar',
michael@0: '
',
michael@0: '
foo[]bar
',
michael@0:
michael@0: '
foo[]
',
michael@0: '
',
michael@0: '
',
michael@0: '
[]foo
',
michael@0: '
',
michael@0: '
',
michael@0: '
foo[]bar
',
michael@0: '
',
michael@0: '
',
michael@0: ],
michael@0: //@}
michael@0: inserttext: [
michael@0: //@{
michael@0: 'foo[bar]baz',
michael@0: ['', 'foo[bar]baz'],
michael@0:
michael@0: ['\t', 'foo[]bar'],
michael@0: ['&', 'foo[]bar'],
michael@0: ['\n', 'foo[]bar'],
michael@0: ['abc\ndef', 'foo[]bar'],
michael@0: ['\x07', 'foo[]bar'],
michael@0:
michael@0: ['
hi ', 'foo[]bar'],
michael@0: ['<', 'foo[]bar'],
michael@0: ['&', 'foo[]bar'],
michael@0:
michael@0: // http://www.w3.org/Bugs/Public/show_bug.cgi?id=14254
michael@0: ['!\r', 'foo[]bar'],
michael@0: ['!\r\n', 'foo[]bar'],
michael@0: ['!\0', 'foo[]bar'],
michael@0: ['!\ud800', 'foo[]bar'],
michael@0:
michael@0: // Whitespace tests! The following two bugs are relevant to some of
michael@0: // these:
michael@0: // http://www.w3.org/Bugs/Public/show_bug.cgi?id=14119
michael@0: // https://bugzilla.mozilla.org/show_bug.cgi?id=681626
michael@0: [' ', 'foo[]bar'],
michael@0: [' ', 'foo []bar'],
michael@0: [' ', 'foo[] bar'],
michael@0: [' ', 'foo []bar'],
michael@0: [' ', 'foo [] bar'],
michael@0: [' ', 'foo[] bar'],
michael@0: [' ', 'foo []bar'],
michael@0: [' ', 'foo [] bar'],
michael@0: [' ', 'foo[] bar'],
michael@0: [' ', 'foo []bar'],
michael@0: [' ', 'foo [] bar'],
michael@0: [' ', 'foo[] bar'],
michael@0: [' ', 'foo [] bar'],
michael@0: [' ', 'foo []bar'],
michael@0: [' ', 'foo [] bar'],
michael@0:
michael@0: [' ', '[]foo'],
michael@0: [' ', '{}foo'],
michael@0: [' ', 'foo[]'],
michael@0: [' ', 'foo{}'],
michael@0: [' ', 'foo []'],
michael@0: [' ', 'foo {}'],
michael@0: [' ', 'foo []'],
michael@0: [' ', 'foo {}'],
michael@0: [' ', '
foo[] bar'],
michael@0: [' ', 'foo[]
bar '],
michael@0:
michael@0: [' ', 'foo[] '],
michael@0: [' ', ' foo [] '],
michael@0: [' ', 'foo[]
'],
michael@0: [' ', 'foo[]
'],
michael@0: [' ', ' []foo'],
michael@0: [' ', ' [] foo '],
michael@0: [' ', '
[]foo'],
michael@0: [' ', '
[]foo'],
michael@0:
michael@0: [' ', '{}
'],
michael@0: [' ', '
{} '],
michael@0:
michael@0: [' ', '
foo[]
bar'],
michael@0: [' ', '
foo []
bar'],
michael@0: [' ', '
foo[]
bar'],
michael@0:
michael@0: // Some of the same tests as above, repeated with various values of
michael@0: // white-space.
michael@0: [' ', '
foo[]bar '],
michael@0: [' ', '
foo []bar '],
michael@0: [' ', '
foo[] bar '],
michael@0: [' ', '
foo []bar '],
michael@0: [' ', '
[]foo '],
michael@0: [' ', '
foo[] '],
michael@0: [' ', '
foo [] '],
michael@0: [' ', '
foo [] '],
michael@0:
michael@0: [' ', '
foo[]bar
'],
michael@0: [' ', '
foo []bar
'],
michael@0: [' ', '
foo[] bar
'],
michael@0: [' ', '
foo []bar
'],
michael@0: [' ', '
[]foo
'],
michael@0: [' ', '
foo[]
'],
michael@0: [' ', '
foo []
'],
michael@0: [' ', '
foo []
'],
michael@0:
michael@0: [' ', '
foo[]bar
'],
michael@0: [' ', '
foo []bar
'],
michael@0: [' ', '
foo[] bar
'],
michael@0: [' ', '
foo []bar
'],
michael@0: [' ', '
[]foo
'],
michael@0: [' ', '
foo[]
'],
michael@0: [' ', '
foo []
'],
michael@0: [' ', '
foo []
'],
michael@0:
michael@0: [' ', '
foo[]bar
'],
michael@0: [' ', '
foo []bar
'],
michael@0: [' ', '
foo[] bar
'],
michael@0: [' ', '
foo []bar
'],
michael@0: [' ', '
[]foo
'],
michael@0: [' ', '
foo[]
'],
michael@0: [' ', '
foo []
'],
michael@0: [' ', '
foo []
'],
michael@0:
michael@0: [' ', '
foo[]bar
'],
michael@0: [' ', '
foo []bar
'],
michael@0: [' ', '
foo[] bar
'],
michael@0: [' ', '
foo []bar
'],
michael@0: [' ', '
[]foo
'],
michael@0: [' ', '
foo[]
'],
michael@0: [' ', '
foo []
'],
michael@0: [' ', '
foo []
'],
michael@0:
michael@0: // End whitespace tests
michael@0:
michael@0: // Autolinking tests
michael@0: [' ', 'http://a[]'],
michael@0: [' ', 'ftp://a[]'],
michael@0: [' ', 'quasit://a[]'],
michael@0: [' ', '.x-++-.://a[]'],
michael@0: [' ', '(http://a)[]'],
michael@0: [' ', '<http://a>[]'],
michael@0: // http://www.w3.org/Bugs/Public/show_bug.cgi?id=14744
michael@0: ['! ', '[http://a][]'],
michael@0: ['! ', '{http://a}[]'],
michael@0: [' ', 'http://a![]'],
michael@0: [' ', '!"#$%&\'()*+,-./:;<=>?\^_`|~http://a!"#$%&\'()*+,-./:;<=>?\^_`|~[]'],
michael@0: [' ', 'http://a!"\'(),-.:;<>`[]'],
michael@0: [' ', 'http://a#$%&*+/=?\^_|~[]'],
michael@0: [' ', 'mailto:a[]'],
michael@0: [' ', 'a@b[]'],
michael@0: [' ', 'a@[]'],
michael@0: [' ', '@b[]'],
michael@0: [' ', '#@x[]'],
michael@0: [' ', 'a@.[]'],
michael@0: [' ', '!"#$%&\'()*+,-./:;<=>?\^_`|~a@b!"#$%&\'()*+,-./:;<=>?\^_`|~[]'],
michael@0: [' ', '
a@b {}'],
michael@0: [' ', '
a @ b {}'],
michael@0: [' ', 'a@b
[]c '],
michael@0: [' ', '
a@b
[]c
'],
michael@0: ['a', 'http://a[]'],
michael@0: ['\t', 'http://a[]'],
michael@0: // http://www.w3.org/Bugs/Public/show_bug.cgi?id=14254
michael@0: ['!\r', 'http://a[]'],
michael@0: // http://www.w3.org/Bugs/Public/show_bug.cgi?id=14745
michael@0: ['!\n', 'http://a[]'],
michael@0: ['\f', 'http://a[]'],
michael@0: ['\u00A0', 'http://a[]'],
michael@0:
michael@0: [' ', 'foo[]'],
michael@0:
michael@0: 'foo[]bar',
michael@0: 'foo []',
michael@0: 'foo\xa0[]',
michael@0: '
foo[]',
michael@0: '
foo
{}',
michael@0: '
[]foo',
michael@0: '
{}foo',
michael@0: '{}
foo',
michael@0: '
foo
{}
bar
',
michael@0: '
foo[] bar',
michael@0: '
foo []bar',
michael@0: 'foo
{} bar',
michael@0: '
foo[] bar',
michael@0: '
foo []bar',
michael@0: '
foo[] bar',
michael@0: '
foo []bar',
michael@0: '
fo[o
b]ar',
michael@0: '
fo[o
bar
b]az',
michael@0: '{} ',
michael@0: '
{} ',
michael@0: '
{} ',
michael@0: '
foo[bar] baz',
michael@0: '
foo{bar} baz',
michael@0: '
foo{bar }baz',
michael@0: '
[foobar] baz',
michael@0: '
{foobar} baz',
michael@0: '
foo[bar baz]',
michael@0: '
foo{bar baz}',
michael@0: '
foo[bar baz] quz',
michael@0:
michael@0:
michael@0: // These are like the corresponding tests in the multitest section, but
michael@0: // because the selection isn't collapsed, we don't need to do
michael@0: // multitests to set overrides.
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0:
michael@0: // Now repeat but with different selections.
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0: '[foobar] baz',
michael@0:
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0:
michael@0: // https://bugs.webkit.org/show_bug.cgi?id=19702
michael@0: '
[foo] ',
michael@0: ],
michael@0: //@}
michael@0: insertunorderedlist: [
michael@0: //@{
michael@0: 'foo[]bar',
michael@0: 'foo[bar]baz',
michael@0: 'foo
[bar]',
michael@0: 'f[oo
b]ar
baz',
michael@0: '
[foo] bar
',
michael@0: '[foo
bar] baz',
michael@0: 'foo
[bar baz]',
michael@0: '[foo
baz',
michael@0: 'foo
baz]',
michael@0: 'foo
baz] quz',
michael@0: 'foo
[bar quz',
michael@0:
michael@0: '
',
michael@0: '
',
michael@0: '{
}',
michael@0:
michael@0: '
foo
[bar]
baz',
michael@0: '
foo
[bar] baz',
michael@0: '
foo [bar] baz quz ',
michael@0: '
foo bar [baz] quz ',
michael@0:
michael@0: '
[foo
bar]
baz',
michael@0: '
[foo
bar] baz',
michael@0: '
[foo bar] baz quz ',
michael@0: '
foo [bar baz] quz ',
michael@0:
michael@0: '
[foo
bar]
baz
',
michael@0:
michael@0:
michael@0: // Various
stuff
michael@0: 'foo [bar] baz ',
michael@0: 'foo [bar]',
michael@0: '[foo]bar ',
michael@0: 'foo [bar]baz ',
michael@0: '[foo] ',
michael@0: '[foo] bar baz ',
michael@0: 'foo [bar] baz ',
michael@0: '[foo]
barbaz ',
michael@0: 'foo[bar] baz quz ',
michael@0: 'foobar [baz] quz ',
michael@0: 'foo [bar] baz quz ',
michael@0: 'foo bar [baz] quz ',
michael@0: '[foo]bar baz ',
michael@0: '[foo] bar baz ',
michael@0: 'foo [bar]baz quz ',
michael@0: 'foo [bar] baz quz ',
michael@0: 'foobar baz [quz] ',
michael@0: 'foo bar baz [quz] ',
michael@0:
michael@0: // Multiple items at once.
michael@0: 'foo [bar baz] ',
michael@0: '[foobar] baz ',
michael@0: 'foob[ar b]az ',
michael@0: '[foobar baz] extra',
michael@0:
michael@0: // We probably can't actually get this DOM . . .
michael@0: '
[foo]bar baz ',
michael@0: 'foo[bar] baz ',
michael@0: 'foobar [baz] ',
michael@0: '[foobar] baz ',
michael@0:
michael@0:
michael@0: // Same stuff but with
michael@0: '',
michael@0: '[bar]',
michael@0: '[foo]',
michael@0: '[bar]',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0:
michael@0: // Multiple items at once.
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: 'extra',
michael@0:
michael@0: // We probably can't actually get this DOM . . .
michael@0: '
',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0:
michael@0:
michael@0: // Mix of and
michael@0: 'foobar quz',
michael@0: 'foobar quz]',
michael@0: 'foobaz quz',
michael@0: '[foobaz quz',
michael@0:
michael@0: // Interaction with indentation
michael@0: '[foo]bar baz',
michael@0: 'foo[bar] baz',
michael@0: '[foobar] baz',
michael@0: 'foo [bar] baz',
michael@0: '[foo]bar baz',
michael@0: 'foo[bar] baz ',
michael@0: '[foobar] baz ',
michael@0: 'foo [bar] baz ',
michael@0:
michael@0: '[foo]
bar
baz',
michael@0: '
foo
[bar]
baz',
michael@0: '
[foo
bar]
baz',
michael@0: '
foo [bar]
baz',
michael@0:
michael@0: // Attributes
michael@0: '
',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0:
michael@0: // Whitespace nodes
michael@0: ' [bar]',
michael@0: '
[foo]
',
michael@0: ' [bar]
',
michael@0:
michael@0: // https://bugs.webkit.org/show_bug.cgi?id=24167
michael@0: '{1
2
}',
michael@0: ],
michael@0: //@}
michael@0: italic: [
michael@0: //@{
michael@0: 'foo[]bar',
michael@0: '[foo
bar]
',
michael@0: '[foo bar] ',
michael@0: '[foo
bar
baz]
',
michael@0: '[foo
bar]',
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar ',
michael@0: 'foo {}bar ',
michael@0: 'foo[ ]bar ',
michael@0: 'foo[bar]baz',
michael@0: 'foo[barbaz]qoz quz',
michael@0: 'foo[barbaz]qoz quz',
michael@0: '{
foo
}',
michael@0:
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '{}',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foo [bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0:
michael@0: 'foo{bar }baz',
michael@0: 'foo{bar }baz',
michael@0: 'foo{bar }baz',
michael@0: 'foo{bar }baz',
michael@0: 'foo{bar }baz',
michael@0: 'foo{bar }baz',
michael@0:
michael@0: 'foob[a]r baz',
michael@0: 'foob[a]r baz',
michael@0: 'foob[a]r baz',
michael@0: 'foob[a]r baz',
michael@0: 'foob[a]r baz',
michael@0: 'foob[a]r baz',
michael@0:
michael@0: 'fo[obar b]az',
michael@0: 'fo[obar b]az',
michael@0: 'fo[obar b]az',
michael@0: 'fo[obar b]az',
michael@0: 'fo[obar b]az',
michael@0: 'fo[obar b]az',
michael@0:
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar baz]',
michael@0:
michael@0: '[foobar ]baz',
michael@0: '[foobar ]baz',
michael@0: '[foobar ]baz',
michael@0: '[foobar ]baz',
michael@0: '[foobar ]baz',
michael@0: '[foobar ]baz',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0:
michael@0: '{ foo
bar
}baz
',
michael@0: 'foo[bar }
baz
',
michael@0: 'foo [bar baz] qoz quz sic',
michael@0: 'foo bar baz [qoz quz] sic',
michael@0: 'foo [bar baz] qoz quz sic',
michael@0: 'foo bar baz [qoz quz] sic',
michael@0:
michael@0: // Tests for queryCommandIndeterm() and queryCommandState()
michael@0: 'fo[ob]ar baz',
michael@0: 'fooba[r b]az',
michael@0: 'fo[obar b]az',
michael@0: 'foo[b]ar baz',
michael@0: 'fooba[r ]baz',
michael@0: 'foo[bar ]baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo{bar }baz',
michael@0: 'fo[ob]ar baz',
michael@0: 'fo[ob]ar baz',
michael@0: 'fo[o b]ar ',
michael@0: 'fo[o b]ar ',
michael@0: 'fo[o b]ar ',
michael@0: ],
michael@0: //@}
michael@0: justifycenter: [
michael@0: //@{
michael@0: 'foo[]barextra',
michael@0: 'foo {}bar
extra',
michael@0: 'foo[ ]bar
extra',
michael@0: 'foo[bar]baz
extra',
michael@0: 'foo[barbaz]qoz quz
extra',
michael@0: '
foo[]bar
extra',
michael@0: '
foo[bar]baz
extra',
michael@0: '
foo[bar]baz extra',
michael@0: '
foo[bar]baz extra',
michael@0: '
foo[bar]baz extra',
michael@0: '
[foo]
bar
extra',
michael@0: '
[foo
bar]
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '{
}extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '{
}extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '{
}extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '{
}extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0:
michael@0: '
foo [bar]extra',
michael@0: '[foo]
bar extra',
michael@0: '
foo [bar]baz extra',
michael@0: '
foo
[bar]extra',
michael@0: '[foo]
bar
extra',
michael@0: '
foo
[bar]baz
extra',
michael@0: '
[bar]
extra',
michael@0: '
[foo]
extra',
michael@0: '
[bar]
extra',
michael@0: '
foo
[bar]extra',
michael@0: '[foo]
bar
extra',
michael@0: '
foo
[bar]baz
extra',
michael@0: '
[bar]
extra',
michael@0: '
[foo]
extra',
michael@0: '
[bar]
extra',
michael@0: '
foo
[bar]
extra',
michael@0: '
[foo]
bar
extra',
michael@0: '
foo
[bar]
baz
extra',
michael@0:
michael@0: '
[foo bar]extra',
michael@0: '
fo[o b]arextra',
michael@0: '
[foo
bar]extra',
michael@0: '
fo[o
b]arextra',
michael@0: '
[foo
bar]extra',
michael@0: '
fo[o
b]arextra',
michael@0: '[foo]
extra',
michael@0: 'f[o]o
extra',
michael@0:
michael@0: '
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '[foo]
extra',
michael@0:
michael@0: '
',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '{
foo
}
',
michael@0: '{
foo
}
',
michael@0: '',
michael@0: '',
michael@0:
michael@0: '[foo]
extra',
michael@0: '
[foo]
extra',
michael@0: '
[foo]
extra',
michael@0: '
[foo]
extra',
michael@0:
michael@0: // Whitespace nodes
michael@0: '
[bar]',
michael@0: '
[bar]',
michael@0: '
foo
[bar]',
michael@0: '
[foo]
',
michael@0: '[foo]
',
michael@0: '[foo]
bar
',
michael@0: ' [bar]
',
michael@0: ' [bar]
',
michael@0: 'foo
[bar]
baz
',
michael@0: ],
michael@0: //@}
michael@0: justifyfull: [
michael@0: //@{
michael@0: 'foo[]barextra',
michael@0: 'foo {}bar
extra',
michael@0: 'foo[ ]bar
extra',
michael@0: 'foo[bar]baz
extra',
michael@0: 'foo[barbaz]qoz quz
extra',
michael@0: '
foo[]bar
extra',
michael@0: '
foo[bar]baz
extra',
michael@0: '
foo[bar]baz extra',
michael@0: '
foo[bar]baz extra',
michael@0: '
foo[bar]baz extra',
michael@0: '
[foo]
bar
extra',
michael@0: '
[foo
bar]
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '{
}extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '{
}extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '{
}extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '{
}extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0:
michael@0: '
foo
[bar]extra',
michael@0: '[foo]
bar
extra',
michael@0: '
foo
[bar]baz
extra',
michael@0: '
[bar]
extra',
michael@0: '
[foo]
extra',
michael@0: '
[bar]
extra',
michael@0: '
foo
[bar]extra',
michael@0: '[foo]
bar
extra',
michael@0: '
foo
[bar]baz
extra',
michael@0: '
[bar]
extra',
michael@0: '
[foo]
extra',
michael@0: '
[bar]
extra',
michael@0: '
foo
[bar]
extra',
michael@0: '
[foo]
bar
extra',
michael@0: '
foo
[bar]
baz
extra',
michael@0:
michael@0: '
[foo
bar]extra',
michael@0: '
fo[o
b]arextra',
michael@0: '
[foo
bar]extra',
michael@0: '
fo[o
b]arextra',
michael@0: '[foo]
extra',
michael@0: 'f[o]o
extra',
michael@0:
michael@0: '
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '[foo]
extra',
michael@0:
michael@0: '
[foo]
extra',
michael@0: '
[foo]
extra',
michael@0: '
[foo]
extra',
michael@0: '
[foo]
extra',
michael@0:
michael@0: // Whitespace nodes
michael@0: '
[bar]',
michael@0: '
[bar]',
michael@0: '
[foo]
',
michael@0: '[foo]
',
michael@0: ' [bar]
',
michael@0: ' [bar]
',
michael@0: ],
michael@0: //@}
michael@0: justifyleft: [
michael@0: //@{
michael@0: 'foo[]barextra',
michael@0: 'foo {}bar
extra',
michael@0: 'foo[ ]bar
extra',
michael@0: 'foo[bar]baz
extra',
michael@0: 'foo[barbaz]qoz quz
extra',
michael@0: '
foo[]bar
extra',
michael@0: '
foo[bar]baz
extra',
michael@0: '
foo[bar]baz extra',
michael@0: '
foo[bar]baz extra',
michael@0: '
foo[bar]baz extra',
michael@0: '
[foo]
bar
extra',
michael@0: '
[foo
bar]
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '{
}extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '{
}extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '{
}extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '{
}extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0:
michael@0: '
foo
[bar]extra',
michael@0: '[foo]
bar
extra',
michael@0: '
foo
[bar]baz
extra',
michael@0: '
[bar]
extra',
michael@0: '
[foo]
extra',
michael@0: '
[bar]
extra',
michael@0: '
foo
[bar]extra',
michael@0: '[foo]
bar
extra',
michael@0: '
foo
[bar]baz
extra',
michael@0: '
[bar]
extra',
michael@0: '
[foo]
extra',
michael@0: '
[bar]
extra',
michael@0: '
foo
[bar]
extra',
michael@0: '
[foo]
bar
extra',
michael@0: '
foo
[bar]
baz
extra',
michael@0:
michael@0: '
[foo
bar]extra',
michael@0: '
fo[o
b]arextra',
michael@0: '
[foo
bar]extra',
michael@0: '
fo[o
b]arextra',
michael@0: '[foo]
extra',
michael@0: 'f[o]o
extra',
michael@0:
michael@0: '
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '[foo]
extra',
michael@0:
michael@0: '
[foo]
extra',
michael@0: '
[foo]
extra',
michael@0: '
[foo]
extra',
michael@0: '
[foo]
extra',
michael@0:
michael@0: // Whitespace nodes
michael@0: '
[bar]',
michael@0: '
[bar]',
michael@0: '
[foo]
',
michael@0: '[foo]
',
michael@0: ' [bar]
',
michael@0: ' [bar]
',
michael@0: ],
michael@0: //@}
michael@0: justifyright: [
michael@0: //@{
michael@0: 'foo[]barextra',
michael@0: 'foo {}bar
extra',
michael@0: 'foo[ ]bar
extra',
michael@0: 'foo[bar]baz
extra',
michael@0: 'foo[barbaz]qoz quz
extra',
michael@0: '
foo[]bar
extra',
michael@0: '
foo[bar]baz
extra',
michael@0: '
foo[bar]baz extra',
michael@0: '
foo[bar]baz extra',
michael@0: '
foo[bar]baz extra',
michael@0: '
[foo]
bar
extra',
michael@0: '
[foo
bar]
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '{
}extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '{
}extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '{
}extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '{
}extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0: '
extra',
michael@0:
michael@0: '
foo
[bar]extra',
michael@0: '[foo]
bar
extra',
michael@0: '
foo
[bar]baz
extra',
michael@0: '
[bar]
extra',
michael@0: '
[foo]
extra',
michael@0: '
[bar]
extra',
michael@0: '
foo
[bar]extra',
michael@0: '[foo]
bar
extra',
michael@0: '
foo
[bar]baz
extra',
michael@0: '
[bar]
extra',
michael@0: '
[foo]
extra',
michael@0: '
[bar]
extra',
michael@0: '
foo
[bar]
extra',
michael@0: '
[foo]
bar
extra',
michael@0: '
foo
[bar]
baz
extra',
michael@0:
michael@0: '
[foo
bar]extra',
michael@0: '
fo[o
b]arextra',
michael@0: '
[foo
bar]extra',
michael@0: '
fo[o
b]arextra',
michael@0: '[foo]
extra',
michael@0: 'f[o]o
extra',
michael@0:
michael@0: '
extra',
michael@0:
michael@0: '
extra',
michael@0: '
extra',
michael@0: '[foo]
extra',
michael@0:
michael@0: '
[foo]
extra',
michael@0: '
[foo]
extra',
michael@0: '
[foo]
extra',
michael@0: '
[foo]
extra',
michael@0:
michael@0: // Whitespace nodes
michael@0: '
[bar]',
michael@0: '
[bar]',
michael@0: '
[foo]
',
michael@0: '[foo]
',
michael@0: ' [bar]
',
michael@0: ' [bar]
',
michael@0: ],
michael@0: //@}
michael@0: outdent: [
michael@0: //@{
michael@0: // These mimic existing indentation in various browsers, to see how
michael@0: // they cope with outdenting various things. This is spec, Gecko
michael@0: // non-CSS, and Opera:
michael@0: 'foo[bar]
baz
extra',
michael@0: '
foo[bar
b]az
extra',
michael@0: '
foo[bar]
baz
extra',
michael@0: '
foo[bar
b]az
extra',
michael@0:
michael@0: // IE:
michael@0: '
foo[bar]
baz
extra',
michael@0: '
foo[bar
b]az
extra',
michael@0: '
foo[bar]
baz
extra',
michael@0: '
foo[bar
b]az
extra',
michael@0:
michael@0: // Firefox CSS mode:
michael@0: '
foo[bar]
baz
extra',
michael@0: '
foo[bar
b]az
extra',
michael@0: '
foo[bar]
baz
extra',
michael@0: '
foo[bar
b]az
extra',
michael@0:
michael@0: // WebKit:
michael@0: '
foo[bar]
baz
extra',
michael@0: '
foo[bar
b]az
extra',
michael@0: '
foo[bar]
baz
extra',
michael@0: '
foo[bar
b]az
extra',
michael@0:
michael@0: // Now let's try nesting lots of stuff and see what happens.
michael@0: '
foo[bar]baz ',
michael@0: 'foo[bar]baz ',
michael@0: 'foo[bar]baz ',
michael@0: 'foo[bar]baz
',
michael@0: 'foo[bar]baz
',
michael@0: 'foo[bar]baz ',
michael@0: 'foo[bar]baz ',
michael@0:
michael@0: 'foo[bar]
baz
',
michael@0: 'foo[bar]
baz
',
michael@0: 'foo[bar]
baz
',
michael@0: ' ',
michael@0: ' ',
michael@0: 'foo[bar]
baz
',
michael@0: 'foo[bar]
baz
',
michael@0:
michael@0: 'foo[bar]
baz
',
michael@0: 'foo[bar]
baz
',
michael@0: 'foo[bar]
baz
',
michael@0: 'foo[bar]
baz
',
michael@0: 'foo[bar]
baz
',
michael@0:
michael@0: // Lists!
michael@0: 'foo [bar] baz ',
michael@0: 'foo bar baz ',
michael@0: 'foo [bar]',
michael@0: '[foo] bar baz ',
michael@0: 'foo [bar] baz ',
michael@0: '[foo]
barbaz ',
michael@0: 'foo[bar] baz quz ',
michael@0: 'foobar [baz] quz ',
michael@0: 'foo [bar] baz quz ',
michael@0: 'foo bar baz quz ',
michael@0: 'foo bar [baz] quz ',
michael@0: 'foo bar baz quz ',
michael@0: 'foob[a]r baz ',
michael@0: 'foo b[a]r baz ',
michael@0: 'foo{bar } baz ',
michael@0: 'foo {bar }baz ',
michael@0: '[foo]bar baz ',
michael@0: '[foo] bar baz ',
michael@0: 'foo [bar]baz quz ',
michael@0: 'foo [bar] baz quz ',
michael@0: 'foobar baz [quz] ',
michael@0: 'foo bar baz [quz] ',
michael@0:
michael@0: // Try outdenting multiple items at once.
michael@0: 'foo b[ar baz] ',
michael@0: '[foobar] baz ',
michael@0: '[foo bar] baz ',
michael@0: 'foob[ar b]az ',
michael@0: 'foo b[ar b]az ',
michael@0: '[foobar baz] extra',
michael@0: '
[foo bar baz] extra',
michael@0:
michael@0: // We probably can't actually get this DOM . . .
michael@0: '
[foo]bar baz ',
michael@0: 'foo[bar] baz ',
michael@0: 'foobar [baz] ',
michael@0: '[foobar] baz ',
michael@0:
michael@0: // Attribute handling on lists
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo [bar] ',
michael@0: '',
michael@0: 'foo [bar] baz ',
michael@0: 'foo [bar] baz ',
michael@0: 'foo [bar] baz ',
michael@0: 'foo [bar] baz ',
michael@0: 'foo [bar baz] quz ',
michael@0: 'foo [bar baz] quz ',
michael@0: 'foo [bar baz] quz ',
michael@0: 'foo [bar baz] quz ',
michael@0:
michael@0: // List inside indentation element
michael@0: '[foo] extra',
michael@0: '
foo[bar] baz extra',
michael@0: '
foo [bar] baz extra',
michael@0:
michael@0: '
[foo] ',
michael@0: '[foo] ',
michael@0: 'foo baz ',
michael@0:
michael@0: // Whitespace nodes
michael@0: ' [foo]
',
michael@0: '[foo]
',
michael@0: ' [foo]
',
michael@0: ' [foo] ',
michael@0: '[foo] ',
michael@0: ' [foo] ',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: ' [foo]
bar
baz
',
michael@0: ' foo
[bar]
baz
',
michael@0: ' foo
bar
[baz]
',
michael@0: ' [foo] bar baz ',
michael@0: ' foo [bar] baz ',
michael@0: ' foo bar [baz] ',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0:
michael@0: // https://bugs.webkit.org/show_bug.cgi?id=24249
michael@0: '[]a ',
michael@0: // https://bugs.webkit.org/show_bug.cgi?id=43447
michael@0: 'foo [bar] ',
michael@0: ],
michael@0: //@}
michael@0: removeformat: [
michael@0: //@{
michael@0: 'foo[]bar',
michael@0: 'foo {}bar ',
michael@0: 'foo[ ]bar ',
michael@0: '[foobar baz]',
michael@0: 'foo[bar baz]',
michael@0: 'foo[bar ]baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0:
michael@0: // HTML has lots of inline elements, doesn't it?
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar
baz]',
michael@0: 'foob[a]r
baz',
michael@0: '[foobarbaz]',
michael@0: 'foob[a]rbaz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0:
michael@0: // Empty and replaced elements
michael@0: '[foo bar]',
michael@0: '[foo bar]',
michael@0: '[foobar]',
michael@0: '[foo bar]',
michael@0: '[foo bar]',
michael@0: '[foo bar]',
michael@0: '[foo bar]',
michael@0: '[foo bar]',
michael@0:
michael@0: // Unrecognized elements
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0:
michael@0: // Random stuff
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: '[foobar baz]',
michael@0: 'foob[a]r baz',
michael@0: 'foo[bar]baz
',
michael@0: 'foo[bar]baz
',
michael@0: 'foo[bar]baz
',
michael@0: 'foo[bar]baz
',
michael@0: 'foo[bar]baz
',
michael@0: '{foobarbaz
}',
michael@0: 'foo[bar]baz
',
michael@0: '{foobarbaz
}',
michael@0:
michael@0: // https://bugzilla.mozilla.org/show_bug.cgi?id=649138
michael@0: // Chrome 15 dev fails this for some unclear reason.
michael@0: '',
michael@0: ],
michael@0: //@}
michael@0: strikethrough: [
michael@0: //@{
michael@0: 'foo[]bar',
michael@0: '[foo
bar]
',
michael@0: '[foo bar] ',
michael@0: '[foo
bar
baz]
',
michael@0: '[foo
bar]',
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar ',
michael@0: 'foo {}bar ',
michael@0: 'foo[ ]bar ',
michael@0: 'foo[bar]baz',
michael@0: 'foo[barbaz]qoz quz',
michael@0: 'foo[barbaz]qoz quz',
michael@0: '{
foo
}',
michael@0:
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '{}',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar]baz ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]baz
',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar]baz ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]baz
',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar]baz ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar]baz ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0:
michael@0: 'foo[bar]baz',
michael@0: 'foo[bar]baz',
michael@0: 'foo[bar]ba z',
michael@0: 'foo[bar]ba z',
michael@0: 'foo[bar]ba z',
michael@0: 'foo[bar]ba z',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0:
michael@0: 'foo[bar]baz
',
michael@0: 'foo[bar]baz
',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0:
michael@0: // Tests for queryCommandIndeterm() and queryCommandState()
michael@0: 'fo[ob]ar baz',
michael@0: 'fooba[r b]az',
michael@0: 'fo[obar b]az',
michael@0: 'foo[b]ar baz',
michael@0: 'fooba[r ]baz',
michael@0: 'foo[bar ]baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo{bar }baz',
michael@0: 'fo[ob]ar baz',
michael@0: 'fo[o b]ar ',
michael@0: 'fo[o b]ar',
michael@0: ],
michael@0: //@}
michael@0: subscript: [
michael@0: //@{
michael@0: 'foo[]bar',
michael@0: '[foo
bar]
',
michael@0: '[foo bar] ',
michael@0: '[foo
bar
baz]
',
michael@0: '[foo
bar]',
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar ',
michael@0: 'foo {}bar ',
michael@0: 'foo[ ]bar ',
michael@0: 'foo[bar]baz',
michael@0: 'foo[barbaz]qoz quz',
michael@0: 'foo[barbaz]qoz quz',
michael@0: '{
foo
}',
michael@0:
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '{}',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foob[a] r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foob[a] r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foob[a] r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foob[a] r baz',
michael@0:
michael@0: // Tests for queryCommandIndeterm() and queryCommandState()
michael@0: 'fo[ob]ar baz',
michael@0: 'fooba[r b]az',
michael@0: 'fo[obar b]az',
michael@0: 'foo[b]ar baz',
michael@0: 'fooba[r ]baz',
michael@0: 'foo[bar ]baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo{bar }baz',
michael@0: 'fo[o b]ar ',
michael@0: 'fo[o b]ar ',
michael@0: 'foo[bar] baz',
michael@0: 'fo[o b]ar ',
michael@0: ],
michael@0: //@}
michael@0: superscript: [
michael@0: //@{
michael@0: 'foo[]bar',
michael@0: '[foo
bar]
',
michael@0: '[foo bar] ',
michael@0: '[foo
bar
baz]
',
michael@0: '[foo
bar]',
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar ',
michael@0: 'foo {}bar ',
michael@0: 'foo[ ]bar ',
michael@0: 'foo[bar]baz',
michael@0: 'foo[barbaz]qoz quz',
michael@0: 'foo[barbaz]qoz quz',
michael@0: '{
foo
}',
michael@0:
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '{}',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foob[a] r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foob[a] r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foob[a] r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foob[a] r baz',
michael@0:
michael@0: // Tests for queryCommandIndeterm() and queryCommandState()
michael@0: 'fo[ob]ar baz',
michael@0: 'fooba[r b]az',
michael@0: 'fo[obar b]az',
michael@0: 'foo[b]ar baz',
michael@0: 'fooba[r ]baz',
michael@0: 'foo[bar ]baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo{bar }baz',
michael@0: 'fo[o b]ar ',
michael@0: 'fo[o b]ar ',
michael@0: 'foo[bar] baz',
michael@0: 'fo[o b]ar ',
michael@0:
michael@0: // https://bugs.webkit.org/show_bug.cgi?id=28472
michael@0: 'foo[bar] ',
michael@0: ],
michael@0: //@}
michael@0: underline: [
michael@0: //@{
michael@0: 'foo[]bar',
michael@0: '[foo
bar]
',
michael@0: '[foo bar] ',
michael@0: '[foo
bar
baz]
',
michael@0: '[foo
bar]',
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar ',
michael@0: 'foo {}bar ',
michael@0: 'foo[ ]bar ',
michael@0: 'foo[bar]baz',
michael@0: 'foo[barbaz]qoz quz',
michael@0: 'foo[barbaz]qoz quz',
michael@0: '{
foo
}',
michael@0:
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '',
michael@0: '{}',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar]baz ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]baz
',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar]baz ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]baz
',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar]baz ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar]baz ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0: 'foo[bar]ba z ',
michael@0:
michael@0: 'foo[bar]baz',
michael@0: 'foo[bar]baz',
michael@0: 'foo[bar]ba z',
michael@0: 'foo[bar]ba z',
michael@0: 'foo[bar]ba z',
michael@0: 'foo[bar]ba z',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0:
michael@0: 'foo[bar]baz
',
michael@0: 'foo[bar]baz
',
michael@0:
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0: 'foo[bar] baz',
michael@0: 'foob[a]r baz',
michael@0:
michael@0: // Tests for queryCommandIndeterm() and queryCommandState()
michael@0: 'fo[ob]ar baz',
michael@0: 'fooba[r b]az',
michael@0: 'fo[obar b]az',
michael@0: 'foo[b]ar baz',
michael@0: 'fooba[r ]baz',
michael@0: 'foo[bar ]baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo{bar }baz',
michael@0: 'fo[ob]ar baz',
michael@0: 'fo[o b]ar ',
michael@0: 'fo[o b]ar ',
michael@0: ],
michael@0: //@}
michael@0: unlink: [
michael@0: //@{
michael@0: 'foo[]bar',
michael@0: '[foo
bar]
',
michael@0: '[foo bar] ',
michael@0: '[foo
bar
baz]
',
michael@0: 'foo[]bar ',
michael@0: 'foo[]bar ',
michael@0: 'foo {}bar ',
michael@0: 'foo[ ]bar ',
michael@0: 'foo[bar]baz',
michael@0: 'foo[barbaz]qoz quz',
michael@0: 'foo[barbaz]qoz quz',
michael@0: '{
foo
}',
michael@0:
michael@0: 'foo[bar]baz ',
michael@0: 'foo[barbaz }',
michael@0: '{foobar]baz ',
michael@0: '{foobarbaz }',
michael@0: '[foobarbaz] ',
michael@0:
michael@0: 'foob[]ar baz',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar ]baz',
michael@0: 'foo[bar baz]',
michael@0: '[foobar] baz',
michael@0: '[foobar baz]',
michael@0:
michael@0: 'foobar[]baz ',
michael@0: 'foo[bar]baz ',
michael@0: '[foobarbaz] ',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar ]baz',
michael@0: '[foobar baz]',
michael@0:
michael@0: 'foobar[]baz ',
michael@0: 'foo[bar]baz ',
michael@0: '[foobarbaz] ',
michael@0: 'foo[bar] baz',
michael@0: 'foo[bar ]baz',
michael@0: '[foobar baz]',
michael@0: ],
michael@0: //@}
michael@0: copy: ['!foo[bar]baz'],
michael@0: cut: ['!foo[bar]baz'],
michael@0: defaultparagraphseparator: [
michael@0: //@{
michael@0: ['', 'foo[bar]baz'],
michael@0: ['div', 'foo[bar]baz'],
michael@0: ['p', 'foo[bar]baz'],
michael@0: ['DIV', 'foo[bar]baz'],
michael@0: ['P', 'foo[bar]baz'],
michael@0: [' div ', 'foo[bar]baz'],
michael@0: [' p ', 'foo[bar]baz'],
michael@0: ['', 'foo[bar]baz'],
michael@0: ['
', 'foo[bar]baz'],
michael@0: ['li', 'foo[bar]baz'],
michael@0: ['blockquote', 'foo[bar]baz'],
michael@0: ],
michael@0: //@}
michael@0: paste: ['!foo[bar]baz'],
michael@0: selectall: ['foo[bar]baz'],
michael@0: stylewithcss: [
michael@0: //@{
michael@0: ['true', 'foo[bar]baz'],
michael@0: ['TRUE', 'foo[bar]baz'],
michael@0: ['TrUe', 'foo[bar]baz'],
michael@0: ['true ', 'foo[bar]baz'],
michael@0: [' true', 'foo[bar]baz'],
michael@0: ['truer', 'foo[bar]baz'],
michael@0: [' true ', 'foo[bar]baz'],
michael@0: [' TrUe', 'foo[bar]baz'],
michael@0: ['', 'foo[bar]baz'],
michael@0: [' ', 'foo[bar]baz'],
michael@0: ['false', 'foo[bar]baz'],
michael@0: ['FALSE', 'foo[bar]baz'],
michael@0: ['FaLsE', 'foo[bar]baz'],
michael@0: [' false', 'foo[bar]baz'],
michael@0: ['false ', 'foo[bar]baz'],
michael@0: ['falser', 'foo[bar]baz'],
michael@0: ['falsé', 'foo[bar]baz'],
michael@0: ],
michael@0: //@}
michael@0: usecss: [
michael@0: //@{
michael@0: ['true', 'foo[bar]baz'],
michael@0: ['TRUE', 'foo[bar]baz'],
michael@0: ['TrUe', 'foo[bar]baz'],
michael@0: ['true ', 'foo[bar]baz'],
michael@0: [' true', 'foo[bar]baz'],
michael@0: ['truer', 'foo[bar]baz'],
michael@0: [' true ', 'foo[bar]baz'],
michael@0: [' TrUe', 'foo[bar]baz'],
michael@0: ['', 'foo[bar]baz'],
michael@0: [' ', 'foo[bar]baz'],
michael@0: ['false', 'foo[bar]baz'],
michael@0: ['FALSE', 'foo[bar]baz'],
michael@0: ['FaLsE', 'foo[bar]baz'],
michael@0: [' false', 'foo[bar]baz'],
michael@0: ['false ', 'foo[bar]baz'],
michael@0: ['falser', 'foo[bar]baz'],
michael@0: ['falsé', 'foo[bar]baz'],
michael@0: ],
michael@0: //@}
michael@0: quasit: ['foo[bar]baz'],
michael@0: multitest: [
michael@0: //@{
michael@0: // Insertion-affecting state. Test that insertText works right, and
michael@0: // test that various block commands preserve (or don't preserve) the
michael@0: // state.
michael@0: ['foo[]bar', 'bold', 'inserttext'],
michael@0: ['foo[]bar', 'bold', 'delete'],
michael@0: ['foo[]bar', 'bold', 'delete', 'inserttext'],
michael@0: ['foo[]bar', 'bold', 'formatblock'],
michael@0: ['foo[]bar', 'bold', 'formatblock', 'inserttext'],
michael@0: ['foo[]bar', 'bold', 'forwarddelete'],
michael@0: ['foo[]bar', 'bold', 'forwarddelete', 'inserttext'],
michael@0: ['foo[]bar', 'bold', 'indent'],
michael@0: ['foo[]bar', 'bold', 'indent', 'inserttext'],
michael@0: ['foo[]bar', 'bold', 'inserthorizontalrule'],
michael@0: ['foo[]bar', 'bold', 'inserthorizontalrule', 'inserttext'],
michael@0: ['foo[]bar', 'bold', 'inserthtml'],
michael@0: ['foo[]bar', 'bold', 'inserthtml', 'inserttext'],
michael@0: ['foo[]bar', 'bold', 'insertimage'],
michael@0: ['foo[]bar', 'bold', 'insertimage', 'inserttext'],
michael@0: ['foo[]bar', 'bold', 'insertlinebreak'],
michael@0: ['foo[]bar', 'bold', 'insertlinebreak', 'inserttext'],
michael@0: ['foo[]bar', 'bold', 'insertorderedlist'],
michael@0: ['foo[]bar', 'bold', 'insertorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'bold', 'insertparagraph'],
michael@0: ['foo[]bar', 'bold', 'insertparagraph', 'inserttext'],
michael@0: ['foo[]bar', 'bold', 'insertunorderedlist'],
michael@0: ['foo[]bar', 'bold', 'insertunorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'bold', 'justifycenter'],
michael@0: ['foo[]bar', 'bold', 'justifycenter', 'inserttext'],
michael@0: ['foo[]bar', 'bold', 'justifyfull'],
michael@0: ['foo[]bar', 'bold', 'justifyfull', 'inserttext'],
michael@0: ['foo[]bar', 'bold', 'justifyleft'],
michael@0: ['foo[]bar', 'bold', 'justifyleft', 'inserttext'],
michael@0: ['foo[]bar', 'bold', 'justifyright'],
michael@0: ['foo[]bar', 'bold', 'justifyright', 'inserttext'],
michael@0: ['foo[]bar', 'bold', 'outdent'],
michael@0: ['foo[]bar', 'bold', 'outdent', 'inserttext'],
michael@0:
michael@0: ['foo[]bar', 'italic', 'inserttext'],
michael@0: ['foo[]bar', 'italic', 'delete'],
michael@0: ['foo[]bar', 'italic', 'delete', 'inserttext'],
michael@0: ['foo[]bar', 'italic', 'formatblock'],
michael@0: ['foo[]bar', 'italic', 'formatblock', 'inserttext'],
michael@0: ['foo[]bar', 'italic', 'forwarddelete'],
michael@0: ['foo[]bar', 'italic', 'forwarddelete', 'inserttext'],
michael@0: ['foo[]bar', 'italic', 'indent'],
michael@0: ['foo[]bar', 'italic', 'indent', 'inserttext'],
michael@0: ['foo[]bar', 'italic', 'inserthorizontalrule'],
michael@0: ['foo[]bar', 'italic', 'inserthorizontalrule', 'inserttext'],
michael@0: ['foo[]bar', 'italic', 'inserthtml'],
michael@0: ['foo[]bar', 'italic', 'inserthtml', 'inserttext'],
michael@0: ['foo[]bar', 'italic', 'insertimage'],
michael@0: ['foo[]bar', 'italic', 'insertimage', 'inserttext'],
michael@0: ['foo[]bar', 'italic', 'insertlinebreak'],
michael@0: ['foo[]bar', 'italic', 'insertlinebreak', 'inserttext'],
michael@0: ['foo[]bar', 'italic', 'insertorderedlist'],
michael@0: ['foo[]bar', 'italic', 'insertorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'italic', 'insertparagraph'],
michael@0: ['foo[]bar', 'italic', 'insertparagraph', 'inserttext'],
michael@0: ['foo[]bar', 'italic', 'insertunorderedlist'],
michael@0: ['foo[]bar', 'italic', 'insertunorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'italic', 'justifycenter'],
michael@0: ['foo[]bar', 'italic', 'justifycenter', 'inserttext'],
michael@0: ['foo[]bar', 'italic', 'justifyfull'],
michael@0: ['foo[]bar', 'italic', 'justifyfull', 'inserttext'],
michael@0: ['foo[]bar', 'italic', 'justifyleft'],
michael@0: ['foo[]bar', 'italic', 'justifyleft', 'inserttext'],
michael@0: ['foo[]bar', 'italic', 'justifyright'],
michael@0: ['foo[]bar', 'italic', 'justifyright', 'inserttext'],
michael@0: ['foo[]bar', 'italic', 'outdent'],
michael@0: ['foo[]bar', 'italic', 'outdent', 'inserttext'],
michael@0:
michael@0: ['foo[]bar', 'strikethrough', 'inserttext'],
michael@0: ['foo[]bar', 'strikethrough', 'delete'],
michael@0: ['foo[]bar', 'strikethrough', 'delete', 'inserttext'],
michael@0: ['foo[]bar', 'strikethrough', 'formatblock'],
michael@0: ['foo[]bar', 'strikethrough', 'formatblock', 'inserttext'],
michael@0: ['foo[]bar', 'strikethrough', 'forwarddelete'],
michael@0: ['foo[]bar', 'strikethrough', 'forwarddelete', 'inserttext'],
michael@0: ['foo[]bar', 'strikethrough', 'indent'],
michael@0: ['foo[]bar', 'strikethrough', 'indent', 'inserttext'],
michael@0: ['foo[]bar', 'strikethrough', 'inserthorizontalrule'],
michael@0: ['foo[]bar', 'strikethrough', 'inserthorizontalrule', 'inserttext'],
michael@0: ['foo[]bar', 'strikethrough', 'inserthtml'],
michael@0: ['foo[]bar', 'strikethrough', 'inserthtml', 'inserttext'],
michael@0: ['foo[]bar', 'strikethrough', 'insertimage'],
michael@0: ['foo[]bar', 'strikethrough', 'insertimage', 'inserttext'],
michael@0: ['foo[]bar', 'strikethrough', 'insertlinebreak'],
michael@0: ['foo[]bar', 'strikethrough', 'insertlinebreak', 'inserttext'],
michael@0: ['foo[]bar', 'strikethrough', 'insertorderedlist'],
michael@0: ['foo[]bar', 'strikethrough', 'insertorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'strikethrough', 'insertparagraph'],
michael@0: ['foo[]bar', 'strikethrough', 'insertparagraph', 'inserttext'],
michael@0: ['foo[]bar', 'strikethrough', 'insertunorderedlist'],
michael@0: ['foo[]bar', 'strikethrough', 'insertunorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'strikethrough', 'justifycenter'],
michael@0: ['foo[]bar', 'strikethrough', 'justifycenter', 'inserttext'],
michael@0: ['foo[]bar', 'strikethrough', 'justifyfull'],
michael@0: ['foo[]bar', 'strikethrough', 'justifyfull', 'inserttext'],
michael@0: ['foo[]bar', 'strikethrough', 'justifyleft'],
michael@0: ['foo[]bar', 'strikethrough', 'justifyleft', 'inserttext'],
michael@0: ['foo[]bar', 'strikethrough', 'justifyright'],
michael@0: ['foo[]bar', 'strikethrough', 'justifyright', 'inserttext'],
michael@0: ['foo[]bar', 'strikethrough', 'outdent'],
michael@0: ['foo[]bar', 'strikethrough', 'outdent', 'inserttext'],
michael@0:
michael@0: ['foo[]bar', 'subscript', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', 'delete'],
michael@0: ['foo[]bar', 'subscript', 'delete', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', 'formatblock'],
michael@0: ['foo[]bar', 'subscript', 'formatblock', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', 'forwarddelete'],
michael@0: ['foo[]bar', 'subscript', 'forwarddelete', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', 'indent'],
michael@0: ['foo[]bar', 'subscript', 'indent', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', 'inserthorizontalrule'],
michael@0: ['foo[]bar', 'subscript', 'inserthorizontalrule', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', 'inserthtml'],
michael@0: ['foo[]bar', 'subscript', 'inserthtml', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', 'insertimage'],
michael@0: ['foo[]bar', 'subscript', 'insertimage', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', 'insertlinebreak'],
michael@0: ['foo[]bar', 'subscript', 'insertlinebreak', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', 'insertorderedlist'],
michael@0: ['foo[]bar', 'subscript', 'insertorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', 'insertparagraph'],
michael@0: ['foo[]bar', 'subscript', 'insertparagraph', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', 'insertunorderedlist'],
michael@0: ['foo[]bar', 'subscript', 'insertunorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', 'justifycenter'],
michael@0: ['foo[]bar', 'subscript', 'justifycenter', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', 'justifyfull'],
michael@0: ['foo[]bar', 'subscript', 'justifyfull', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', 'justifyleft'],
michael@0: ['foo[]bar', 'subscript', 'justifyleft', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', 'justifyright'],
michael@0: ['foo[]bar', 'subscript', 'justifyright', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', 'outdent'],
michael@0: ['foo[]bar', 'subscript', 'outdent', 'inserttext'],
michael@0:
michael@0: ['foo[]bar', 'superscript', 'inserttext'],
michael@0: ['foo[]bar', 'superscript', 'delete'],
michael@0: ['foo[]bar', 'superscript', 'delete', 'inserttext'],
michael@0: ['foo[]bar', 'superscript', 'formatblock'],
michael@0: ['foo[]bar', 'superscript', 'formatblock', 'inserttext'],
michael@0: ['foo[]bar', 'superscript', 'forwarddelete'],
michael@0: ['foo[]bar', 'superscript', 'forwarddelete', 'inserttext'],
michael@0: ['foo[]bar', 'superscript', 'indent'],
michael@0: ['foo[]bar', 'superscript', 'indent', 'inserttext'],
michael@0: ['foo[]bar', 'superscript', 'inserthorizontalrule'],
michael@0: ['foo[]bar', 'superscript', 'inserthorizontalrule', 'inserttext'],
michael@0: ['foo[]bar', 'superscript', 'inserthtml'],
michael@0: ['foo[]bar', 'superscript', 'inserthtml', 'inserttext'],
michael@0: ['foo[]bar', 'superscript', 'insertimage'],
michael@0: ['foo[]bar', 'superscript', 'insertimage', 'inserttext'],
michael@0: ['foo[]bar', 'superscript', 'insertlinebreak'],
michael@0: ['foo[]bar', 'superscript', 'insertlinebreak', 'inserttext'],
michael@0: ['foo[]bar', 'superscript', 'insertorderedlist'],
michael@0: ['foo[]bar', 'superscript', 'insertorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'superscript', 'insertparagraph'],
michael@0: ['foo[]bar', 'superscript', 'insertparagraph', 'inserttext'],
michael@0: ['foo[]bar', 'superscript', 'insertunorderedlist'],
michael@0: ['foo[]bar', 'superscript', 'insertunorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'superscript', 'justifycenter'],
michael@0: ['foo[]bar', 'superscript', 'justifycenter', 'inserttext'],
michael@0: ['foo[]bar', 'superscript', 'justifyfull'],
michael@0: ['foo[]bar', 'superscript', 'justifyfull', 'inserttext'],
michael@0: ['foo[]bar', 'superscript', 'justifyleft'],
michael@0: ['foo[]bar', 'superscript', 'justifyleft', 'inserttext'],
michael@0: ['foo[]bar', 'superscript', 'justifyright'],
michael@0: ['foo[]bar', 'superscript', 'justifyright', 'inserttext'],
michael@0: ['foo[]bar', 'superscript', 'outdent'],
michael@0: ['foo[]bar', 'superscript', 'outdent', 'inserttext'],
michael@0:
michael@0: ['foo[]bar', 'underline', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'delete'],
michael@0: ['foo[]bar', 'underline', 'delete', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'formatblock'],
michael@0: ['foo[]bar', 'underline', 'formatblock', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'forwarddelete'],
michael@0: ['foo[]bar', 'underline', 'forwarddelete', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'indent'],
michael@0: ['foo[]bar', 'underline', 'indent', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'inserthorizontalrule'],
michael@0: ['foo[]bar', 'underline', 'inserthorizontalrule', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'inserthtml'],
michael@0: ['foo[]bar', 'underline', 'inserthtml', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'insertimage'],
michael@0: ['foo[]bar', 'underline', 'insertimage', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'insertlinebreak'],
michael@0: ['foo[]bar', 'underline', 'insertlinebreak', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'insertorderedlist'],
michael@0: ['foo[]bar', 'underline', 'insertorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'insertparagraph'],
michael@0: ['foo[]bar', 'underline', 'insertparagraph', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'insertunorderedlist'],
michael@0: ['foo[]bar', 'underline', 'insertunorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'justifycenter'],
michael@0: ['foo[]bar', 'underline', 'justifycenter', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'justifyfull'],
michael@0: ['foo[]bar', 'underline', 'justifyfull', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'justifyleft'],
michael@0: ['foo[]bar', 'underline', 'justifyleft', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'justifyright'],
michael@0: ['foo[]bar', 'underline', 'justifyright', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'outdent'],
michael@0: ['foo[]bar', 'underline', 'outdent', 'inserttext'],
michael@0:
michael@0: // Insertion-affecting value. Test that insertText works right, and
michael@0: // test that various block commands preserve (or don't preserve) the
michael@0: // value.
michael@0: ['foo[]bar', 'backcolor', 'inserttext'],
michael@0: ['foo[]bar', 'backcolor', 'delete'],
michael@0: ['foo[]bar', 'backcolor', 'delete', 'inserttext'],
michael@0: ['foo[]bar', 'backcolor', 'formatblock'],
michael@0: ['foo[]bar', 'backcolor', 'formatblock', 'inserttext'],
michael@0: ['foo[]bar', 'backcolor', 'forwarddelete'],
michael@0: ['foo[]bar', 'backcolor', 'forwarddelete', 'inserttext'],
michael@0: ['foo[]bar', 'backcolor', 'indent'],
michael@0: ['foo[]bar', 'backcolor', 'indent', 'inserttext'],
michael@0: ['foo[]bar', 'backcolor', 'inserthorizontalrule'],
michael@0: ['foo[]bar', 'backcolor', 'inserthorizontalrule', 'inserttext'],
michael@0: ['foo[]bar', 'backcolor', 'inserthtml'],
michael@0: ['foo[]bar', 'backcolor', 'inserthtml', 'inserttext'],
michael@0: ['foo[]bar', 'backcolor', 'insertimage'],
michael@0: ['foo[]bar', 'backcolor', 'insertimage', 'inserttext'],
michael@0: ['foo[]bar', 'backcolor', 'insertlinebreak'],
michael@0: ['foo[]bar', 'backcolor', 'insertlinebreak', 'inserttext'],
michael@0: ['foo[]bar', 'backcolor', 'insertorderedlist'],
michael@0: ['foo[]bar', 'backcolor', 'insertorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'backcolor', 'insertparagraph'],
michael@0: ['foo[]bar', 'backcolor', 'insertparagraph', 'inserttext'],
michael@0: ['foo[]bar', 'backcolor', 'insertunorderedlist'],
michael@0: ['foo[]bar', 'backcolor', 'insertunorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'backcolor', 'justifycenter'],
michael@0: ['foo[]bar', 'backcolor', 'justifycenter', 'inserttext'],
michael@0: ['foo[]bar', 'backcolor', 'justifyfull'],
michael@0: ['foo[]bar', 'backcolor', 'justifyfull', 'inserttext'],
michael@0: ['foo[]bar', 'backcolor', 'justifyleft'],
michael@0: ['foo[]bar', 'backcolor', 'justifyleft', 'inserttext'],
michael@0: ['foo[]bar', 'backcolor', 'justifyright'],
michael@0: ['foo[]bar', 'backcolor', 'justifyright', 'inserttext'],
michael@0: ['foo[]bar', 'backcolor', 'outdent'],
michael@0: ['foo[]bar', 'backcolor', 'outdent', 'inserttext'],
michael@0:
michael@0: ['foo[]bar', 'createlink', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'delete'],
michael@0: ['foo[]bar', 'createlink', 'delete', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'formatblock'],
michael@0: ['foo[]bar', 'createlink', 'formatblock', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'forwarddelete'],
michael@0: ['foo[]bar', 'createlink', 'forwarddelete', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'indent'],
michael@0: ['foo[]bar', 'createlink', 'indent', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'inserthorizontalrule'],
michael@0: ['foo[]bar', 'createlink', 'inserthorizontalrule', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'inserthtml'],
michael@0: ['foo[]bar', 'createlink', 'inserthtml', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'insertimage'],
michael@0: ['foo[]bar', 'createlink', 'insertimage', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'insertlinebreak'],
michael@0: ['foo[]bar', 'createlink', 'insertlinebreak', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'insertorderedlist'],
michael@0: ['foo[]bar', 'createlink', 'insertorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'insertparagraph'],
michael@0: ['foo[]bar', 'createlink', 'insertparagraph', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'insertunorderedlist'],
michael@0: ['foo[]bar', 'createlink', 'insertunorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'justifycenter'],
michael@0: ['foo[]bar', 'createlink', 'justifycenter', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'justifyfull'],
michael@0: ['foo[]bar', 'createlink', 'justifyfull', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'justifyleft'],
michael@0: ['foo[]bar', 'createlink', 'justifyleft', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'justifyright'],
michael@0: ['foo[]bar', 'createlink', 'justifyright', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'outdent'],
michael@0: ['foo[]bar', 'createlink', 'outdent', 'inserttext'],
michael@0:
michael@0: ['foo[]bar', 'fontname', 'inserttext'],
michael@0: ['foo[]bar', 'fontname', 'delete'],
michael@0: ['foo[]bar', 'fontname', 'delete', 'inserttext'],
michael@0: ['foo[]bar', 'fontname', 'formatblock'],
michael@0: ['foo[]bar', 'fontname', 'formatblock', 'inserttext'],
michael@0: ['foo[]bar', 'fontname', 'forwarddelete'],
michael@0: ['foo[]bar', 'fontname', 'forwarddelete', 'inserttext'],
michael@0: ['foo[]bar', 'fontname', 'indent'],
michael@0: ['foo[]bar', 'fontname', 'indent', 'inserttext'],
michael@0: ['foo[]bar', 'fontname', 'inserthorizontalrule'],
michael@0: ['foo[]bar', 'fontname', 'inserthorizontalrule', 'inserttext'],
michael@0: ['foo[]bar', 'fontname', 'inserthtml'],
michael@0: ['foo[]bar', 'fontname', 'inserthtml', 'inserttext'],
michael@0: ['foo[]bar', 'fontname', 'insertimage'],
michael@0: ['foo[]bar', 'fontname', 'insertimage', 'inserttext'],
michael@0: ['foo[]bar', 'fontname', 'insertlinebreak'],
michael@0: ['foo[]bar', 'fontname', 'insertlinebreak', 'inserttext'],
michael@0: ['foo[]bar', 'fontname', 'insertorderedlist'],
michael@0: ['foo[]bar', 'fontname', 'insertorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'fontname', 'insertparagraph'],
michael@0: ['foo[]bar', 'fontname', 'insertparagraph', 'inserttext'],
michael@0: ['foo[]bar', 'fontname', 'insertunorderedlist'],
michael@0: ['foo[]bar', 'fontname', 'insertunorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'fontname', 'justifycenter'],
michael@0: ['foo[]bar', 'fontname', 'justifycenter', 'inserttext'],
michael@0: ['foo[]bar', 'fontname', 'justifyfull'],
michael@0: ['foo[]bar', 'fontname', 'justifyfull', 'inserttext'],
michael@0: ['foo[]bar', 'fontname', 'justifyleft'],
michael@0: ['foo[]bar', 'fontname', 'justifyleft', 'inserttext'],
michael@0: ['foo[]bar', 'fontname', 'justifyright'],
michael@0: ['foo[]bar', 'fontname', 'justifyright', 'inserttext'],
michael@0: ['foo[]bar', 'fontname', 'outdent'],
michael@0: ['foo[]bar', 'fontname', 'outdent', 'inserttext'],
michael@0:
michael@0: ['foo[]bar', 'fontsize', 'inserttext'],
michael@0: ['foo[]bar', 'fontsize', 'delete'],
michael@0: ['foo[]bar', 'fontsize', 'delete', 'inserttext'],
michael@0: ['foo[]bar', 'fontsize', 'formatblock'],
michael@0: ['foo[]bar', 'fontsize', 'formatblock', 'inserttext'],
michael@0: ['foo[]bar', 'fontsize', 'forwarddelete'],
michael@0: ['foo[]bar', 'fontsize', 'forwarddelete', 'inserttext'],
michael@0: ['foo[]bar', 'fontsize', 'indent'],
michael@0: ['foo[]bar', 'fontsize', 'indent', 'inserttext'],
michael@0: ['foo[]bar', 'fontsize', 'inserthorizontalrule'],
michael@0: ['foo[]bar', 'fontsize', 'inserthorizontalrule', 'inserttext'],
michael@0: ['foo[]bar', 'fontsize', 'inserthtml'],
michael@0: ['foo[]bar', 'fontsize', 'inserthtml', 'inserttext'],
michael@0: ['foo[]bar', 'fontsize', 'insertimage'],
michael@0: ['foo[]bar', 'fontsize', 'insertimage', 'inserttext'],
michael@0: ['foo[]bar', 'fontsize', 'insertlinebreak'],
michael@0: ['foo[]bar', 'fontsize', 'insertlinebreak', 'inserttext'],
michael@0: ['foo[]bar', 'fontsize', 'insertorderedlist'],
michael@0: ['foo[]bar', 'fontsize', 'insertorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'fontsize', 'insertparagraph'],
michael@0: ['foo[]bar', 'fontsize', 'insertparagraph', 'inserttext'],
michael@0: ['foo[]bar', 'fontsize', 'insertunorderedlist'],
michael@0: ['foo[]bar', 'fontsize', 'insertunorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'fontsize', 'justifycenter'],
michael@0: ['foo[]bar', 'fontsize', 'justifycenter', 'inserttext'],
michael@0: ['foo[]bar', 'fontsize', 'justifyfull'],
michael@0: ['foo[]bar', 'fontsize', 'justifyfull', 'inserttext'],
michael@0: ['foo[]bar', 'fontsize', 'justifyleft'],
michael@0: ['foo[]bar', 'fontsize', 'justifyleft', 'inserttext'],
michael@0: ['foo[]bar', 'fontsize', 'justifyright'],
michael@0: ['foo[]bar', 'fontsize', 'justifyright', 'inserttext'],
michael@0: ['foo[]bar', 'fontsize', 'outdent'],
michael@0: ['foo[]bar', 'fontsize', 'outdent', 'inserttext'],
michael@0:
michael@0: ['foo[]bar', 'forecolor', 'inserttext'],
michael@0: ['foo[]bar', 'forecolor', 'delete'],
michael@0: ['foo[]bar', 'forecolor', 'delete', 'inserttext'],
michael@0: ['foo[]bar', 'forecolor', 'formatblock'],
michael@0: ['foo[]bar', 'forecolor', 'formatblock', 'inserttext'],
michael@0: ['foo[]bar', 'forecolor', 'forwarddelete'],
michael@0: ['foo[]bar', 'forecolor', 'forwarddelete', 'inserttext'],
michael@0: ['foo[]bar', 'forecolor', 'indent'],
michael@0: ['foo[]bar', 'forecolor', 'indent', 'inserttext'],
michael@0: ['foo[]bar', 'forecolor', 'inserthorizontalrule'],
michael@0: ['foo[]bar', 'forecolor', 'inserthorizontalrule', 'inserttext'],
michael@0: ['foo[]bar', 'forecolor', 'inserthtml'],
michael@0: ['foo[]bar', 'forecolor', 'inserthtml', 'inserttext'],
michael@0: ['foo[]bar', 'forecolor', 'insertimage'],
michael@0: ['foo[]bar', 'forecolor', 'insertimage', 'inserttext'],
michael@0: ['foo[]bar', 'forecolor', 'insertlinebreak'],
michael@0: ['foo[]bar', 'forecolor', 'insertlinebreak', 'inserttext'],
michael@0: ['foo[]bar', 'forecolor', 'insertorderedlist'],
michael@0: ['foo[]bar', 'forecolor', 'insertorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'forecolor', 'insertparagraph'],
michael@0: ['foo[]bar', 'forecolor', 'insertparagraph', 'inserttext'],
michael@0: ['foo[]bar', 'forecolor', 'insertunorderedlist'],
michael@0: ['foo[]bar', 'forecolor', 'insertunorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'forecolor', 'justifycenter'],
michael@0: ['foo[]bar', 'forecolor', 'justifycenter', 'inserttext'],
michael@0: ['foo[]bar', 'forecolor', 'justifyfull'],
michael@0: ['foo[]bar', 'forecolor', 'justifyfull', 'inserttext'],
michael@0: ['foo[]bar', 'forecolor', 'justifyleft'],
michael@0: ['foo[]bar', 'forecolor', 'justifyleft', 'inserttext'],
michael@0: ['foo[]bar', 'forecolor', 'justifyright'],
michael@0: ['foo[]bar', 'forecolor', 'justifyright', 'inserttext'],
michael@0: ['foo[]bar', 'forecolor', 'outdent'],
michael@0: ['foo[]bar', 'forecolor', 'outdent', 'inserttext'],
michael@0:
michael@0: ['foo[]bar', 'hilitecolor', 'inserttext'],
michael@0: ['foo[]bar', 'hilitecolor', 'delete'],
michael@0: ['foo[]bar', 'hilitecolor', 'delete', 'inserttext'],
michael@0: ['foo[]bar', 'hilitecolor', 'formatblock'],
michael@0: ['foo[]bar', 'hilitecolor', 'formatblock', 'inserttext'],
michael@0: ['foo[]bar', 'hilitecolor', 'forwarddelete'],
michael@0: ['foo[]bar', 'hilitecolor', 'forwarddelete', 'inserttext'],
michael@0: ['foo[]bar', 'hilitecolor', 'indent'],
michael@0: ['foo[]bar', 'hilitecolor', 'indent', 'inserttext'],
michael@0: ['foo[]bar', 'hilitecolor', 'inserthorizontalrule'],
michael@0: ['foo[]bar', 'hilitecolor', 'inserthorizontalrule', 'inserttext'],
michael@0: ['foo[]bar', 'hilitecolor', 'inserthtml'],
michael@0: ['foo[]bar', 'hilitecolor', 'inserthtml', 'inserttext'],
michael@0: ['foo[]bar', 'hilitecolor', 'insertimage'],
michael@0: ['foo[]bar', 'hilitecolor', 'insertimage', 'inserttext'],
michael@0: ['foo[]bar', 'hilitecolor', 'insertlinebreak'],
michael@0: ['foo[]bar', 'hilitecolor', 'insertlinebreak', 'inserttext'],
michael@0: ['foo[]bar', 'hilitecolor', 'insertorderedlist'],
michael@0: ['foo[]bar', 'hilitecolor', 'insertorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'hilitecolor', 'insertparagraph'],
michael@0: ['foo[]bar', 'hilitecolor', 'insertparagraph', 'inserttext'],
michael@0: ['foo[]bar', 'hilitecolor', 'insertunorderedlist'],
michael@0: ['foo[]bar', 'hilitecolor', 'insertunorderedlist', 'inserttext'],
michael@0: ['foo[]bar', 'hilitecolor', 'justifycenter'],
michael@0: ['foo[]bar', 'hilitecolor', 'justifycenter', 'inserttext'],
michael@0: ['foo[]bar', 'hilitecolor', 'justifyfull'],
michael@0: ['foo[]bar', 'hilitecolor', 'justifyfull', 'inserttext'],
michael@0: ['foo[]bar', 'hilitecolor', 'justifyleft'],
michael@0: ['foo[]bar', 'hilitecolor', 'justifyleft', 'inserttext'],
michael@0: ['foo[]bar', 'hilitecolor', 'justifyright'],
michael@0: ['foo[]bar', 'hilitecolor', 'justifyright', 'inserttext'],
michael@0: ['foo[]bar', 'hilitecolor', 'outdent'],
michael@0: ['foo[]bar', 'hilitecolor', 'outdent', 'inserttext'],
michael@0:
michael@0: // Test things that interfere with each other
michael@0: ['foo[]bar', 'superscript', 'subscript', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', 'superscript', 'inserttext'],
michael@0:
michael@0: ['foo[]bar', 'createlink', ['forecolor', '#0000FF'], 'inserttext'],
michael@0: ['foo[]bar', ['forecolor', '#0000FF'], 'createlink', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', ['forecolor', 'blue'], 'inserttext'],
michael@0: ['foo[]bar', ['forecolor', 'blue'], 'createlink', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', ['forecolor', 'brown'], 'inserttext'],
michael@0: ['foo[]bar', ['forecolor', 'brown'], 'createlink', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', ['forecolor', 'black'], 'inserttext'],
michael@0: ['foo[]bar', ['forecolor', 'black'], 'createlink', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'underline', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'createlink', 'inserttext'],
michael@0: ['foo[]bar', 'createlink', 'underline', 'underline', 'inserttext'],
michael@0: ['foo[]bar', 'underline', 'underline', 'createlink', 'inserttext'],
michael@0:
michael@0: ['foo[]bar', 'subscript', ['fontsize', '2'], 'inserttext'],
michael@0: ['foo[]bar', ['fontsize', '2'], 'subscript', 'inserttext'],
michael@0: ['foo[]bar', 'subscript', ['fontsize', '3'], 'inserttext'],
michael@0: ['foo[]bar', ['fontsize', '3'], 'subscript', 'inserttext'],
michael@0:
michael@0: ['foo[]bar', ['hilitecolor', 'aqua'], ['backcolor', 'tan'], 'inserttext'],
michael@0: ['foo[]bar', ['backcolor', 'tan'], ['hilitecolor', 'aqua'], 'inserttext'],
michael@0:
michael@0:
michael@0: // The following are all just inserttext tests that we took from there,
michael@0: // but we first backspace the selected text instead of letting
michael@0: // inserttext handle it. This tests that deletion correctly sets
michael@0: // overrides.
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0: ['foo[bar] baz', 'delete', 'inserttext'],
michael@0:
michael@0: // Now repeat but with different selections.
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0: ['[foobar] baz', 'delete', 'inserttext'],
michael@0:
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0: ['foo[bar baz]', 'delete', 'inserttext'],
michael@0:
michael@0: // https://bugs.webkit.org/show_bug.cgi?id=19702
michael@0: ['
[foo] ', 'delete', 'inserttext'],
michael@0: ],
michael@0: //@}
michael@0: };
michael@0: tests.backcolor = tests.hilitecolor;
michael@0: tests.insertlinebreak = tests.insertparagraph;
michael@0:
michael@0: // Tests that start with "!" are believed to have bogus results and should be
michael@0: // skipped until the relevant bugs are fixed.
michael@0: var badTests = {};
michael@0: (function(){
michael@0: for (var command in tests) {
michael@0: badTests[command] = [];
michael@0: for (var i = 0; i < tests[command].length; i++) {
michael@0: var test = tests[command][i];
michael@0: if (typeof test == "string" && test[0] == "!") {
michael@0: test = test.slice(1);
michael@0: tests[command][i] = test;
michael@0: badTests[command].push(test);
michael@0: }
michael@0: if (typeof test == "object" && test[0][0] == "!") {
michael@0: test = [test[0].slice(1)].concat(test.slice(1));
michael@0: tests[command][i] = test;
michael@0: badTests[command].push(test);
michael@0: }
michael@0: }
michael@0: }
michael@0: })();
michael@0:
michael@0: var defaultValues = {
michael@0: //@{
michael@0: backcolor: "#00FFFF",
michael@0: createlink: "http://www.google.com/",
michael@0: fontname: "sans-serif",
michael@0: fontsize: "4",
michael@0: forecolor: "#0000FF",
michael@0: formatblock: "
",
michael@0: hilitecolor: "#00FFFF",
michael@0: inserthorizontalrule: "",
michael@0: inserthtml: "ab
c d",
michael@0: insertimage: "/img/lion.svg",
michael@0: inserttext: "a",
michael@0: defaultparagraphseparator: "p",
michael@0: stylewithcss: "true",
michael@0: usecss: "true",
michael@0: };
michael@0: //@}
michael@0:
michael@0: var notes = {
michael@0: //@{
michael@0: fontname: 'Note that the body\'s font-family is "serif".',
michael@0: };
michael@0: //@}
michael@0:
michael@0: var doubleTestingCommands = [
michael@0: //@{
michael@0: "backcolor",
michael@0: "bold",
michael@0: "fontname",
michael@0: "fontsize",
michael@0: "forecolor",
michael@0: "italic",
michael@0: "justifycenter",
michael@0: "justifyfull",
michael@0: "justifyleft",
michael@0: "justifyright",
michael@0: "strikethrough",
michael@0: "stylewithcss",
michael@0: "subscript",
michael@0: "superscript",
michael@0: "underline",
michael@0: "usecss",
michael@0: ];
michael@0: //@}
michael@0:
michael@0: function prettyPrint(value) {
michael@0: //@{
michael@0: // Partly stolen from testharness.js
michael@0: if (typeof value != "string") {
michael@0: return String(value);
michael@0: }
michael@0:
michael@0: value = value.replace(/\\/g, "\\\\")
michael@0: .replace(/"/g, '\\"');
michael@0:
michael@0: for (var i = 0; i < 32; i++) {
michael@0: var replace = "\\";
michael@0: switch (i) {
michael@0: case 0: replace += "0"; break;
michael@0: case 1: replace += "x01"; break;
michael@0: case 2: replace += "x02"; break;
michael@0: case 3: replace += "x03"; break;
michael@0: case 4: replace += "x04"; break;
michael@0: case 5: replace += "x05"; break;
michael@0: case 6: replace += "x06"; break;
michael@0: case 7: replace += "x07"; break;
michael@0: case 8: replace += "b"; break;
michael@0: case 9: replace += "t"; break;
michael@0: case 10: replace += "n"; break;
michael@0: case 11: replace += "v"; break;
michael@0: case 12: replace += "f"; break;
michael@0: case 13: replace += "r"; break;
michael@0: case 14: replace += "x0e"; break;
michael@0: case 15: replace += "x0f"; break;
michael@0: case 16: replace += "x10"; break;
michael@0: case 17: replace += "x11"; break;
michael@0: case 18: replace += "x12"; break;
michael@0: case 19: replace += "x13"; break;
michael@0: case 20: replace += "x14"; break;
michael@0: case 21: replace += "x15"; break;
michael@0: case 22: replace += "x16"; break;
michael@0: case 23: replace += "x17"; break;
michael@0: case 24: replace += "x18"; break;
michael@0: case 25: replace += "x19"; break;
michael@0: case 26: replace += "x1a"; break;
michael@0: case 27: replace += "x1b"; break;
michael@0: case 28: replace += "x1c"; break;
michael@0: case 29: replace += "x1d"; break;
michael@0: case 30: replace += "x1e"; break;
michael@0: case 31: replace += "x1f"; break;
michael@0: }
michael@0: value = value.replace(new RegExp(String.fromCharCode(i), "g"), replace);
michael@0: }
michael@0: return '"' + value + '"';
michael@0: }
michael@0: //@}
michael@0:
michael@0: function doSetup(selector, idx) {
michael@0: //@{
michael@0: var table = document.querySelectorAll(selector)[idx];
michael@0:
michael@0: var tr = document.createElement("tr");
michael@0: table.firstChild.appendChild(tr);
michael@0: tr.className = (tr.className + " active").trim();
michael@0:
michael@0: return tr;
michael@0: }
michael@0: //@}
michael@0:
michael@0: function queryOutputHelper(beforeIndeterm, beforeState, beforeValue,
michael@0: afterIndeterm, afterState, afterValue,
michael@0: command, value) {
michael@0: //@{
michael@0: var frag = document.createDocumentFragment();
michael@0: var beforeDiv = document.createElement("div");
michael@0: var afterDiv = document.createElement("div");
michael@0: frag.appendChild(beforeDiv);
michael@0: frag.appendChild(afterDiv);
michael@0: beforeDiv.className = afterDiv.className = "extra-results";
michael@0: beforeDiv.textContent = "Before: ";
michael@0: afterDiv.textContent = "After: ";
michael@0:
michael@0: beforeDiv.appendChild(document.createElement("span"));
michael@0: afterDiv.appendChild(document.createElement("span"));
michael@0: if ("indeterm" in commands[command]) {
michael@0: // We only know it has to be either true or false.
michael@0: if (beforeIndeterm !== true && beforeIndeterm !== false) {
michael@0: beforeDiv.lastChild.className = "bad-result";
michael@0: }
michael@0: } else {
michael@0: // It always has to be false.
michael@0: beforeDiv.lastChild.className = beforeIndeterm === false
michael@0: ? "good-result"
michael@0: : "bad-result";
michael@0: }
michael@0: // After running the command, indeterminate must always be false, except if
michael@0: // it's an exception, or if it's insert*list and the state was true to
michael@0: // begin with. And we can't help strikethrough/underline.
michael@0: if ((/^insert(un)?orderedlist$/.test(command) && beforeState)
michael@0: || command == "strikethrough"
michael@0: || command == "underline") {
michael@0: if (afterIndeterm !== true && afterIndeterm !== false) {
michael@0: afterDiv.lastChild.className = "bad-result";
michael@0: }
michael@0: } else {
michael@0: afterDiv.lastChild.className =
michael@0: afterIndeterm === false
michael@0: ? "good-result"
michael@0: : "bad-result";
michael@0: }
michael@0: beforeDiv.lastChild.textContent = "indeterm " + prettyPrint(beforeIndeterm);
michael@0: afterDiv.lastChild.textContent = "indeterm " + prettyPrint(afterIndeterm);
michael@0:
michael@0: beforeDiv.appendChild(document.createTextNode(", "));
michael@0: afterDiv.appendChild(document.createTextNode(", "));
michael@0:
michael@0: beforeDiv.appendChild(document.createElement("span"));
michael@0: afterDiv.appendChild(document.createElement("span"));
michael@0: if (/^insert(un)?orderedlist$/.test(command)) {
michael@0: // If the before state is true, the after state could be either true or
michael@0: // false. But if the before state is false, the after state has to be
michael@0: // true.
michael@0: if (beforeState !== true && beforeState !== false) {
michael@0: beforeDiv.lastChild.className = "bad-result";
michael@0: }
michael@0: if (!beforeState) {
michael@0: afterDiv.lastChild.className = afterState === true
michael@0: ? "good-result"
michael@0: : "bad-result";
michael@0: } else if (afterState !== true && afterState !== false) {
michael@0: afterDiv.lastChild.className = "bad-result";
michael@0: }
michael@0: } else if (/^justify(center|full|left|right)$/.test(command)) {
michael@0: // We don't know about the before state, but the after state is always
michael@0: // supposed to be true.
michael@0: if (beforeState !== true && beforeState !== false) {
michael@0: beforeDiv.lastChild.className = "bad-result";
michael@0: }
michael@0: afterDiv.lastChild.className = afterState === true
michael@0: ? "good-result"
michael@0: : "bad-result";
michael@0: } else if (command == "strikethrough" || command == "underline") {
michael@0: // The only thing we can say is the before/after states need to be
michael@0: // either true or false.
michael@0: if (beforeState !== true && beforeState !== false) {
michael@0: beforeDiv.lastChild.className = "bad-result";
michael@0: }
michael@0: if (afterState !== true && afterState !== false) {
michael@0: afterDiv.lastChild.className = "bad-result";
michael@0: }
michael@0: } else {
michael@0: // The general rule is it must flip the state, unless there's no state
michael@0: // defined, in which case it should always be false.
michael@0: beforeDiv.lastChild.className =
michael@0: afterDiv.lastChild.className =
michael@0: ("state" in commands[command] && typeof beforeState == "boolean" && typeof afterState == "boolean" && beforeState === !afterState)
michael@0: || (!("state" in commands[command]) && beforeState === false && afterState === false)
michael@0: ? "good-result"
michael@0: : "bad-result";
michael@0: }
michael@0: beforeDiv.lastChild.textContent = "state " + prettyPrint(beforeState);
michael@0: afterDiv.lastChild.textContent = "state " + prettyPrint(afterState);
michael@0:
michael@0: beforeDiv.appendChild(document.createTextNode(", "));
michael@0: afterDiv.appendChild(document.createTextNode(", "));
michael@0:
michael@0: beforeDiv.appendChild(document.createElement("span"));
michael@0: afterDiv.appendChild(document.createElement("span"));
michael@0:
michael@0: // Direct equality comparison doesn't make sense in a bunch of cases.
michael@0: if (command == "backcolor" || command == "forecolor" || command == "hilitecolor") {
michael@0: if (/^([0-9a-fA-F]{3}){1,2}$/.test(value)) {
michael@0: value = "#" + value;
michael@0: }
michael@0: } else if (command == "fontsize") {
michael@0: value = normalizeFontSize(value);
michael@0: if (value !== null) {
michael@0: value = String(cssSizeToLegacy(value));
michael@0: }
michael@0: } else if (command == "formatblock") {
michael@0: value = value.replace(/^<(.*)>$/, "$1").toLowerCase();
michael@0: } else if (command == "defaultparagraphseparator") {
michael@0: value = value.toLowerCase();
michael@0: if (value != "p" && value != "div") {
michael@0: value = "";
michael@0: }
michael@0: }
michael@0:
michael@0: if (((command == "backcolor" || command == "forecolor" || command == "hilitecolor") && value.toLowerCase() == "currentcolor")
michael@0: || (command == "fontsize" && value === null)
michael@0: || (command == "formatblock" && formattableBlockNames.indexOf(value.replace(/^<(.*)>$/, "$1").trim()) == -1)
michael@0: || (command == "defaultparagraphseparator" && value == "")) {
michael@0: afterDiv.lastChild.className = beforeValue === afterValue
michael@0: ? "good-result"
michael@0: : "bad-result";
michael@0: } else if (/^justify(center|full|left|right)$/.test(command)) {
michael@0: // We know there are only four correct values beforehand, and afterward
michael@0: // the value has to be the one we set.
michael@0: if (!/^(center|justify|left|right)$/.test(beforeValue)) {
michael@0: beforeDiv.lastChild.className = "bad-result";
michael@0: }
michael@0: var expectedValue = command == "justifyfull"
michael@0: ? "justify"
michael@0: : command.replace("justify", "");
michael@0: afterDiv.lastChild.className = afterValue === expectedValue
michael@0: ? "good-result"
michael@0: : "bad-result";
michael@0: } else if (!("value" in commands[command])) {
michael@0: // If it's not defined we want "".
michael@0: beforeDiv.lastChild.className = beforeValue === ""
michael@0: ? "good-result"
michael@0: : "bad-result";
michael@0: afterDiv.lastChild.className = afterValue === ""
michael@0: ? "good-result"
michael@0: : "bad-result";
michael@0: } else {
michael@0: // And in all other cases, the value afterwards has to be the one we
michael@0: // set.
michael@0: afterDiv.lastChild.className =
michael@0: areEquivalentValues(command, afterValue, value)
michael@0: ? "good-result"
michael@0: : "bad-result";
michael@0: }
michael@0: beforeDiv.lastChild.textContent = "value " + prettyPrint(beforeValue);
michael@0: afterDiv.lastChild.textContent = "value " + prettyPrint(afterValue);
michael@0:
michael@0: return frag;
michael@0: }
michael@0: //@}
michael@0:
michael@0: function normalizeTest(command, test, styleWithCss) {
michael@0: //@{
michael@0: // Our standard format for test processing is:
michael@0: // [input HTML, [command1, value1], [command2, value2], ...]
michael@0: // But this is verbose, so we actually use three different formats in the
michael@0: // tests and multiTests arrays:
michael@0: //
michael@0: // 1) Plain string giving the input HTML. The command is implicit from the
michael@0: // key of the tests array. If the command takes values, the value is given
michael@0: // by defaultValues, otherwise it's "". Has to be converted to
michael@0: // [input HTML, [command, value].
michael@0: //
michael@0: // 2) Two-element array [value, input HTML]. Has to be converted to
michael@0: // [input HTML, [command, value]].
michael@0: //
michael@0: // 3) An element of multiTests. This just has to have values filled in.
michael@0: //
michael@0: // Optionally, a styleWithCss argument can be passed, either true or false.
michael@0: // If it is, we'll prepend a styleWithCss invocation.
michael@0: if (command == "multitest") {
michael@0: if (typeof test == "string") {
michael@0: test = JSON.parse(test);
michael@0: }
michael@0: for (var i = 1; i < test.length; i++) {
michael@0: if (typeof test[i] == "string"
michael@0: && test[i] in defaultValues) {
michael@0: test[i] = [test[i], defaultValues[test[i]]];
michael@0: } else if (typeof test[i] == "string") {
michael@0: test[i] = [test[i], ""];
michael@0: }
michael@0: }
michael@0: return test;
michael@0: }
michael@0:
michael@0: if (typeof test == "string") {
michael@0: if (command in defaultValues) {
michael@0: test = [test, [command, defaultValues[command]]];
michael@0: } else {
michael@0: test = [test, [command, ""]];
michael@0: }
michael@0: } else if (test.length == 2) {
michael@0: test = [test[1], [command, String(test[0])]];
michael@0: }
michael@0:
michael@0: if (styleWithCss !== undefined) {
michael@0: test.splice(1, 0, ["stylewithcss", String(styleWithCss)]);
michael@0: }
michael@0:
michael@0: return test;
michael@0: }
michael@0: //@}
michael@0:
michael@0: function doInputCell(tr, test, command) {
michael@0: //@{
michael@0: var testHtml = test[0];
michael@0:
michael@0: var msg = null;
michael@0: if (command in defaultValues) {
michael@0: // Single command with a value, possibly with a styleWithCss stuck
michael@0: // before. We don't need to specify the command itself, since this
michael@0: // presumably isn't in multiTests, so the command is already given by
michael@0: // the section header.
michael@0: msg = 'value: ' + prettyPrint(test[test.length - 1][1]);
michael@0: } else if (command == "multitest") {
michael@0: // Uses a different input format
michael@0: msg = JSON.stringify(test);
michael@0: }
michael@0: var inputCell = document.createElement("td");
michael@0: inputCell.innerHTML = "
";
michael@0: inputCell.firstChild.innerHTML = testHtml;
michael@0: inputCell.lastChild.textContent = inputCell.firstChild.innerHTML;
michael@0: if (msg !== null) {
michael@0: inputCell.lastChild.textContent += " (" + msg + ")";
michael@0: }
michael@0:
michael@0: tr.appendChild(inputCell);
michael@0: }
michael@0: //@}
michael@0:
michael@0: function doSpecCell(tr, test, command) {
michael@0: //@{
michael@0: var specCell = document.createElement("td");
michael@0: tr.appendChild(specCell);
michael@0: try {
michael@0: var points = setupCell(specCell, test[0]);
michael@0: var range = document.createRange();
michael@0: range.setStart(points[0], points[1]);
michael@0: range.setEnd(points[2], points[3]);
michael@0: // The points might be backwards
michael@0: if (range.collapsed) {
michael@0: range.setEnd(points[0], points[1]);
michael@0: }
michael@0: specCell.firstChild.contentEditable = "true";
michael@0: specCell.firstChild.spellcheck = false;
michael@0:
michael@0: if (command != "multitest") {
michael@0: try { var beforeIndeterm = myQueryCommandIndeterm(command, range) }
michael@0: catch(e) { beforeIndeterm = "Exception" }
michael@0: try { var beforeState = myQueryCommandState(command, range) }
michael@0: catch(e) { beforeState = "Exception" }
michael@0: try { var beforeValue = myQueryCommandValue(command, range) }
michael@0: catch(e) { beforeValue = "Exception" }
michael@0: }
michael@0:
michael@0: for (var i = 1; i < test.length; i++) {
michael@0: myExecCommand(test[i][0], false, test[i][1], range);
michael@0: }
michael@0:
michael@0: if (command != "multitest") {
michael@0: try { var afterIndeterm = myQueryCommandIndeterm(command, range) }
michael@0: catch(e) { afterIndeterm = "Exception" }
michael@0: try { var afterState = myQueryCommandState(command, range) }
michael@0: catch(e) { afterState = "Exception" }
michael@0: try { var afterValue = myQueryCommandValue(command, range) }
michael@0: catch(e) { afterValue = "Exception" }
michael@0: }
michael@0:
michael@0: specCell.firstChild.contentEditable = "inherit";
michael@0: specCell.firstChild.removeAttribute("spellcheck");
michael@0: var compareDiv1 = specCell.firstChild.cloneNode(true);
michael@0:
michael@0: // Now do various sanity checks, and throw if they're violated. First
michael@0: // just count children:
michael@0: if (specCell.childNodes.length != 2) {
michael@0: throw "The cell didn't have two children. Did something spill outside the test div?";
michael@0: }
michael@0:
michael@0: // Now verify that the DOM serializes.
michael@0: compareDiv1.normalize();
michael@0: var compareDiv2 = compareDiv1.cloneNode(false);
michael@0: compareDiv2.innerHTML = compareDiv1.innerHTML;
michael@0: // Oddly, IE9 sometimes produces two nodes that return true for
michael@0: // isEqualNode but have different innerHTML (omitting closing tags vs.
michael@0: // not).
michael@0: if (!compareDiv1.isEqualNode(compareDiv2)
michael@0: && compareDiv1.innerHTML != compareDiv2.innerHTML) {
michael@0: throw "DOM does not round-trip through serialization! "
michael@0: + compareDiv1.innerHTML + " vs. " + compareDiv2.innerHTML;
michael@0: }
michael@0: if (!compareDiv1.isEqualNode(compareDiv2)) {
michael@0: throw "DOM does not round-trip through serialization (although innerHTML is the same)! "
michael@0: + compareDiv1.innerHTML;
michael@0: }
michael@0:
michael@0: // Check for attributes
michael@0: if (specCell.firstChild.attributes.length) {
michael@0: throw "Wrapper div has attributes! " +
michael@0: specCell.innerHTML.replace(/
<\/div>$/, "");
michael@0: }
michael@0:
michael@0: // Final sanity check: make sure everything isAllowedChild() of its
michael@0: // parent.
michael@0: getDescendants(specCell.firstChild).forEach(function(descendant) {
michael@0: if (!isAllowedChild(descendant, descendant.parentNode)) {
michael@0: throw "Something here is not an allowed child of its parent: " + descendant;
michael@0: }
michael@0: });
michael@0:
michael@0: addBrackets(range);
michael@0:
michael@0: specCell.lastChild.textContent = specCell.firstChild.innerHTML;
michael@0: if (command != "multitest") {
michael@0: specCell.lastChild.appendChild(queryOutputHelper(
michael@0: beforeIndeterm, beforeState, beforeValue,
michael@0: afterIndeterm, afterState, afterValue,
michael@0: command, test[test.length - 1][1]));
michael@0: if (specCell.querySelector(".bad-result")) {
michael@0: specCell.parentNode.className = "alert";
michael@0: }
michael@0: }
michael@0: } catch (e) {
michael@0: specCell.firstChild.contentEditable = "inherit";
michael@0: specCell.firstChild.removeAttribute("spellcheck");
michael@0: specCell.lastChild.textContent = "Exception: " + formatException(e);
michael@0:
michael@0: specCell.parentNode.className = "alert";
michael@0: specCell.lastChild.className = "alert";
michael@0:
michael@0: // Don't bother comparing to localStorage, this is always wrong no
michael@0: // matter what.
michael@0: return;
michael@0: }
michael@0:
michael@0: if (command != "multitest") {
michael@0: // Old storage format
michael@0: var key = "execcommand-" + command
michael@0: + "-" + (test.length == 2 || test[1][1] == "false" ? "0" : "1")
michael@0: + "-" + tr.firstChild.lastChild.textContent;
michael@0: } else {
michael@0: var key = "execcommand-" + JSON.stringify(test);
michael@0: }
michael@0:
michael@0: // Use getItem() instead of direct property access to work around Firefox
michael@0: // bug: https://bugzilla.mozilla.org/show_bug.cgi?id=532062
michael@0: var oldValue = localStorage.getItem(key);
michael@0: var newValue = specCell.lastChild.firstChild.textContent;
michael@0:
michael@0: // Ignore differences between {} and [].
michael@0: if (oldValue === null
michael@0: || oldValue.replace("{}", "[]") !== newValue.replace("{}", "[]")) {
michael@0: specCell.parentNode.className = "alert";
michael@0: var alertDiv = document.createElement("div");
michael@0: specCell.lastChild.appendChild(alertDiv);
michael@0: alertDiv.className = "alert";
michael@0: if (oldValue === null) {
michael@0: alertDiv.textContent = "Newly added test result";
michael@0: } else if (oldValue.replace(/[\[\]{}]/g, "") == newValue.replace(/[\[\]{}]/g, "")) {
michael@0: alertDiv.textContent = "Last run produced a different selection: " + oldValue;
michael@0: } else {
michael@0: alertDiv.textContent = "Last run produced different markup: " + oldValue;
michael@0: }
michael@0:
michael@0: var button = document.createElement("button");
michael@0: alertDiv.appendChild(button);
michael@0: button.textContent = "Store new result";
michael@0: button.className = "store-new-result";
michael@0: button.onclick = (function(key, val, alertDiv) { return function() {
michael@0: localStorage[key] = val;
michael@0: // Make it easier to do mass updates, and also to jump to the next
michael@0: // new result
michael@0: var buttons = document.getElementsByClassName("store-new-result");
michael@0: for (var i = 0; i < buttons.length; i++) {
michael@0: if (isDescendant(buttons[i], alertDiv)
michael@0: && i + 1 < buttons.length) {
michael@0: buttons[i + 1].focus();
michael@0: break;
michael@0: }
michael@0: }
michael@0: var td = alertDiv;
michael@0: while (td.tagName != "TD") {
michael@0: td = td.parentNode;
michael@0: }
michael@0: alertDiv.parentNode.removeChild(alertDiv);
michael@0: if (!td.querySelector(".alert")) {
michael@0: td.parentNode.className = (" " + td.parentNode.className + " ")
michael@0: .replace(/ alert /g, "")
michael@0: .replace(/^ | $/g, "");
michael@0: }
michael@0: } })(key, newValue, alertDiv);
michael@0: }
michael@0: }
michael@0: //@}
michael@0:
michael@0: function browserCellException(e, testDiv, browserCell) {
michael@0: //@{
michael@0: if (testDiv) {
michael@0: testDiv.contenteditable = "inherit";
michael@0: testDiv.removeAttribute("spellcheck");
michael@0: }
michael@0: browserCell.lastChild.className = "alert";
michael@0: browserCell.lastChild.textContent = "Exception: " + formatException(e);
michael@0: if (testDiv && testDiv.parentNode != browserCell) {
michael@0: browserCell.insertBefore(testDiv, browserCell.firstChild);
michael@0: }
michael@0: }
michael@0: //@}
michael@0:
michael@0: function formatException(e) {
michael@0: //@{
michael@0: if (typeof e == "object" && "stack" in e) {
michael@0: return e + " (stack: " + e.stack + ")";
michael@0: }
michael@0: return String(e);
michael@0: }
michael@0: //@}
michael@0:
michael@0: function doSameCell(tr) {
michael@0: //@{
michael@0: tr.className = (" " + tr.className + " ").replace(" active ", "").trim();
michael@0: if (tr.className == "") {
michael@0: tr.removeAttribute("class");
michael@0: }
michael@0:
michael@0: var sameCell = document.createElement("td");
michael@0: if (!document.querySelector("#browser-checkbox").checked) {
michael@0: sameCell.className = "maybe";
michael@0: sameCell.textContent = "?";
michael@0: } else {
michael@0: var exception = false;
michael@0: try {
michael@0: // Ad hoc normalization to avoid basically spurious mismatches. For
michael@0: // now this includes ignoring where the selection goes.
michael@0: var normalizedSpecCell = tr.childNodes[1].lastChild.firstChild.textContent
michael@0: .replace(/[[\]{}]/g, "")
michael@0: .replace(/ style="margin: 0 0 0 40px; border: none; padding: 0px;"/g, '')
michael@0: .replace(/ style="margin-right: 0px;" dir="ltr"/g, '')
michael@0: .replace(/ style="margin-left: 0px;" dir="rtl"/g, '')
michael@0: .replace(/ style="margin-(left|right): 40px;"/g, '')
michael@0: .replace(/: /g, ":")
michael@0: .replace(/;? ?"/g, '"')
michael@0: .replace(/<(\/?)strong/g, '<$1b')
michael@0: .replace(/<(\/?)strike/g, '<$1s')
michael@0: .replace(/<(\/?)em/g, '<$1i')
michael@0: .replace(/#[0-9a-fA-F]{6}/g, function(match) { return match.toUpperCase(); });
michael@0: var normalizedBrowserCell = tr.childNodes[2].lastChild.firstChild.textContent
michael@0: .replace(/[[\]{}]/g, "")
michael@0: .replace(/ style="margin: 0 0 0 40px; border: none; padding: 0px;"/g, '')
michael@0: .replace(/ style="margin-right: 0px;" dir="ltr"/g, '')
michael@0: .replace(/ style="margin-left: 0px;" dir="rtl"/g, '')
michael@0: .replace(/ style="margin-(left|right): 40px;"/g, '')
michael@0: .replace(/: /g, ":")
michael@0: .replace(/;? ?"/g, '"')
michael@0: .replace(/<(\/?)strong/g, '<$1b')
michael@0: .replace(/<(\/?)strike/g, '<$1s')
michael@0: .replace(/<(\/?)em/g, '<$1i')
michael@0: .replace(/#[0-9a-fA-F]{6}/g, function(match) { return match.toUpperCase(); })
michael@0: .replace(/ size="2" width="100%"/g, '');
michael@0: if (navigator.userAgent.indexOf("MSIE") != -1) {
michael@0: // IE produces
instead of , so let's
michael@0: // translate all s to s.
michael@0: normalizedSpecCell = normalizedSpecCell
michael@0: .replace(/<(\/?)span/g, '<$1font');
michael@0: normalizedBrowserCell = normalizedBrowserCell
michael@0: .replace(/<(\/?)span/g, '<$1font');
michael@0: }
michael@0: } catch (e) {
michael@0: exception = true;
michael@0: }
michael@0: if (!exception && normalizedSpecCell == normalizedBrowserCell) {
michael@0: sameCell.className = "yes";
michael@0: sameCell.textContent = "\u2713";
michael@0: } else {
michael@0: sameCell.className = "no";
michael@0: sameCell.textContent = "\u2717";
michael@0: }
michael@0: }
michael@0: tr.appendChild(sameCell);
michael@0:
michael@0: for (var i = 0; i <= 2; i++) {
michael@0: // Insert so IE doesn't stretch the screen. This is considerably
michael@0: // more complicated than it has to be, thanks to Firefox's lack of
michael@0: // support for outerHTML.
michael@0: var div = tr.childNodes[i].lastChild;
michael@0: if (div.firstChild) {
michael@0: var text = div.firstChild.textContent;
michael@0: div.removeChild(div.firstChild);
michael@0: div.insertBefore(document.createElement("div"), div.firstChild);
michael@0: div.firstChild.innerHTML = text
michael@0: .replace(/&/g, "&")
michael@0: .replace(//g, ">")
michael@0: .replace(/</g, "<");
michael@0: while (div.firstChild.hasChildNodes()) {
michael@0: div.insertBefore(div.firstChild.lastChild, div.firstChild.nextSibling);
michael@0: }
michael@0: div.removeChild(div.firstChild);
michael@0: }
michael@0:
michael@0: // Add position: absolute span to not affect vertical layout
michael@0: getDescendants(tr.childNodes[i].firstChild)
michael@0: .filter(function(node) {
michael@0: return node.nodeType == Node.TEXT_NODE
michael@0: && /^(\{\}?|\})$/.test(node.data);
michael@0: }).forEach(function(node) {
michael@0: var span = document.createElement("span");
michael@0: span.style.position = "absolute";
michael@0: span.textContent = node.data;
michael@0: node.parentNode.insertBefore(span, node);
michael@0: node.parentNode.removeChild(node);
michael@0: });
michael@0: }
michael@0: }
michael@0: //@}
michael@0:
michael@0: function doTearDown(command) {
michael@0: //@{
michael@0: getSelection().removeAllRanges();
michael@0: }
michael@0: //@}
michael@0:
michael@0: function setupCell(cell, html) {
michael@0: //@{
michael@0: cell.innerHTML = "
";
michael@0:
michael@0: return setupDiv(cell.firstChild, html);
michael@0: }
michael@0: //@}
michael@0:
michael@0: function setupDiv(node, html) {
michael@0: //@{
michael@0: // A variety of checks to avoid simple errors. Not foolproof, of course.
michael@0: var re = /\{|\[|data-start/g;
michael@0: var markers = [];
michael@0: var marker;
michael@0: while (marker = re.exec(html)) {
michael@0: markers.push(marker);
michael@0: }
michael@0: if (markers.length != 1) {
michael@0: throw "Need exactly one start marker ([ or { or data-start), found " + markers.length;
michael@0: }
michael@0:
michael@0: var re = /\}|\]|data-end/g;
michael@0: var markers = [];
michael@0: var marker;
michael@0: while (marker = re.exec(html)) {
michael@0: markers.push(marker);
michael@0: }
michael@0: if (markers.length != 1) {
michael@0: throw "Need exactly one end marker (] or } or data-end), found " + markers.length;
michael@0: }
michael@0:
michael@0: node.innerHTML = html;
michael@0:
michael@0: var startNode, startOffset, endNode, endOffset;
michael@0:
michael@0: // For braces that don't lie inside text nodes, we can't just set
michael@0: // innerHTML, because that might disturb the DOM. For instance, if the
michael@0: // brace is right before a , it could get moved outside the table
michael@0: // entirely, which messes everything up pretty badly. So we instead
michael@0: // allow using data attributes: data-start and data-end on the start and
michael@0: // end nodes, with a numeric value indicating the offset. This format
michael@0: // doesn't allow the parent div to be a start or end node, but in that case
michael@0: // you can always use the curly braces.
michael@0: if (node.querySelector("[data-start]")) {
michael@0: startNode = node.querySelector("[data-start]");
michael@0: startOffset = startNode.getAttribute("data-start");
michael@0: startNode.removeAttribute("data-start");
michael@0: }
michael@0: if (node.querySelector("[data-end]")) {
michael@0: endNode = node.querySelector("[data-end]");
michael@0: endOffset = endNode.getAttribute("data-end");
michael@0: endNode.removeAttribute("data-end");
michael@0: }
michael@0:
michael@0: var cur = node;
michael@0: while (true) {
michael@0: if (!cur || (cur != node && !(cur.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINS))) {
michael@0: break;
michael@0: }
michael@0:
michael@0: if (cur.nodeType != Node.TEXT_NODE) {
michael@0: cur = nextNode(cur);
michael@0: continue;
michael@0: }
michael@0:
michael@0: var data = cur.data.replace(/\]/g, "");
michael@0: var startIdx = data.indexOf("[");
michael@0:
michael@0: data = cur.data.replace(/\[/g, "");
michael@0: var endIdx = data.indexOf("]");
michael@0:
michael@0: cur.data = cur.data.replace(/[\[\]]/g, "");
michael@0:
michael@0: if (startIdx != -1) {
michael@0: startNode = cur;
michael@0: startOffset = startIdx;
michael@0: }
michael@0:
michael@0: if (endIdx != -1) {
michael@0: endNode = cur;
michael@0: endOffset = endIdx;
michael@0: }
michael@0:
michael@0: // These are only legal as the first or last
michael@0: data = cur.data.replace(/\}/g, "");
michael@0: var elStartIdx = data.indexOf("{");
michael@0:
michael@0: data = cur.data.replace(/\{/g, "");
michael@0: var elEndIdx = data.indexOf("}");
michael@0:
michael@0: if (elStartIdx == 0) {
michael@0: startNode = cur.parentNode;
michael@0: startOffset = getNodeIndex(cur);
michael@0: } else if (elStartIdx != -1) {
michael@0: startNode = cur.parentNode;
michael@0: startOffset = getNodeIndex(cur) + 1;
michael@0: }
michael@0: if (elEndIdx == 0) {
michael@0: endNode = cur.parentNode;
michael@0: endOffset = getNodeIndex(cur);
michael@0: } else if (elEndIdx != -1) {
michael@0: endNode = cur.parentNode;
michael@0: endOffset = getNodeIndex(cur) + 1;
michael@0: }
michael@0:
michael@0: cur.data = cur.data.replace(/[{}]/g, "");
michael@0: if (!cur.data.length) {
michael@0: if (cur == startNode || cur == endNode) {
michael@0: throw "You put a square bracket where there was no text node . . .";
michael@0: }
michael@0: var oldCur = cur;
michael@0: cur = nextNode(cur);
michael@0: oldCur.parentNode.removeChild(oldCur);
michael@0: } else {
michael@0: cur = nextNode(cur);
michael@0: }
michael@0: }
michael@0:
michael@0: return [startNode, startOffset, endNode, endOffset];
michael@0: }
michael@0: //@}
michael@0:
michael@0: function setSelection(startNode, startOffset, endNode, endOffset) {
michael@0: //@{
michael@0: if (navigator.userAgent.indexOf("Opera") != -1) {
michael@0: // Yes, browser sniffing is evil, but I can't be bothered to debug
michael@0: // Opera.
michael@0: var range = document.createRange();
michael@0: range.setStart(startNode, startOffset);
michael@0: range.setEnd(endNode, endOffset);
michael@0: if (range.collapsed) {
michael@0: range.setEnd(startNode, startOffset);
michael@0: }
michael@0: getSelection().removeAllRanges();
michael@0: getSelection().addRange(range);
michael@0: } else if ("extend" in getSelection()) {
michael@0: // WebKit behaves unreasonably for collapse(), so do that manually.
michael@0: /*
michael@0: var range = document.createRange();
michael@0: range.setStart(startNode, startOffset);
michael@0: getSelection().removeAllRanges();
michael@0: getSelection().addRange(range);
michael@0: */
michael@0: getSelection().collapse(startNode, startOffset);
michael@0: getSelection().extend(endNode, endOffset);
michael@0: } else {
michael@0: // IE9. Selections have no direction, so we just make the selection
michael@0: // always forwards.
michael@0: var range;
michael@0: if (getSelection().rangeCount) {
michael@0: range = getSelection().getRangeAt(0);
michael@0: } else {
michael@0: range = document.createRange();
michael@0: }
michael@0: range.setStart(startNode, startOffset);
michael@0: range.setEnd(endNode, endOffset);
michael@0: if (range.collapsed) {
michael@0: // Phooey, we got them backwards.
michael@0: range.setEnd(startNode, startOffset);
michael@0: }
michael@0: if (!getSelection().rangeCount) {
michael@0: getSelection().addRange(range);
michael@0: }
michael@0: }
michael@0: }
michael@0: //@}
michael@0:
michael@0: /**
michael@0: * Add brackets at the start and end points of the given range, so that they're
michael@0: * visible.
michael@0: */
michael@0: function addBrackets(range) {
michael@0: //@{
michael@0: // Handle the collapsed case specially, to avoid confusingly getting the
michael@0: // markers backwards in some cases
michael@0: if (range.startContainer.nodeType == Node.TEXT_NODE
michael@0: || range.startContainer.nodeType == Node.COMMENT_NODE) {
michael@0: if (range.collapsed) {
michael@0: range.startContainer.insertData(range.startOffset, "[]");
michael@0: } else {
michael@0: range.startContainer.insertData(range.startOffset, "[");
michael@0: }
michael@0: } else {
michael@0: var marker = range.collapsed ? "{}" : "{";
michael@0: if (range.startOffset != range.startContainer.childNodes.length
michael@0: && range.startContainer.childNodes[range.startOffset].nodeType == Node.TEXT_NODE) {
michael@0: range.startContainer.childNodes[range.startOffset].insertData(0, marker);
michael@0: } else if (range.startOffset != 0
michael@0: && range.startContainer.childNodes[range.startOffset - 1].nodeType == Node.TEXT_NODE) {
michael@0: range.startContainer.childNodes[range.startOffset - 1].appendData(marker);
michael@0: } else {
michael@0: // Seems to serialize as I'd want even for tables . . . IE doesn't
michael@0: // allow undefined to be passed as the second argument (it throws
michael@0: // an exception), so we have to explicitly check the number of
michael@0: // children and pass null.
michael@0: range.startContainer.insertBefore(document.createTextNode(marker),
michael@0: range.startContainer.childNodes.length == range.startOffset
michael@0: ? null
michael@0: : range.startContainer.childNodes[range.startOffset]);
michael@0: }
michael@0: }
michael@0: if (range.collapsed) {
michael@0: return;
michael@0: }
michael@0: if (range.endContainer.nodeType == Node.TEXT_NODE
michael@0: || range.endContainer.nodeType == Node.COMMENT_NODE) {
michael@0: range.endContainer.insertData(range.endOffset, "]");
michael@0: } else {
michael@0: if (range.endOffset != range.endContainer.childNodes.length
michael@0: && range.endContainer.childNodes[range.endOffset].nodeType == Node.TEXT_NODE) {
michael@0: range.endContainer.childNodes[range.endOffset].insertData(0, "}");
michael@0: } else if (range.endOffset != 0
michael@0: && range.endContainer.childNodes[range.endOffset - 1].nodeType == Node.TEXT_NODE) {
michael@0: range.endContainer.childNodes[range.endOffset - 1].appendData("}");
michael@0: } else {
michael@0: range.endContainer.insertBefore(document.createTextNode("}"),
michael@0: range.endContainer.childNodes.length == range.endOffset
michael@0: ? null
michael@0: : range.endContainer.childNodes[range.endOffset]);
michael@0: }
michael@0: }
michael@0: }
michael@0: //@}
michael@0:
michael@0: function normalizeSerializedStyle(wrapper) {
michael@0: //@{
michael@0: // Inline CSS attribute serialization has terrible interop, so we fix
michael@0: // things up a bit to avoid spurious mismatches. This needs to be removed
michael@0: // once CSSOM defines this stuff properly, but for now there's just no
michael@0: // standard for any of it. This only normalizes descendants of wrapper,
michael@0: // not wrapper itself.
michael@0: [].forEach.call(wrapper.querySelectorAll("[style]"), function(node) {
michael@0: if (node.style.color != "") {
michael@0: var newColor = normalizeColor(node.style.color);
michael@0: node.style.color = "";
michael@0: node.style.color = newColor;
michael@0: }
michael@0: if (node.style.backgroundColor != "") {
michael@0: var newBackgroundColor = normalizeColor(node.style.backgroundColor);
michael@0: node.style.backgroundColor = "";
michael@0: node.style.backgroundColor = newBackgroundColor;
michael@0: }
michael@0: node.setAttribute("style", node.getAttribute("style")
michael@0: // Random spacing differences
michael@0: .replace(/; ?$/, "")
michael@0: .replace(/: /g, ":")
michael@0: // Gecko likes "transparent"
michael@0: .replace(/transparent/g, "rgba(0, 0, 0, 0)")
michael@0: // WebKit likes to look overly precise
michael@0: .replace(/, 0.496094\)/g, ", 0.5)")
michael@0: // Gecko converts anything with full alpha to "transparent" which
michael@0: // then becomes "rgba(0, 0, 0, 0)", so we have to make other
michael@0: // browsers match
michael@0: .replace(/rgba\([0-9]+, [0-9]+, [0-9]+, 0\)/g, "rgba(0, 0, 0, 0)")
michael@0: );
michael@0: });
michael@0: }
michael@0: //@}
michael@0:
michael@0: /**
michael@0: * Input is the same format as output of generateTest in gentest.html.
michael@0: */
michael@0: function runConformanceTest(browserTest) {
michael@0: //@{
michael@0: document.getElementById("test-container").innerHTML = "
test";
michael@0: var testName = JSON.stringify(browserTest[1]) + " " + format_value(browserTest[0]);
michael@0: var testDiv = document.querySelector("div[contenteditable]");
michael@0: var originalRootElement, newRootElement;
michael@0: var exception = null;
michael@0: var expectedExecCommandReturnValues = browserTest[3];
michael@0: var expectedQueryResults = browserTest[4];
michael@0: var actualQueryResults = {};
michael@0: var actualQueryExceptions = {};
michael@0:
michael@0: try {
michael@0: var points = setupDiv(testDiv, browserTest[0]);
michael@0:
michael@0: var range = document.createRange();
michael@0: range.setStart(points[0], points[1]);
michael@0: range.setEnd(points[2], points[3]);
michael@0: // The points might be backwards
michael@0: if (range.collapsed) {
michael@0: range.setEnd(points[0], points[1]);
michael@0: }
michael@0: getSelection().removeAllRanges();
michael@0: getSelection().addRange(range);
michael@0:
michael@0: var originalRootElement = document.documentElement.cloneNode(true);
michael@0: originalRootElement.querySelector("[contenteditable]").parentNode
michael@0: .removeChild(originalRootElement.querySelector("[contenteditable]"));
michael@0: originalRootElement.querySelector("#log").parentNode
michael@0: .removeChild(originalRootElement.querySelector("#log"));
michael@0:
michael@0: for (var command in expectedQueryResults) {
michael@0: var results = [];
michael@0: var exceptions = {};
michael@0: try { results[0] = document.queryCommandIndeterm(command) }
michael@0: catch(e) { exceptions[0] = e }
michael@0: try { results[1] = document.queryCommandState(command) }
michael@0: catch(e) { exceptions[1] = e }
michael@0: try { results[2] = document.queryCommandValue(command) }
michael@0: catch(e) { exceptions[2] = e }
michael@0: actualQueryResults[command] = results;
michael@0: actualQueryExceptions[command] = exceptions;
michael@0: }
michael@0: } catch(e) {
michael@0: exception = e;
michael@0: }
michael@0:
michael@0: for (var i = 0; i < browserTest[1].length; i++) {
michael@0: test(function() {
michael@0: assert_equals(exception, null, "Setup must not throw an exception");
michael@0:
michael@0: assert_equals(document.execCommand(browserTest[1][i][0], false, browserTest[1][i][1]),
michael@0: expectedExecCommandReturnValues[i]);
michael@0: }, testName + ": execCommand(" + format_value(browserTest[1][i][0]) + ", false, " + format_value(browserTest[1][i][1]) + ") return value");
michael@0: }
michael@0:
michael@0: if (exception === null) {
michael@0: try {
michael@0: for (var command in expectedQueryResults) {
michael@0: var results = actualQueryResults[command];
michael@0: var exceptions = actualQueryExceptions[command];
michael@0: try { results[3] = document.queryCommandIndeterm(command) }
michael@0: catch(e) { exceptions[3] = e }
michael@0: try { results[4] = document.queryCommandState(command) }
michael@0: catch(e) { exceptions[4] = e }
michael@0: try { results[5] = document.queryCommandValue(command) }
michael@0: catch(e) { exceptions[5] = e }
michael@0: }
michael@0:
michael@0: var newRootElement = document.documentElement.cloneNode(true);
michael@0: newRootElement.querySelector("[contenteditable]").parentNode
michael@0: .removeChild(newRootElement.querySelector("[contenteditable]"));
michael@0: newRootElement.querySelector("#log").parentNode
michael@0: .removeChild(newRootElement.querySelector("#log"));
michael@0:
michael@0: normalizeSerializedStyle(testDiv);
michael@0: } catch(e) {
michael@0: exception = e;
michael@0: }
michael@0: }
michael@0:
michael@0: test(function() {
michael@0: assert_equals(exception, null, "Setup must not throw an exception");
michael@0:
michael@0: // Now test for modifications to non-editable content. First just
michael@0: // count children:
michael@0: assert_equals(testDiv.parentNode.childNodes.length, 2,
michael@0: "The parent div must have two children. Did something spill outside the test div?");
michael@0:
michael@0: // Check for attributes
michael@0: assert_equals(testDiv.attributes.length, 1,
michael@0: 'Wrapper div must have only one attribute (
), but has more (' +
michael@0: formatStartTag(testDiv) + ")");
michael@0:
michael@0: assert_equals(document.body.attributes.length, 0,
michael@0: "Body element must have no attributes (), but has more (" +
michael@0: formatStartTag(document.body) + ")");
michael@0:
michael@0: // Check that in general, nothing outside the test div was modified.
michael@0: // TODO: Less verbose error reporting, the way some of the range tests
michael@0: // do?
michael@0: assert_equals(newRootElement.innerHTML, originalRootElement.innerHTML,
michael@0: "Everything outside the editable div must be unchanged, but some change did occur");
michael@0: }, testName + " checks for modifications to non-editable content");
michael@0:
michael@0: test(function() {
michael@0: assert_equals(exception, null, "Setup must not throw an exception");
michael@0:
michael@0: assert_equals(testDiv.innerHTML,
michael@0: browserTest[2].replace(/[\[\]{}]/g, ""),
michael@0: "Unexpected innerHTML (after normalizing inline style)");
michael@0: }, testName + " compare innerHTML");
michael@0:
michael@0: for (var command in expectedQueryResults) {
michael@0: var descriptions = [
michael@0: 'queryCommandIndeterm("' + command + '") before',
michael@0: 'queryCommandState("' + command + '") before',
michael@0: 'queryCommandValue("' + command + '") before',
michael@0: 'queryCommandIndeterm("' + command + '") after',
michael@0: 'queryCommandState("' + command + '") after',
michael@0: 'queryCommandValue("' + command + '") after',
michael@0: ];
michael@0: for (var i = 0; i < 6; i++) {
michael@0: test(function() {
michael@0: assert_equals(exception, null, "Setup must not throw an exception");
michael@0:
michael@0: if (expectedQueryResults[command][i] === null) {
michael@0: // Some ad hoc tests to verify that we have a real
michael@0: // DOMException. FIXME: This should be made more rigorous,
michael@0: // with clear steps specified for checking that something
michael@0: // is really a DOMException.
michael@0: assert_true(i in actualQueryExceptions[command],
michael@0: "An exception must be thrown in this case");
michael@0: var e = actualQueryExceptions[command][i];
michael@0: assert_equals(typeof e, "object",
michael@0: "typeof thrown object");
michael@0: assert_idl_attribute(e, "code",
michael@0: "Thrown object must be a DOMException");
michael@0: assert_idl_attribute(e, "INVALID_ACCESS_ERR",
michael@0: "Thrown object must be a DOMException");
michael@0: assert_equals(e.code, e.INVALID_ACCESS_ERR,
michael@0: "Thrown object must be an INVALID_ACCESS_ERR, so its .code and .INVALID_ACCESS_ERR attributes must be equal");
michael@0: } else if ((i == 2 || i == 5)
michael@0: && (command == "backcolor" || command == "forecolor" || command == "hilitecolor")
michael@0: && typeof actualQueryResults[command][i] == "string") {
michael@0: assert_false(i in actualQueryExceptions[command],
michael@0: "An exception must not be thrown in this case");
michael@0: // We don't return the format that the color should be in:
michael@0: // that's up to CSSOM. Thus we normalize before comparing.
michael@0: assert_equals(normalizeColor(actualQueryResults[command][i]),
michael@0: expectedQueryResults[command][i],
michael@0: "Wrong result returned (after color normalization)");
michael@0: } else {
michael@0: assert_false(i in actualQueryExceptions[command],
michael@0: "An exception must not be thrown in this case");
michael@0: assert_equals(actualQueryResults[command][i],
michael@0: expectedQueryResults[command][i],
michael@0: "Wrong result returned");
michael@0: }
michael@0: }, testName + " " + descriptions[i]);
michael@0: }
michael@0: }
michael@0:
michael@0: // Silly Firefox
michael@0: document.body.removeAttribute("bgcolor");
michael@0: }
michael@0: //@}
michael@0:
michael@0: /**
michael@0: * Return a string like ''.
michael@0: */
michael@0: function formatStartTag(el) {
michael@0: //@{
michael@0: var ret = "<" + el.tagName.toLowerCase();
michael@0: for (var i = 0; i < el.attributes.length; i++) {
michael@0: ret += " " + el.attributes[i].name + '="';
michael@0: ret += el.attributes[i].value.replace(/\&/g, "&")
michael@0: .replace(/"/g, """);
michael@0: ret += '"';
michael@0: }
michael@0: return ret + ">";
michael@0: }
michael@0: //@}
michael@0:
michael@0: // vim: foldmarker=@{,@} foldmethod=marker