Implement parsing for CSS will-change
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Aug 2015 17:59:05 +0000 (17:59 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Aug 2015 17:59:05 +0000 (17:59 +0000)
commit26b51cae90e23d0c4c8ff28992accd0b99355c52
tree1ec18740df026496269c15c44a533a02c941a635
parent80cc418276e55a7203964fb1666e14eac65ba3d8
Implement parsing for CSS will-change
https://bugs.webkit.org/show_bug.cgi?id=148052

Reviewed by Dean Jackson.

Source/WebCore:

Syntax is
    will-change: auto | <animateable-feature>#
where
    <animateable-feature> = scroll-position | contents | <custom-ident>

To support this, add WillChangeData which stores a vector of "feature"
and CSS property squished into 16 bits. This is stored in rareNonInheritedData.
If null or an empty list, the property value is 'auto'. The list preserves
unknown properties.

Test: fast/css/will-change-parsing.html

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::getWillChangePropertyValue):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::isValidGridPositionCustomIdent): Renamed from isValidCustomIdent(),
since it's grid-specific.
(WebCore::CSSParser::parseIntegerOrCustomIdentFromGridPosition):
(WebCore::valueIsCSSKeyword): Returns true for the "CSS-wide" keywords like
"initial", "inherit" and "default".
(WebCore::CSSParser::parseFontFamily):
(WebCore::isValidWillChangeAnimatableFeature):
(WebCore::CSSParser::parseWillChange):
(WebCore::isValidCustomIdent): Deleted.
* css/CSSParser.h:
* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isPropertyID): New utility function.
* css/CSSPropertyNames.in:
* css/CSSValueKeywords.in:
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueWillChange):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setWillChange):
* rendering/style/RenderStyle.h:
* rendering/style/StyleAllInOne.cpp:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
(WebCore::StyleRareNonInheritedData::willChangeDataEquivalent):
* rendering/style/StyleRareNonInheritedData.h:
* rendering/style/WillChangeData.cpp: Added.
(WebCore::WillChangeData::operator==):
(WebCore::WillChangeData::containsScrollPosition):
(WebCore::WillChangeData::containsContents):
(WebCore::WillChangeData::containsProperty):
(WebCore::WillChangeData::addFeature):
(WebCore::WillChangeData::featureAt):
* rendering/style/WillChangeData.h: Added.
(WebCore::WillChangeData::create):
(WebCore::WillChangeData::operator!=):
(WebCore::WillChangeData::isAuto):
(WebCore::WillChangeData::numFeatures):
(WebCore::WillChangeData::WillChangeData):
(WebCore::WillChangeData::AnimatableFeature::feature):
(WebCore::WillChangeData::AnimatableFeature::property):
(WebCore::WillChangeData::AnimatableFeature::featurePropertyPair):
(WebCore::WillChangeData::AnimatableFeature::AnimatableFeature):
(WebCore::WillChangeData::AnimatableFeature::operator==):

LayoutTests:

will-change parsing test.

* fast/css/will-change-parsing-expected.txt: Added.
* fast/css/will-change-parsing.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188512 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/will-change-parsing-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/will-change-parsing.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/CSSPrimitiveValue.h
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/StyleBuilderCustom.h
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/StyleAllInOne.cpp
Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
Source/WebCore/rendering/style/StyleRareNonInheritedData.h
Source/WebCore/rendering/style/WillChangeData.cpp [new file with mode: 0644]
Source/WebCore/rendering/style/WillChangeData.h [new file with mode: 0644]