[CSS3 Backgrounds and Borders] Implement new CSS3 background-position parsing.
authoralexis@webkit.org <alexis@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Nov 2012 21:24:10 +0000 (21:24 +0000)
committeralexis@webkit.org <alexis@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Nov 2012 21:24:10 +0000 (21:24 +0000)
commit5bea51c7c606370b8d3824fd7560342302519e8c
tree6367261f9613ed8cb11af2c6e927020e5b4cd469
parentf9950f1f428cd47d4a38f122b5c26ca172271914
[CSS3 Backgrounds and Borders] Implement new CSS3 background-position parsing.
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: https://svn.webkit.org/repository/webkit/trunk@135632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
34 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/fast/backgrounds/background-position-parsing-2-expected.txt
LayoutTests/fast/backgrounds/background-position-parsing-2.html
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/qt/TestExpectations
LayoutTests/platform/win/TestExpectations
LayoutTests/platform/wincairo/TestExpectations
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/GNUmakefile.am
Source/WebCore/GNUmakefile.features.am
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/features.gypi
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/FeatureDefines.xcconfig
Source/cmake/WebKitFeatures.cmake
Source/cmakeconfig.h.cmake
Tools/ChangeLog
Tools/Scripts/webkitperl/FeatureList.pm
Tools/qmake/mkspecs/features/features.pri
WebKitLibraries/ChangeLog
WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
configure.ac