script: Add initial implementation of italic command (#44432)

While working on this, I realised that the `current_state`
computation was wrong. Instead, the spec actually clearly
defines what to do, but I hadn't found it yet. The code
now correctly implements state computation and voila, it
also fixes the previous underline issue that I didn't
understand why it would fail.

Part of #25005

Testing: WPT

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
Tim van der Lippe
2026-04-23 17:54:57 +02:00
committed by GitHub
parent aa7eca43b7
commit 9189fe06a5
12 changed files with 132 additions and 1438 deletions

View File

@@ -21,6 +21,7 @@ use crate::dom::execcommand::commands::delete::execute_delete_command;
use crate::dom::execcommand::commands::fontsize::{
execute_fontsize_command, font_size_loosely_equivalent, value_for_fontsize_command,
};
use crate::dom::execcommand::commands::italic::execute_italic_command;
use crate::dom::execcommand::commands::strikethrough::execute_strikethrough_command;
use crate::dom::execcommand::commands::stylewithcss::execute_style_with_css_command;
use crate::dom::execcommand::commands::underline::execute_underline_command;
@@ -230,21 +231,42 @@ impl CommandName {
// > True if the CSS styling flag is true, otherwise false.
document.css_styling_flag()
},
CommandName::FontSize => {
// Font size does not have a state defined for its command
false
},
_ => {
// https://w3c.github.io/editing/docs/execCommand/#state
// > The state of a command is true if it is already in effect,
// > in some sense specific to the command.
// https://w3c.github.io/editing/docs/execCommand/#inline-formatting-command-definitions
// > If a command has inline command activated values defined, its state is true if either
// > no formattable node is effectively contained in the active range,
// > and the active range's start node's effective command value is one of the given values;
// > or if there is at least one formattable node effectively contained in the active range,
// > and all of them have an effective command value equal to one of the given values.
let inline_command_activated_values = self.inline_command_activated_values();
if inline_command_activated_values.is_empty() {
return None;
}
let selection = document.GetSelection(CanGc::from_cx(cx))?;
let active_range = selection.active_range()?;
active_range
.first_formattable_contained_node()
.unwrap_or_else(|| active_range.start_container())
.effective_command_value(self)
.is_some()
let mut at_least_one_child_is_formattable = false;
let mut all_children_have_matching_command_values = true;
active_range.for_each_effectively_contained_child(|node| {
if !node.is_formattable() {
return;
}
at_least_one_child_is_formattable = true;
all_children_have_matching_command_values &= node
.effective_command_value(self)
.is_some_and(|effective_value| {
inline_command_activated_values.contains(&&*effective_value.str())
});
});
if at_least_one_child_is_formattable {
all_children_have_matching_command_values
} else {
active_range
.start_container()
.effective_command_value(self)
.is_some_and(|effective_value| {
inline_command_activated_values.contains(&&*effective_value.str())
})
}
},
})
}
@@ -373,6 +395,7 @@ impl CommandName {
},
CommandName::Delete => execute_delete_command(cx, document, selection),
CommandName::FontSize => execute_fontsize_command(cx, document, selection, value),
CommandName::Italic => execute_italic_command(cx, document, selection),
CommandName::Strikethrough => execute_strikethrough_command(cx, document, selection),
CommandName::StyleWithCss => execute_style_with_css_command(document, value),
CommandName::Underline => execute_underline_command(cx, document, selection),

View File

@@ -0,0 +1,28 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use js::context::JSContext;
use crate::dom::document::Document;
use crate::dom::execcommand::basecommand::CommandName;
use crate::dom::execcommand::execcommands::DocumentExecCommandSupport;
use crate::dom::selection::Selection;
/// <https://w3c.github.io/editing/docs/execCommand/#the-italic-command>
pub(crate) fn execute_italic_command(
cx: &mut JSContext,
document: &Document,
selection: &Selection,
) -> bool {
// > If queryCommandState("italic") returns true, set the selection's value to "normal".
// > Otherwise set the selection's value to "italic". Either way, return true.
let value = if document.command_state_for_command(cx, "italic".into()) {
Some("normal".into())
} else {
Some("italic".into())
};
selection.set_the_selection_value(cx, value, CommandName::Italic, document);
true
}

View File

@@ -5,6 +5,7 @@
pub(crate) mod defaultparagraphseparator;
pub(crate) mod delete;
pub(crate) mod fontsize;
pub(crate) mod italic;
pub(crate) mod strikethrough;
pub(crate) mod stylewithcss;
pub(crate) mod underline;

View File

@@ -120,6 +120,7 @@ impl Document {
"delete" => CommandName::Delete,
"defaultparagraphseparator" => CommandName::DefaultParagraphSeparator,
"fontsize" => CommandName::FontSize,
"italic" => CommandName::Italic,
"strikethrough" => CommandName::Strikethrough,
"stylewithcss" => CommandName::StyleWithCss,
"underline" => CommandName::Underline,

View File

@@ -65,12 +65,6 @@
[Command hiliteColor, value "green": input event]
expected: FAIL
[Command italic, value "": input event]
expected: FAIL
[Command italic, value "quasit": input event]
expected: FAIL
[Command removeFormat, value "": input event]
expected: FAIL

View File

@@ -14,9 +14,6 @@
[Test for execCommand("bold", false, undefined) in "<div>a[b\]c</div>"]
expected: FAIL
[Test for execCommand("italic", false, undefined) in "<div>a[b\]c</div>"]
expected: FAIL
[Test for execCommand("createLink", false, "another.html") in "<div>a[b\]c</div>"]
expected: FAIL
@@ -43,9 +40,6 @@
[Test for execCommand("bold", false, undefined) in "<div>a[b\]c</div>"]
expected: FAIL
[Test for execCommand("italic", false, undefined) in "<div>a[b\]c</div>"]
expected: FAIL
[Test for execCommand("createLink", false, "another.html") in "<div>a[b\]c</div>"]
expected: FAIL
@@ -72,9 +66,6 @@
[Test for execCommand("bold", false, undefined) in "<div>a[b\]c</div>"]
expected: FAIL
[Test for execCommand("italic", false, undefined) in "<div>a[b\]c</div>"]
expected: FAIL
[Test for execCommand("createLink", false, "another.html") in "<div>a[b\]c</div>"]
expected: FAIL
@@ -101,9 +92,6 @@
[Test for execCommand("bold", false, undefined) in "<div>a[b\]c</div>"]
expected: FAIL
[Test for execCommand("italic", false, undefined) in "<div>a[b\]c</div>"]
expected: FAIL
[Test for execCommand("createLink", false, "another.html") in "<div>a[b\]c</div>"]
expected: FAIL
@@ -130,9 +118,6 @@
[Test for execCommand("bold", false, undefined) in "<div>a[b\]c</div>"]
expected: FAIL
[Test for execCommand("italic", false, undefined) in "<div>a[b\]c</div>"]
expected: FAIL
[Test for execCommand("createLink", false, "another.html") in "<div>a[b\]c</div>"]
expected: FAIL

View File

@@ -2,9 +2,6 @@
[In <input type="password">, execCommand("bold", false, bold), a[b\]c): The command should be supported]
expected: FAIL
[In <input type="password">, execCommand("italic", false, null), a[b\]c): The command should be supported]
expected: FAIL
[In <input type="password">, execCommand("superscript", false, null), a[b\]c): The command should be supported]
expected: FAIL
@@ -155,9 +152,6 @@
[In <input type="password"> in contenteditable, execCommand("bold", false, bold), a[b\]c): The command should be supported]
expected: FAIL
[In <input type="password"> in contenteditable, execCommand("italic", false, null), a[b\]c): The command should be supported]
expected: FAIL
[In <input type="password"> in contenteditable, execCommand("superscript", false, null), a[b\]c): The command should be supported]
expected: FAIL
@@ -434,14 +428,26 @@
[In <input type="password"> in contenteditable, execCommand("strikethrough", false, null), a[b\]c): input.target should be undefined]
expected: FAIL
[In <input type="password"> in contenteditable, execCommand("italic", false, null), a[b\]c): The command should not be enabled]
expected: FAIL
[In <input type="password"> in contenteditable, execCommand("italic", false, null), a[b\]c): execCommand() should return false]
expected: FAIL
[In <input type="password"> in contenteditable, execCommand("italic", false, null), a[b\]c): should not fire beforeinput event]
expected: FAIL
[In <input type="password"> in contenteditable, execCommand("italic", false, null), a[b\]c): input.inputType should be undefined]
expected: FAIL
[In <input type="password"> in contenteditable, execCommand("italic", false, null), a[b\]c): input.target should be undefined]
expected: FAIL
[exec-command-with-text-editor.tentative.html?type=text]
[In <input type="text">, execCommand("bold", false, bold), a[b\]c): The command should be supported]
expected: FAIL
[In <input type="text">, execCommand("italic", false, null), a[b\]c): The command should be supported]
expected: FAIL
[In <input type="text">, execCommand("superscript", false, null), a[b\]c): The command should be supported]
expected: FAIL
@@ -592,9 +598,6 @@
[In <input type="text"> in contenteditable, execCommand("bold", false, bold), a[b\]c): The command should be supported]
expected: FAIL
[In <input type="text"> in contenteditable, execCommand("italic", false, null), a[b\]c): The command should be supported]
expected: FAIL
[In <input type="text"> in contenteditable, execCommand("superscript", false, null), a[b\]c): The command should be supported]
expected: FAIL
@@ -871,14 +874,26 @@
[In <input type="text"> in contenteditable, execCommand("strikethrough", false, null), a[b\]c): input.target should be undefined]
expected: FAIL
[In <input type="text"> in contenteditable, execCommand("italic", false, null), a[b\]c): The command should not be enabled]
expected: FAIL
[In <input type="text"> in contenteditable, execCommand("italic", false, null), a[b\]c): execCommand() should return false]
expected: FAIL
[In <input type="text"> in contenteditable, execCommand("italic", false, null), a[b\]c): should not fire beforeinput event]
expected: FAIL
[In <input type="text"> in contenteditable, execCommand("italic", false, null), a[b\]c): input.inputType should be undefined]
expected: FAIL
[In <input type="text"> in contenteditable, execCommand("italic", false, null), a[b\]c): input.target should be undefined]
expected: FAIL
[exec-command-with-text-editor.tentative.html?type=textarea]
[In <textarea>, execCommand("bold", false, bold), a[b\]c): The command should be supported]
expected: FAIL
[In <textarea>, execCommand("italic", false, null), a[b\]c): The command should be supported]
expected: FAIL
[In <textarea>, execCommand("superscript", false, null), a[b\]c): The command should be supported]
expected: FAIL
@@ -1035,9 +1050,6 @@
[In <textarea> in contenteditable, execCommand("bold", false, bold), a[b\]c): The command should be supported]
expected: FAIL
[In <textarea> in contenteditable, execCommand("italic", false, null), a[b\]c): The command should be supported]
expected: FAIL
[In <textarea> in contenteditable, execCommand("superscript", false, null), a[b\]c): The command should be supported]
expected: FAIL
@@ -1319,3 +1331,18 @@
[In <textarea> in contenteditable, execCommand("strikethrough", false, null), a[b\]c): input.target should be undefined]
expected: FAIL
[In <textarea> in contenteditable, execCommand("italic", false, null), a[b\]c): The command should not be enabled]
expected: FAIL
[In <textarea> in contenteditable, execCommand("italic", false, null), a[b\]c): execCommand() should return false]
expected: FAIL
[In <textarea> in contenteditable, execCommand("italic", false, null), a[b\]c): should not fire beforeinput event]
expected: FAIL
[In <textarea> in contenteditable, execCommand("italic", false, null), a[b\]c): input.inputType should be undefined]
expected: FAIL
[In <textarea> in contenteditable, execCommand("italic", false, null), a[b\]c): input.target should be undefined]
expected: FAIL

View File

@@ -1,9 +1,6 @@
[removing-inline-style-specified-by-parent-block.tentative.html?u]
[removing-inline-style-specified-by-parent-block.tentative.html?i]
[Disabling style to text, it's applied to the parent block]
expected: FAIL
[Disabling style to text, it's applied to the editing host]
expected: FAIL

File diff suppressed because it is too large Load Diff

View File

@@ -1360,27 +1360,15 @@
[[["bold",""\],["outdent",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("bold") after]
expected: FAIL
[[["italic",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("inserttext", false, "a") return value]
expected: FAIL
[[["italic",""\],["inserttext","a"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["delete",""\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["delete",""\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["delete",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["delete",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("inserttext", false, "a") return value]
expected: FAIL
@@ -1390,24 +1378,15 @@
[[["italic",""\],["delete",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["formatblock","<div>"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["formatblock","<div>"\]\] "foo[\]bar": execCommand("formatblock", false, "<div>") return value]
expected: FAIL
[[["italic",""\],["formatblock","<div>"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["formatblock","<div>"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["formatblock","<div>"\]\] "foo[\]bar" queryCommandValue("formatblock") after]
expected: FAIL
[[["italic",""\],["formatblock","<div>"\],["inserttext","a"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["formatblock","<div>"\],["inserttext","a"\]\] "foo[\]bar": execCommand("formatblock", false, "<div>") return value]
expected: FAIL
@@ -1417,27 +1396,15 @@
[[["italic",""\],["formatblock","<div>"\],["inserttext","a"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["formatblock","<div>"\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["formatblock","<div>"\],["inserttext","a"\]\] "foo[\]bar" queryCommandValue("formatblock") after]
expected: FAIL
[[["italic",""\],["forwarddelete",""\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["forwarddelete",""\]\] "foo[\]bar": execCommand("forwarddelete", false, "") return value]
expected: FAIL
[[["italic",""\],["forwarddelete",""\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["forwarddelete",""\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["forwarddelete",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["forwarddelete",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("forwarddelete", false, "") return value]
expected: FAIL
@@ -1447,24 +1414,12 @@
[[["italic",""\],["forwarddelete",""\],["inserttext","a"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["forwarddelete",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["indent",""\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["indent",""\]\] "foo[\]bar": execCommand("indent", false, "") return value]
expected: FAIL
[[["italic",""\],["indent",""\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["indent",""\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["indent",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["indent",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("indent", false, "") return value]
expected: FAIL
@@ -1474,24 +1429,12 @@
[[["italic",""\],["indent",""\],["inserttext","a"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["indent",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["inserthorizontalrule",""\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["inserthorizontalrule",""\]\] "foo[\]bar": execCommand("inserthorizontalrule", false, "") return value]
expected: FAIL
[[["italic",""\],["inserthorizontalrule",""\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["inserthorizontalrule",""\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["inserthorizontalrule",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["inserthorizontalrule",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("inserthorizontalrule", false, "") return value]
expected: FAIL
@@ -1501,24 +1444,12 @@
[[["italic",""\],["inserthorizontalrule",""\],["inserttext","a"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["inserthorizontalrule",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["inserthtml","ab<b>c</b>d"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["inserthtml","ab<b>c</b>d"\]\] "foo[\]bar": execCommand("inserthtml", false, "ab<b>c</b>d") return value]
expected: FAIL
[[["italic",""\],["inserthtml","ab<b>c</b>d"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["inserthtml","ab<b>c</b>d"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["inserthtml","ab<b>c</b>d"\],["inserttext","a"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["inserthtml","ab<b>c</b>d"\],["inserttext","a"\]\] "foo[\]bar": execCommand("inserthtml", false, "ab<b>c</b>d") return value]
expected: FAIL
@@ -1528,24 +1459,12 @@
[[["italic",""\],["inserthtml","ab<b>c</b>d"\],["inserttext","a"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["inserthtml","ab<b>c</b>d"\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["insertimage","/img/lion.svg"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["insertimage","/img/lion.svg"\]\] "foo[\]bar": execCommand("insertimage", false, "/img/lion.svg") return value]
expected: FAIL
[[["italic",""\],["insertimage","/img/lion.svg"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["insertimage","/img/lion.svg"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["insertimage","/img/lion.svg"\],["inserttext","a"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["insertimage","/img/lion.svg"\],["inserttext","a"\]\] "foo[\]bar": execCommand("insertimage", false, "/img/lion.svg") return value]
expected: FAIL
@@ -1555,24 +1474,12 @@
[[["italic",""\],["insertimage","/img/lion.svg"\],["inserttext","a"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["insertimage","/img/lion.svg"\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["insertlinebreak",""\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["insertlinebreak",""\]\] "foo[\]bar": execCommand("insertlinebreak", false, "") return value]
expected: FAIL
[[["italic",""\],["insertlinebreak",""\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["insertlinebreak",""\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["insertlinebreak",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["insertlinebreak",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("insertlinebreak", false, "") return value]
expected: FAIL
@@ -1582,27 +1489,15 @@
[[["italic",""\],["insertlinebreak",""\],["inserttext","a"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["insertlinebreak",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["insertorderedlist",""\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["insertorderedlist",""\]\] "foo[\]bar": execCommand("insertorderedlist", false, "") return value]
expected: FAIL
[[["italic",""\],["insertorderedlist",""\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["insertorderedlist",""\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["insertorderedlist",""\]\] "foo[\]bar" queryCommandState("insertorderedlist") after]
expected: FAIL
[[["italic",""\],["insertorderedlist",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["insertorderedlist",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("insertorderedlist", false, "") return value]
expected: FAIL
@@ -1612,29 +1507,17 @@
[[["italic",""\],["insertorderedlist",""\],["inserttext","a"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["insertorderedlist",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["insertorderedlist",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("insertorderedlist") after]
expected: FAIL
[multitest.html?1001-2000]
[[["italic",""\],["insertparagraph",""\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["insertparagraph",""\]\] "foo[\]bar": execCommand("insertparagraph", false, "") return value]
expected: FAIL
[[["italic",""\],["insertparagraph",""\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["insertparagraph",""\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["insertparagraph",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["insertparagraph",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("insertparagraph", false, "") return value]
expected: FAIL
@@ -1644,27 +1527,15 @@
[[["italic",""\],["insertparagraph",""\],["inserttext","a"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["insertparagraph",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["insertunorderedlist",""\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["insertunorderedlist",""\]\] "foo[\]bar": execCommand("insertunorderedlist", false, "") return value]
expected: FAIL
[[["italic",""\],["insertunorderedlist",""\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["insertunorderedlist",""\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["insertunorderedlist",""\]\] "foo[\]bar" queryCommandState("insertunorderedlist") after]
expected: FAIL
[[["italic",""\],["insertunorderedlist",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["insertunorderedlist",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("insertunorderedlist", false, "") return value]
expected: FAIL
@@ -1674,24 +1545,15 @@
[[["italic",""\],["insertunorderedlist",""\],["inserttext","a"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["insertunorderedlist",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["insertunorderedlist",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("insertunorderedlist") after]
expected: FAIL
[[["italic",""\],["justifycenter",""\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["justifycenter",""\]\] "foo[\]bar": execCommand("justifycenter", false, "") return value]
expected: FAIL
[[["italic",""\],["justifycenter",""\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["justifycenter",""\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["justifycenter",""\]\] "foo[\]bar" queryCommandValue("justifycenter") before]
expected: FAIL
@@ -1701,9 +1563,6 @@
[[["italic",""\],["justifycenter",""\]\] "foo[\]bar" queryCommandValue("justifycenter") after]
expected: FAIL
[[["italic",""\],["justifycenter",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["justifycenter",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("justifycenter", false, "") return value]
expected: FAIL
@@ -1713,9 +1572,6 @@
[[["italic",""\],["justifycenter",""\],["inserttext","a"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["justifycenter",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["justifycenter",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandValue("justifycenter") before]
expected: FAIL
@@ -1725,18 +1581,12 @@
[[["italic",""\],["justifycenter",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandValue("justifycenter") after]
expected: FAIL
[[["italic",""\],["justifyfull",""\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["justifyfull",""\]\] "foo[\]bar": execCommand("justifyfull", false, "") return value]
expected: FAIL
[[["italic",""\],["justifyfull",""\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["justifyfull",""\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["justifyfull",""\]\] "foo[\]bar" queryCommandValue("justifyfull") before]
expected: FAIL
@@ -1746,9 +1596,6 @@
[[["italic",""\],["justifyfull",""\]\] "foo[\]bar" queryCommandValue("justifyfull") after]
expected: FAIL
[[["italic",""\],["justifyfull",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["justifyfull",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("justifyfull", false, "") return value]
expected: FAIL
@@ -1758,9 +1605,6 @@
[[["italic",""\],["justifyfull",""\],["inserttext","a"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["justifyfull",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["justifyfull",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandValue("justifyfull") before]
expected: FAIL
@@ -1770,15 +1614,9 @@
[[["italic",""\],["justifyfull",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandValue("justifyfull") after]
expected: FAIL
[[["italic",""\],["justifyleft",""\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["justifyleft",""\]\] "foo[\]bar": execCommand("justifyleft", false, "") return value]
expected: FAIL
[[["italic",""\],["justifyleft",""\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["justifyleft",""\]\] "foo[\]bar" queryCommandState("justifyleft") before]
expected: FAIL
@@ -1791,9 +1629,6 @@
[[["italic",""\],["justifyleft",""\]\] "foo[\]bar" queryCommandValue("justifyleft") after]
expected: FAIL
[[["italic",""\],["justifyleft",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["justifyleft",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("justifyleft", false, "") return value]
expected: FAIL
@@ -1803,9 +1638,6 @@
[[["italic",""\],["justifyleft",""\],["inserttext","a"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["justifyleft",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["justifyleft",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("justifyleft") before]
expected: FAIL
@@ -1818,18 +1650,12 @@
[[["italic",""\],["justifyleft",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandValue("justifyleft") after]
expected: FAIL
[[["italic",""\],["justifyright",""\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["justifyright",""\]\] "foo[\]bar": execCommand("justifyright", false, "") return value]
expected: FAIL
[[["italic",""\],["justifyright",""\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["justifyright",""\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["justifyright",""\]\] "foo[\]bar" queryCommandValue("justifyright") before]
expected: FAIL
@@ -1839,9 +1665,6 @@
[[["italic",""\],["justifyright",""\]\] "foo[\]bar" queryCommandValue("justifyright") after]
expected: FAIL
[[["italic",""\],["justifyright",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["justifyright",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("justifyright", false, "") return value]
expected: FAIL
@@ -1851,9 +1674,6 @@
[[["italic",""\],["justifyright",""\],["inserttext","a"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["justifyright",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["justifyright",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandValue("justifyright") before]
expected: FAIL
@@ -1863,18 +1683,9 @@
[[["italic",""\],["justifyright",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandValue("justifyright") after]
expected: FAIL
[[["italic",""\],["outdent",""\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["outdent",""\]\] "foo[\]bar": execCommand("outdent", false, "") return value]
expected: FAIL
[[["italic",""\],["outdent",""\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["italic",""\],["outdent",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("italic", false, "") return value]
expected: FAIL
[[["italic",""\],["outdent",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("outdent", false, "") return value]
expected: FAIL
@@ -1884,9 +1695,6 @@
[[["italic",""\],["outdent",""\],["inserttext","a"\]\] "foo[\]bar" compare innerHTML]
expected: FAIL
[[["italic",""\],["outdent",""\],["inserttext","a"\]\] "foo[\]bar" queryCommandState("italic") after]
expected: FAIL
[[["strikethrough",""\],["inserttext","a"\]\] "foo[\]bar": execCommand("inserttext", false, "a") return value]
expected: FAIL
@@ -6115,9 +5923,6 @@
[[["stylewithcss","false"\],["fontsize","4"\],["insertText","a"\]\] "<font size=7>{}<br></font>" compare innerHTML]
expected: FAIL
[[["stylewithcss","true"\],["italic",""\],["insertText","a"\]\] "<span style=font-weight:bold>{}<br></span></b>": execCommand("italic", false, "") return value]
expected: FAIL
[[["stylewithcss","true"\],["italic",""\],["insertText","a"\]\] "<span style=font-weight:bold>{}<br></span></b>": execCommand("insertText", false, "a") return value]
expected: FAIL
@@ -6328,18 +6133,12 @@
[[["styleWithCSS","false"\],["bold",""\],["italic",""\],["insertText","b"\]\] "a[\]c": execCommand("bold", false, "") return value]
expected: FAIL
[[["styleWithCSS","false"\],["bold",""\],["italic",""\],["insertText","b"\]\] "a[\]c": execCommand("italic", false, "") return value]
expected: FAIL
[[["styleWithCSS","false"\],["bold",""\],["italic",""\],["insertText","b"\]\] "a[\]c": execCommand("insertText", false, "b") return value]
expected: FAIL
[[["styleWithCSS","false"\],["bold",""\],["italic",""\],["insertText","b"\]\] "a[\]c" compare innerHTML]
expected: FAIL
[[["styleWithCSS","false"\],["italic",""\],["bold",""\],["insertText","b"\]\] "a[\]c": execCommand("italic", false, "") return value]
expected: FAIL
[[["styleWithCSS","false"\],["italic",""\],["bold",""\],["insertText","b"\]\] "a[\]c": execCommand("bold", false, "") return value]
expected: FAIL
@@ -6352,9 +6151,6 @@
[[["styleWithCSS","false"\],["bold",""\],["italic",""\],["insertText","b"\]\] "<b>a[\]</b>c": execCommand("bold", false, "") return value]
expected: FAIL
[[["styleWithCSS","false"\],["bold",""\],["italic",""\],["insertText","b"\]\] "<b>a[\]</b>c": execCommand("italic", false, "") return value]
expected: FAIL
[[["styleWithCSS","false"\],["bold",""\],["italic",""\],["insertText","b"\]\] "<b>a[\]</b>c": execCommand("insertText", false, "b") return value]
expected: FAIL
@@ -6364,9 +6160,6 @@
[[["styleWithCSS","false"\],["bold",""\],["italic",""\],["insertText","b"\]\] "<i>a[\]</i>c": execCommand("bold", false, "") return value]
expected: FAIL
[[["styleWithCSS","false"\],["bold",""\],["italic",""\],["insertText","b"\]\] "<i>a[\]</i>c": execCommand("italic", false, "") return value]
expected: FAIL
[[["styleWithCSS","false"\],["bold",""\],["italic",""\],["insertText","b"\]\] "<i>a[\]</i>c": execCommand("insertText", false, "b") return value]
expected: FAIL
@@ -6376,9 +6169,6 @@
[[["styleWithCSS","false"\],["bold",""\],["italic",""\],["insertText","b"\]\] "a[\]<b>c</b>": execCommand("bold", false, "") return value]
expected: FAIL
[[["styleWithCSS","false"\],["bold",""\],["italic",""\],["insertText","b"\]\] "a[\]<b>c</b>": execCommand("italic", false, "") return value]
expected: FAIL
[[["styleWithCSS","false"\],["bold",""\],["italic",""\],["insertText","b"\]\] "a[\]<b>c</b>": execCommand("insertText", false, "b") return value]
expected: FAIL
@@ -6388,9 +6178,6 @@
[[["styleWithCSS","false"\],["bold",""\],["italic",""\],["insertText","b"\]\] "a[\]<i>c</i>": execCommand("bold", false, "") return value]
expected: FAIL
[[["styleWithCSS","false"\],["bold",""\],["italic",""\],["insertText","b"\]\] "a[\]<i>c</i>": execCommand("italic", false, "") return value]
expected: FAIL
[[["styleWithCSS","false"\],["bold",""\],["italic",""\],["insertText","b"\]\] "a[\]<i>c</i>": execCommand("insertText", false, "b") return value]
expected: FAIL

View File

@@ -38,18 +38,6 @@
[[["stylewithcss","true"\],["strikethrough",""\]\] "foo<s>[bar\]</s>baz" queryCommandState("strikethrough") after]
expected: FAIL
[[["stylewithcss","true"\],["strikethrough",""\]\] "<strike>fo[o</strike><s>b\]ar</s>" queryCommandState("strikethrough") after]
expected: FAIL
[[["stylewithcss","false"\],["strikethrough",""\]\] "<strike>fo[o</strike><s>b\]ar</s>" queryCommandState("strikethrough") after]
expected: FAIL
[[["stylewithcss","true"\],["strikethrough",""\]\] "<s>fo[o</s><del>b\]ar</del>" queryCommandState("strikethrough") after]
expected: FAIL
[[["stylewithcss","false"\],["strikethrough",""\]\] "<s>fo[o</s><del>b\]ar</del>" queryCommandState("strikethrough") after]
expected: FAIL
[strikethrough.html?1001-2000]
[[["stylewithcss","true"\],["strikethrough",""\]\] "<strike>foo[b<span style=\\"color:blue\\">ar\]ba</span>z</strike>" compare innerHTML]
@@ -214,13 +202,7 @@
[[["stylewithcss","false"\],["strikethrough",""\]\] "foo<u style=\\"text-decoration: line-through\\">b[a\]r</u>baz" queryCommandState("strikethrough") after]
expected: FAIL
[[["strikethrough",""\]\] "foo<s>ba[r</s>b\]az" queryCommandState("strikethrough") before]
expected: FAIL
[[["stylewithcss","true"\],["strikethrough",""\]\] "foo<s>ba[r</s>\]baz" queryCommandState("strikethrough") after]
expected: FAIL
[[["stylewithcss","false"\],["strikethrough",""\]\] "foo<s>ba[r</s>\]baz" queryCommandState("strikethrough") after]
[[["strikethrough",""\]\] "foo<s>ba[r</s>b\]az" compare innerHTML]
expected: FAIL

View File

@@ -118,12 +118,6 @@
[[["stylewithcss","false"\],["underline",""\]\] "<ins>fo[o</ins><u>b\]ar</u>" queryCommandState("underline") after]
expected: FAIL
[[["stylewithcss","false"\],["underline",""\]\] "<u>fo[o</u><ins>b\]ar</ins>" queryCommandState("underline") after]
expected: FAIL
[[["stylewithcss","true"\],["underline",""\]\] "<u>fo[o</u><ins>b\]ar</ins>" queryCommandState("underline") after]
expected: FAIL
[underline.html?1001-2000]
[[["stylewithcss","false"\],["underline",""\]\] "foo<strike>[bar\]</strike>baz" queryCommandState("underline") after]
@@ -156,9 +150,6 @@
[[["underline",""\]\] "fo[o<u>b\]ar</u>baz" queryCommandIndeterm("underline") before]
expected: FAIL
[[["underline",""\]\] "foo<u>ba[r</u>b\]az" compare innerHTML]
expected: FAIL
[[["underline",""\]\] "foo<u>ba[r</u>b\]az" queryCommandIndeterm("underline") before]
expected: FAIL
@@ -171,15 +162,6 @@
[[["stylewithcss","true"\],["underline",""\]\] "<strike>foo[bar\]baz</strike>" queryCommandState("stylewithcss") before]
expected: FAIL
[[["underline",""\]\] "foo<u>ba[r</u>b\]az" queryCommandState("underline") before]
expected: FAIL
[[["stylewithcss","false"\],["underline",""\]\] "foo<u>ba[r</u>\]baz" queryCommandState("underline") after]
expected: FAIL
[[["stylewithcss","true"\],["underline",""\]\] "foo<u>ba[r</u>\]baz" queryCommandState("underline") after]
expected: FAIL
[[["stylewithcss","true"\],["underline",""\]\] "foo<s style=\\"text-decoration: underline\\">b[a\]r</s>baz" queryCommandState("underline") after]
expected: FAIL