2011-07-29 Rob Buis <rbuis@rim.com>
authorrwlbuis@webkit.org <rwlbuis@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Jul 2011 03:22:56 +0000 (03:22 +0000)
committerrwlbuis@webkit.org <rwlbuis@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Jul 2011 03:22:56 +0000 (03:22 +0000)
commit44f2898a1ec7bff0797fa5300d1ac2d985d28507
treeac914eb6f8b04f62542ebef2569c3edd26abf73e
parent2b02d56603ad2a2f771d342046af2b1ef24a4070
2011-07-29  Rob Buis  <rbuis@rim.com>

        URL references are completely broken in SVG
        https://bugs.webkit.org/show_bug.cgi?id=63283

        Reviewed by Nikolas Zimmermann.

        Change SVGURIElement::getTarget to be more strict about iri resolving and make it serve as a central
        place to resolve a iri to a SVGElement. The iri can be same-document or external, for now we only handle
        the former, the latter will be handled in bug 65344.
        Accept as same-document if the iri combined with the base uri equals the document url (ignoring
        the fragment identifier). For convenience a method is added to lookup the element, if found.

        Tests: svg/custom/external-paintserver-reference.svg
               svg/custom/linking-base-external-reference.xhtml
               svg/custom/uri-reference-handling.svg

        * css/CSSCursorImageValue.cpp:
        (WebCore::resourceReferencedByCursorElement):
        (WebCore::CSSCursorImageValue::~CSSCursorImageValue):
        (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed):
        * css/CSSFontFaceSource.cpp:
        (WebCore::CSSFontFaceSource::getFontData):
        * css/CSSFontSelector.h:
        (WebCore::CSSFontSelector::document):
        * css/SVGCSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::applySVGProperty):
        * rendering/svg/RenderSVGTextPath.cpp:
        (WebCore::RenderSVGTextPath::layoutPath):
        * rendering/svg/SVGResources.cpp:
        (WebCore::targetReferenceFromResource):
        (WebCore::paintingResourceFromSVGPaint):
        * svg/SVGAltGlyphElement.cpp:
        (WebCore::SVGAltGlyphElement::hasValidGlyphElements):
        * svg/SVGFEImageElement.cpp:
        (WebCore::SVGFEImageElement::requestImageResource):
        (WebCore::SVGFEImageElement::build):
        * svg/SVGGlyphRefElement.cpp:
        (WebCore::SVGGlyphRefElement::hasValidGlyphElement):
        * svg/SVGLinearGradientElement.cpp:
        (WebCore::SVGLinearGradientElement::collectGradientAttributes):
        * svg/SVGMPathElement.cpp:
        (WebCore::SVGMPathElement::pathElement):
        * svg/SVGPaint.cpp:
        (WebCore::SVGPaint::matchesTargetURI):
        * svg/SVGPatternElement.cpp:
        (WebCore::SVGPatternElement::collectPatternAttributes):
        * svg/SVGRadialGradientElement.cpp:
        (WebCore::SVGRadialGradientElement::collectGradientAttributes):
        * svg/SVGTRefElement.cpp:
        (WebCore::SVGTRefElement::updateReferencedText):
        (WebCore::SVGTRefElement::svgAttributeChanged):
        (WebCore::SVGTRefElement::buildPendingResource):
        * svg/SVGTextPathElement.cpp:
        (WebCore::SVGTextPathElement::insertedIntoDocument):
        * svg/SVGURIReference.cpp:
        (WebCore::SVGURIReference::fragmentIdentifierFromIRIString):
        (WebCore::SVGURIReference::targetElementFromIRIString):
        * svg/SVGURIReference.h:
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::buildPendingResource):
        (WebCore::SVGUseElement::hasCycleUseReferencing):
        (WebCore::SVGUseElement::expandUseElementsInShadowTree):
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::targetElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@92047 268f45cc-cd09-0410-ab3c-d52691b4dbfc
62 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/svg/W3C-SVG-1.1/struct-use-05-b-expected.txt
LayoutTests/platform/mac/svg/batik/filters/feTile-expected.txt
LayoutTests/platform/mac/svg/batik/filters/filterRegions-expected.txt
LayoutTests/platform/mac/svg/batik/masking/maskRegions-expected.txt
LayoutTests/platform/mac/svg/batik/paints/gradientLimit-expected.txt
LayoutTests/platform/mac/svg/batik/paints/patternPreserveAspectRatioA-expected.txt
LayoutTests/platform/mac/svg/batik/paints/patternRegionA-expected.txt
LayoutTests/platform/mac/svg/batik/paints/patternRegions-expected.txt
LayoutTests/platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.txt
LayoutTests/platform/mac/svg/batik/text/longTextOnPath-expected.txt
LayoutTests/platform/mac/svg/batik/text/smallFonts-expected.txt
LayoutTests/platform/mac/svg/batik/text/textAnchor-expected.txt
LayoutTests/platform/mac/svg/batik/text/textDecoration-expected.txt
LayoutTests/platform/mac/svg/batik/text/textEffect-expected.txt
LayoutTests/platform/mac/svg/batik/text/textEffect2-expected.txt
LayoutTests/platform/mac/svg/batik/text/textEffect3-expected.txt
LayoutTests/platform/mac/svg/batik/text/textFeatures-expected.txt
LayoutTests/platform/mac/svg/batik/text/textLayout-expected.txt
LayoutTests/platform/mac/svg/batik/text/textLayout2-expected.txt
LayoutTests/platform/mac/svg/batik/text/textLength-expected.txt
LayoutTests/platform/mac/svg/batik/text/textOnPath-expected.txt
LayoutTests/platform/mac/svg/batik/text/textOnPathSpaces-expected.txt
LayoutTests/platform/mac/svg/batik/text/textPosition-expected.txt
LayoutTests/platform/mac/svg/batik/text/textPosition2-expected.txt
LayoutTests/platform/mac/svg/batik/text/textProperties-expected.txt
LayoutTests/platform/mac/svg/batik/text/textProperties2-expected.txt
LayoutTests/platform/mac/svg/batik/text/textStyles-expected.txt
LayoutTests/platform/mac/svg/batik/text/verticalText-expected.txt
LayoutTests/platform/mac/svg/batik/text/verticalTextOnPath-expected.txt
LayoutTests/platform/mac/svg/hixie/error/014-expected.txt
LayoutTests/platform/mac/svg/hixie/use/002-expected.txt
LayoutTests/svg/custom/external-paintserver-reference-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/external-paintserver-reference-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/external-paintserver-reference.svg [new file with mode: 0644]
LayoutTests/svg/custom/linking-base-external-reference-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/linking-base-external-reference-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/linking-base-external-reference.xhtml [new file with mode: 0644]
LayoutTests/svg/custom/uri-reference-handling-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/uri-reference-handling-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/uri-reference-handling.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSCursorImageValue.cpp
Source/WebCore/css/CSSFontFaceSource.cpp
Source/WebCore/css/CSSFontSelector.h
Source/WebCore/css/SVGCSSStyleSelector.cpp
Source/WebCore/rendering/svg/RenderSVGTextPath.cpp
Source/WebCore/rendering/svg/SVGResources.cpp
Source/WebCore/svg/SVGAltGlyphElement.cpp
Source/WebCore/svg/SVGFEImageElement.cpp
Source/WebCore/svg/SVGGlyphRefElement.cpp
Source/WebCore/svg/SVGLinearGradientElement.cpp
Source/WebCore/svg/SVGMPathElement.cpp
Source/WebCore/svg/SVGPaint.cpp
Source/WebCore/svg/SVGPatternElement.cpp
Source/WebCore/svg/SVGRadialGradientElement.cpp
Source/WebCore/svg/SVGTRefElement.cpp
Source/WebCore/svg/SVGTextPathElement.cpp
Source/WebCore/svg/SVGURIReference.cpp
Source/WebCore/svg/SVGURIReference.h
Source/WebCore/svg/SVGUseElement.cpp
Source/WebCore/svg/animation/SVGSMILElement.cpp