Changeset 123379 in webkit


Ignore:
Timestamp:
Jul 23, 2012 2:03:45 PM (12 years ago)
Author:
Simon Fraser
Message:

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

Reviewed by Ojan Vafai.

Source/JavaScriptCore:

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):

Location:
trunk
Files:
5 added
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r123378 r123379  
     12012-07-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Part 2 of: Implement sticky positioning
     4        https://bugs.webkit.org/show_bug.cgi?id=90046
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Test for parsing and returning fro getComputedStyle() the new
     9        -webkit-sticky value for position.
     10
     11        * fast/css/sticky/parsing-position-sticky-expected.txt: Added.
     12        * fast/css/sticky/parsing-position-sticky.html: Added.
     13        * fast/css/sticky/resources/parsing-position-sticky.js: Added.
     14        (test):
     15
    1162012-07-23  Andrew Wilson  <atwilson@chromium.org>
    217
  • trunk/Source/JavaScriptCore/ChangeLog

    r123376 r123379  
     12012-07-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Part 2 of: Implement sticky positioning
     4        https://bugs.webkit.org/show_bug.cgi?id=90046
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Turn on ENABLE_CSS_STICKY_POSITION.
     9
     10        * Configurations/FeatureDefines.xcconfig:
     11
    1122012-07-23  Patrick Gansterer  <paroga@webkit.org>
    213
  • trunk/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig

    r123350 r123379  
    4444ENABLE_CSS_REGIONS = ENABLE_CSS_REGIONS;
    4545ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS;
    46 ENABLE_CSS_STICKY_POSITION = ;
     46ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION;
    4747ENABLE_CSS_VARIABLES = ;
    4848ENABLE_CSS3_FLEXBOX = ENABLE_CSS3_FLEXBOX;
  • trunk/Source/WebCore/ChangeLog

    r123377 r123379  
     12012-07-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Part 2 of: Implement sticky positioning
     4        https://bugs.webkit.org/show_bug.cgi?id=90046
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Turn on ENABLE_CSS_STICKY_POSITION. Add support for parsing the new '-webkit-sticky'
     9        value for position, returning it from getComputedStyle(), and storing it in RenderStyle.
     10
     11        Test: fast/css/sticky/parsing-position-sticky.html
     12
     13        * Configurations/FeatureDefines.xcconfig:
     14        * css/CSSComputedStyleDeclaration.cpp:
     15        (WebCore::getPositionOffsetValue):
     16        * css/CSSParser.cpp:
     17        (WebCore::isValidKeywordPropertyAndValue):
     18        * css/CSSPrimitiveValueMappings.h:
     19        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
     20        (WebCore::CSSPrimitiveValue::operator EPosition):
     21        * css/CSSValueKeywords.in:
     22        * rendering/style/RenderStyle.h:
     23        * rendering/style/RenderStyleConstants.h:
     24
    1252012-07-23  Stephen Chenney  <schenney@chromium.org>
    226
  • trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig

    r123350 r123379  
    4444ENABLE_CSS_REGIONS = ENABLE_CSS_REGIONS;
    4545ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS;
    46 ENABLE_CSS_STICKY_POSITION = ;
     46ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION;
    4747ENABLE_CSS_VARIABLES = ;
    4848ENABLE_CSS3_FLEXBOX = ENABLE_CSS3_FLEXBOX;
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r122895 r123379  
    609609    }
    610610
    611     if (style->position() == RelativePosition) {
     611    if (style->position() == RelativePosition || style->position() == StickyPosition) {
    612612        // FIXME: It's not enough to simply return "auto" values for one offset if the other side is defined.
    613613        // In other words if left is auto and right is not auto, then left's computed value is negative right().
  • trunk/Source/WebCore/css/CSSParser.cpp

    r123135 r123379  
    616616            return true;
    617617        break;
    618     case CSSPropertyPosition: // static | relative | absolute | fixed | inherit
    619         if (valueID == CSSValueStatic || valueID == CSSValueRelative || valueID == CSSValueAbsolute || valueID == CSSValueFixed)
     618    case CSSPropertyPosition: // static | relative | absolute | fixed | sticky | inherit
     619        if (valueID == CSSValueStatic || valueID == CSSValueRelative || valueID == CSSValueAbsolute || valueID == CSSValueFixed
     620#if ENABLE(CSS_STICKY_POSITION)
     621            || valueID == CSSValueWebkitSticky
     622#endif
     623            )
    620624            return true;
    621625        break;
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r123300 r123379  
    20332033            m_value.ident = CSSValueFixed;
    20342034            break;
     2035#if ENABLE(CSS_STICKY_POSITION)
     2036        case StickyPosition:
     2037            m_value.ident = CSSValueWebkitSticky;
     2038            break;
     2039#endif
    20352040    }
    20362041}
     
    20472052        case CSSValueFixed:
    20482053            return FixedPosition;
     2054#if ENABLE(CSS_STICKY_POSITION)
     2055        case CSSValueWebkitSticky:
     2056            return StickyPosition;
     2057#endif
    20492058        default:
    20502059            ASSERT_NOT_REACHED();
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r121127 r123379  
    916916edges
    917917
     918// position
     919#if defined(ENABLE_CSS_STICKY_POSITION) && ENABLE_CSS_STICKY_POSITION
     920-webkit-sticky
     921#endif // CSS_STICKY_POSITION
     922
    918923// (pointer:) media feature
    919924// none
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r122895 r123379  
    305305        unsigned _vertical_align : 4; // EVerticalAlign
    306306        unsigned _clear : 2; // EClear
    307         unsigned _position : 2; // EPosition
     307        unsigned _position : 3; // EPosition
    308308        unsigned _floating : 2; // EFloat
    309309        unsigned _table_layout : 1; // ETableLayout
     
    332332        unsigned _isLink : 1;
    333333        // If you add more style bits here, you will also need to update RenderStyle::copyNonInheritedFrom()
    334         // 53 bits
     334        // 54 bits
    335335    } noninherited_flags;
    336336
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.h

    r121127 r123379  
    9595
    9696enum EPosition {
    97     StaticPosition, RelativePosition, AbsolutePosition, FixedPosition
     97    StaticPosition, RelativePosition, AbsolutePosition, FixedPosition, StickyPosition
    9898};
    9999
  • trunk/Source/WebKit/chromium/ChangeLog

    r123375 r123379  
     12012-07-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Part 2 of: Implement sticky positioning
     4        https://bugs.webkit.org/show_bug.cgi?id=90046
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Turn on ENABLE_CSS_STICKY_POSITION.
     9
     10        * features.gypi:
     11
    1122012-07-23  Shawn Singh  <shawnsingh@chromium.org>
    213
  • trunk/Source/WebKit/chromium/features.gypi

    r123350 r123379  
    4848      'ENABLE_CSS_SHADERS=1',
    4949      'ENABLE_CSS_VARIABLES=1',
    50       'ENABLE_CSS_STICKY_POSITION=0',
     50      'ENABLE_CSS_STICKY_POSITION=1',
    5151      'ENABLE_CUSTOM_SCHEME_HANDLER=0',
    5252      'ENABLE_DATALIST_ELEMENT=1',
  • trunk/Source/WebKit/mac/ChangeLog

    r123354 r123379  
     12012-07-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Part 2 of: Implement sticky positioning
     4        https://bugs.webkit.org/show_bug.cgi?id=90046
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Turn on ENABLE_CSS_STICKY_POSITION.
     9
     10        * Configurations/FeatureDefines.xcconfig:
     11
    1122012-07-23  Pierre Rossi  <pierre.rossi@gmail.com>
    213
  • trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig

    r123350 r123379  
    4545ENABLE_CSS_REGIONS = ENABLE_CSS_REGIONS;
    4646ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS;
    47 ENABLE_CSS_STICKY_POSITION = ;
     47ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION;
    4848ENABLE_CSS_VARIABLES = ;
    4949ENABLE_CSS3_FLEXBOX = ENABLE_CSS3_FLEXBOX;
  • trunk/Source/WebKit2/ChangeLog

    r123374 r123379  
     12012-07-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Part 2 of: Implement sticky positioning
     4        https://bugs.webkit.org/show_bug.cgi?id=90046
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Turn on ENABLE_CSS_STICKY_POSITION.
     9
     10        * Configurations/FeatureDefines.xcconfig:
     11
    1122012-07-23  Christophe Dumez  <christophe.dumez@intel.com>
    213
  • trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig

    r123350 r123379  
    4545ENABLE_CSS_REGIONS = ENABLE_CSS_REGIONS;
    4646ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS;
    47 ENABLE_CSS_STICKY_POSITION = ;
     47ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION;
    4848ENABLE_CSS_VARIABLES = ;
    4949ENABLE_CSS3_FLEXBOX = ENABLE_CSS3_FLEXBOX;
Note: See TracChangeset for help on using the changeset viewer.