[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

rniwa at webkit.org rniwa at webkit.org
Wed Dec 22 15:11:02 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 66e8b3db7c0c4c82a5644908f2e4db5202cd56de
Author: rniwa at webkit.org <rniwa at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 28 21:38:45 2010 +0000

    2010-10-28  Ryosuke Niwa  <rniwa at webkit.org>
    
            Reviewed by Darin Adler.
    
            queryCommandValue should fall back to queryCommandState
            https://bugs.webkit.org/show_bug.cgi?id=48479
    
            Added a fallback to Command::value so that commands with a state function without a value function
            returns the value returned by the state function as a string.
    
            * editing/EditorCommand.cpp:
            (WebCore::Editor::Command::value):
    2010-10-28  Ryosuke Niwa  <rniwa at webkit.org>
    
            Reviewed by Darin Adler.
    
            queryCommandValue should fall back to queryCommandState
            https://bugs.webkit.org/show_bug.cgi?id=48479
    
            Modified the existing tests to ensure queryCommandValue returns 'true' or 'false'
            for commands that supports queryCommandState.
    
            * editing/execCommand/script-tests/query-command-state.js:
            (testQueryCommandState):
            * editing/execCommand/script-tests/query-text-alignment.js:
            (isEquivalentBoolean):
            (queryTextAlignment):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70810 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d1a27b4..82ba778 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2010-10-28  Ryosuke Niwa  <rniwa at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        queryCommandValue should fall back to queryCommandState
+        https://bugs.webkit.org/show_bug.cgi?id=48479
+
+        Modified the existing tests to ensure queryCommandValue returns 'true' or 'false'
+        for commands that supports queryCommandState.
+
+        * editing/execCommand/script-tests/query-command-state.js:
+        (testQueryCommandState):
+        * editing/execCommand/script-tests/query-text-alignment.js:
+        (isEquivalentBoolean):
+        (queryTextAlignment):
+
 2010-10-28  Martin Robinson  <mrobinson at igalia.com>
 
         Unskip some passing canvas tests on GTK+. These were
diff --git a/LayoutTests/editing/execCommand/script-tests/query-command-state.js b/LayoutTests/editing/execCommand/script-tests/query-command-state.js
index 7e68b78..e73c9df 100644
--- a/LayoutTests/editing/execCommand/script-tests/query-command-state.js
+++ b/LayoutTests/editing/execCommand/script-tests/query-command-state.js
@@ -9,11 +9,14 @@ function testQueryCommandState(command, contents, selector, expectedState)
     testContainer.innerHTML = contents;
     var selected = selector(testContainer);
     var actualState = document.queryCommandState(command);
+    var actualValue = document.queryCommandValue(command);
     var action = 'queryCommandState("' + command + '") returns ' + actualState + ' when selecting ' + selected + ' of "' + contents + '"';
-    if (actualState === expectedState)
-        testPassed(action);
-    else
+    if (actualState != expectedState)
         testFailed(action + ', expected ' + expectedState + '');
+    else if (actualValue != actualState.toString())
+        testFailed(action + ' but queryCommandValue returned ' + actualValue);
+    else
+        testPassed(action);
 }
 
 function selectAll(container) {
diff --git a/LayoutTests/editing/execCommand/script-tests/query-text-alignment.js b/LayoutTests/editing/execCommand/script-tests/query-text-alignment.js
index 75ee0c6..fcc1bac 100644
--- a/LayoutTests/editing/execCommand/script-tests/query-text-alignment.js
+++ b/LayoutTests/editing/execCommand/script-tests/query-text-alignment.js
@@ -12,15 +12,22 @@ function queryTextAlignment(selector, content, expected)
     var full = document.queryCommandState('justifyFull');
     var left = document.queryCommandState('justifyLeft');
     var right = document.queryCommandState('justifyRight');
+    var centerValue = document.queryCommandValue('justifyCenter');
+    var fullValue = document.queryCommandValue('justifyFull');
+    var leftValue = document.queryCommandValue('justifyLeft');
+    var rightValue = document.queryCommandValue('justifyRight');
     if ((center && full) || (full && left) || (left && right) || (right && center))
         testFailed('Inconsistent state when selecting ' + selected + ' of "' + content + '".  More than one of justifyCenter, justifyFull, justifyRight, and justifyLeft returned true.')
 
     var actual = center ? 'center' : full ? 'full' : left ? 'left' : right ? 'right' : '';
     var action = "queryCommand('format') returns \"" + actual + '" when selecting ' + selected + ' of "' + content + '"';
-    if (actual == expected)
-        testPassed(action);
-    else
+    if (actual != expected)
         testFailed(action + ' but expected "' + expected + '"');
+    else if (centerValue != center.toString() || fullValue != full.toString()
+        || leftValue != left.toString() || rightValue != right.toString())
+        testFailed(action + ' but values returned by queryCommandState and queryCommandValue did not match');
+    else
+        testPassed(action);
 }
 
 function selectFirstPosition(container) {
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8350e62..d809544 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-10-28  Ryosuke Niwa  <rniwa at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        queryCommandValue should fall back to queryCommandState
+        https://bugs.webkit.org/show_bug.cgi?id=48479
+
+        Added a fallback to Command::value so that commands with a state function without a value function
+        returns the value returned by the state function as a string.
+
+        * editing/EditorCommand.cpp:
+        (WebCore::Editor::Command::value):
+
 2010-10-28  Pavel Feldman  <pfeldman at chromium.org>
 
         Not reviewed. Rolling out r70800.
diff --git a/WebCore/editing/EditorCommand.cpp b/WebCore/editing/EditorCommand.cpp
index 23fba39..85becd5 100644
--- a/WebCore/editing/EditorCommand.cpp
+++ b/WebCore/editing/EditorCommand.cpp
@@ -1638,6 +1638,8 @@ String Editor::Command::value(Event* triggeringEvent) const
 {
     if (!isSupported() || !m_frame)
         return String();
+    if (m_command->value == valueNull && m_command->state != stateNone)
+        return m_command->state(m_frame.get(), triggeringEvent) == TrueTriState ? "true" : "false";
     return m_command->value(m_frame.get(), triggeringEvent);
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list