Title: [117721] trunk
Revision
117721
Author
[email protected]
Date
2012-05-20 18:47:16 -0700 (Sun, 20 May 2012)

Log Message

Unsupported commands should have queryCommandValue() = "", not false
https://bugs.webkit.org/show_bug.cgi?id=86964

Patch by Joe Thomas <[email protected]> on 2012-05-20
Reviewed by Ryosuke Niwa.

queryCommandValue for unsupported commands should return empty string.
The specification related to this can be located at http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#methods-to-query-and-execute-commands

Source/WebCore:

Test: editing/execCommand/queryCommandValue-unsupported-commands.html

* dom/Document.idl:

LayoutTests:

* editing/execCommand/queryCommandValue-unsupported-commands-expected.txt: Added.
* editing/execCommand/queryCommandValue-unsupported-commands.html: Added.
* editing/execCommand/use-css-expected.txt:
* editing/execCommand/use-css.html:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (117720 => 117721)


--- trunk/LayoutTests/ChangeLog	2012-05-21 01:25:04 UTC (rev 117720)
+++ trunk/LayoutTests/ChangeLog	2012-05-21 01:47:16 UTC (rev 117721)
@@ -1,3 +1,18 @@
+2012-05-20  Joe Thomas  <[email protected]>
+
+        Unsupported commands should have queryCommandValue() = "", not false
+        https://bugs.webkit.org/show_bug.cgi?id=86964
+
+        Reviewed by Ryosuke Niwa.
+
+        queryCommandValue for unsupported commands should return empty string.
+        The specification related to this can be located at http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#methods-to-query-and-execute-commands
+
+        * editing/execCommand/queryCommandValue-unsupported-commands-expected.txt: Added.
+        * editing/execCommand/queryCommandValue-unsupported-commands.html: Added.
+        * editing/execCommand/use-css-expected.txt:
+        * editing/execCommand/use-css.html:
+
 2012-05-20  Philippe Normand  <[email protected]>
 
         Unreviewed, GTK gardening.

Added: trunk/LayoutTests/editing/execCommand/queryCommandValue-unsupported-commands-expected.txt (0 => 117721)


--- trunk/LayoutTests/editing/execCommand/queryCommandValue-unsupported-commands-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/editing/execCommand/queryCommandValue-unsupported-commands-expected.txt	2012-05-21 01:47:16 UTC (rev 117721)
@@ -0,0 +1,13 @@
+Tests queryCommandValue returns empty string for unsupported commands
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.queryCommandValue('foofoo') is ''
+PASS typeof document.queryCommandValue('foofoo') is 'string'
+PASS document.queryCommandValue('fontSize') is '5'
+PASS typeof document.queryCommandValue('fontSize') is 'string'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/editing/execCommand/queryCommandValue-unsupported-commands.html (0 => 117721)


--- trunk/LayoutTests/editing/execCommand/queryCommandValue-unsupported-commands.html	                        (rev 0)
+++ trunk/LayoutTests/editing/execCommand/queryCommandValue-unsupported-commands.html	2012-05-21 01:47:16 UTC (rev 117721)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<script src=""
+<div id="test" contenteditable></div>
+<script>
+description("Tests queryCommandValue returns empty string for unsupported commands");
+
+var test = document.getElementById('test');
+test.focus();
+document.execCommand('fontSize', false, 5);
+shouldBe("document.queryCommandValue('foofoo')", "''");
+shouldBe("typeof document.queryCommandValue('foofoo')", "'string'");
+shouldBe("document.queryCommandValue('fontSize')", "'5'");
+shouldBe("typeof document.queryCommandValue('fontSize')", "'string'");
+</script>
+<script src=""
+</html>

Modified: trunk/LayoutTests/editing/execCommand/use-css-expected.txt (117720 => 117721)


--- trunk/LayoutTests/editing/execCommand/use-css-expected.txt	2012-05-21 01:25:04 UTC (rev 117720)
+++ trunk/LayoutTests/editing/execCommand/use-css-expected.txt	2012-05-21 01:47:16 UTC (rev 117721)
@@ -9,7 +9,7 @@
 PASS useCSS changed the state successfully
 PASS useCSS changed the state successfully
 PASS queryCommandState('useCSS') returns false
-PASS queryCommandValue('useCSS') returns false
+PASS queryCommandValue('useCSS') returns ''
 PASS one underline command converted test to <span style="text-decoration: underline;">test</span>
 PASS successfullyParsed is true
 

Modified: trunk/LayoutTests/editing/execCommand/use-css.html (117720 => 117721)


--- trunk/LayoutTests/editing/execCommand/use-css.html	2012-05-21 01:25:04 UTC (rev 117720)
+++ trunk/LayoutTests/editing/execCommand/use-css.html	2012-05-21 01:47:16 UTC (rev 117721)
@@ -45,10 +45,10 @@
 else
     testFailed("queryCommandState('useCSS') should return boolean false");
 
-if (document.queryCommandValue('useCSS') === false)
-    testPassed("queryCommandValue('useCSS') returns false");
+if (document.queryCommandValue('useCSS') === "")
+    testPassed("queryCommandValue('useCSS') returns ''");
 else
-    testFailed("queryCommandValue('useCSS') should return boolean false");
+    testFailed("queryCommandValue('useCSS') should return string ''");
 
 testSingleToggle("underline", "test", "<span style=\"text-decoration: underline;\">test</span>");
 

Modified: trunk/Source/WebCore/ChangeLog (117720 => 117721)


--- trunk/Source/WebCore/ChangeLog	2012-05-21 01:25:04 UTC (rev 117720)
+++ trunk/Source/WebCore/ChangeLog	2012-05-21 01:47:16 UTC (rev 117721)
@@ -1,3 +1,17 @@
+2012-05-20  Joe Thomas  <[email protected]>
+
+        Unsupported commands should have queryCommandValue() = "", not false
+        https://bugs.webkit.org/show_bug.cgi?id=86964
+
+        Reviewed by Ryosuke Niwa.
+
+        queryCommandValue for unsupported commands should return empty string.
+        The specification related to this can be located at http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#methods-to-query-and-execute-commands
+
+        Test: editing/execCommand/queryCommandValue-unsupported-commands.html
+
+        * dom/Document.idl:
+
 2012-05-20  Kentaro Hara  <[email protected]>
 
         Unreviewed. Rebaselined run-bindings-tests results.

Modified: trunk/Source/WebCore/dom/Document.idl (117720 => 117721)


--- trunk/Source/WebCore/dom/Document.idl	2012-05-21 01:25:04 UTC (rev 117720)
+++ trunk/Source/WebCore/dom/Document.idl	2012-05-21 01:47:16 UTC (rev 117721)
@@ -141,7 +141,7 @@
         boolean            queryCommandIndeterm(in [Optional=DefaultIsUndefined] DOMString command);
         boolean            queryCommandState(in [Optional=DefaultIsUndefined] DOMString command);
         boolean            queryCommandSupported(in [Optional=DefaultIsUndefined] DOMString command);
-        [TreatReturnedNullStringAs=False] DOMString queryCommandValue(in [Optional=DefaultIsUndefined] DOMString command);
+        DOMString          queryCommandValue(in [Optional=DefaultIsUndefined] DOMString command);
 
         // Moved down from HTMLDocument
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to