Title: [107881] trunk
Revision
107881
Author
[email protected]
Date
2012-02-15 21:09:09 -0800 (Wed, 15 Feb 2012)

Log Message

Source/WebCore: Add -webkit-overflow-scrolling CSS property
https://bugs.webkit.org/show_bug.cgi?id=78664

Patch by Sami Kyostila <[email protected]> on 2012-02-15
Reviewed by Eric Seidel.

Add a CSS property indicating that an element with overflow scrolling
should follow the platform's behavior for touch scrollable user
interface objects. For instance, this property could enable momentum
scrolling for the element if that is the platform convention.

The property has two possible values: auto (default) and touch. The
former does not alter overflow scrolling behavior, while the latter
activates touch scrolling.

As a side effect, enabling touch scrolling also causes an element to
gain a stacking context. This is to allow the implementation to promote
the scrolling contents into a render layer, which can be translated more
efficiently.

This property was introduced with iOS 5 WebKit. Another implementation
is in Chrome for Android.

Test: platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty):
* css/CSSPropertyNames.in:
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::adjustRenderStyle):
(WebCore::CSSStyleSelector::applyProperty):
* css/CSSValueKeywords.in:
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):
* rendering/style/StyleRareInheritedData.h:
(StyleRareInheritedData):

Source/WebKit/chromium: Enable -webkit-overflow-scrolling CSS property
https://bugs.webkit.org/show_bug.cgi?id=78664

Patch by Sami Kyostila <[email protected]> on 2012-02-15
Reviewed by Eric Seidel.

* features.gypi:

LayoutTests: Add stacking context test for -webkit-overflow-scrolling CSS property
https://bugs.webkit.org/show_bug.cgi?id=78664

Patch by Sami Kyostila <[email protected]> on 2012-02-15
Reviewed by Eric Seidel.

Make sure a stacking context is created for elements with touch overflow scrolling.

* platform/chromium-win/fast/css/getComputedStyle/computed-style-expected.txt: Added new property.
* platform/chromium-win/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: Ditto.
* platform/chromium-win/svg/css/getComputedStyle-basic-expected.txt: Ditto.
* platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context-expected.png: Added.
* platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context-expected.txt: Added.
* platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (107880 => 107881)


--- trunk/LayoutTests/ChangeLog	2012-02-16 04:49:03 UTC (rev 107880)
+++ trunk/LayoutTests/ChangeLog	2012-02-16 05:09:09 UTC (rev 107881)
@@ -1,3 +1,19 @@
+2012-02-15  Sami Kyostila  <[email protected]>
+
+        Add stacking context test for -webkit-overflow-scrolling CSS property
+        https://bugs.webkit.org/show_bug.cgi?id=78664
+
+        Reviewed by Eric Seidel.
+
+        Make sure a stacking context is created for elements with touch overflow scrolling.
+
+        * platform/chromium-win/fast/css/getComputedStyle/computed-style-expected.txt: Added new property.
+        * platform/chromium-win/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: Ditto.
+        * platform/chromium-win/svg/css/getComputedStyle-basic-expected.txt: Ditto.
+        * platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context-expected.png: Added.
+        * platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context-expected.txt: Added.
+        * platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context.html: Added.
+
 2012-02-15  Alexey Proskuryakov  <[email protected]>
 
         Crash after trying to use FileReader in a document with null origin string

Added: trunk/LayoutTests/platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context-expected.png (0 => 107881)


--- trunk/LayoutTests/platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context-expected.png	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context-expected.png	2012-02-16 05:09:09 UTC (rev 107881)
@@ -0,0 +1,7 @@
+\x89PNG
+
+
+IHDR X')tEXtchecksumf74a771587f0ac8576d2d733fa12421b\xAC\xADu;
+\xC2IDATx\x9C\xED\xDC1
+\x84@E\xC1\x9De\xEF-\x9E\xBC=\x81\xB0\xC1CE\xAA\xD2I~\xF8\xE8`\xD6\xCC|\xE8|\xEF\xF06 &\xB0b &\xB0b &\xB0b\xBF\xB3\x87\xB5\xAF+w\xFCi6\xBFvO\xE7\x82X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81[3s\xF7\x80Wq\xC1\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88\x81
+\xAB\xE7\xCCW_IEND\xAEB`\x82
\ No newline at end of file

Added: trunk/LayoutTests/platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context-expected.txt (0 => 107881)


--- trunk/LayoutTests/platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context-expected.txt	2012-02-16 05:09:09 UTC (rev 107881)
@@ -0,0 +1,11 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x8
+  RenderBlock {HTML} at (0,0) size 800x8
+    RenderBody {BODY} at (8,8) size 784x0
+layer at (8,8) size 50x50
+  RenderBlock (positioned) {DIV} at (8,8) size 50x50
+layer at (8,8) size 50x50
+  RenderBlock (positioned) zI: 1 {DIV} at (0,0) size 50x50 [bgcolor=#FF0000]
+layer at (8,8) size 50x50
+  RenderBlock (positioned) {DIV} at (8,8) size 50x50 [bgcolor=#008000]

Added: trunk/LayoutTests/platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context.html (0 => 107881)


--- trunk/LayoutTests/platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context.html	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context.html	2012-02-16 05:09:09 UTC (rev 107881)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <style type="text/css">
+    .box {
+      position: absolute;
+      width: 50px;
+      height: 50px;
+    }
+
+    .scrollable {
+      -webkit-overflow-scrolling: touch;
+    }
+
+    .indicator {
+      background: red;
+      z-index: 1;
+    }
+
+    .test {
+      background: green;
+    }
+  </style>
+</head>
+<body>
+
+  <!-- Check that touch overflow scrollable elements get a stacking context. -->
+  <div class="scrollable box">
+    <div class="indicator box"></div>
+  </div>
+  <div class="test box"></div>
+
+</body>
+</html>

Modified: trunk/LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-expected.txt (107880 => 107881)


--- trunk/LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-expected.txt	2012-02-16 04:49:03 UTC (rev 107880)
+++ trunk/LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-expected.txt	2012-02-16 05:09:09 UTC (rev 107881)
@@ -185,6 +185,7 @@
 -webkit-mask-repeat: repeat;
 -webkit-mask-size: auto;
 -webkit-nbsp-mode: normal;
+-webkit-overflow-scrolling: auto;
 -webkit-perspective: none;
 -webkit-perspective-origin: 392px 288px;
 -webkit-print-color-adjust: economy;

Modified: trunk/LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt (107880 => 107881)


--- trunk/LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt	2012-02-16 04:49:03 UTC (rev 107880)
+++ trunk/LayoutTests/platform/chromium-win/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt	2012-02-16 05:09:09 UTC (rev 107881)
@@ -184,6 +184,7 @@
     -webkit-mask-repeat: repeat
     -webkit-mask-size: auto
     -webkit-nbsp-mode: normal
+    -webkit-overflow-scrolling: auto
     -webkit-perspective: none
     -webkit-perspective-origin: 50% 50%
     -webkit-print-color-adjust: economy

Modified: trunk/LayoutTests/platform/chromium-win/svg/css/getComputedStyle-basic-expected.txt (107880 => 107881)


--- trunk/LayoutTests/platform/chromium-win/svg/css/getComputedStyle-basic-expected.txt	2012-02-16 04:49:03 UTC (rev 107880)
+++ trunk/LayoutTests/platform/chromium-win/svg/css/getComputedStyle-basic-expected.txt	2012-02-16 05:09:09 UTC (rev 107881)
@@ -368,6 +368,8 @@
 rect: style.getPropertyCSSValue(-webkit-mask-size) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-nbsp-mode) : normal
 rect: style.getPropertyCSSValue(-webkit-nbsp-mode) : [object CSSPrimitiveValue]
+rect: style.getPropertyValue(-webkit-overflow-scrolling) : auto
+rect: style.getPropertyCSSValue(-webkit-overflow-scrolling) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-perspective) : none
 rect: style.getPropertyCSSValue(-webkit-perspective) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-perspective-origin) : 0px 0px
@@ -882,6 +884,8 @@
 g: style.getPropertyCSSValue(-webkit-mask-size) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-nbsp-mode) : normal
 g: style.getPropertyCSSValue(-webkit-nbsp-mode) : [object CSSPrimitiveValue]
+g: style.getPropertyValue(-webkit-overflow-scrolling) : auto
+g: style.getPropertyCSSValue(-webkit-overflow-scrolling) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-perspective) : none
 g: style.getPropertyCSSValue(-webkit-perspective) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-perspective-origin) : 0px 0px

Modified: trunk/Source/WebCore/ChangeLog (107880 => 107881)


--- trunk/Source/WebCore/ChangeLog	2012-02-16 04:49:03 UTC (rev 107880)
+++ trunk/Source/WebCore/ChangeLog	2012-02-16 05:09:09 UTC (rev 107881)
@@ -1,3 +1,48 @@
+2012-02-15  Sami Kyostila  <[email protected]>
+
+        Add -webkit-overflow-scrolling CSS property
+        https://bugs.webkit.org/show_bug.cgi?id=78664
+
+        Reviewed by Eric Seidel.
+
+        Add a CSS property indicating that an element with overflow scrolling
+        should follow the platform's behavior for touch scrollable user
+        interface objects. For instance, this property could enable momentum
+        scrolling for the element if that is the platform convention.
+
+        The property has two possible values: auto (default) and touch. The
+        former does not alter overflow scrolling behavior, while the latter
+        activates touch scrolling.
+
+        As a side effect, enabling touch scrolling also causes an element to
+        gain a stacking context. This is to allow the implementation to promote
+        the scrolling contents into a render layer, which can be translated more
+        efficiently.
+
+        This property was introduced with iOS 5 WebKit. Another implementation
+        is in Chrome for Android.
+
+        Test: platform/chromium/compositing/overflow/overflow-scrolling-touch-stacking-context.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore):
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+        * css/CSSProperty.cpp:
+        (WebCore::CSSProperty::isInheritedProperty):
+        * css/CSSPropertyNames.in:
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::adjustRenderStyle):
+        (WebCore::CSSStyleSelector::applyProperty):
+        * css/CSSValueKeywords.in:
+        * rendering/style/RenderStyle.h:
+        * rendering/style/StyleRareInheritedData.cpp:
+        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
+        (WebCore::StyleRareInheritedData::operator==):
+        * rendering/style/StyleRareInheritedData.h:
+        (StyleRareInheritedData):
+
 2012-02-15  Levi Weintraub  <[email protected]>
 
         Add zeroLayoutUnit constant.

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (107880 => 107881)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2012-02-16 04:49:03 UTC (rev 107880)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2012-02-16 05:09:09 UTC (rev 107881)
@@ -266,6 +266,9 @@
     CSSPropertyWebkitMaskRepeat,
     CSSPropertyWebkitMaskSize,
     CSSPropertyWebkitNbspMode,
+#if ENABLE(OVERFLOW_SCROLLING)
+    CSSPropertyWebkitOverflowScrolling,
+#endif
     CSSPropertyWebkitPerspective,
     CSSPropertyWebkitPerspectiveOrigin,
     CSSPropertyWebkitPrintColorAdjust,
@@ -2119,6 +2122,12 @@
         case CSSPropertyWebkitMarginTopCollapse:
         case CSSPropertyWebkitMarginBeforeCollapse:
             return cssValuePool->createValue(style->marginBeforeCollapse());
+#if ENABLE(OVERFLOW_SCROLLING)
+        case CSSPropertyWebkitOverflowScrolling:
+            if (!style->useTouchOverflowScrolling())
+                return cssValuePool->createIdentifierValue(CSSValueAuto);
+            return cssValuePool->createIdentifierValue(CSSValueTouch);
+#endif
         case CSSPropertyWebkitPerspective:
             if (!style->hasPerspective())
                 return cssValuePool->createIdentifierValue(CSSValueNone);

Modified: trunk/Source/WebCore/css/CSSParser.cpp (107880 => 107881)


--- trunk/Source/WebCore/css/CSSParser.cpp	2012-02-16 04:49:03 UTC (rev 107880)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2012-02-16 05:09:09 UTC (rev 107881)
@@ -2092,6 +2092,14 @@
         }
         break;
 #endif
+
+#if ENABLE(OVERFLOW_SCROLLING)
+    case CSSPropertyWebkitOverflowScrolling:
+        if (id == CSSValueAuto || id == CSSValueTouch)
+            validPrimitive = true;
+        break;
+#endif
+
         /* shorthand properties */
     case CSSPropertyBackground: {
         // Position must come before color in this array because a plain old "0" is a legal color

Modified: trunk/Source/WebCore/css/CSSProperty.cpp (107880 => 107881)


--- trunk/Source/WebCore/css/CSSProperty.cpp	2012-02-16 04:49:03 UTC (rev 107880)
+++ trunk/Source/WebCore/css/CSSProperty.cpp	2012-02-16 05:09:09 UTC (rev 107881)
@@ -333,6 +333,9 @@
     case CSSPropertyWebkitLineGrid:
     case CSSPropertyWebkitLineSnap:
     case CSSPropertyWebkitNbspMode:
+#if ENABLE(OVERFLOW_SCROLLING)
+    case CSSPropertyWebkitOverflowScrolling:
+#endif
     case CSSPropertyWebkitPrintColorAdjust:
     case CSSPropertyWebkitRtlOrdering:
     case CSSPropertyWebkitTextCombine:

Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (107880 => 107881)


--- trunk/Source/WebCore/css/CSSPropertyNames.in	2012-02-16 04:49:03 UTC (rev 107880)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in	2012-02-16 05:09:09 UTC (rev 107881)
@@ -379,3 +379,6 @@
 #if defined(ENABLE_DASHBOARD_SUPPORT) && ENABLE_DASHBOARD_SUPPORT
 -webkit-dashboard-region
 #endif
+#if defined(ENABLE_OVERFLOW_SCROLLING)
+-webkit-overflow-scrolling
+#endif

Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (107880 => 107881)


--- trunk/Source/WebCore/css/CSSStyleSelector.cpp	2012-02-16 04:49:03 UTC (rev 107880)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp	2012-02-16 05:09:09 UTC (rev 107881)
@@ -1903,7 +1903,12 @@
     // cases where objects that should be blended as a single unit end up with a non-transparent
     // object wedged in between them.  Auto z-index also becomes 0 for objects that specify transforms/masks/reflections.
     if (style->hasAutoZIndex() && ((e && e->document()->documentElement() == e) || style->opacity() < 1.0f
-        || style->hasTransformRelatedProperty() || style->hasMask() || style->boxReflect() || style->hasFilter()))
+        || style->hasTransformRelatedProperty() || style->hasMask() || style->boxReflect() || style->hasFilter()
+#if ENABLE(OVERFLOW_SCROLLING)
+        // Touch overflow scrolling creates a stacking context.
+        || style->useTouchOverflowScrolling()
+#endif
+        ))
         style->setZIndex(0);
 
     // Textarea considers overflow visible as auto.
@@ -3725,6 +3730,15 @@
         return;
     }
 #endif
+#if ENABLE(OVERFLOW_SCROLLING)
+    case CSSPropertyWebkitOverflowScrolling: {
+        HANDLE_INHERIT_AND_INITIAL(useTouchOverflowScrolling, UseTouchOverflowScrolling);
+        if (!primitiveValue)
+            break;
+        m_style->setUseTouchOverflowScrolling(primitiveValue->getIdent() == CSSValueTouch);
+        return;
+    }
+#endif
     case CSSPropertyWebkitColorCorrection:
         HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(colorSpace, ColorSpace);
         return;

Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (107880 => 107881)


--- trunk/Source/WebCore/css/CSSValueKeywords.in	2012-02-16 04:49:03 UTC (rev 107880)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in	2012-02-16 05:09:09 UTC (rev 107881)
@@ -802,6 +802,12 @@
 manual
 // auto
 
+#if defined(ENABLE_OVERFLOW_SCROLLING)
+// -webkit-overflow-scrolling
+// auto
+touch
+#endif
+
 // -webkit-writing-mode
 // SVG compatibility
 lr

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (107880 => 107881)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-02-16 04:49:03 UTC (rev 107880)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-02-16 05:09:09 UTC (rev 107881)
@@ -943,6 +943,9 @@
 #if ENABLE(TOUCH_EVENTS)
     Color tapHighlightColor() const { return rareInheritedData->tapHighlightColor; }
 #endif
+#if ENABLE(OVERFLOW_SCROLLING)
+    bool useTouchOverflowScrolling() const { return rareInheritedData->useTouchOverflowScrolling; }
+#endif
     bool textSizeAdjust() const { return rareInheritedData->textSizeAdjust; }
     ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(rareInheritedData->textSecurity); }
 
@@ -1347,6 +1350,9 @@
 #if ENABLE(TOUCH_EVENTS)
     void setTapHighlightColor(const Color& c) { SET_VAR(rareInheritedData, tapHighlightColor, c); }
 #endif
+#if ENABLE(OVERFLOW_SCROLLING)
+    void setUseTouchOverflowScrolling(bool v) { SET_VAR(rareInheritedData, useTouchOverflowScrolling, v); }
+#endif
     bool setTextSizeAdjust(bool);
     void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedData, textSecurity, aTextSecurity); }
 
@@ -1647,6 +1653,9 @@
 #if ENABLE(TOUCH_EVENTS)
     static Color initialTapHighlightColor();
 #endif
+#if ENABLE(OVERFLOW_SCROLLING)
+    static bool initialUseTouchOverflowScrolling() { return false; }
+#endif
 #if ENABLE(DASHBOARD_SUPPORT)
     static const Vector<StyleDashboardRegion>& initialDashboardRegions();
     static const Vector<StyleDashboardRegion>& noneDashboardRegions();

Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp (107880 => 107881)


--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp	2012-02-16 04:49:03 UTC (rev 107880)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp	2012-02-16 05:09:09 UTC (rev 107881)
@@ -54,6 +54,9 @@
     , m_lineBoxContain(RenderStyle::initialLineBoxContain())
     , m_imageRendering(RenderStyle::initialImageRendering())
     , m_lineSnap(RenderStyle::initialLineSnap())
+#if ENABLE(OVERFLOW_SCROLLING)
+    , useTouchOverflowScrolling(RenderStyle::initialUseTouchOverflowScrolling())
+#endif
     , hyphenationLimitBefore(-1)
     , hyphenationLimitAfter(-1)
     , hyphenationLimitLines(-1)
@@ -98,6 +101,9 @@
     , m_lineBoxContain(o.m_lineBoxContain)
     , m_imageRendering(o.m_imageRendering)
     , m_lineSnap(o.m_lineSnap)
+#if ENABLE(OVERFLOW_SCROLLING)
+    , useTouchOverflowScrolling(o.useTouchOverflowScrolling)
+#endif
     , hyphenationString(o.hyphenationString)
     , hyphenationLimitBefore(o.hyphenationLimitBefore)
     , hyphenationLimitAfter(o.hyphenationLimitAfter)
@@ -149,6 +155,9 @@
         && wordWrap == o.wordWrap
         && nbspMode == o.nbspMode
         && khtmlLineBreak == o.khtmlLineBreak
+#if ENABLE(OVERFLOW_SCROLLING)
+        && useTouchOverflowScrolling == o.useTouchOverflowScrolling
+#endif
         && textSizeAdjust == o.textSizeAdjust
         && resize == o.resize
         && userSelect == o.userSelect

Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h (107880 => 107881)


--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h	2012-02-16 04:49:03 UTC (rev 107880)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h	2012-02-16 05:09:09 UTC (rev 107881)
@@ -92,6 +92,9 @@
     // CSS Image Values Level 3
     unsigned m_imageRendering : 2; // EImageRendering
     unsigned m_lineSnap : 2; // LineSnap
+#if ENABLE(OVERFLOW_SCROLLING)
+    unsigned useTouchOverflowScrolling: 1;
+#endif
 
     AtomicString hyphenationString;
     short hyphenationLimitBefore;

Modified: trunk/Source/WebKit/chromium/ChangeLog (107880 => 107881)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-02-16 04:49:03 UTC (rev 107880)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-02-16 05:09:09 UTC (rev 107881)
@@ -1,3 +1,12 @@
+2012-02-15  Sami Kyostila  <[email protected]>
+
+        Enable -webkit-overflow-scrolling CSS property
+        https://bugs.webkit.org/show_bug.cgi?id=78664
+
+        Reviewed by Eric Seidel.
+
+        * features.gypi:
+
 2012-02-15  Tommy Widenflycht  <[email protected]>
 
         MediaStream API: Removing SecurityContext from the embedder API

Modified: trunk/Source/WebKit/chromium/features.gypi (107880 => 107881)


--- trunk/Source/WebKit/chromium/features.gypi	2012-02-16 04:49:03 UTC (rev 107880)
+++ trunk/Source/WebKit/chromium/features.gypi	2012-02-16 05:09:09 UTC (rev 107881)
@@ -73,6 +73,7 @@
       'ENABLE_MUTATION_OBSERVERS=<(enable_mutation_observers)',
       'ENABLE_NOTIFICATIONS=1',
       'ENABLE_ORIENTATION_EVENTS=0',
+      'ENABLE_OVERFLOW_SCROLLING=1',
       'ENABLE_PAGE_VISIBILITY_API=1',
       'ENABLE_POINTER_LOCK=1',
       'ENABLE_PROGRESS_TAG=1',
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to