Title: [123379] trunk
Revision
123379
Author
[email protected]
Date
2012-07-23 14:03:45 -0700 (Mon, 23 Jul 2012)

Log Message

Part 2 of: Implement sticky positioning
https://bugs.webkit.org/show_bug.cgi?id=90046

Reviewed by Ojan Vafai.

Source/_javascript_Core:

Turn on ENABLE_CSS_STICKY_POSITION.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Turn on ENABLE_CSS_STICKY_POSITION. Add support for parsing the new '-webkit-sticky'
value for position, returning it from getComputedStyle(), and storing it in RenderStyle.

Test: fast/css/sticky/parsing-position-sticky.html

* Configurations/FeatureDefines.xcconfig:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::getPositionOffsetValue):
* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator EPosition):
* css/CSSValueKeywords.in:
* rendering/style/RenderStyle.h:
* rendering/style/RenderStyleConstants.h:

Source/WebKit/chromium:

Turn on ENABLE_CSS_STICKY_POSITION.

* features.gypi:

Source/WebKit/mac:

Turn on ENABLE_CSS_STICKY_POSITION.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

Turn on ENABLE_CSS_STICKY_POSITION.

* Configurations/FeatureDefines.xcconfig:

LayoutTests:

Test for parsing and returning fro getComputedStyle() the new
-webkit-sticky value for position.

* fast/css/sticky/parsing-position-sticky-expected.txt: Added.
* fast/css/sticky/parsing-position-sticky.html: Added.
* fast/css/sticky/resources/parsing-position-sticky.js: Added.
(test):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (123378 => 123379)


--- trunk/LayoutTests/ChangeLog	2012-07-23 21:03:15 UTC (rev 123378)
+++ trunk/LayoutTests/ChangeLog	2012-07-23 21:03:45 UTC (rev 123379)
@@ -1,3 +1,18 @@
+2012-07-23  Simon Fraser  <[email protected]>
+
+        Part 2 of: Implement sticky positioning
+        https://bugs.webkit.org/show_bug.cgi?id=90046
+
+        Reviewed by Ojan Vafai.
+
+        Test for parsing and returning fro getComputedStyle() the new
+        -webkit-sticky value for position.
+
+        * fast/css/sticky/parsing-position-sticky-expected.txt: Added.
+        * fast/css/sticky/parsing-position-sticky.html: Added.
+        * fast/css/sticky/resources/parsing-position-sticky.js: Added.
+        (test):
+
 2012-07-23  Andrew Wilson  <[email protected]>
 
         Unreviewed chromium expectations change to mark media/media-fragments/TC0010-TC0019.html as flaky/crashy.

Added: trunk/LayoutTests/fast/css/sticky/parsing-position-sticky-expected.txt (0 => 123379)


--- trunk/LayoutTests/fast/css/sticky/parsing-position-sticky-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/sticky/parsing-position-sticky-expected.txt	2012-07-23 21:03:45 UTC (rev 123379)
@@ -0,0 +1,11 @@
+This tests checks that the -webkit-sticky value for position parses correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS test("position: -webkit-sticky;") is "-webkit-sticky"
+PASS test("position: sticky;") is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Property changes on: trunk/LayoutTests/fast/css/sticky/parsing-position-sticky-expected.txt
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Added: trunk/LayoutTests/fast/css/sticky/parsing-position-sticky.html (0 => 123379)


--- trunk/LayoutTests/fast/css/sticky/parsing-position-sticky.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/sticky/parsing-position-sticky.html	2012-07-23 21:03:45 UTC (rev 123379)
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<style type="text/css"></style>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+</body>
+</html>
Property changes on: trunk/LayoutTests/fast/css/sticky/parsing-position-sticky.html
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Added: trunk/LayoutTests/fast/css/sticky/resources/parsing-position-sticky.js (0 => 123379)


--- trunk/LayoutTests/fast/css/sticky/resources/parsing-position-sticky.js	                        (rev 0)
+++ trunk/LayoutTests/fast/css/sticky/resources/parsing-position-sticky.js	2012-07-23 21:03:45 UTC (rev 123379)
@@ -0,0 +1,15 @@
+description("This tests checks that the -webkit-sticky value for position parses correctly.");
+
+function test(value)
+{
+    var div = document.createElement("div");
+    div.setAttribute("style", value);
+    document.body.appendChild(div);
+    
+    var result = div.style.getPropertyValue("position");
+    document.body.removeChild(div);
+    return result;
+}
+
+shouldBe('test("position: -webkit-sticky;")', '"-webkit-sticky"');
+shouldBe('test("position: sticky;")', 'null');
Property changes on: trunk/LayoutTests/fast/css/sticky/resources/parsing-position-sticky.js
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Modified: trunk/Source/_javascript_Core/ChangeLog (123378 => 123379)


--- trunk/Source/_javascript_Core/ChangeLog	2012-07-23 21:03:15 UTC (rev 123378)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-07-23 21:03:45 UTC (rev 123379)
@@ -1,3 +1,14 @@
+2012-07-23  Simon Fraser  <[email protected]>
+
+        Part 2 of: Implement sticky positioning
+        https://bugs.webkit.org/show_bug.cgi?id=90046
+
+        Reviewed by Ojan Vafai.
+
+        Turn on ENABLE_CSS_STICKY_POSITION.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2012-07-23  Patrick Gansterer  <[email protected]>
 
         Move JSC::parseDate() from DateConversion to JSDateMath

Modified: trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig (123378 => 123379)


--- trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig	2012-07-23 21:03:15 UTC (rev 123378)
+++ trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig	2012-07-23 21:03:45 UTC (rev 123379)
@@ -43,7 +43,7 @@
 ENABLE_CSS_IMAGE_RESOLUTION = ;
 ENABLE_CSS_REGIONS = ENABLE_CSS_REGIONS;
 ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS;
-ENABLE_CSS_STICKY_POSITION = ;
+ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION;
 ENABLE_CSS_VARIABLES = ;
 ENABLE_CSS3_FLEXBOX = ENABLE_CSS3_FLEXBOX;
 ENABLE_CUSTOM_SCHEME_HANDLER = ;

Modified: trunk/Source/WebCore/ChangeLog (123378 => 123379)


--- trunk/Source/WebCore/ChangeLog	2012-07-23 21:03:15 UTC (rev 123378)
+++ trunk/Source/WebCore/ChangeLog	2012-07-23 21:03:45 UTC (rev 123379)
@@ -1,3 +1,27 @@
+2012-07-23  Simon Fraser  <[email protected]>
+
+        Part 2 of: Implement sticky positioning
+        https://bugs.webkit.org/show_bug.cgi?id=90046
+
+        Reviewed by Ojan Vafai.
+
+        Turn on ENABLE_CSS_STICKY_POSITION. Add support for parsing the new '-webkit-sticky'
+        value for position, returning it from getComputedStyle(), and storing it in RenderStyle.
+
+        Test: fast/css/sticky/parsing-position-sticky.html
+
+        * Configurations/FeatureDefines.xcconfig:
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::getPositionOffsetValue):
+        * css/CSSParser.cpp:
+        (WebCore::isValidKeywordPropertyAndValue):
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::operator EPosition):
+        * css/CSSValueKeywords.in:
+        * rendering/style/RenderStyle.h:
+        * rendering/style/RenderStyleConstants.h:
+
 2012-07-23  Stephen Chenney  <[email protected]>
 
         Crash when setting empty class name on a new element

Modified: trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig (123378 => 123379)


--- trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig	2012-07-23 21:03:15 UTC (rev 123378)
+++ trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig	2012-07-23 21:03:45 UTC (rev 123379)
@@ -43,7 +43,7 @@
 ENABLE_CSS_IMAGE_RESOLUTION = ;
 ENABLE_CSS_REGIONS = ENABLE_CSS_REGIONS;
 ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS;
-ENABLE_CSS_STICKY_POSITION = ;
+ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION;
 ENABLE_CSS_VARIABLES = ;
 ENABLE_CSS3_FLEXBOX = ENABLE_CSS3_FLEXBOX;
 ENABLE_CUSTOM_SCHEME_HANDLER = ;

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (123378 => 123379)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2012-07-23 21:03:15 UTC (rev 123378)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2012-07-23 21:03:45 UTC (rev 123379)
@@ -608,7 +608,7 @@
         return cssValuePool().createValue(l);
     }
 
-    if (style->position() == RelativePosition) {
+    if (style->position() == RelativePosition || style->position() == StickyPosition) {
         // FIXME: It's not enough to simply return "auto" values for one offset if the other side is defined.
         // In other words if left is auto and right is not auto, then left's computed value is negative right().
         // So we should get the opposite length unit and see if it is auto.

Modified: trunk/Source/WebCore/css/CSSParser.cpp (123378 => 123379)


--- trunk/Source/WebCore/css/CSSParser.cpp	2012-07-23 21:03:15 UTC (rev 123378)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2012-07-23 21:03:45 UTC (rev 123379)
@@ -615,8 +615,12 @@
         if (valueID == CSSValueVisible || valueID == CSSValueNone || valueID == CSSValueAll || valueID == CSSValueAuto || (valueID >= CSSValueVisiblepainted && valueID <= CSSValueStroke))
             return true;
         break;
-    case CSSPropertyPosition: // static | relative | absolute | fixed | inherit
-        if (valueID == CSSValueStatic || valueID == CSSValueRelative || valueID == CSSValueAbsolute || valueID == CSSValueFixed)
+    case CSSPropertyPosition: // static | relative | absolute | fixed | sticky | inherit
+        if (valueID == CSSValueStatic || valueID == CSSValueRelative || valueID == CSSValueAbsolute || valueID == CSSValueFixed
+#if ENABLE(CSS_STICKY_POSITION)
+            || valueID == CSSValueWebkitSticky
+#endif
+            )
             return true;
         break;
     case CSSPropertyResize: // none | both | horizontal | vertical | auto

Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (123378 => 123379)


--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h	2012-07-23 21:03:15 UTC (rev 123378)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h	2012-07-23 21:03:45 UTC (rev 123379)
@@ -2032,6 +2032,11 @@
         case FixedPosition:
             m_value.ident = CSSValueFixed;
             break;
+#if ENABLE(CSS_STICKY_POSITION)
+        case StickyPosition:
+            m_value.ident = CSSValueWebkitSticky;
+            break;
+#endif
     }
 }
 
@@ -2046,6 +2051,10 @@
             return AbsolutePosition;
         case CSSValueFixed:
             return FixedPosition;
+#if ENABLE(CSS_STICKY_POSITION)
+        case CSSValueWebkitSticky:
+            return StickyPosition;
+#endif
         default:
             ASSERT_NOT_REACHED();
             return StaticPosition;

Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (123378 => 123379)


--- trunk/Source/WebCore/css/CSSValueKeywords.in	2012-07-23 21:03:15 UTC (rev 123378)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in	2012-07-23 21:03:45 UTC (rev 123379)
@@ -915,6 +915,11 @@
 // -webkit-line-align
 edges
 
+// position
+#if defined(ENABLE_CSS_STICKY_POSITION) && ENABLE_CSS_STICKY_POSITION
+-webkit-sticky
+#endif // CSS_STICKY_POSITION
+
 // (pointer:) media feature
 // none
 coarse

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (123378 => 123379)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-07-23 21:03:15 UTC (rev 123378)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-07-23 21:03:45 UTC (rev 123379)
@@ -304,7 +304,7 @@
         unsigned _overflowY : 3; // EOverflow
         unsigned _vertical_align : 4; // EVerticalAlign
         unsigned _clear : 2; // EClear
-        unsigned _position : 2; // EPosition
+        unsigned _position : 3; // EPosition
         unsigned _floating : 2; // EFloat
         unsigned _table_layout : 1; // ETableLayout
 
@@ -331,7 +331,7 @@
         unsigned _affectedByDrag : 1;
         unsigned _isLink : 1;
         // If you add more style bits here, you will also need to update RenderStyle::copyNonInheritedFrom()
-        // 53 bits
+        // 54 bits
     } noninherited_flags;
 
 // !END SYNC!

Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (123378 => 123379)


--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h	2012-07-23 21:03:15 UTC (rev 123378)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h	2012-07-23 21:03:45 UTC (rev 123379)
@@ -94,7 +94,7 @@
 enum OutlineIsAuto { AUTO_OFF = 0, AUTO_ON };
 
 enum EPosition {
-    StaticPosition, RelativePosition, AbsolutePosition, FixedPosition
+    StaticPosition, RelativePosition, AbsolutePosition, FixedPosition, StickyPosition
 };
 
 enum EFloat {

Modified: trunk/Source/WebKit/chromium/ChangeLog (123378 => 123379)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-07-23 21:03:15 UTC (rev 123378)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-07-23 21:03:45 UTC (rev 123379)
@@ -1,3 +1,14 @@
+2012-07-23  Simon Fraser  <[email protected]>
+
+        Part 2 of: Implement sticky positioning
+        https://bugs.webkit.org/show_bug.cgi?id=90046
+
+        Reviewed by Ojan Vafai.
+
+        Turn on ENABLE_CSS_STICKY_POSITION.
+
+        * features.gypi:
+
 2012-07-23  Shawn Singh  <[email protected]>
 
         [chromium] Refactor CCLayerTreeHostCommon: clean up clipRect and drawableContentRect design

Modified: trunk/Source/WebKit/chromium/features.gypi (123378 => 123379)


--- trunk/Source/WebKit/chromium/features.gypi	2012-07-23 21:03:15 UTC (rev 123378)
+++ trunk/Source/WebKit/chromium/features.gypi	2012-07-23 21:03:45 UTC (rev 123379)
@@ -47,7 +47,7 @@
       'ENABLE_CSS_REGIONS=1',
       'ENABLE_CSS_SHADERS=1',
       'ENABLE_CSS_VARIABLES=1',
-      'ENABLE_CSS_STICKY_POSITION=0',
+      'ENABLE_CSS_STICKY_POSITION=1',
       'ENABLE_CUSTOM_SCHEME_HANDLER=0',
       'ENABLE_DATALIST_ELEMENT=1',
       'ENABLE_DASHBOARD_SUPPORT=0',

Modified: trunk/Source/WebKit/mac/ChangeLog (123378 => 123379)


--- trunk/Source/WebKit/mac/ChangeLog	2012-07-23 21:03:15 UTC (rev 123378)
+++ trunk/Source/WebKit/mac/ChangeLog	2012-07-23 21:03:45 UTC (rev 123379)
@@ -1,3 +1,14 @@
+2012-07-23  Simon Fraser  <[email protected]>
+
+        Part 2 of: Implement sticky positioning
+        https://bugs.webkit.org/show_bug.cgi?id=90046
+
+        Reviewed by Ojan Vafai.
+
+        Turn on ENABLE_CSS_STICKY_POSITION.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2012-07-23  Pierre Rossi  <[email protected]>
 
         Unify numTouchEventHandlersChanged and needTouchEvents in the chrome client

Modified: trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig (123378 => 123379)


--- trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig	2012-07-23 21:03:15 UTC (rev 123378)
+++ trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig	2012-07-23 21:03:45 UTC (rev 123379)
@@ -44,7 +44,7 @@
 ENABLE_CSS_IMAGE_RESOLUTION = ;
 ENABLE_CSS_REGIONS = ENABLE_CSS_REGIONS;
 ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS;
-ENABLE_CSS_STICKY_POSITION = ;
+ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION;
 ENABLE_CSS_VARIABLES = ;
 ENABLE_CSS3_FLEXBOX = ENABLE_CSS3_FLEXBOX;
 ENABLE_CUSTOM_SCHEME_HANDLER = ;

Modified: trunk/Source/WebKit2/ChangeLog (123378 => 123379)


--- trunk/Source/WebKit2/ChangeLog	2012-07-23 21:03:15 UTC (rev 123378)
+++ trunk/Source/WebKit2/ChangeLog	2012-07-23 21:03:45 UTC (rev 123379)
@@ -1,3 +1,14 @@
+2012-07-23  Simon Fraser  <[email protected]>
+
+        Part 2 of: Implement sticky positioning
+        https://bugs.webkit.org/show_bug.cgi?id=90046
+
+        Reviewed by Ojan Vafai.
+
+        Turn on ENABLE_CSS_STICKY_POSITION.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2012-07-23  Christophe Dumez  <[email protected]>
 
         [WK2] WebKitTestRunner needs to print information about Web intents

Modified: trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig (123378 => 123379)


--- trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig	2012-07-23 21:03:15 UTC (rev 123378)
+++ trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig	2012-07-23 21:03:45 UTC (rev 123379)
@@ -44,7 +44,7 @@
 ENABLE_CSS_IMAGE_RESOLUTION = ;
 ENABLE_CSS_REGIONS = ENABLE_CSS_REGIONS;
 ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS;
-ENABLE_CSS_STICKY_POSITION = ;
+ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION;
 ENABLE_CSS_VARIABLES = ;
 ENABLE_CSS3_FLEXBOX = ENABLE_CSS3_FLEXBOX;
 ENABLE_CUSTOM_SCHEME_HANDLER = ;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to