Changeset 110692 in webkit
- Timestamp:
- Mar 14, 2012, 5:00:44 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r110690 r110692 1 2012-03-14 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 External <use> xlink:href references do not work 4 https://bugs.webkit.org/show_bug.cgi?id=12499 5 6 Reviewed by Zoltan Herczeg. 7 8 Rebaseline tests after r110676 using Generic RGB Profile on Lion, and update them after my fixes. 9 Replace xml:id with id everywhere, to make the new tiny tests work. 10 11 * platform/mac/svg/W3C-SVG-1.2-Tiny/struct-use-recursion-02-t-expected.png: 12 * platform/mac/svg/W3C-SVG-1.2-Tiny/struct-use-recursion-02-t-expected.txt: 13 * platform/mac/svg/W3C-SVG-1.2-Tiny/struct-use-recursion-03-t-expected.png: 14 * platform/mac/svg/W3C-SVG-1.2-Tiny/struct-use-recursion-03-t-expected.txt: 15 * platform/mac/svg/batik/filters/feTile-expected.png: 16 * platform/mac/svg/batik/filters/filterRegions-expected.png: 17 * platform/mac/svg/batik/text/textEffect-expected.png: 18 * platform/mac/svg/batik/text/textEffect3-expected.png: 19 * platform/mac/svg/dynamic-updates/SVGUseElement-svgdom-href1-prop-expected.png: 20 * svg/W3C-SVG-1.2-Tiny/struct-use-recursion-01-t.svg: 21 * svg/W3C-SVG-1.2-Tiny/struct-use-recursion-02-t.svg: 22 * svg/W3C-SVG-1.2-Tiny/struct-use-recursion-03-t.svg: 23 * svg/custom/use-external-crash-expected.txt: Added. 24 * svg/custom/use-external-crash.svg: Added. 25 1 26 2012-03-14 Ádám Kallai <kadam@inf.u-szeged.hu> 2 27 -
trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.2-Tiny/struct-use-recursion-02-t-expected.txt
r110676 r110692 4 4 RenderSVGRoot {svg} at (0,0) size 800x600 5 5 RenderSVGHiddenContainer {defs} at (0,0) size 0x0 6 RenderSVGContainer {g} at (150,25) size 484x4527 RenderSVGContainer {g} at (150,25) size 34x346 RenderSVGContainer {g} at (150,25) size 502x452 7 RenderSVGContainer {g} at (150,25) size 502x77 8 8 RenderSVGPath {circle} at (150,25) size 34x34 [fill={[type=SOLID] [color=#FF7F00]}] [cx=100.00] [cy=25.00] [r=10.00] 9 RenderSVGContainer {use} at (0,0) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,25.00)}] 9 RenderSVGContainer {use} at (614,64) size 38x38 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,25.00)}] 10 RenderSVGContainer {g} at (614,64) size 38x38 11 RenderSVGContainer {g} at (0,0) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,25.00)}] 12 RenderSVGPath {circle} at (614,64) size 38x38 [stroke={[type=SOLID] [color=#808080] [stroke width=2.00] [line cap=ROUND] [dash array={4.00}]}] [fill={[type=SOLID] [color=#FFFF00]}] [cx=380.00] [cy=25.00] [r=10.00] 10 13 RenderSVGText {text} at (100,257) size 280x28 contains 1 chunk(s) 11 14 RenderSVGInlineText {#text} at (0,0) size 280x28 -
trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.2-Tiny/struct-use-recursion-03-t-expected.txt
r110676 r110692 4 4 RenderSVGRoot {svg} at (0,0) size 800x600 5 5 RenderSVGHiddenContainer {defs} at (0,0) size 0x0 6 RenderSVGContainer {g} at (166,25) size 484x452 7 RenderSVGContainer {g} at (616,25) size 34x34 8 RenderSVGContainer {use} at (0,0) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,25.00)}] 6 RenderSVGContainer {g} at (148,25) size 502x452 7 RenderSVGContainer {g} at (148,25) size 502x77 8 RenderSVGContainer {use} at (148,64) size 37x38 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,25.00)}] 9 RenderSVGContainer {g} at (148,64) size 37x38 10 RenderSVGPath {circle} at (148,64) size 37x38 [stroke={[type=SOLID] [color=#808080] [stroke width=2.00] [line cap=ROUND] [dash array={4.00}]}] [fill={[type=SOLID] [color=#FF7F00]}] [cx=100.00] [cy=25.00] [r=10.00] 11 RenderSVGContainer {g} at (0,0) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,25.00)}] 9 12 RenderSVGPath {circle} at (616,25) size 34x34 [fill={[type=SOLID] [color=#FFFF00]}] [cx=380.00] [cy=25.00] [r=10.00] 10 13 RenderSVGText {text} at (100,257) size 280x28 contains 1 chunk(s) -
trunk/LayoutTests/svg/W3C-SVG-1.2-Tiny/struct-use-recursion-01-t.svg
r110676 r110692 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <svg version="1.2" baseProfile="tiny" xml:id="svg-root" width="100%" height="100%"2 <svg version="1.2" baseProfile="tiny" id="svg-root" width="100%" height="100%" 3 3 viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg" 4 4 xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xe="http://www.w3.org/2001/xml-events"> … … 22 22 </d:OperatorScript> 23 23 </SVGTestCase> 24 <title xml:id="test-title">$RCSfile: struct-use-recursion-01-t.svg,v $</title>24 <title id="test-title">$RCSfile: struct-use-recursion-01-t.svg,v $</title> 25 25 <defs> 26 26 <font-face … … 32 32 </font-face> 33 33 </defs> 34 <g xml:id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">34 <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> 35 35 36 <g xml:id="group-1">37 <circle xml:id="circle-1" cx='100' cy='25' r='10' fill='#FF7F00' />38 <use xml:id="use-1" x="0" y="25" xlink:href="#group-2" stroke="gray" stroke-width="2" stroke-dasharray="4" stroke-linecap="round"/>36 <g id="group-1"> 37 <circle id="circle-1" cx='100' cy='25' r='10' fill='#FF7F00' /> 38 <use id="use-1" x="0" y="25" xlink:href="#group-2" stroke="gray" stroke-width="2" stroke-dasharray="4" stroke-linecap="round"/> 39 39 </g> 40 <g xml:id="group-2">41 <circle xml:id="circle-2" cx='380' cy='25' r='10' fill='#FFFF00' />42 <use xml:id="use-2" x="0" y="25" xlink:href="#group-1" stroke="gray" stroke-width="2" stroke-dasharray="4" stroke-linecap="round"/>40 <g id="group-2"> 41 <circle id="circle-2" cx='380' cy='25' r='10' fill='#FFFF00' /> 42 <use id="use-2" x="0" y="25" xlink:href="#group-1" stroke="gray" stroke-width="2" stroke-dasharray="4" stroke-linecap="round"/> 43 43 </g> 44 44 45 <text xml:id="pass" x="240" y="280" text-anchor="middle" fill="green" font-size="24">This text should be visible.</text>45 <text id="pass" x="240" y="280" text-anchor="middle" fill="green" font-size="24">This text should be visible.</text> 46 46 47 47 </g> 48 48 <g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> 49 <text xml:id="revision" x="10" y="340" stroke="none"49 <text id="revision" x="10" y="340" stroke="none" 50 50 fill="black">$Revision: 1.5 $</text> 51 51 </g> 52 <rect xml:id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>52 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> 53 53 54 54 </svg> -
trunk/LayoutTests/svg/W3C-SVG-1.2-Tiny/struct-use-recursion-02-t.svg
r110676 r110692 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <svg version="1.2" baseProfile="tiny" xml:id="svg-root" width="100%" height="100%"2 <svg version="1.2" baseProfile="tiny" id="svg-root" width="100%" height="100%" 3 3 viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg" 4 4 xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xe="http://www.w3.org/2001/xml-events"> … … 25 25 </d:OperatorScript> 26 26 </SVGTestCase> 27 <title xml:id="test-title">$RCSfile: struct-use-recursion-02-t.svg,v $</title>27 <title id="test-title">$RCSfile: struct-use-recursion-02-t.svg,v $</title> 28 28 <defs> 29 29 <font-face … … 35 35 </font-face> 36 36 </defs> 37 <g xml:id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">37 <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> 38 38 39 <g xml:id="group-1">40 <circle xml:id="circle-1" cx='100' cy='25' r='10' fill='#FF7F00' />41 <use xml:id="use-1" x="0" y="25" xlink:href="struct-use-recursion-03-t.svg#group-2" stroke="gray" stroke-width="2" stroke-dasharray="4" stroke-linecap="round"/>39 <g id="group-1"> 40 <circle id="circle-1" cx='100' cy='25' r='10' fill='#FF7F00' /> 41 <use id="use-1" x="0" y="25" xlink:href="struct-use-recursion-03-t.svg#group-2" stroke="gray" stroke-width="2" stroke-dasharray="4" stroke-linecap="round"/> 42 42 </g> 43 43 44 <text xml:id="pass" x="240" y="280" text-anchor="middle" fill="green" font-size="24">This text should be visible.</text>44 <text id="pass" x="240" y="280" text-anchor="middle" fill="green" font-size="24">This text should be visible.</text> 45 45 46 46 </g> 47 47 <g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> 48 <text xml:id="revision" x="10" y="340" stroke="none"48 <text id="revision" x="10" y="340" stroke="none" 49 49 fill="black">$Revision: 1.5 $</text> 50 50 </g> 51 <rect xml:id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>51 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> 52 52 53 53 </svg> -
trunk/LayoutTests/svg/W3C-SVG-1.2-Tiny/struct-use-recursion-03-t.svg
r110676 r110692 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <svg version="1.2" baseProfile="tiny" xml:id="svg-root" width="100%" height="100%"2 <svg version="1.2" baseProfile="tiny" id="svg-root" width="100%" height="100%" 3 3 viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg" 4 4 xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xe="http://www.w3.org/2001/xml-events"> … … 25 25 </d:OperatorScript> 26 26 </SVGTestCase> 27 <title xml:id="test-title">$RCSfile: struct-use-recursion-03-t.svg,v $</title>27 <title id="test-title">$RCSfile: struct-use-recursion-03-t.svg,v $</title> 28 28 <defs> 29 29 <font-face … … 35 35 </font-face> 36 36 </defs> 37 <g xml:id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">37 <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> 38 38 39 <g xml:id="group-2">40 <use xml:id="use-2" x="0" y="25" xlink:href="struct-use-recursion-02-t.svg#group-1" stroke="gray" stroke-width="2" stroke-dasharray="4" stroke-linecap="round"/>41 <circle xml:id="circle-2" cx='380' cy='25' r='10' fill='#FFFF00' />39 <g id="group-2"> 40 <use id="use-2" x="0" y="25" xlink:href="struct-use-recursion-02-t.svg#group-1" stroke="gray" stroke-width="2" stroke-dasharray="4" stroke-linecap="round"/> 41 <circle id="circle-2" cx='380' cy='25' r='10' fill='#FFFF00' /> 42 42 </g> 43 43 44 <text xml:id="pass" x="240" y="280" text-anchor="middle" fill="green" font-size="24">This text should be visible.</text>44 <text id="pass" x="240" y="280" text-anchor="middle" fill="green" font-size="24">This text should be visible.</text> 45 45 46 46 </g> 47 47 <g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> 48 <text xml:id="revision" x="10" y="340" stroke="none"48 <text id="revision" x="10" y="340" stroke="none" 49 49 fill="black">$Revision: 1.5 $</text> 50 50 </g> 51 <rect xml:id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>51 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> 52 52 53 53 </svg> -
trunk/Source/WebCore/ChangeLog
r110691 r110692 1 2012-03-14 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 External <use> xlink:href references do not work 4 https://bugs.webkit.org/show_bug.cgi?id=12499 5 6 Reviewed by Zoltan Herczeg. 7 8 Follow-up fix after r110676. 9 Assertions are firing due last minute changes in isExternalURIReference. 10 11 Fix detecting local resources properly, when the given iri contains a /complex/path. 12 Use document->completeURL() instead, and compare with the document->url() to decide 13 if its a local reference or not. 14 15 If an external document load fails with an error (eg. file missing) don't assert 16 in debug builds, instead handle it gracefully. 17 18 I decided to clean the code up as well, to make it more safe & obvious. 19 20 Test: svg/custom/use-external-crash.svg 21 22 * svg/SVGURIReference.cpp: 23 (WebCore::SVGURIReference::targetElementFromIRIString): 24 * svg/SVGURIReference.h: 25 (WebCore::SVGURIReference::isExternalURIReference): 26 * svg/SVGUseElement.cpp: 27 (WebCore::SVGUseElement::externalDocument): 28 (WebCore::SVGUseElement::buildPendingResource): 29 1 30 2012-03-14 Lars Knudsen <lars.knudsen@nokia.com> 2 31 -
trunk/Source/WebCore/svg/SVGURIReference.cpp
r110676 r110692 88 88 return 0; 89 89 90 // If we're requesting an external resources, and externalDocument is non-zero, the load already succeeded.91 // Go ahead and check if the externalDocuments URL matches the expected URL, that we resolved using the92 // host document before in urlFromIRIStringWithFragmentIdentifier(). For internal resources, the same93 // assumption must hold true, just with the host documents URL, not the external documents URL.94 if (!equalIgnoringFragmentIdentifier(url, externalDocument ? externalDocument->url() : document->url()))95 return 0;96 97 90 if (fragmentIdentifier) 98 91 *fragmentIdentifier = id; … … 101 94 return 0; 102 95 103 if (externalDocument) 96 if (externalDocument) { 97 // Enforce that the referenced url matches the url of the document that we've loaded for it! 98 ASSERT(equalIgnoringFragmentIdentifier(url, externalDocument->url())); 104 99 return externalDocument->getElementById(id); 100 } 101 102 // Exit early if the referenced url is external, and we have no externalDocument given. 105 103 if (isExternalURIReference(iri, document)) 106 return 0; // Non-existing external resource104 return 0; 107 105 108 106 return document->getElementById(id); -
trunk/Source/WebCore/svg/SVGURIReference.h
r110676 r110692 43 43 static Element* targetElementFromIRIString(const String&, Document*, String* = 0, Document* = 0); 44 44 45 static inline bool isExternalURIReference(const String& uri, Document* baseDocument)45 static inline bool isExternalURIReference(const String& uri, Document* document) 46 46 { 47 if (uri.startsWith("#")) 47 // If the URI matches our documents URL, early exit, we're dealing with a local reference. 48 ASSERT(document); 49 KURL url = document->completeURL(uri); 50 if (equalIgnoringFragmentIdentifier(url, document->url())) 48 51 return false; 49 52 50 size_t startOfFragmentIdentifier = uri.find('#'); 51 // If the target document is the base document but its path is given in format href="thisDocument.svg#targetTag" 52 // then we should handle it as internal. 53 if (uri.substring(0, startOfFragmentIdentifier) != baseDocument->url().lastPathComponent()) 54 return true; 55 return false; 53 // If the URI doesn't contain a base string, just see if it starts with a fragment-identifier. 54 return uri.find('#') != notFound; 56 55 } 57 56 -
trunk/Source/WebCore/svg/SVGUseElement.cpp
r110676 r110692 199 199 { 200 200 if (m_cachedDocument && m_cachedDocument->isLoaded()) { 201 // Gracefully handle error condition. 202 if (m_cachedDocument->errorOccurred()) 203 return 0; 201 204 ASSERT(m_cachedDocument->document()); 202 205 return m_cachedDocument->document(); … … 401 404 Element* target = SVGURIReference::targetElementFromIRIString(href(), document(), &id, externalDocument()); 402 405 if (!target) { 406 // If we can't find the target of an external element, just give up. 407 // We can't observe if the target somewhen enters the external document, nor should we do it. 408 if (externalDocument()) 409 return; 403 410 if (hasPendingResources() || id.isEmpty()) 404 411 return;
Note:
See TracChangeset
for help on using the changeset viewer.