Add parsing and style application for css3-images image-orientation
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jul 2012 23:23:36 +0000 (23:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jul 2012 23:23:36 +0000 (23:23 +0000)
commit72de277a63e97071e38981d8e30bd76b84e6874f
tree832b194fd94304703ec937e5d28fbdaf8866e5e7
parentf05f7f2dc3f6b980ea67d3e857c53fa587fa4673
Add parsing and style application for css3-images image-orientation
https://bugs.webkit.org/show_bug.cgi?id=89624

Patch by David Barr <davidbarr@chromium.org> on 2012-07-17
Reviewed by Tony Chang.

The css3-images module is at candidate recommendation.
http://www.w3.org/TR/2012/CR-css3-images-20120417/#the-image-orientation

Source/WebCore:

Test: fast/css/image-orientation/image-orientation.html

* css/CSSComputedStyleDeclaration.cpp: Add computed style for image-orientation.
(WebCore): Add CSSPropertyImageOrientation to computedProperties.
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Map CSSPropertyImageOrientation using cast operator from PrimitiveValueMappings.
* css/CSSParser.cpp: Add parsing rule for image-orientation.
(WebCore::CSSParser::parseValue): Parse the value of CSSPropertyImageOrientation as an angle.
* css/CSSPrimitiveValueMappings.h: Add mappings between CSSPrimitiveValue and ImageOrientationEnum.
(WebCore): Add conditional include for ImageOrientation.h.
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Map the natural orientations to angles.
(WebCore::CSSPrimitiveValue::operator ImageOrientationEnum): Round angles away from zero to quarter turns and map to the natural orientations.
* css/CSSProperty.cpp: Add CSSPropertyImageOrientation.
(WebCore::CSSProperty::isInheritedProperty): Map CSSPropertyImageOrientation inherited.
* css/CSSPropertyNames.in: Add image-orientation.
* css/StyleBuilder.cpp: Add style application logic for CSSPropertyImageOrientation.
(WebCore::StyleBuilder::StyleBuilder): Map CSSPropertyImageOrientation to RenderStyle::imageOrientation with type ImageOrientationEnum.
* css/StyleResolver.cpp: Handle CSSPropertyImageOrientation.
(WebCore::StyleResolver::applyProperty): Expect CSSPropertyImageOrientation to be handled by StyleBuilder.
* rendering/style/RenderStyle.h: Add imageOrientation, setImageOrientation and initialImageOrientation.
* rendering/style/StyleRareInheritedData.cpp: Add m_imageOrientation.
(WebCore::StyleRareInheritedData::StyleRareInheritedData): Add m_imageOrientation to default and copy contructors.
(WebCore::StyleRareInheritedData::operator==): Include m_imageOrientation in comparison.
* rendering/style/StyleRareInheritedData.h: Add m_imageOrientation.
(StyleRareInheritedData): Add 4-bit field m_imageOrientation, mapping to ImageOrientationEnum.

LayoutTests:

* fast/css/image-orientation/image-orientation-expected.txt: Added.
* fast/css/image-orientation/image-orientation.html: Added.
* platform/chromium/TestExpectations: Skip tests until image-orientation implementation lands.
* platform/efl/TestExpectations: Skip tests until image-orientation implementation lands.
* platform/gtk/TestExpectations: Skip tests until image-orientation implementation lands.
* platform/mac/TestExpectations: Skip tests until image-orientation implementation lands.
* platform/qt/TestExpectations: Skip tests until image-orientation implementation lands.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122895 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/image-orientation/image-orientation-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/image-orientation/image-orientation.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/qt/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSProperty.cpp
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/StyleBuilder.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/StyleRareInheritedData.cpp
Source/WebCore/rendering/style/StyleRareInheritedData.h