Changeset 171591 in webkit


Ignore:
Timestamp:
Jul 25, 2014 2:52:25 AM (10 years ago)
Author:
krit@webkit.org
Message:

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.
Location:
trunk
Files:
3 added
1 deleted
29 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r171588 r171591  
     12014-07-24  Dirk Schulze  <krit@webkit.org>
     2
     3        Turn x/y to presentation attributes
     4        https://bugs.webkit.org/show_bug.cgi?id=135215
     5
     6        Test parsing of x and y attributes. Rendering and SVG animation
     7        covered by existing tests.
     8        CSS Transition test, test transition from specified attribute value
     9        to new property value.
     10
     11        Reviewed by Dean Jackson.
     12
     13        * svg/css/parse-length-expected.txt: Added.
     14        * svg/css/parse-length.html: Renamed from LayoutTests/svg/css/parse-width.html.
     15        * svg/css/parse-width-expected.txt: Removed.
     16        * transitions/svg-layout-transition-expected.txt: Added.
     17        * transitions/svg-layout-transition.html: Added.
     18
    1192014-07-24  Yusuke Suzuki  <utatane.tea@gmail.com>
    220
  • trunk/LayoutTests/svg/css/parse-length.html

    r171588 r171591  
    1010<script src="../../resources/js-test-pre.js"></script>
    1111<script>
    12 description("Test that 'with' presentation attribute is parsed with CSS presentation rules.");
     12description("Test that 'width' presentation attribute is parsed with CSS presentation rules.");
    1313
    1414function computedStyle(property, value) {
     
    2929}
    3030
    31 // test mask-image
     31function negativeTestZero(property, value) {
     32    testComputed(property, value, "0px");
     33}
     34
     35// Test 'width'.
    3236testComputed("width", "auto", "auto");
    3337testComputed("width", "  100", "100px");
     
    4145// testComputed("width", "1vw", "14.029999732971191px");
    4246
    43 // negative tests
     47// Test 'x'.
     48testComputed("x", "  100", "100px");
     49testComputed("x", "100   ", "100px");
     50testComputed("x", "100px", "100px");
     51testComputed("x", "1em", "16px");
     52testComputed("x", "1ex", "12.800000190734863px");
     53testComputed("x", "20%", "20%");
     54testComputed("x", "-200px", "-200px");
     55
     56// Test 'y'.
     57testComputed("y", "  100", "100px");
     58testComputed("y", "100   ", "100px");
     59testComputed("y", "100px", "100px");
     60testComputed("y", "1em", "16px");
     61testComputed("y", "1ex", "12.800000190734863px");
     62testComputed("y", "20%", "20%");
     63testComputed("y", "-200px", "-200px");
     64
     65// Negative tests for 'width'.
    4466negativeTest("width", "100   px");
    4567negativeTest("width", "100px;");
     
    4870negativeTest("width", "-100px");
    4971
     72// Negative tests for 'x'.
     73negativeTestZero("x", "auto", "auto");
     74negativeTestZero("x", "100   px");
     75negativeTestZero("x", "100px;");
     76negativeTestZero("x", "100px !important");
     77negativeTestZero("x", "{ 100px }");
     78
     79// Negative tests for 'y'.
     80negativeTestZero("y", "auto");
     81negativeTestZero("y", "100   px");
     82negativeTestZero("y", "100px;");
     83negativeTestZero("y", "100px !important");
     84negativeTestZero("y", "{ 100px }");
    5085</script>
    5186<script src="../../resources/js-test-post.js"></script>
  • trunk/Source/WebCore/ChangeLog

    r171588 r171591  
     12014-07-24  Dirk Schulze  <krit@webkit.org>
     2
     3        Turn x/y to presentation attributes
     4        https://bugs.webkit.org/show_bug.cgi?id=135215
     5
     6        Reviewed by Dean Jackson.
     7
     8        This follows the patch for width and height presentation attributes and
     9        turns x and y to presentation attributes as well:
     10
     11        http://trac.webkit.org/changeset/171341
     12
     13        Tests: svg/css/parse-length.html
     14               transitions/svg-layout-transition.html
     15
     16        Added copyright where I forgot it in previous patch.
     17
     18        * css/CSSComputedStyleDeclaration.cpp: Computed style of x and y.
     19        (WebCore::ComputedStyleExtractor::propertyValue):
     20        * css/CSSParser.cpp:
     21        (WebCore::isSimpleLengthPropertyID): Add x and y to list.
     22        * css/DeprecatedStyleBuilder.cpp:
     23        (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder): Resolve x and y.
     24        * css/SVGCSSParser.cpp:
     25        (WebCore::CSSParser::parseSVGValue): Parse x and y property.
     26        * css/SVGCSSPropertyNames.in: Add x and y to list of names.
     27        * css/StyleResolver.h:
     28        * page/animation/CSSPropertyAnimation.cpp: Animate x and y as Length.
     29        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
     30        * rendering/style/RenderStyle.h: Add x and y setters and getters.
     31        * rendering/style/SVGRenderStyle.cpp: Add x and y setters for StyleLayoutData.
     32        (WebCore::SVGRenderStyle::SVGRenderStyle):
     33        (WebCore::SVGRenderStyle::operator==):
     34        (WebCore::SVGRenderStyle::copyNonInheritedFrom):
     35        (WebCore::SVGRenderStyle::diff):
     36        * rendering/style/SVGRenderStyle.h:
     37        (WebCore::SVGRenderStyle::setX):
     38        (WebCore::SVGRenderStyle::setY):
     39        (WebCore::SVGRenderStyle::x):
     40        (WebCore::SVGRenderStyle::y):
     41        * rendering/style/SVGRenderStyleDefs.cpp: Add StyleLayoutData for style storing.
     42        (WebCore::StyleLayoutData::StyleLayoutData):
     43        (WebCore::StyleLayoutData::copy):
     44        (WebCore::StyleLayoutData::operator==):
     45        * rendering/style/SVGRenderStyleDefs.h:
     46        (WebCore::StyleLayoutData::create):
     47        (WebCore::StyleLayoutData::operator!=):
     48        * rendering/svg/RenderSVGRect.cpp:
     49        (WebCore::RenderSVGRect::updateShapeFromElement):
     50        * rendering/svg/SVGPathData.cpp: Use RenderStyle values rather than attribute values.
     51        (WebCore::updatePathFromRectElement):
     52        * svg/SVGAnimationElement.cpp:
     53        (WebCore::SVGAnimationElement::isTargetAttributeCSSProperty): Fix text detection.
     54        * svg/SVGElement.cpp: Add x and y to the relevant property lists.
     55        (WebCore::populateAttributeNameToCSSPropertyIDMap):
     56        (WebCore::populateCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap):
     57        * svg/SVGFilterElement.cpp: Style update on change of x and y.
     58        (WebCore::SVGFilterElement::svgAttributeChanged):
     59        * svg/SVGMaskElement.cpp: Ditto.
     60        (WebCore::SVGMaskElement::svgAttributeChanged):
     61        * svg/SVGPatternElement.cpp: Ditto.
     62        (WebCore::SVGPatternElement::svgAttributeChanged):
     63        * svg/SVGRectElement.cpp: Ditto.
     64        (WebCore::SVGRectElement::svgAttributeChanged):
     65        * svg/SVGTextPositioningElement.cpp: Exclude x and y of text elements since they
     66            are lists instead of individual values. Solution about to be discussed
     67            in the WG. Keep current behavior for now.
     68        (WebCore::SVGTextPositioningElement::collectStyleForPresentationAttribute):
     69        (WebCore::SVGTextPositioningElement::isPresentationAttribute):
     70        * svg/SVGTextPositioningElement.h:
     71
    1722014-07-24  Yusuke Suzuki  <utatane.tea@gmail.com>
    273
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r171341 r171591  
    429429    CSSPropertyGlyphOrientationVertical,
    430430    CSSPropertyWebkitSvgShadow,
    431     CSSPropertyVectorEffect
     431    CSSPropertyVectorEffect,
     432    CSSPropertyX,
     433    CSSPropertyY
    432434};
    433435
     
    28982900            break;
    28992901
     2902        // New positioning properties for SVG.
     2903        case CSSPropertyX:
     2904            return zoomAdjustedPixelValueForLength(style->svgStyle().x(), style.get());
     2905        case CSSPropertyY:
     2906            return zoomAdjustedPixelValueForLength(style->svgStyle().y(), style.get());
     2907
    29002908        /* Unimplemented CSS 3 properties (including CSS3 shorthand properties) */
    29012909        case CSSPropertyWebkitTextEmphasis:
  • trunk/Source/WebCore/css/CSSParser.cpp

    r171010 r171591  
    570570    case CSSPropertyWebkitMarginEnd:
    571571    case CSSPropertyWebkitMarginStart:
     572    case CSSPropertyX:
     573    case CSSPropertyY:
    572574        acceptsNegativeNumbers = true;
    573575        return true;
  • trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp

    r171341 r171591  
    25942594    // UAs must treat 'word-wrap' as an alternate name for the 'overflow-wrap' property. So using the same handlers.
    25952595    setPropertyHandler(CSSPropertyWordWrap, ApplyPropertyDefault<EOverflowWrap, &RenderStyle::overflowWrap, EOverflowWrap, &RenderStyle::setOverflowWrap, EOverflowWrap, &RenderStyle::initialOverflowWrap>::createHandler());
     2596
     2597    setPropertyHandler(CSSPropertyX, ApplyPropertyLength<&RenderStyle::x, &RenderStyle::setX, &RenderStyle::initialZeroLength>::createHandler());
     2598    setPropertyHandler(CSSPropertyY, ApplyPropertyLength<&RenderStyle::y, &RenderStyle::setY, &RenderStyle::initialZeroLength>::createHandler());
     2599
    25962600    setPropertyHandler(CSSPropertyZIndex, ApplyPropertyAuto<int, &RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex>::createHandler());
    25972601    setPropertyHandler(CSSPropertyZoom, ApplyPropertyZoom::createHandler());
  • trunk/Source/WebCore/css/SVGCSSParser.cpp

    r165676 r171591  
    300300        return true;
    301301    }
     302    case CSSPropertyX:
     303    case CSSPropertyY:
     304        valid_primitive = (!id && validUnit(value, FLength | FPercent));
     305        break;
    302306    default:
    303307        // If you crash here, it's because you added a css property and are not handling it
  • trunk/Source/WebCore/css/SVGCSSPropertyNames.in

    r163440 r171591  
    5252
    5353-webkit-svg-shadow
     54
     55x
     56y
     57
  • trunk/Source/WebCore/css/StyleResolver.h

    r171341 r171591  
    8989class StyleSheetList;
    9090class StyledElement;
     91class SVGSVGElement;
    9192class ViewportStyleResolver;
    9293class WebKitCSSFilterValue;
  • trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp

    r170774 r171591  
    12571257        new PropertyWrapper<float>(CSSPropertyStrokeMiterlimit, &RenderStyle::strokeMiterLimit, &RenderStyle::setStrokeMiterLimit),
    12581258
     1259        new LengthPropertyWrapper<Length>(CSSPropertyX, &RenderStyle::x, &RenderStyle::setX),
     1260        new LengthPropertyWrapper<Length>(CSSPropertyY, &RenderStyle::y, &RenderStyle::setY),
     1261
    12591262        new PropertyWrapper<float>(CSSPropertyFloodOpacity, &RenderStyle::floodOpacity, &RenderStyle::setFloodOpacity),
    12601263        new PropertyWrapperMaybeInvalidColor(CSSPropertyFloodColor, &RenderStyle::floodColor, &RenderStyle::setFloodColor),
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r171588 r171591  
    16331633    void setStrokeMiterLimit(float f) { accessSVGStyle().setStrokeMiterLimit(f); }
    16341634
     1635    const Length& x() const { return svgStyle().x(); }
     1636    void setX(Length x) { accessSVGStyle().setX(x); }
     1637    const Length& y() const { return svgStyle().y(); }
     1638    void setY(Length y) { accessSVGStyle().setY(y); }
     1639
    16351640    float floodOpacity() const { return svgStyle().floodOpacity(); }
    16361641    void setFloodOpacity(float f) { accessSVGStyle().setFloodOpacity(f); }
     
    17881793    static Length initialPadding() { return Length(Fixed); }
    17891794    static Length initialTextIndent() { return Length(Fixed); }
     1795    static Length initialZeroLength() { return Length(Fixed); }
    17901796#if ENABLE(CSS3_TEXT)
    17911797    static TextIndentLine initialTextIndentLine() { return TextIndentFirstLine; }
  • trunk/Source/WebCore/rendering/style/SVGRenderStyle.cpp

    r165676 r171591  
    5757    , misc(defaultSVGStyle().misc)
    5858    , shadowSVG(defaultSVGStyle().shadowSVG)
     59    , layout(defaultSVGStyle().layout)
    5960    , resources(defaultSVGStyle().resources)
    6061{
     
    7071    , misc(StyleMiscData::create())
    7172    , shadowSVG(StyleShadowSVGData::create())
     73    , layout(StyleLayoutData::create())
    7274    , resources(StyleResourceData::create())
    7375{
     
    8688    , misc(other.misc)
    8789    , shadowSVG(other.shadowSVG)
     90    , layout(other.layout)
    8891    , resources(other.resources)
    8992{
     
    107110        && misc == other.misc
    108111        && shadowSVG == other.shadowSVG
     112        && layout == other.layout
    109113        && inheritedResources == other.inheritedResources
    110114        && resources == other.resources
     
    141145    misc = other->misc;
    142146    shadowSVG = other->shadowSVG;
     147    layout = other->layout;
    143148    resources = other->resources;
    144149}
     
    223228    if (shadowSVG != other->shadowSVG)
    224229        return StyleDifferenceLayout;
     230
     231    // The x or y properties require relayout.
     232    if (layout != other->layout)
     233        return StyleDifferenceLayout;
    225234
    226235    // Some stroke properties, requires relayouts, as the cached stroke boundaries need to be recalculated.
  • trunk/Source/WebCore/rendering/style/SVGRenderStyle.h

    r170774 r171591  
    44    Copyright (C) 2005, 2006 Apple Inc.
    55    Copyright (C) Research In Motion Limited 2010. All rights reserved.
     6    Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
    67
    78    This library is free software; you can redistribute it and/or
     
    146147    void setMaskType(EMaskType val) { svg_noninherited_flags.f.maskType = val; }
    147148    void setPaintOrder(PaintOrder val) { svg_inherited_flags.paintOrder = val; }
     149    void setX(const Length& obj)
     150    {
     151        if (!(layout->x == obj))
     152            layout.access()->x = obj;
     153    }
     154    void setY(const Length& obj)
     155    {
     156        if (!(layout->y == obj))
     157            layout.access()->y = obj;
     158    }
    148159
    149160    void setFillOpacity(float obj)
     
    343354    SVGLength baselineShiftValue() const { return misc->baselineShiftValue; }
    344355    ShadowData* shadow() const { return shadowSVG->shadow.get(); }
     356    const Length& x() const { return layout->x; }
     357    const Length& y() const { return layout->y; }
    345358    String clipperResource() const { return resources->clipper; }
    346359    String filterResource() const { return resources->filter; }
     
    441454    DataRef<StyleMiscData> misc;
    442455    DataRef<StyleShadowSVGData> shadowSVG;
     456    DataRef<StyleLayoutData> layout;
    443457    DataRef<StyleResourceData> resources;
    444458
  • trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp

    r165676 r171591  
    33                  2004, 2005, 2007 Rob Buis <buis@kde.org>
    44    Copyright (C) Research In Motion Limited 2010. All rights reserved.
     5    Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
    56
    67    Based on khtml code by:
     
    277278}
    278279
    279 }
     280StyleLayoutData::StyleLayoutData()
     281    : x(RenderStyle::initialZeroLength())
     282    , y(RenderStyle::initialZeroLength())
     283{
     284}
     285
     286inline StyleLayoutData::StyleLayoutData(const StyleLayoutData& other)
     287    : RefCounted<StyleLayoutData>()
     288    , x(other.x)
     289    , y(other.y)
     290{
     291}
     292
     293PassRef<StyleLayoutData> StyleLayoutData::copy() const
     294{
     295    return adoptRef(*new StyleLayoutData(*this));
     296}
     297
     298bool StyleLayoutData::operator==(const StyleLayoutData& other) const
     299{
     300    return x == other.x
     301        && y == other.y;
     302}
     303
     304}
  • trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.h

    r165676 r171591  
    33                  2004, 2005 Rob Buis <buis@kde.org>
    44    Copyright (C) Research In Motion Limited 2010. All rights reserved.
     5    Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
    56
    67    Based on khtml code by:
     
    2930#define SVGRenderStyleDefs_h
    3031
     32#include "Length.h"
    3133#include "SVGLength.h"
    3234#include "SVGPaint.h"
     
    289291    };
    290292
     293    // Positioning and sizing properties.
     294    class StyleLayoutData : public RefCounted<StyleLayoutData> {
     295    public:
     296        static PassRef<StyleLayoutData> create() { return adoptRef(*new StyleLayoutData); }
     297        PassRef<StyleLayoutData> copy() const;
     298
     299        bool operator==(const StyleLayoutData&) const;
     300        bool operator!=(const StyleLayoutData& other) const
     301        {
     302            return !(*this == other);
     303        }
     304
     305        Length x;
     306        Length y;
     307
     308    private:       
     309        StyleLayoutData();
     310        StyleLayoutData(const StyleLayoutData&);
     311    };
     312
    291313} // namespace WebCore
    292314
  • trunk/Source/WebCore/rendering/svg/RenderSVGRect.cpp

    r171341 r171591  
    7474    }
    7575
    76     m_fillBoundingBox = FloatRect(FloatPoint(rectElement().x().value(lengthContext), rectElement().y().value(lengthContext)), boundingBoxSize);
     76    m_fillBoundingBox = FloatRect(FloatPoint(lengthContext.valueForLength(style().svgStyle().x(), LengthModeWidth),
     77        lengthContext.valueForLength(style().svgStyle().y(), LengthModeHeight)),
     78        boundingBoxSize);
    7779
    7880    // To decide if the stroke contains a point we create two rects which represent the inner and
  • trunk/Source/WebCore/rendering/svg/SVGPathData.cpp

    r171341 r171591  
    120120    if (height <= 0)
    121121        return;
    122     float x = rect->x().value(lengthContext);
    123     float y = rect->y().value(lengthContext);
     122    float x = lengthContext.valueForLength(style.svgStyle().x(), LengthModeWidth);
     123    float y = lengthContext.valueForLength(style.svgStyle().y(), LengthModeHeight);
    124124    float rx = rect->rx().value(lengthContext);
    125125    float ry = rect->ry().value(lengthContext);
  • trunk/Source/WebCore/svg/SVGAnimateElement.cpp

    r171341 r171591  
    44 * Copyright (C) 2008 Apple Inc. All rights reserved.
    55 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
     6 * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
    67 *
    78 * This library is free software; you can redistribute it and/or
  • trunk/Source/WebCore/svg/SVGAnimationElement.cpp

    r171341 r171591  
    66 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
    77 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
     8 * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
    89 *
    910 * This library is free software; you can redistribute it and/or
     
    356357bool SVGAnimationElement::isTargetAttributeCSSProperty(SVGElement* element, const QualifiedName& attributeName)
    357358{
    358     // FIXME: Must be isSVGTextPositioningElement(element) instead.
    359     if (isSVGTextElement(element)
     359    if (element->isTextContent()
    360360        && (attributeName == SVGNames::xAttr || attributeName == SVGNames::yAttr))
    361361        return false;
  • trunk/Source/WebCore/svg/SVGElement.cpp

    r171341 r171591  
    145145        &word_spacingAttr,
    146146        &writing_modeAttr,
     147        &xAttr,
     148        &yAttr,
    147149    };
    148150
     
    245247        { SVGNames::heightAttr, AnimatedLength },
    246248        { SVGNames::widthAttr, AnimatedLength },
     249        { xAttr, AnimatedLength },
     250        { yAttr, AnimatedLength },
    247251    };
    248252
  • trunk/Source/WebCore/svg/SVGFilterElement.cpp

    r171341 r171591  
    55 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
    66 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
     7 * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
    78 *
    89 * This library is free software; you can redistribute it and/or
     
    169170    SVGElementInstance::InvalidationGuard invalidationGuard(this);
    170171
    171     if (attrName == SVGNames::widthAttr
     172    if (attrName == SVGNames::xAttr
     173        || attrName == SVGNames::yAttr
     174        || attrName == SVGNames::widthAttr
    172175        || attrName == SVGNames::heightAttr) {
    173176        invalidateSVGPresentationAttributeStyle();
    174177        return;
    175178    }
    176 
    177     if (attrName == SVGNames::xAttr
    178         || attrName == SVGNames::yAttr)
    179         updateRelativeLengthsInformation();
    180179
    181180    if (RenderObject* object = renderer())
  • trunk/Source/WebCore/svg/SVGForeignObjectElement.cpp

    r171341 r171591  
    22 * Copyright (C) 2006 Apple Inc. All rights reserved.
    33 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
     4 * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
    45 *
    56 * This library is free software; you can redistribute it and/or
  • trunk/Source/WebCore/svg/SVGImageElement.cpp

    r171341 r171591  
    33 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Rob Buis <buis@kde.org>
    44 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>
     5 * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
    56 *
    67 * This library is free software; you can redistribute it and/or
  • trunk/Source/WebCore/svg/SVGLengthContext.cpp

    r171341 r171591  
    44 * Copyright (C) 2007 Apple Inc. All rights reserved.
    55 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
     6 * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
    67 *
    78 * This library is free software; you can redistribute it and/or
  • trunk/Source/WebCore/svg/SVGMaskElement.cpp

    r171341 r171591  
    55 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
    66 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
     7 * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
    78 *
    89 * This library is free software; you can redistribute it and/or
     
    136137    SVGElementInstance::InvalidationGuard invalidationGuard(this);
    137138
    138     if (attrName == SVGNames::widthAttr
     139    if (attrName == SVGNames::xAttr
     140        || attrName == SVGNames::yAttr
     141        || attrName == SVGNames::widthAttr
    139142        || attrName == SVGNames::heightAttr) {
    140143        invalidateSVGPresentationAttributeStyle();
    141144        return;
    142145    }
    143 
    144     if (attrName == SVGNames::xAttr
    145         || attrName == SVGNames::yAttr)
    146         updateRelativeLengthsInformation();
    147146
    148147    if (RenderObject* object = renderer())
  • trunk/Source/WebCore/svg/SVGPatternElement.cpp

    r171341 r171591  
    33 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
    44 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
     5 * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
    56 *
    67 * This library is free software; you can redistribute it and/or
     
    161162    SVGElementInstance::InvalidationGuard invalidationGuard(this);
    162163
    163     if (attrName == SVGNames::widthAttr
     164    if (attrName == SVGNames::xAttr
     165        || attrName == SVGNames::yAttr
     166        || attrName == SVGNames::widthAttr
    164167        || attrName == SVGNames::heightAttr) {
    165168        invalidateSVGPresentationAttributeStyle();
    166169        return;
    167170    }
    168 
    169     if (attrName == SVGNames::xAttr
    170         || attrName == SVGNames::yAttr)
    171         updateRelativeLengthsInformation();
    172171
    173172    if (RenderObject* object = renderer())
  • trunk/Source/WebCore/svg/SVGRectElement.cpp

    r171341 r171591  
    22 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org>
    33 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
     4 * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
    45 *
    56 * This library is free software; you can redistribute it and/or
     
    122123    SVGElementInstance::InvalidationGuard invalidationGuard(this);
    123124
    124     if (attrName == SVGNames::widthAttr
     125    if (attrName == SVGNames::xAttr
     126        || attrName == SVGNames::yAttr
     127        || attrName == SVGNames::widthAttr
    125128        || attrName == SVGNames::heightAttr) {
    126129        invalidateSVGPresentationAttributeStyle();
     
    128131    }
    129132
    130     bool isLengthAttribute = attrName == SVGNames::xAttr
    131                           || attrName == SVGNames::yAttr
    132                           || attrName == SVGNames::rxAttr
     133    bool isLengthAttribute = attrName == SVGNames::rxAttr
    133134                          || attrName == SVGNames::ryAttr;
    134135
  • trunk/Source/WebCore/svg/SVGSVGElement.cpp

    r171341 r171591  
    33 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org>
    44 * Copyright (C) 2007 Apple Inc. All rights reserved.
     5 * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
    56 *
    67 * This library is free software; you can redistribute it and/or
  • trunk/Source/WebCore/svg/SVGTextPositioningElement.cpp

    r168469 r171591  
    22 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
    33 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org>
     4 * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
    45 *
    56 * This library is free software; you can redistribute it and/or
     
    118119}
    119120
     121void SVGTextPositioningElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStyleProperties& style)
     122{
     123    if (name == SVGNames::xAttr || name == SVGNames::yAttr)
     124        return;
     125    SVGTextContentElement::collectStyleForPresentationAttribute(name, value, style);
     126}
     127
     128bool SVGTextPositioningElement::isPresentationAttribute(const QualifiedName& name) const
     129{
     130    if (name == SVGNames::xAttr || name == SVGNames::yAttr)
     131        return false;
     132    return SVGTextContentElement::isPresentationAttribute(name);
     133}
     134
    120135void SVGTextPositioningElement::svgAttributeChanged(const QualifiedName& attrName)
    121136{
  • trunk/Source/WebCore/svg/SVGTextPositioningElement.h

    r163440 r171591  
    3535    SVGTextPositioningElement(const QualifiedName&, Document&);
    3636
     37    virtual bool isPresentationAttribute(const QualifiedName&) const override final;
     38    virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) override final;
    3739    bool isSupportedAttribute(const QualifiedName&);
    3840    virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
Note: See TracChangeset for help on using the changeset viewer.