Part 1 of: Extend -webkit-user-select with a new value "all"
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Aug 2012 21:48:04 +0000 (21:48 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Aug 2012 21:48:04 +0000 (21:48 +0000)
<rdar://problem/10161404>
https://bugs.webkit.org/show_bug.cgi?id=93562

Patch by Alice Cheng <alice_cheng@apple.com> on 2012-08-10
Reviewed by Dan Bernstein.

Source/WebCore:

Parse the new "all" value for -webkit-user-select

Test: editing/selection/user-select-all-parsing.html

* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue): Add new value all
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add new value all
(WebCore::CSSPrimitiveValue::operator EUserSelect): Add one more bit to store the new property value
* rendering/style/RenderStyleConstants.h: Add new value all
* rendering/style/StyleRareInheritedData.h: Add new value all
(StyleRareInheritedData):

Source/WebKit/gtk:

Modify the enum to resolve ambiguous reference

* webkit/webkitwebview.cpp:
(webkit_web_view_class_init): Modify the ambiguous enum
(webkit_web_view_select_all): Modify the ambiguous enum

LayoutTests:

Add a test to verify that the new "all" value is parsed correctly.

* editing/selection/user-select-all-parsing-expected.txt: Added.
* editing/selection/user-select-all-parsing.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125330 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/editing/selection/user-select-all-parsing-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/user-select-all-parsing.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/rendering/style/StyleRareInheritedData.h
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/webkit/webkitwebview.cpp

index 854694d..b0d0672 100644 (file)
@@ -1,3 +1,16 @@
+2012-08-10  Alice Cheng  <alice_cheng@apple.com>
+
+        Part 1 of: Extend -webkit-user-select with a new value "all"
+        <rdar://problem/10161404>
+        https://bugs.webkit.org/show_bug.cgi?id=93562
+
+        Reviewed by Dan Bernstein.
+
+        Add a test to verify that the new "all" value is parsed correctly.
+
+        * editing/selection/user-select-all-parsing-expected.txt: Added.
+        * editing/selection/user-select-all-parsing.html: Added.
+
 2012-08-10  Florin Malita  <fmalita@chromium.org>
 
         [Chromium] Updated results for fast/borders/border-shadow-large-radius.html.
diff --git a/LayoutTests/editing/selection/user-select-all-parsing-expected.txt b/LayoutTests/editing/selection/user-select-all-parsing-expected.txt
new file mode 100644 (file)
index 0000000..d9798f8
--- /dev/null
@@ -0,0 +1,11 @@
+this is text of -webkit-user-select all
+Test for Parsing new value all for -webkit-user-select
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS userSelect.getPropertyValue("-webkit-user-select") is "all"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/editing/selection/user-select-all-parsing.html b/LayoutTests/editing/selection/user-select-all-parsing.html
new file mode 100644 (file)
index 0000000..66346cf
--- /dev/null
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+    <head>
+        <style>
+        .userSelectAll {-webkit-user-select: all;}
+        </style>
+        <script src="../../fast/js/resources/js-test-pre.js"></script>
+    </head>
+    <body contentEditable="true">
+        <div class="userSelectAll" id ="allArea">
+            this is text of -webkit-user-select all
+        </div>
+        <div id="console"></div>
+            
+        <script>
+            description("Test for Parsing new value all for -webkit-user-select");
+            var userSelect = document.defaultView.getComputedStyle(document.getElementById("allArea"),null);
+            shouldBeEqualToString('userSelect.getPropertyValue("-webkit-user-select")', 'all');
+        </script>
+        <script src="../../fast/js/resources/js-test-post.js"></script>
+    </body>
+</html>
index 66b267e..90c7dcc 100644 (file)
@@ -1,3 +1,24 @@
+2012-08-10  Alice Cheng  <alice_cheng@apple.com>
+
+        Part 1 of: Extend -webkit-user-select with a new value "all"
+        <rdar://problem/10161404>
+        https://bugs.webkit.org/show_bug.cgi?id=93562
+
+        Reviewed by Dan Bernstein.
+
+        Parse the new "all" value for -webkit-user-select
+
+        Test: editing/selection/user-select-all-parsing.html
+
+        * css/CSSParser.cpp:
+        (WebCore::isValidKeywordPropertyAndValue): Add new value all
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add new value all
+        (WebCore::CSSPrimitiveValue::operator EUserSelect): Add one more bit to store the new property value
+        * rendering/style/RenderStyleConstants.h: Add new value all
+        * rendering/style/StyleRareInheritedData.h: Add new value all
+        (StyleRareInheritedData):
+
 2012-08-10  Iain Merrick  <husky@google.com>
 
         [chromium] Upstream Android changes to WebFrameImpl::selectRange
index 087f570..aa08c18 100644 (file)
@@ -836,8 +836,8 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int
         if (valueID == CSSValueReadOnly || valueID == CSSValueReadWrite || valueID == CSSValueReadWritePlaintextOnly)
             return true;
         break;
-    case CSSPropertyWebkitUserSelect: // auto | none | text
-        if (valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueText)
+    case CSSPropertyWebkitUserSelect: // auto | none | text | all
+        if (valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueText || valueID == CSSValueAll)
             return true;
         break;
 #if ENABLE(CSS_EXCLUSIONS)
index 33ac1fc..6a33760 100644 (file)
@@ -2366,6 +2366,9 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserSelect e)
         case SELECT_TEXT:
             m_value.ident = CSSValueText;
             break;
+        case SELECT_ALL:
+            m_value.ident = CSSValueAll;
+            break;
     }
 }
 
@@ -2378,6 +2381,8 @@ template<> inline CSSPrimitiveValue::operator EUserSelect() const
             return SELECT_NONE;
         case CSSValueText:
             return SELECT_TEXT;
+        case CSSValueAll:
+            return SELECT_ALL;
         default:
             ASSERT_NOT_REACHED();
             return SELECT_TEXT;
index 149cd44..f71934a 100644 (file)
@@ -198,7 +198,7 @@ enum EUserDrag {
 // CSS3 User Select Values
 
 enum EUserSelect {
-    SELECT_NONE, SELECT_TEXT
+    SELECT_NONE, SELECT_TEXT, SELECT_ALL
 };
 
 // Word Break Values. Matches WinIE, rather than CSS3
index bb433ed..39e096e 100644 (file)
@@ -89,7 +89,7 @@ public:
     unsigned khtmlLineBreak : 1; // EKHTMLLineBreak
     unsigned textSizeAdjust : 1; // An Apple extension.
     unsigned resize : 2; // EResize
-    unsigned userSelect : 1;  // EUserSelect
+    unsigned userSelect : 2; // EUserSelect
     unsigned colorSpace : 1; // ColorSpace
     unsigned speak : 3; // ESpeak
     unsigned hyphens : 2; // Hyphens
index 0172bbb..268a9df 100644 (file)
@@ -1,3 +1,17 @@
+2012-08-10  Alice Cheng  <alice_cheng@apple.com>
+
+        Part 1 of: Extend -webkit-user-select with a new value "all"
+        <rdar://problem/10161404>
+        https://bugs.webkit.org/show_bug.cgi?id=93562
+
+        Reviewed by Dan Bernstein.
+
+        Modify the enum to resolve ambiguous reference
+
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_class_init): Modify the ambiguous enum
+        (webkit_web_view_select_all): Modify the ambiguous enum
+
 2012-08-10  Mario Sanchez Prada  <msanchez@igalia.com>
 
         [GTK] Broken implementation of AtkText and AtkEditableText for password fields
index 8870721..0b8d6a8 100644 (file)
@@ -2290,7 +2290,7 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
      *
      * The default bindings for this signal is Ctrl-a.
      */
-    webkit_web_view_signals[SELECT_ALL] = g_signal_new("select-all",
+    webkit_web_view_signals[::SELECT_ALL] = g_signal_new("select-all",
             G_TYPE_FROM_CLASS(webViewClass),
             (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
             G_STRUCT_OFFSET(WebKitWebViewClass, select_all),
@@ -4419,7 +4419,7 @@ void webkit_web_view_select_all(WebKitWebView* webView)
 {
     g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
 
-    g_signal_emit(webView, webkit_web_view_signals[SELECT_ALL], 0);
+    g_signal_emit(webView, webkit_web_view_signals[::SELECT_ALL], 0);
 }
 
 /**