Turn x/y to presentation attributes
authorkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jul 2014 09:52:25 +0000 (09:52 +0000)
committerkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jul 2014 09:52:25 +0000 (09:52 +0000)
commit3fbe6138725d972b0e8eddbd658dee8f14775fa7
tree0fc2bb558b4d9362ac5e38ec607707f5a4a54059
parent965be9fcd18694d37ea1c626114694ab66ecbb4c
Turn x/y to presentation attributes
https://bugs.webkit.org/show_bug.cgi?id=135215

Source/WebCore:
Patch by Dirk Schulze <krit@webkit.org> on 2014-07-24
Reviewed by Dean Jackson.

This follows the patch for width and height presentation attributes and
turns x and y to presentation attributes as well:

http://trac.webkit.org/changeset/171341

Tests: svg/css/parse-length.html
       transitions/svg-layout-transition.html

Added copyright where I forgot it in previous patch.

* css/CSSComputedStyleDeclaration.cpp: Computed style of x and y.
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp:
(WebCore::isSimpleLengthPropertyID): Add x and y to list.
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder): Resolve x and y.
* css/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue): Parse x and y property.
* css/SVGCSSPropertyNames.in: Add x and y to list of names.
* css/StyleResolver.h:
* page/animation/CSSPropertyAnimation.cpp: Animate x and y as Length.
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.h: Add x and y setters and getters.
* rendering/style/SVGRenderStyle.cpp: Add x and y setters for StyleLayoutData.
(WebCore::SVGRenderStyle::SVGRenderStyle):
(WebCore::SVGRenderStyle::operator==):
(WebCore::SVGRenderStyle::copyNonInheritedFrom):
(WebCore::SVGRenderStyle::diff):
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::setX):
(WebCore::SVGRenderStyle::setY):
(WebCore::SVGRenderStyle::x):
(WebCore::SVGRenderStyle::y):
* rendering/style/SVGRenderStyleDefs.cpp: Add StyleLayoutData for style storing.
(WebCore::StyleLayoutData::StyleLayoutData):
(WebCore::StyleLayoutData::copy):
(WebCore::StyleLayoutData::operator==):
* rendering/style/SVGRenderStyleDefs.h:
(WebCore::StyleLayoutData::create):
(WebCore::StyleLayoutData::operator!=):
* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::updateShapeFromElement):
* rendering/svg/SVGPathData.cpp: Use RenderStyle values rather than attribute values.
(WebCore::updatePathFromRectElement):
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::isTargetAttributeCSSProperty): Fix text detection.
* svg/SVGElement.cpp: Add x and y to the relevant property lists.
(WebCore::populateAttributeNameToCSSPropertyIDMap):
(WebCore::populateCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap):
* svg/SVGFilterElement.cpp: Style update on change of x and y.
(WebCore::SVGFilterElement::svgAttributeChanged):
* svg/SVGMaskElement.cpp: Ditto.
(WebCore::SVGMaskElement::svgAttributeChanged):
* svg/SVGPatternElement.cpp: Ditto.
(WebCore::SVGPatternElement::svgAttributeChanged):
* svg/SVGRectElement.cpp: Ditto.
(WebCore::SVGRectElement::svgAttributeChanged):
* svg/SVGTextPositioningElement.cpp: Exclude x and y of text elements since they
    are lists instead of individual values. Solution about to be discussed
    in the WG. Keep current behavior for now.
(WebCore::SVGTextPositioningElement::collectStyleForPresentationAttribute):
(WebCore::SVGTextPositioningElement::isPresentationAttribute):
* svg/SVGTextPositioningElement.h:

LayoutTests:
Test parsing of x and y attributes. Rendering and SVG animation
covered by existing tests.
CSS Transition test, test transition from specified attribute value
to new property value.

Patch by Dirk Schulze <krit@webkit.org> on 2014-07-24
Reviewed by Dean Jackson.

* svg/css/parse-length-expected.txt: Added.
* svg/css/parse-length.html: Renamed from LayoutTests/svg/css/parse-width.html.
* svg/css/parse-width-expected.txt: Removed.
* transitions/svg-layout-transition-expected.txt: Added.
* transitions/svg-layout-transition.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@171591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
34 files changed:
LayoutTests/ChangeLog
LayoutTests/svg/css/parse-length-expected.txt [new file with mode: 0644]
LayoutTests/svg/css/parse-length.html [moved from LayoutTests/svg/css/parse-width.html with 56% similarity]
LayoutTests/svg/css/parse-width-expected.txt [deleted file]
LayoutTests/transitions/svg-layout-transition-expected.txt [new file with mode: 0644]
LayoutTests/transitions/svg-layout-transition.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/DeprecatedStyleBuilder.cpp
Source/WebCore/css/SVGCSSParser.cpp
Source/WebCore/css/SVGCSSPropertyNames.in
Source/WebCore/css/StyleResolver.h
Source/WebCore/page/animation/CSSPropertyAnimation.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/SVGRenderStyle.cpp
Source/WebCore/rendering/style/SVGRenderStyle.h
Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp
Source/WebCore/rendering/style/SVGRenderStyleDefs.h
Source/WebCore/rendering/svg/RenderSVGRect.cpp
Source/WebCore/rendering/svg/SVGPathData.cpp
Source/WebCore/svg/SVGAnimateElement.cpp
Source/WebCore/svg/SVGAnimationElement.cpp
Source/WebCore/svg/SVGElement.cpp
Source/WebCore/svg/SVGFilterElement.cpp
Source/WebCore/svg/SVGForeignObjectElement.cpp
Source/WebCore/svg/SVGImageElement.cpp
Source/WebCore/svg/SVGLengthContext.cpp
Source/WebCore/svg/SVGMaskElement.cpp
Source/WebCore/svg/SVGPatternElement.cpp
Source/WebCore/svg/SVGRectElement.cpp
Source/WebCore/svg/SVGSVGElement.cpp
Source/WebCore/svg/SVGTextPositioningElement.cpp
Source/WebCore/svg/SVGTextPositioningElement.h