[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 14:02:11 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit a23cf7641bd4a58f998e678d2a91896d7a16788a
Author: rniwa at webkit.org <rniwa at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 1 18:25:59 2010 +0000

    2010-09-30  Ryosuke Niwa  <rniwa at webkit.org>
    
            Reviewed by Darin Adler.
    
            Implement queryCommandState('justifyFull')
            https://bugs.webkit.org/show_bug.cgi?id=46954
    
            Implemented queryCommandState('justifyFull').
            New tests are added to editing/style/inline-style-container.html
    
            * editing/ApplyStyleCommand.cpp:
            (WebCore::getTextAlignment): Added support for CSSValueJustify.
            * editing/EditorCommand.cpp:
            (WebCore::stateJustifyFull): Added.
            (WebCore::createCommandMap): Added stateJustifyFull.
    2010-09-30  Ryosuke Niwa  <rniwa at webkit.org>
    
            Reviewed by Darin Adler.
    
            Implement queryCommandState('justifyFull')
            https://bugs.webkit.org/show_bug.cgi?id=46954
    
            Added tests for queryCommandState('justifyFull') to editing/execCommand/query-text-alignment.html
    
            * editing/execCommand/query-text-alignment-expected.txt:
            * editing/execCommand/script-tests/query-text-alignment.js:
            (queryTextAlignment):
            (runRangeTests):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68904 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 72f725a..d9c8c30 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-30  Ryosuke Niwa  <rniwa at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Implement queryCommandState('justifyFull')
+        https://bugs.webkit.org/show_bug.cgi?id=46954
+
+        Added tests for queryCommandState('justifyFull') to editing/execCommand/query-text-alignment.html
+
+        * editing/execCommand/query-text-alignment-expected.txt:
+        * editing/execCommand/script-tests/query-text-alignment.js:
+        (queryTextAlignment):
+        (runRangeTests):
+
 2010-10-01  David Hyatt  <hyatt at apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/LayoutTests/editing/execCommand/query-text-alignment-expected.txt b/LayoutTests/editing/execCommand/query-text-alignment-expected.txt
index ca47482..5cd5fab 100644
--- a/LayoutTests/editing/execCommand/query-text-alignment-expected.txt
+++ b/LayoutTests/editing/execCommand/query-text-alignment-expected.txt
@@ -1,4 +1,4 @@
-Tests queryCommandState('justifyCenter'), queryCommandState('justifyLeft'), queryCommandState('justifyRight')
+Tests queryCommandState('justifyCenter'), queryCommandState('justifyFull'), queryCommandState('justifyLeft'), and queryCommandState('justifyRight')
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
@@ -8,11 +8,14 @@ PASS queryCommand('format') returns "" when selecting no selection on of "hello"
 PASS queryCommand('format') returns "" when selecting first position of "hello"
 PASS queryCommand('format') returns "" when selecting first position of "<p>hello</p>"
 PASS queryCommand('format') returns "center" when selecting first position of "<p align="center">hello</p>"
+PASS queryCommand('format') returns "full" when selecting first position of "<p align="justify">hello</p>"
 PASS queryCommand('format') returns "left" when selecting first position of "<p align="left">hello</p>"
 PASS queryCommand('format') returns "right" when selecting first position of "<p align="right">hello</p>"
 PASS queryCommand('format') returns "center" when selecting first position of "<p style="text-align: center;">hello</p>"
+PASS queryCommand('format') returns "full" when selecting first position of "<p style="text-align: justify;">hello</p>"
 PASS queryCommand('format') returns "left" when selecting first position of "<p style="text-align: left;">hello</p>"
 PASS queryCommand('format') returns "right" when selecting first position of "<p style="text-align: right;">hello</p>"
+PASS queryCommand('format') returns "full" when selecting first position of "<p align="center" style="text-align: justify;">hello</p>"
 PASS queryCommand('format') returns "left" when selecting first position of "<p align="right" style="text-align: left;">hello</p>"
 PASS queryCommand('format') returns "right" when selecting first position of "<p align="center" style="text-align: right;">hello</p>"
 PASS queryCommand('format') returns "center" when selecting first position of "<p align="left" style="text-align: center;">hello</p>"
@@ -21,11 +24,13 @@ PASS queryCommand('format') returns "right" when selecting first position of "<p
 PASS queryCommand('format') returns "center" when selecting first position of "<p align="left" style="text-align: center;">hello</p>"
 PASS queryCommand('format') returns "" when selecting first position of "<h1>hello</h1>"
 PASS queryCommand('format') returns "center" when selecting first position of "<h1 align="center">hello</h1>"
+PASS queryCommand('format') returns "full" when selecting first position of "<h1 align="justify">hello</h1>"
 PASS queryCommand('format') returns "left" when selecting first position of "<h2 align="left">hello</h2>"
 PASS queryCommand('format') returns "right" when selecting first position of "<h3 align="right">hello</h3>"
 PASS queryCommand('format') returns "center" when selecting first position of "<h4 align="center">hello</h4>"
 PASS queryCommand('format') returns "left" when selecting first position of "<h5 align="left">hello</h5>"
 PASS queryCommand('format') returns "right" when selecting first position of "<h6 align="right">hello</h6>"
+PASS queryCommand('format') returns "full" when selecting first position of "<div align="justify">hello</div>"
 PASS queryCommand('format') returns "center" when selecting first position of "<div align="center">hello</div>"
 PASS queryCommand('format') returns "left" when selecting first position of "<div align="left">hello</div>"
 PASS queryCommand('format') returns "right" when selecting first position of "<div align="right">hello</div>"
@@ -36,11 +41,13 @@ PASS queryCommand('format') returns "" when selecting middle of "<p align="left"
 PASS queryCommand('format') returns "" when selecting middle of "<p>hello</p><p align="left">world</p>"
 PASS queryCommand('format') returns "" when selecting middle of "<p align="left">hello</p><p align="right">world</p>"
 PASS queryCommand('format') returns "center" when selecting middle of "<p align="center">hello</p><p align="center">world</p>"
+PASS queryCommand('format') returns "full" when selecting middle of "<p align="justify">hello</p><p align="justify">world</p>"
 PASS queryCommand('format') returns "left" when selecting middle of "<p align="left">hello</p><p align="left">world</p>"
 PASS queryCommand('format') returns "right" when selecting middle of "<p align="right">hello</p><p align="right">world</p>"
 PASS queryCommand('format') returns "" when selecting middle of "<div align="right">hello<p align="left">world</p></div>"
 PASS queryCommand('format') returns "" when selecting middle of "<div align="left"><p align="center">world</p>hello</div>"
-FAIL queryCommand('format') returns "" when selecting middle of "<p align="left">hello</p><p>w</p><p align="left">orld</p>" but expected "[object Object]"
+PASS queryCommand('format') returns "" when selecting middle of "<p align="left">hello</p><p>w</p><p align="left">orld</p>"
+PASS queryCommand('format') returns "" when selecting middle of "<p align="justify">hello</p><p>w</p><p align="center">orld</p>"
 
 Tests for mac
 PASS queryCommand('format') returns "" when selecting middle of "<p>hello</p><p>world</p>"
@@ -48,11 +55,13 @@ PASS queryCommand('format') returns "left" when selecting middle of "<p align="l
 PASS queryCommand('format') returns "" when selecting middle of "<p>hello</p><p align="left">world</p>"
 PASS queryCommand('format') returns "left" when selecting middle of "<p align="left">hello</p><p align="right">world</p>"
 PASS queryCommand('format') returns "center" when selecting middle of "<p align="center">hello</p><p align="center">world</p>"
+PASS queryCommand('format') returns "full" when selecting middle of "<p align="justify">hello</p><p align="justify">world</p>"
 PASS queryCommand('format') returns "left" when selecting middle of "<p align="left">hello</p><p align="left">world</p>"
 PASS queryCommand('format') returns "right" when selecting middle of "<p align="right">hello</p><p align="right">world</p>"
 PASS queryCommand('format') returns "right" when selecting middle of "<div align="right">hello<p align="left">world</p></div>"
 PASS queryCommand('format') returns "center" when selecting middle of "<div align="left"><p align="center">world</p>hello</div>"
-FAIL queryCommand('format') returns "left" when selecting middle of "<p align="left">hello</p><p>w</p><p align="left">orld</p>" but expected "[object Object]"
+PASS queryCommand('format') returns "left" when selecting middle of "<p align="left">hello</p><p>w</p><p align="left">orld</p>"
+PASS queryCommand('format') returns "full" when selecting middle of "<p align="justify">hello</p><p>w</p><p align="center">orld</p>"
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/editing/execCommand/script-tests/query-text-alignment.js b/LayoutTests/editing/execCommand/script-tests/query-text-alignment.js
index 2e7d936..75ee0c6 100644
--- a/LayoutTests/editing/execCommand/script-tests/query-text-alignment.js
+++ b/LayoutTests/editing/execCommand/script-tests/query-text-alignment.js
@@ -1,4 +1,4 @@
-description("Tests queryCommandState('justifyCenter'), queryCommandState('justifyLeft'), queryCommandState('justifyRight')")
+description("Tests queryCommandState('justifyCenter'), queryCommandState('justifyFull'), queryCommandState('justifyLeft'), and queryCommandState('justifyRight')")
 
 var testContainer = document.createElement("div");
 testContainer.contentEditable = true;
@@ -9,12 +9,13 @@ function queryTextAlignment(selector, content, expected)
     testContainer.innerHTML = content;
     var selected = selector(testContainer);
     var center = document.queryCommandState('justifyCenter');
+    var full = document.queryCommandState('justifyFull');
     var left = document.queryCommandState('justifyLeft');
     var right = document.queryCommandState('justifyRight');
-    if ((center && left) || (left && right) || (right && center))
-        testFailed('Inconsistent state when selecting ' + selected + ' of "' + content + '".  More than one of justifyCenter, justifyRight, and justifyLeft returned true.')
+    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' : left ? 'left' : right ? 'right' : '';
+    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);
@@ -45,11 +46,14 @@ queryTextAlignment(function () {return 'no selection on'}, 'hello', '');
 queryTextAlignment(selectFirstPosition, 'hello', '');
 queryTextAlignment(selectFirstPosition, '<p>hello</p>', '');
 queryTextAlignment(selectFirstPosition, '<p align="center">hello</p>', 'center');
+queryTextAlignment(selectFirstPosition, '<p align="justify">hello</p>', 'full');
 queryTextAlignment(selectFirstPosition, '<p align="left">hello</p>', 'left');
 queryTextAlignment(selectFirstPosition, '<p align="right">hello</p>', 'right');
 queryTextAlignment(selectFirstPosition, '<p style="text-align: center;">hello</p>', 'center');
+queryTextAlignment(selectFirstPosition, '<p style="text-align: justify;">hello</p>', 'full');
 queryTextAlignment(selectFirstPosition, '<p style="text-align: left;">hello</p>', 'left');
 queryTextAlignment(selectFirstPosition, '<p style="text-align: right;">hello</p>', 'right');
+queryTextAlignment(selectFirstPosition, '<p align="center" style="text-align: justify;">hello</p>', 'full');
 queryTextAlignment(selectFirstPosition, '<p align="right" style="text-align: left;">hello</p>', 'left');
 queryTextAlignment(selectFirstPosition, '<p align="center" style="text-align: right;">hello</p>', 'right');
 queryTextAlignment(selectFirstPosition, '<p align="left" style="text-align: center;">hello</p>', 'center');
@@ -58,11 +62,13 @@ queryTextAlignment(selectFirstPosition, '<p align="center" style="text-align: ri
 queryTextAlignment(selectFirstPosition, '<p align="left" style="text-align: center;">hello</p>', 'center');
 queryTextAlignment(selectFirstPosition, '<h1>hello</h1>', '');
 queryTextAlignment(selectFirstPosition, '<h1 align="center">hello</h1>', 'center');
+queryTextAlignment(selectFirstPosition, '<h1 align="justify">hello</h1>', 'full');
 queryTextAlignment(selectFirstPosition, '<h2 align="left">hello</h2>', 'left');
 queryTextAlignment(selectFirstPosition, '<h3 align="right">hello</h3>', 'right');
 queryTextAlignment(selectFirstPosition, '<h4 align="center">hello</h4>', 'center');
 queryTextAlignment(selectFirstPosition, '<h5 align="left">hello</h5>', 'left');
 queryTextAlignment(selectFirstPosition, '<h6 align="right">hello</h6>', 'right');
+queryTextAlignment(selectFirstPosition, '<div align="justify">hello</div>', 'full');
 queryTextAlignment(selectFirstPosition, '<div align="center">hello</div>', 'center');
 queryTextAlignment(selectFirstPosition, '<div align="left">hello</div>', 'left');
 queryTextAlignment(selectFirstPosition, '<div align="right">hello</div>', 'right');
@@ -78,11 +84,13 @@ function runRangeTests(editingBehavior)
     queryTextAlignment(selectMiddleOfHelloWorld, '<p>hello</p><p align="left">world</p>', '');
     queryTextAlignment(selectMiddleOfHelloWorld, '<p align="left">hello</p><p align="right">world</p>', {'mac': 'left', 'win': ''}[editingBehavior]);
     queryTextAlignment(selectMiddleOfHelloWorld, '<p align="center">hello</p><p align="center">world</p>', 'center');
+    queryTextAlignment(selectMiddleOfHelloWorld, '<p align="justify">hello</p><p align="justify">world</p>', 'full');
     queryTextAlignment(selectMiddleOfHelloWorld, '<p align="left">hello</p><p align="left">world</p>', 'left');
     queryTextAlignment(selectMiddleOfHelloWorld, '<p align="right">hello</p><p align="right">world</p>', 'right');
     queryTextAlignment(selectMiddleOfHelloWorld, '<div align="right">hello<p align="left">world</p></div>', {'mac': 'right', 'win': ''}[editingBehavior]);
     queryTextAlignment(selectMiddleOfHelloWorld, '<div align="left"><p align="center">world</p>hello</div>', {'mac': 'center', 'win': ''}[editingBehavior]);
-    queryTextAlignment(selectMiddleOfHelloWorld, '<p align="left">hello</p><p>w</p><p align="left">orld</p>', {'mac': 'left', 'win': ''});
+    queryTextAlignment(selectMiddleOfHelloWorld, '<p align="left">hello</p><p>w</p><p align="left">orld</p>', {'mac': 'left', 'win': ''}[editingBehavior]);
+    queryTextAlignment(selectMiddleOfHelloWorld, '<p align="justify">hello</p><p>w</p><p align="center">orld</p>', {'mac': 'full', 'win': ''}[editingBehavior]);
 }
 
 debug('');
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 445cbad..426dda2 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-09-30  Ryosuke Niwa  <rniwa at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Implement queryCommandState('justifyFull')
+        https://bugs.webkit.org/show_bug.cgi?id=46954
+
+        Implemented queryCommandState('justifyFull').
+        New tests are added to editing/style/inline-style-container.html
+
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::getTextAlignment): Added support for CSSValueJustify.
+        * editing/EditorCommand.cpp:
+        (WebCore::stateJustifyFull): Added.
+        (WebCore::createCommandMap): Added stateJustifyFull.
+
 2010-10-01  Jia Pu  <jpu at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/editing/ApplyStyleCommand.cpp b/WebCore/editing/ApplyStyleCommand.cpp
index 18ae02d..4c31f24 100644
--- a/WebCore/editing/ApplyStyleCommand.cpp
+++ b/WebCore/editing/ApplyStyleCommand.cpp
@@ -395,6 +395,8 @@ static int getTextAlignment(CSSStyleDeclaration* style)
     case CSSValueCenter:
     case CSSValueWebkitCenter:
         return CSSValueCenter;
+    case CSSValueJustify:
+        return CSSValueJustify;
     case CSSValueLeft:
     case CSSValueWebkitLeft:
         return CSSValueLeft;
diff --git a/WebCore/editing/EditorCommand.cpp b/WebCore/editing/EditorCommand.cpp
index 261c015..7443f42 100644
--- a/WebCore/editing/EditorCommand.cpp
+++ b/WebCore/editing/EditorCommand.cpp
@@ -1304,6 +1304,11 @@ static TriState stateJustifyCenter(Frame* frame, Event*)
     return stateStyle(frame, CSSPropertyTextAlign, "center");
 }
 
+static TriState stateJustifyFull(Frame* frame, Event*)
+{
+    return stateStyle(frame, CSSPropertyTextAlign, "justify");
+}
+
 static TriState stateJustifyLeft(Frame* frame, Event*)
 {
     return stateStyle(frame, CSSPropertyTextAlign, "left");
@@ -1409,7 +1414,7 @@ static const CommandMap& createCommandMap()
         { "InsertUnorderedList", { executeInsertUnorderedList, supported, enabledInRichlyEditableText, stateUnorderedList, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "Italic", { executeToggleItalic, supported, enabledInRichlyEditableText, stateItalic, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "JustifyCenter", { executeJustifyCenter, supported, enabledInRichlyEditableText, stateJustifyCenter, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
-        { "JustifyFull", { executeJustifyFull, supported, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+        { "JustifyFull", { executeJustifyFull, supported, enabledInRichlyEditableText, stateJustifyFull, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "JustifyLeft", { executeJustifyLeft, supported, enabledInRichlyEditableText, stateJustifyLeft, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "JustifyNone", { executeJustifyLeft, supported, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "JustifyRight", { executeJustifyRight, supported, enabledInRichlyEditableText, stateJustifyRight, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list