LibWeb/Editing: Correct checking the command's specified value
We were always checking whether the `createLink` command had a non-empty value, which was a misinterpretation of the spec text. WPT's reference implementation of this algorithm explicitly checks whether a value definition was set for a command, so we do the same.
This commit is contained in:
parent
1513aea26d
commit
6f39652b25
2 changed files with 8 additions and 8 deletions
|
|
@ -3720,7 +3720,7 @@ void set_the_selections_value(DOM::Document& document, FlyString const& command,
|
|||
}
|
||||
|
||||
// 5. Otherwise, if command is "createLink" or it has a value specified, set the value override to new value.
|
||||
else if (command == CommandNames::createLink || !MUST(document.query_command_value(CommandNames::createLink)).is_empty()) {
|
||||
else if (command == CommandNames::createLink || command_definition->value) {
|
||||
document.set_command_value_override(command, *new_value);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ Harness status: OK
|
|||
|
||||
Found 1026 tests
|
||||
|
||||
1017 Pass
|
||||
9 Fail
|
||||
1022 Pass
|
||||
4 Fail
|
||||
Pass [["backcolor","#00FFFF"]] "foo[]bar": execCommand("backcolor", false, "#00FFFF") return value
|
||||
Pass [["backcolor","#00FFFF"]] "foo[]bar" checks for modifications to non-editable content
|
||||
Pass [["backcolor","#00FFFF"]] "foo[]bar" compare innerHTML
|
||||
|
|
@ -12,7 +12,7 @@ Pass [["backcolor","#00FFFF"]] "foo[]bar" queryCommandState("backcolor") before
|
|||
Pass [["backcolor","#00FFFF"]] "foo[]bar" queryCommandValue("backcolor") before
|
||||
Pass [["backcolor","#00FFFF"]] "foo[]bar" queryCommandIndeterm("backcolor") after
|
||||
Pass [["backcolor","#00FFFF"]] "foo[]bar" queryCommandState("backcolor") after
|
||||
Fail [["backcolor","#00FFFF"]] "foo[]bar" queryCommandValue("backcolor") after
|
||||
Pass [["backcolor","#00FFFF"]] "foo[]bar" queryCommandValue("backcolor") after
|
||||
Pass [["stylewithcss","true"],["backcolor","#00FFFF"]] "<p>[foo</p> <p>bar]</p>": execCommand("stylewithcss", false, "true") return value
|
||||
Pass [["stylewithcss","true"],["backcolor","#00FFFF"]] "<p>[foo</p> <p>bar]</p>": execCommand("backcolor", false, "#00FFFF") return value
|
||||
Pass [["stylewithcss","true"],["backcolor","#00FFFF"]] "<p>[foo</p> <p>bar]</p>" checks for modifications to non-editable content
|
||||
|
|
@ -149,7 +149,7 @@ Pass [["backcolor","#00FFFF"]] "<b>foo[]bar</b>" queryCommandState("backcolor")
|
|||
Pass [["backcolor","#00FFFF"]] "<b>foo[]bar</b>" queryCommandValue("backcolor") before
|
||||
Pass [["backcolor","#00FFFF"]] "<b>foo[]bar</b>" queryCommandIndeterm("backcolor") after
|
||||
Pass [["backcolor","#00FFFF"]] "<b>foo[]bar</b>" queryCommandState("backcolor") after
|
||||
Fail [["backcolor","#00FFFF"]] "<b>foo[]bar</b>" queryCommandValue("backcolor") after
|
||||
Pass [["backcolor","#00FFFF"]] "<b>foo[]bar</b>" queryCommandValue("backcolor") after
|
||||
Pass [["backcolor","#00FFFF"]] "<i>foo[]bar</i>": execCommand("backcolor", false, "#00FFFF") return value
|
||||
Pass [["backcolor","#00FFFF"]] "<i>foo[]bar</i>" checks for modifications to non-editable content
|
||||
Pass [["backcolor","#00FFFF"]] "<i>foo[]bar</i>" compare innerHTML
|
||||
|
|
@ -158,7 +158,7 @@ Pass [["backcolor","#00FFFF"]] "<i>foo[]bar</i>" queryCommandState("backcolor")
|
|||
Pass [["backcolor","#00FFFF"]] "<i>foo[]bar</i>" queryCommandValue("backcolor") before
|
||||
Pass [["backcolor","#00FFFF"]] "<i>foo[]bar</i>" queryCommandIndeterm("backcolor") after
|
||||
Pass [["backcolor","#00FFFF"]] "<i>foo[]bar</i>" queryCommandState("backcolor") after
|
||||
Fail [["backcolor","#00FFFF"]] "<i>foo[]bar</i>" queryCommandValue("backcolor") after
|
||||
Pass [["backcolor","#00FFFF"]] "<i>foo[]bar</i>" queryCommandValue("backcolor") after
|
||||
Pass [["backcolor","#00FFFF"]] "<span>foo</span>{}<span>bar</span>": execCommand("backcolor", false, "#00FFFF") return value
|
||||
Pass [["backcolor","#00FFFF"]] "<span>foo</span>{}<span>bar</span>" checks for modifications to non-editable content
|
||||
Pass [["backcolor","#00FFFF"]] "<span>foo</span>{}<span>bar</span>" compare innerHTML
|
||||
|
|
@ -167,7 +167,7 @@ Pass [["backcolor","#00FFFF"]] "<span>foo</span>{}<span>bar</span>" queryCommand
|
|||
Pass [["backcolor","#00FFFF"]] "<span>foo</span>{}<span>bar</span>" queryCommandValue("backcolor") before
|
||||
Pass [["backcolor","#00FFFF"]] "<span>foo</span>{}<span>bar</span>" queryCommandIndeterm("backcolor") after
|
||||
Pass [["backcolor","#00FFFF"]] "<span>foo</span>{}<span>bar</span>" queryCommandState("backcolor") after
|
||||
Fail [["backcolor","#00FFFF"]] "<span>foo</span>{}<span>bar</span>" queryCommandValue("backcolor") after
|
||||
Pass [["backcolor","#00FFFF"]] "<span>foo</span>{}<span>bar</span>" queryCommandValue("backcolor") after
|
||||
Pass [["backcolor","#00FFFF"]] "<span>foo[</span><span>]bar</span>": execCommand("backcolor", false, "#00FFFF") return value
|
||||
Pass [["backcolor","#00FFFF"]] "<span>foo[</span><span>]bar</span>" checks for modifications to non-editable content
|
||||
Pass [["backcolor","#00FFFF"]] "<span>foo[</span><span>]bar</span>" compare innerHTML
|
||||
|
|
@ -176,7 +176,7 @@ Pass [["backcolor","#00FFFF"]] "<span>foo[</span><span>]bar</span>" queryCommand
|
|||
Pass [["backcolor","#00FFFF"]] "<span>foo[</span><span>]bar</span>" queryCommandValue("backcolor") before
|
||||
Pass [["backcolor","#00FFFF"]] "<span>foo[</span><span>]bar</span>" queryCommandIndeterm("backcolor") after
|
||||
Pass [["backcolor","#00FFFF"]] "<span>foo[</span><span>]bar</span>" queryCommandState("backcolor") after
|
||||
Fail [["backcolor","#00FFFF"]] "<span>foo[</span><span>]bar</span>" queryCommandValue("backcolor") after
|
||||
Pass [["backcolor","#00FFFF"]] "<span>foo[</span><span>]bar</span>" queryCommandValue("backcolor") after
|
||||
Pass [["stylewithcss","true"],["backcolor","#00FFFF"]] "foo[bar]baz": execCommand("stylewithcss", false, "true") return value
|
||||
Pass [["stylewithcss","true"],["backcolor","#00FFFF"]] "foo[bar]baz": execCommand("backcolor", false, "#00FFFF") return value
|
||||
Pass [["stylewithcss","true"],["backcolor","#00FFFF"]] "foo[bar]baz" checks for modifications to non-editable content
|
||||
|
|
|
|||
Loading…
Reference in a new issue