Changeset 58187 in webkit


Ignore:
Timestamp:
Apr 23, 2010 1:39:38 PM (14 years ago)
Author:
morrita@google.com
Message:

2010-04-23 MORITA Hajime <morrita@google.com>

Reviewed by Nikolas Zimmermann.

https://bugs.webkit.org/show_bug.cgi?id=37187
SVG <use href="foo"> is interpreted as <use href="#foo">

getTarget() did return url parameter as is if doesn't have
fragment identifier. So fixed to return empty string in such case
because we need to distinguish "yyy.html" from "xxx.svg#yyy.html".


Test: svg/custom/broken-internal-references.svg

  • svg/SVGElement.cpp: (WebCore::SVGElement::insertedIntoDocument):
  • svg/SVGURIReference.cpp: (WebCore::SVGURIReference::getTarget):

2010-04-23 MORITA Hajime <morrita@google.com>

Reviewed by Nikolas Zimmermann.

https://bugs.webkit.org/show_bug.cgi?id=37187
SVG <use href="foo"> is interpreted as <use href="#foo">

  • platform/mac/svg/custom/broken-internal-references-expected.checksum: Added.
  • platform/mac/svg/custom/broken-internal-references-expected.png: Added.
  • platform/mac/svg/custom/broken-internal-references-expected.txt: Added.
  • svg/custom/broken-internal-references.svg: Added.
  • svg/dynamic-updates/SVGTRefElement-dom-href-attr-expected.txt:
  • svg/dynamic-updates/script-tests/SVGTRefElement-dom-href-attr.js: (executeTest): Updated to follow this fix. href value should be an URL, not an id.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r58182 r58187  
     12010-04-23  MORITA Hajime  <morrita@google.com>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=37187
     6        SVG <use href="foo"> is interpreted as <use href="#foo">
     7
     8        * platform/mac/svg/custom/broken-internal-references-expected.checksum: Added.
     9        * platform/mac/svg/custom/broken-internal-references-expected.png: Added.
     10        * platform/mac/svg/custom/broken-internal-references-expected.txt: Added.
     11        * svg/custom/broken-internal-references.svg: Added.
     12        * svg/dynamic-updates/SVGTRefElement-dom-href-attr-expected.txt:
     13        * svg/dynamic-updates/script-tests/SVGTRefElement-dom-href-attr.js:
     14        (executeTest): Updated to follow this fix. href value should be an URL, not an id.
     15
    1162010-04-23  Adam Langley  <agl@chromium.org>
    217
  • trunk/LayoutTests/svg/dynamic-updates/SVGTRefElement-dom-href-attr-expected.txt

    r52960 r58187  
    99
    1010
    11 PASS trefElement.getAttributeNS('http://www.w3.org/1999/xlink', 'href') is "testFail"
     11PASS trefElement.getAttributeNS('http://www.w3.org/1999/xlink', 'href') is "#testFail"
    1212PASS textElement.textContent is "Test failed"
    13 PASS trefElement.getAttributeNS('http://www.w3.org/1999/xlink', 'href') is "testPass"
     13PASS trefElement.getAttributeNS('http://www.w3.org/1999/xlink', 'href') is "#testPass"
    1414PASS textElement.textContent is "Test passed"
    1515PASS successfullyParsed is true
  • trunk/LayoutTests/svg/dynamic-updates/script-tests/SVGTRefElement-dom-href-attr.js

    r52960 r58187  
    2323
    2424var trefElement = createSVGElement("tref");
    25 trefElement.setAttributeNS(xlinkNS, "xlink:href", "testFail");
     25trefElement.setAttributeNS(xlinkNS, "xlink:href", "#testFail");
    2626textElement.appendChild(trefElement);   
    2727
    28 shouldBeEqualToString("trefElement.getAttributeNS('" + xlinkNS + "', 'href')", "testFail");
     28shouldBeEqualToString("trefElement.getAttributeNS('" + xlinkNS + "', 'href')", "#testFail");
    2929shouldBeEqualToString("textElement.textContent", "Test failed");
    3030
    3131function executeTest() {
    32     trefElement.setAttributeNS(xlinkNS, "xlink:href", "testPass");
    33     shouldBeEqualToString("trefElement.getAttributeNS('" + xlinkNS + "', 'href')", "testPass");
     32    trefElement.setAttributeNS(xlinkNS, "xlink:href", "#testPass");
     33    shouldBeEqualToString("trefElement.getAttributeNS('" + xlinkNS + "', 'href')", "#testPass");
    3434    shouldBeEqualToString("textElement.textContent", "Test passed");
    3535
  • trunk/WebCore/ChangeLog

    r58186 r58187  
     12010-04-23  MORITA Hajime  <morrita@google.com>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=37187
     6        SVG <use href="foo"> is interpreted as <use href="#foo">
     7
     8        getTarget() did return url parameter as is if doesn't have
     9        fragment identifier. So fixed to return empty string in such case
     10        because we need to distinguish "yyy.html" from "xxx.svg#yyy.html".
     11       
     12        Test: svg/custom/broken-internal-references.svg
     13
     14        * svg/SVGElement.cpp:
     15        (WebCore::SVGElement::insertedIntoDocument):
     16        * svg/SVGURIReference.cpp:
     17        (WebCore::SVGURIReference::getTarget):
     18
    1192010-04-23  Simon Fraser  <simon.fraser@apple.com>
    220
  • trunk/WebCore/svg/SVGElement.cpp

    r56402 r58187  
    282282    SVGDocumentExtensions* extensions = document()->accessSVGExtensions();
    283283
    284     String resourceId = SVGURIReference::getTarget(getAttribute(idAttributeName()));
     284    String resourceId = getAttribute(idAttributeName());
    285285    if (extensions->isPendingResource(resourceId)) {
    286286        OwnPtr<HashSet<SVGStyledElement*> > clients(extensions->removePendingResource(resourceId));
  • trunk/WebCore/svg/SVGURIReference.cpp

    r53879 r58187  
    6161        unsigned int start = url.find('#') + 1;
    6262        return url.substring(start, url.length() - start);
    63     } else // Normal Reference, ie. style="color-profile:changeColor"
    64         return url;
     63    } else // The url doesn't have any target.
     64        return String();
    6565}
    6666
Note: See TracChangeset for help on using the changeset viewer.