Changeset 251499 in webkit


Ignore:
Timestamp:
Oct 23, 2019 2:22:40 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

[SVG2] Fix SVGElement to conform with SVG2
https://bugs.webkit.org/show_bug.cgi?id=203280

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-10-23
Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

  • web-platform-tests/svg/historical-expected.txt:

Some sub-tests are now passing with this change.

Source/WebCore:

The interface of SVGElement is defined here:

https://www.w3.org/TR/SVG2/types.html#InterfaceSVGElement.

-- Remove SVGElement.getPresentationAttribute.
-- Remove the SVGElement attributes xmllang and xmlspace.
-- Remove the class SVGLangSpace

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • svg/SVGComponentTransferFunctionElement.cpp:

(WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged):
Fix a bug. This function was calling SVGLangSpace::isKnownAttribute()
instead of calling PropertyRegistry::isKnownAttribute().

  • svg/SVGElement.cpp:

(WebCore::SVGElement::SVGElement):
(WebCore::SVGElement::parseAttribute):
(WebCore::SVGElement::svgAttributeChanged):
(WebCore::SVGElement::getPresentationAttribute): Deleted.

  • svg/SVGElement.h:
  • svg/SVGElement.idl:
  • svg/SVGFilterPrimitiveStandardAttributes.cpp:

(WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged):
Fix a bug. This function was calling SVGLangSpace::isKnownAttribute()
instead of calling PropertyRegistry::isKnownAttribute().

  • svg/SVGLangSpace.cpp: Removed.
  • svg/SVGLangSpace.h: Removed.
  • svg/SVGUseElement.cpp:

(WebCore::SVGUseElement::svgAttributeChanged):

LayoutTests:

  • platform/gtk/svg/custom/getPresentationAttribute-expected.png: Removed.
  • platform/gtk/svg/custom/getPresentationAttribute-expected.txt: Removed.
  • platform/ios/svg/custom/getPresentationAttribute-expected.txt: Removed.
  • platform/mac/svg/custom/getPresentationAttribute-expected.png: Removed.
  • platform/mac/svg/custom/getPresentationAttribute-expected.txt: Removed.
  • platform/mac/svg/custom/getPresentationAttribute-modify-expected.png: Removed.
  • platform/win/svg/custom/getPresentationAttribute-expected.txt: Removed.
  • platform/wincairo/svg/custom/getPresentationAttribute-expected.txt: Removed.
  • platform/wpe/svg/custom/getPresentationAttribute-expected.txt: Removed.
  • svg/custom/getPresentationAttribute.svg: Removed.
  • svg/custom/path-getPresentationAttribute-crash-expected.txt: Removed.
  • svg/custom/path-getPresentationAttribute-crash.html: Removed.

SVGElement.getPresentationAttribute has to be removed.

Location:
trunk
Files:
14 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r251495 r251499  
     12019-10-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        [SVG2] Fix SVGElement to conform with SVG2
     4        https://bugs.webkit.org/show_bug.cgi?id=203280
     5
     6        Reviewed by Simon Fraser.
     7
     8        * platform/gtk/svg/custom/getPresentationAttribute-expected.png: Removed.
     9        * platform/gtk/svg/custom/getPresentationAttribute-expected.txt: Removed.
     10        * platform/ios/svg/custom/getPresentationAttribute-expected.txt: Removed.
     11        * platform/mac/svg/custom/getPresentationAttribute-expected.png: Removed.
     12        * platform/mac/svg/custom/getPresentationAttribute-expected.txt: Removed.
     13        * platform/mac/svg/custom/getPresentationAttribute-modify-expected.png: Removed.
     14        * platform/win/svg/custom/getPresentationAttribute-expected.txt: Removed.
     15        * platform/wincairo/svg/custom/getPresentationAttribute-expected.txt: Removed.
     16        * platform/wpe/svg/custom/getPresentationAttribute-expected.txt: Removed.
     17        * svg/custom/getPresentationAttribute.svg: Removed.
     18        * svg/custom/path-getPresentationAttribute-crash-expected.txt: Removed.
     19        * svg/custom/path-getPresentationAttribute-crash.html: Removed.
     20        SVGElement.getPresentationAttribute has to be removed.
     21
    1222019-10-23  Chris Dumez  <cdumez@apple.com>
    223
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r251492 r251499  
     12019-10-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        [SVG2] Fix SVGElement to conform with SVG2
     4        https://bugs.webkit.org/show_bug.cgi?id=203280
     5
     6        Reviewed by Simon Fraser.
     7
     8        * web-platform-tests/svg/historical-expected.txt:
     9        Some sub-tests are now passing with this change.
     10
    1112019-10-23  Rob Buis  <rbuis@igalia.com>
    212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/svg/historical-expected.txt

    r251461 r251499  
    2222PASS SVGURIReference mixin interface must not be exposed
    2323PASS SVGZoomAndPan mixin interface must not be exposed
    24 FAIL SVGElement.prototype.getPresentationAttribute must be removed assert_false: expected false got true
     24PASS SVGElement.prototype.getPresentationAttribute must be removed
    2525PASS SVGElement.prototype.xmlbase must be removed
    26 FAIL SVGElement.prototype.xmllang must be removed assert_false: expected false got true
    27 FAIL SVGElement.prototype.xmlspace must be removed assert_false: expected false got true
     26PASS SVGElement.prototype.xmllang must be removed
     27PASS SVGElement.prototype.xmlspace must be removed
    2828FAIL SVGGraphicsElement.prototype.getTransformToElement must be removed assert_false: expected false got true
    2929FAIL SVGGraphicsElement.prototype.hasExtension must be removed assert_false: expected false got true
  • trunk/Source/WebCore/ChangeLog

    r251498 r251499  
     12019-10-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        [SVG2] Fix SVGElement to conform with SVG2
     4        https://bugs.webkit.org/show_bug.cgi?id=203280
     5
     6        Reviewed by Simon Fraser.
     7
     8        The interface of SVGElement is defined here:
     9            https://www.w3.org/TR/SVG2/types.html#InterfaceSVGElement.
     10
     11        -- Remove SVGElement.getPresentationAttribute.
     12        -- Remove the SVGElement attributes xmllang and xmlspace.
     13        -- Remove the class SVGLangSpace
     14
     15        * Sources.txt:
     16        * WebCore.xcodeproj/project.pbxproj:
     17        * svg/SVGComponentTransferFunctionElement.cpp:
     18        (WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged):
     19        Fix a bug. This function was calling SVGLangSpace::isKnownAttribute()
     20        instead of calling PropertyRegistry::isKnownAttribute().
     21
     22        * svg/SVGElement.cpp:
     23        (WebCore::SVGElement::SVGElement):
     24        (WebCore::SVGElement::parseAttribute):
     25        (WebCore::SVGElement::svgAttributeChanged):
     26        (WebCore::SVGElement::getPresentationAttribute): Deleted.
     27        * svg/SVGElement.h:
     28        * svg/SVGElement.idl:
     29        * svg/SVGFilterPrimitiveStandardAttributes.cpp:
     30        (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged):
     31        Fix a bug. This function was calling SVGLangSpace::isKnownAttribute()
     32        instead of calling PropertyRegistry::isKnownAttribute().
     33
     34        * svg/SVGLangSpace.cpp: Removed.
     35        * svg/SVGLangSpace.h: Removed.
     36        * svg/SVGUseElement.cpp:
     37        (WebCore::SVGUseElement::svgAttributeChanged):
     38
    1392019-10-22  Jiewen Tan  <jiewen_tan@apple.com>
    240
  • trunk/Source/WebCore/Sources.txt

    r251318 r251499  
    24152415svg/SVGImageElement.cpp
    24162416svg/SVGImageLoader.cpp
    2417 svg/SVGLangSpace.cpp
    24182417svg/SVGLengthContext.cpp
    24192418svg/SVGLengthValue.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r251488 r251499  
    34523452                B2227A2A0D00BF220071B782 /* SVGGradientElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278940D00BF200071B782 /* SVGGradientElement.h */; };
    34533453                B2227A2D0D00BF220071B782 /* SVGImageElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278970D00BF200071B782 /* SVGImageElement.h */; };
    3454                 B2227A300D00BF220071B782 /* SVGLangSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = B222789A0D00BF200071B782 /* SVGLangSpace.h */; };
    34553454                B2227A360D00BF220071B782 /* SVGLengthList.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278A00D00BF200071B782 /* SVGLengthList.h */; settings = {ATTRIBUTES = (Private, ); }; };
    34563455                B2227A390D00BF220071B782 /* SVGLinearGradientElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278A30D00BF200071B782 /* SVGLinearGradientElement.h */; };
     
    1234112340                B22278970D00BF200071B782 /* SVGImageElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGImageElement.h; sourceTree = "<group>"; };
    1234212341                B22278980D00BF200071B782 /* SVGImageElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGImageElement.idl; sourceTree = "<group>"; };
    12343                 B22278990D00BF200071B782 /* SVGLangSpace.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGLangSpace.cpp; sourceTree = "<group>"; };
    12344                 B222789A0D00BF200071B782 /* SVGLangSpace.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGLangSpace.h; sourceTree = "<group>"; };
    1234512342                B222789E0D00BF200071B782 /* SVGLength.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGLength.idl; sourceTree = "<group>"; };
    1234612343                B22278A00D00BF200071B782 /* SVGLengthList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGLengthList.h; sourceTree = "<group>"; };
     
    2437724374                                B28C6A200D00C44800334AA4 /* SVGImageLoader.cpp */,
    2437824375                                B28C6A210D00C44800334AA4 /* SVGImageLoader.h */,
    24379                                 B22278990D00BF200071B782 /* SVGLangSpace.cpp */,
    24380                                 B222789A0D00BF200071B782 /* SVGLangSpace.h */,
    2438124376                                7CE58D511DD7B09300128552 /* SVGLength.h */,
    2438224377                                B222789E0D00BF200071B782 /* SVGLength.idl */,
     
    3219232187                                0854B01F1255E4E600B9CDD0 /* SVGInlineFlowBox.h in Headers */,
    3219332188                                0854B0211255E4E600B9CDD0 /* SVGInlineTextBox.h in Headers */,
    32194                                 B2227A300D00BF220071B782 /* SVGLangSpace.h in Headers */,
    3219532189                                7134496E146941B300720312 /* SVGLengthContext.h in Headers */,
    3219632190                                B2227A360D00BF220071B782 /* SVGLengthList.h in Headers */,
  • trunk/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp

    r246490 r251499  
    9191void SVGComponentTransferFunctionElement::svgAttributeChanged(const QualifiedName& attrName)
    9292{
    93     if (isKnownAttribute(attrName)) {
     93    if (PropertyRegistry::isKnownAttribute(attrName)) {
    9494        InstanceInvalidationGuard guard(*this);
    9595        invalidateFilterPrimitiveParent(this);
  • trunk/Source/WebCore/svg/SVGElement.cpp

    r251290 r251499  
    161161SVGElement::SVGElement(const QualifiedName& tagName, Document& document)
    162162    : StyledElement(tagName, document, CreateSVGElement)
    163     , SVGLangSpace(this)
    164163    , m_propertyAnimatorFactory(makeUnique<SVGPropertyAnimatorFactory>())
    165164{
     
    355354        return;
    356355    }
    357 
    358     SVGLangSpace::parseAttribute(name, value);
    359356}
    360357
     
    835832        return;
    836833    }
    837 
    838     SVGLangSpace::svgAttributeChanged(attrName);
    839834}
    840835
     
    879874}
    880875
    881 RefPtr<DeprecatedCSSOMValue> SVGElement::getPresentationAttribute(const String& name)
    882 {
    883     if (!hasAttributesWithoutUpdate())
    884         return 0;
    885 
    886     QualifiedName attributeName(nullAtom(), name, nullAtom());
    887     const Attribute* attribute = findAttributeByName(attributeName);
    888     if (!attribute)
    889         return 0;
    890 
    891     auto style = MutableStyleProperties::create(SVGAttributeMode);
    892     CSSPropertyID propertyID = cssPropertyIdForSVGAttributeName(attribute->name());
    893     style->setProperty(propertyID, attribute->value());
    894     auto cssValue = style->getPropertyCSSValue(propertyID);
    895     if (!cssValue)
    896         return nullptr;
    897     return cssValue->createDeprecatedCSSOMWrapper(style->ensureCSSStyleDeclaration());
    898 }
    899 
    900876bool SVGElement::instanceUpdatesBlocked() const
    901877{
  • trunk/Source/WebCore/svg/SVGElement.h

    r251290 r251499  
    2424
    2525#include "SVGAnimatedPropertyImpl.h"
    26 #include "SVGLangSpace.h"
    2726#include "SVGLocatable.h"
    2827#include "SVGNames.h"
     
    4847void mapAttributeToCSSProperty(HashMap<AtomStringImpl*, CSSPropertyID>* propertyNameToIdMap, const QualifiedName& attrName);
    4948
    50 class SVGElement : public StyledElement, public SVGLangSpace, public SVGPropertyOwner {
     49class SVGElement : public StyledElement, public SVGPropertyOwner {
    5150    WTF_MAKE_ISO_ALLOCATED(SVGElement);
    5251public:
     
    5756
    5857    String title() const override;
    59     RefPtr<DeprecatedCSSOMValue> getPresentationAttribute(const String& name);
    6058    virtual bool supportsMarkers() const { return false; }
    6159    bool hasRelativeLengths() const { return !m_elementsWithRelativeLengths.isEmpty(); }
  • trunk/Source/WebCore/svg/SVGElement.idl

    r249212 r251499  
    2424    JSGenerateToNativeObject,
    2525] interface SVGElement : Element {
    26     readonly attribute SVGSVGElement ownerSVGElement;
    27     readonly attribute SVGElement viewportElement;
    28 
    29     attribute DOMString xmllang;
    30     attribute DOMString xmlspace;
    3126
    3227    readonly attribute SVGAnimatedString className;
    3328
    34     // FIXME: Using "undefined" as default parameter value is wrong.
    35     // This method is deprecated, and we'd like to remove it someday.
    36     DeprecatedCSSOMValue getPresentationAttribute(optional DOMString name = "undefined");
     29    readonly attribute SVGSVGElement? ownerSVGElement;
     30    readonly attribute SVGElement? viewportElement;
    3731};
    3832
  • trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp

    r249822 r251499  
    7676void SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(const QualifiedName& attrName)
    7777{
    78     if (isKnownAttribute(attrName)) {
     78    if (PropertyRegistry::isKnownAttribute(attrName)) {
    7979        InstanceInvalidationGuard guard(*this);
    8080        invalidate();
  • trunk/Source/WebCore/svg/SVGUseElement.cpp

    r251318 r251499  
    175175    }
    176176
    177     if (SVGLangSpace::isKnownAttribute(attrName))
    178         invalidateShadowTree();
    179 
    180177    SVGGraphicsElement::svgAttributeChanged(attrName);
    181178}
Note: See TracChangeset for help on using the changeset viewer.