Skip to content
  • alexis@webkit.org's avatar
    [CSS3 Backgrounds and Borders] Implement new CSS3 background-position parsing. · d4f31662
    alexis@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=102104
    
    Reviewed by Julien Chaffraix.
    
    .:
    
    Protect the new feature behind a feature flag.
    
    * Source/cmake/WebKitFeatures.cmake:
    * Source/cmakeconfig.h.cmake:
    * configure.ac:
    
    Source/JavaScriptCore:
    
    Protect the new feature behind a feature flag.
    
    * Configurations/FeatureDefines.xcconfig:
    
    Source/WebCore:
    
    Implement the parsing of the CSS3 background-position property which
    allows to specify up to four values to position the background. It is
    documented here :
    http://www.w3.org/TR/css3-background/#the-background-position . I
    decided to split up the patch is two pieces, the parsing and later I
    will do the rendering. I kept the old code as much as possible (i.e.
    the two values parsing) as it is used not only by background-position
    but by few other properties. The new four values support is only valid
    on the property itself but does not work on the shorthand.
    
    Opera has already implemented this feature.
    
    I extended backgrounds/background-position-parsing-2.html to cover the
    new possible values as well as buggy values.
    
    * Configurations/FeatureDefines.xcconfig:
    * GNUmakefile.am:
    * GNUmakefile.features.am:
    * css/CSSParser.cpp:
    (WebCore::CSSParser::parseFillPositionComponent): Modify this function
    to allow creation of CSS primitive values with not only percentage or
    length but with keywords also as the new <position> type allows to
    specify keywords, for example top 30px right 20px.
    (WebCore):
    (WebCore::isValueConflictingWithCurrentEdge):
    (WebCore::isBackgroundPositionKeyword):
    (WebCore::CSSParser::parse3ValuesBackgroundPosition):
    (WebCore::CSSParser::parse4ValuesBackgroundPosition):
    (WebCore::CSSParser::parseFillBackgroundPosition): This function counts
    the number of words for the property value and call dedicated parsing
    functions for each case. Note that in case of two values we just call the old CSS 2.1
    method.
    (WebCore::CSSParser::parseFillPosition):
    (WebCore::CSSParser::parseFillProperty): Only call the new parsing
    function if the feature is activated otherwise fallback to the old code
    path.
    * css/CSSParser.h:
    
    Source/WebKit/chromium:
    
    Protect the new feature behind a feature flag.
    
    * features.gypi:
    
    Source/WebKit/mac:
    
    Protect the new feature behind a feature flag.
    
    * Configurations/FeatureDefines.xcconfig:
    
    Source/WebKit2:
    
    Protect the new feature behind a feature flag.
    
    * Configurations/FeatureDefines.xcconfig:
    
    Tools:
    
    Protect the new feature behind a feature flag.
    
    * Scripts/webkitperl/FeatureList.pm:
    * qmake/mkspecs/features/features.pri:
    
    WebKitLibraries:
    
    Protect the new feature behind a feature flag.
    
    * win/tools/vsprops/FeatureDefines.vsprops:
    * win/tools/vsprops/FeatureDefinesCairo.vsprops:
    
    LayoutTests:
    
    Add new tests to cover the new parsing for the background position
    property. For now the computed style checks are commented out because
    the rendering part of the feature is not yet implemented (i.e.
    FillLayer does not contain yet the feature and this is what
    CSSComputedStyleDeclaration is using).
    
    * fast/backgrounds/background-position-parsing-2-expected.txt:
    * fast/backgrounds/background-position-parsing-2.html:
    * platform/chromium/TestExpectations:
    * platform/efl/TestExpectations:
    * platform/gtk/TestExpectations:
    * platform/mac/TestExpectations:
    * platform/qt/TestExpectations:
    * platform/win/TestExpectations:
    * platform/wincairo/TestExpectations:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    d4f31662