https://bugs.webkit.org/show_bug.cgi?id=78084
Reviewed by Hajime Morita.
Source/WebCore:
SVGLoad event fires too early, making it impossible to use the vanilla repaint.js harness (runRepaintTest).
We're using a hack called runSVGRepaintTest() at the moment in trunk, which runs runRepaintTest() from a 0ms timer,
which is not reliable. The main difference between HTML onload and SVG onload is that HTMLs event is a "window event",
thus dispatched through DOMWindow (eg. <body onload="alert(event.target)" will yield Document,
<svg onload="alert(evt.target)"> will say SVGSVGElement).
Consider:
<svg onload="alert('1')>
<g onload="alert('2)">
<rect onload="alert('3')"/>
</svg>
As soon as the <rect> finishes parsing (SVGElement::finishedParsingChildren), it's SVGLoad event is fired.
So first you'll see '3', then '2', then '1'.
Using:
<svg onload="alert('1')>
<g onload="alert('2)">
<image xlink:href="someExternal.jpg" onload="alert('3')"/>
</svg>
will yield the same SVGLoad order. When using <image externalREsourcesRequired="true", first the '1' will fire,
then '3', then '2', all as expected and specified in SVG.
http://www.w3.org/TR/SVG/interact.html#LoadEvent says:
"The event is triggered at the point at which the user agent has fully parsed the element and its descendants and is
ready to act appropriately upon that element, such as being ready to render the element to the target device. Referenced
external resources that are required must be loaded, parsed and ready to render before the event is triggered. Optional
external resources are not required to be ready for the event to be triggered."
What we don't implement correctly is the second part of the first sentence: "and is ready to act appropriately upon that
element, such as being ready to render the element to the target device". We currently fire the SVGLoad event, right after
</svg> is seen, if no externalResourceRequired="true" attributes are set anywhere. This is not wrong, but not correct for
WebKit, as we're not yet "ready to render".
HTML fires its window onload event from Document::implicitClose(), where it calls Document::dispatchWindowLoadEvent.
At this point we're ready to render. So I'm now aligning the timing of the outermost <svg> elements SVGLoad event, to be
equal to HTML. This lets use use the repaint.js harness w/o any special SVG tricks.
Covered by existing tests.
* dom/Document.cpp:
(WebCore::Document::implicitClose): Dispatch SVGLoad event for outermost <svg> elements from here, as HTML does for its window onload event.
* svg/SVGDocumentExtensions.cpp:
(WebCore::SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements): Sends a SVGLoad event to all outermost <svg> elements in a document, if possible.
There can be multiple ones, if using <svg><foreignObject><svg>... - the <svg> in the <fO> also acts as outermost <svg> element.
* svg/SVGDocumentExtensions.h: Add new dispatchSVGLoadEventToOutermostSVGElements() helper.
* svg/SVGElement.cpp:
(WebCore::SVGElement::isOutermostSVGSVGElement): Moved from SVGSVGElement into SVGElement, and renamed from isOutermostSVG().
(WebCore::SVGElement::sendSVGLoadEventIfPossible): Don't dispatch load events to outermost <svg> elements, if Document::implicitClose() wasn't called yet.
(WebCore::SVGElement::finishParsingChildren): Stop using the default SVGLoad dispatching logic for outermost <svg> elements.
* svg/SVGElement.h: Add isOutermostSVGSVGElement().
* svg/SVGSVGElement.cpp: Rename isOutermostSVG to isOutermostSVGSVGElement.
(WebCore::SVGSVGElement::currentScale):
(WebCore::SVGSVGElement::setCurrentScale):
(WebCore::SVGSVGElement::localCoordinateSpaceTransform):
(WebCore::SVGSVGElement::createRenderer):
* svg/SVGSVGElement.h: Move isOutermostSVG() to SVGElement.
* svg/SVGStyledElement.cpp:
(WebCore::SVGStyledElement::title): Rename isOutermostSVG to isOutermostSVGSVGElement.
LayoutTests:
Remove runSVGRepaintTest() from repaint.js again, and convert all *.svg tests to use runRepaintTest() directly.
This is now possible as the outermost <svg> elements load event timing as aligned with HTML.
* fast/repaint/resources/repaint.js: Remove runSVGRepaintTest(), it's no longer needed.
(runRepaintTest): s/document.rootElement/document.documentElement/ to make it work for all HTML/XHTML and SVG documents (XHTML was broken).
* platform/chromium/test_expectations.txt:
* platform/mac/svg/custom/SVGPoint-matrixTransform-expected.png:
* platform/mac/svg/custom/SVGPoint-matrixTransform-expected.txt:
* platform/mac/svg/custom/getTransformToElement-expected.png:
* platform/mac/svg/custom/getTransformToElement-expected.txt:
* platform/mac/svg/custom/polyline-setattribute-points-null-expected.png:
* platform/mac/svg/custom/polyline-setattribute-points-null-expected.txt:
* platform/mac/svg/custom/text-ctm-expected.png:
* platform/mac/svg/custom/text-ctm-expected.txt:
* platform/mac/svg/custom/text-hit-test-expected.png:
* platform/mac/svg/custom/text-hit-test-expected.txt:
* platform/mac/svg/filters/filter-refresh-expected.png:
* svg/carto.net/tabgroup.svg:
* svg/carto.net/window.svg:
* svg/css/shadow-changes.svg:
* svg/custom/loadevents-externalresourcesrequired.svg:
* svg/dom/SVGPathSegList-segment-modification.svg:
* svg/dom/SVGPathSegList-xml-dom-synchronization2.xhtml:
* svg/dom/SVGRectElement/rect-modify-rx.svg:
* svg/filters/animate-fill.svg:
* svg/filters/feImage-reference-invalidation.svg:
* svg/filters/feImage-target-add-to-document.svg:
* svg/filters/feImage-target-changes-id.svg:
* svg/filters/feImage-target-id-change.svg:
* svg/filters/feImage-target-reappend-to-document.svg:
* svg/filters/feImage-target-remove-from-document.svg:
* svg/filters/filter-refresh.svg:
* svg/filters/filter-width-update.svg:
* svg/filters/invalidate-on-child-layout.svg:
* svg/hixie/perf/001.xml:
* svg/hixie/perf/002.xml:
* svg/hixie/perf/003.xml:
* svg/hixie/perf/004.xml:
* svg/hixie/perf/005.xml:
* svg/hixie/perf/006.xml:
* svg/hixie/perf/007.xml:
* svg/repaint/container-repaint.svg:
* svg/repaint/filter-child-repaint.svg:
* svg/repaint/image-href-change.svg:
* svg/repaint/image-with-clip-path.svg:
* svg/text/text-text-05-t.svg:
* svg/zoom/page/absolute-sized-document-no-scrollbars.svg:
* svg/zoom/page/absolute-sized-document-scrollbars.svg:
* svg/zoom/page/relative-sized-document-scrollbars.svg:
* svg/zoom/page/zoom-coords-viewattr-01-b.svg:
* svg/zoom/page/zoom-foreignObject.svg:
* svg/zoom/page/zoom-mask-with-percentages.svg:
* svg/zoom/resources/testPageZoom.js:
(repaintTest):
* svg/zoom/text/absolute-sized-document-no-scrollbars.svg:
* svg/zoom/text/absolute-sized-document-scrollbars.svg:
* svg/zoom/text/relative-sized-document-scrollbars.svg:
* svg/zoom/text/zoom-coords-viewattr-01-b.svg:
* svg/zoom/text/zoom-foreignObject.svg:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107057
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-08 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ SVGLoad event fires too early
+ https://bugs.webkit.org/show_bug.cgi?id=78084
+
+ Reviewed by Hajime Morita.
+
+ Remove runSVGRepaintTest() from repaint.js again, and convert all *.svg tests to use runRepaintTest() directly.
+ This is now possible as the outermost <svg> elements load event timing as aligned with HTML.
+
+ * fast/repaint/resources/repaint.js: Remove runSVGRepaintTest(), it's no longer needed.
+ (runRepaintTest): s/document.rootElement/document.documentElement/ to make it work for all HTML/XHTML and SVG documents (XHTML was broken).
+ * platform/chromium/test_expectations.txt:
+ * platform/mac/svg/custom/SVGPoint-matrixTransform-expected.png:
+ * platform/mac/svg/custom/SVGPoint-matrixTransform-expected.txt:
+ * platform/mac/svg/custom/getTransformToElement-expected.png:
+ * platform/mac/svg/custom/getTransformToElement-expected.txt:
+ * platform/mac/svg/custom/polyline-setattribute-points-null-expected.png:
+ * platform/mac/svg/custom/polyline-setattribute-points-null-expected.txt:
+ * platform/mac/svg/custom/text-ctm-expected.png:
+ * platform/mac/svg/custom/text-ctm-expected.txt:
+ * platform/mac/svg/custom/text-hit-test-expected.png:
+ * platform/mac/svg/custom/text-hit-test-expected.txt:
+ * platform/mac/svg/filters/filter-refresh-expected.png:
+ * svg/carto.net/tabgroup.svg:
+ * svg/carto.net/window.svg:
+ * svg/css/shadow-changes.svg:
+ * svg/custom/loadevents-externalresourcesrequired.svg:
+ * svg/dom/SVGPathSegList-segment-modification.svg:
+ * svg/dom/SVGPathSegList-xml-dom-synchronization2.xhtml:
+ * svg/dom/SVGRectElement/rect-modify-rx.svg:
+ * svg/filters/animate-fill.svg:
+ * svg/filters/feImage-reference-invalidation.svg:
+ * svg/filters/feImage-target-add-to-document.svg:
+ * svg/filters/feImage-target-changes-id.svg:
+ * svg/filters/feImage-target-id-change.svg:
+ * svg/filters/feImage-target-reappend-to-document.svg:
+ * svg/filters/feImage-target-remove-from-document.svg:
+ * svg/filters/filter-refresh.svg:
+ * svg/filters/filter-width-update.svg:
+ * svg/filters/invalidate-on-child-layout.svg:
+ * svg/hixie/perf/001.xml:
+ * svg/hixie/perf/002.xml:
+ * svg/hixie/perf/003.xml:
+ * svg/hixie/perf/004.xml:
+ * svg/hixie/perf/005.xml:
+ * svg/hixie/perf/006.xml:
+ * svg/hixie/perf/007.xml:
+ * svg/repaint/container-repaint.svg:
+ * svg/repaint/filter-child-repaint.svg:
+ * svg/repaint/image-href-change.svg:
+ * svg/repaint/image-with-clip-path.svg:
+ * svg/text/text-text-05-t.svg:
+ * svg/zoom/page/absolute-sized-document-no-scrollbars.svg:
+ * svg/zoom/page/absolute-sized-document-scrollbars.svg:
+ * svg/zoom/page/relative-sized-document-scrollbars.svg:
+ * svg/zoom/page/zoom-coords-viewattr-01-b.svg:
+ * svg/zoom/page/zoom-foreignObject.svg:
+ * svg/zoom/page/zoom-mask-with-percentages.svg:
+ * svg/zoom/resources/testPageZoom.js:
+ (repaintTest):
+ * svg/zoom/text/absolute-sized-document-no-scrollbars.svg:
+ * svg/zoom/text/absolute-sized-document-scrollbars.svg:
+ * svg/zoom/text/relative-sized-document-scrollbars.svg:
+ * svg/zoom/text/zoom-coords-viewattr-01-b.svg:
+ * svg/zoom/text/zoom-foreignObject.svg:
+
2012-02-07 Alexander Pavlov <apavlov@chromium.org>
Web Inspector: Closed computed style sidebar pane rebuilds, resulting in slowness
if (window.layoutTestController) {
if (document.body)
document.body.offsetTop;
- else if (document.rootElement)
- document.rootElement.offsetTop;
+ else if (document.documentElement)
+ document.documentElement.offsetTop;
layoutTestController.display();
repaintTest();
setTimeout(repaintTest, 100);
}
}
-
-function runSVGRepaintTest()
-{
- // The SVG onload event is fired earlier than the HTML load event. To make display() reliable,
- // call it from a timer, to simulate the same fire time as the HTML load event, until it's fixed.
- if (window.layoutTestController) {
- layoutTestController.waitUntilDone();
- setTimeout(runRepaintTest, 0);
- } else
- runRepaintTest();
-}
BUGWK77736 MAC WIN : svg/zoom/text/zoom-hixie-mixed-009.xml = IMAGE
BUGWK77736 : svg/zoom/text/zoom-hixie-rendering-model-004.xhtml = IMAGE+TEXT
+// SVGLoad event timing changes require some rebaselines.
+BUGWK78084 : svg/custom/SVGPoint-matrixTransform.svg = IMAGE+TEXT
+BUGWK78084 : svg/custom/getTransformToElement.svg = IMAGE+TEXT
+BUGWK78084 : svg/custom/polyline-setattribute-points-null.svg = IMAGE+TEXT
+BUGWK78084 : svg/custom/repaint-on-image-bounds-change.svg = IMAGE+TEXT
+BUGWK78084 : svg/custom/text-ctm.svg = IMAGE+TEXT
+BUGWK78084 : svg/custom/text-hit-test.svg = IMAGE+TEXT
+
BUGWK78038 DEBUG : compositing/iframes/invisible-nested-iframe-show.html = PASS CRASH
BUGWK78038 DEBUG : compositing/iframes/layout-on-compositing-change.html = PASS CRASH
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
- RenderSVGRoot {svg} at (40,10) size 86x38
- RenderSVGText {text} at (20,5) size 43x19 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,0) size 43x19
+ RenderSVGRoot {svg} at (40,12) size 86x36
+ RenderSVGText {text} at (20,6) size 43x18 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 43x18
chunk 1 text run 1 at (20.00,20.00) startOffset 0 endOffset 6 width 43.00: "Passed"
layer at (0,0) size 800x600
RenderSVGRoot {svg} at (20,56) size 101x157
RenderSVGContainer {g} at (0,0) size 0x0 [transform={m=((0.00,0.00)(0.00,0.00)) t=(0.00,0.00)}]
- RenderSVGContainer {g} at (20,56) size 42x18 [transform={m=((1.00,0.00)(0.00,1.00)) t=(15.00,15.00)}]
- RenderSVGText {text} at (50,123) size 84x34 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,0) size 84x34
- chunk 1 text run 1 at (50.00,150.00) startOffset 0 endOffset 6 width 84.00: "Passed"
+ RenderSVGContainer {g} at (20,56) size 41x18 [transform={m=((1.00,0.00)(0.00,1.00)) t=(15.00,15.00)}]
+ RenderSVGText {text} at (50,122) size 82x35 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 82x35
+ chunk 1 text run 1 at (50.00,150.00) startOffset 0 endOffset 6 width 82.00: "Passed"
RenderSVGContainer {g} at (49,141) size 72x72 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(0.00,0.00)}]
RenderSVGRect {rect} at (49,141) size 72x72 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,0.00)}] [x=50.00] [y=50.00] [width=70.00] [height=30.00]
-CONSOLE MESSAGE: line 20: Error: Problem parsing points="undefined"
+CONSOLE MESSAGE: line 1: Error: Problem parsing points="undefined"
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
- RenderSVGRoot {svg} at (100,70) size 86x38
- RenderSVGContainer {g} at (100,70) size 86x38 [transform={m=((1.00,0.00)(0.00,1.00)) t=(10.00,10.00)}]
- RenderSVGViewportContainer {svg} at (100,70) size 86x38
- RenderSVGText {text} at (70,55) size 43x19 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,0) size 43x19
+ RenderSVGRoot {svg} at (100,72) size 86x36
+ RenderSVGContainer {g} at (100,72) size 86x36 [transform={m=((1.00,0.00)(0.00,1.00)) t=(10.00,10.00)}]
+ RenderSVGViewportContainer {svg} at (100,72) size 86x36
+ RenderSVGText {text} at (70,56) size 43x18 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 43x18
chunk 1 text run 1 at (70.00,70.00) startOffset 0 endOffset 6 width 43.00: "Passed"
RenderSVGText {text} at (10,115) size 44x19 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,0) size 44x19
chunk 1 text run 1 at (10.00,130.00) startOffset 0 endOffset 7 width 43.50: "Status:"
- RenderSVGText {text} at (90,115) size 43x19 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,0) size 43x19
+ RenderSVGText {text} at (90,116) size 43x18 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 43x18
chunk 1 text run 1 at (90.00,130.00) startOffset 0 endOffset 6 width 43.00: "Passed"
caret: position 0 of child 0 {#text} of child 1 {text} of child 3 {g} of child 1 {svg} of document
<?xml version="1.0" encoding="UTF-8"?>
<?AdobeSVGViewer save="snapshot"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" viewBox="0 0 1024 768" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" viewBox="0 0 1024 768" onload="runRepaintTest()">
<script type="text/ecmascript" xlink:href="../../fast/repaint/resources/repaint.js"></script>
<script type="text/ecmascript" xlink:href="resources/helper_functions.js"></script>
<script type="text/ecmascript" xlink:href="resources/timer.js"></script>
//tabgroupTriangle.disableAllTabs();
//tabgroupTriangle.enableSingleTab(3);
//tabgroupTriangle.enableAllTabs();
- if (window.layoutTestController)
- layoutTestController.notifyDone();
}
function tabChanged(id,title,index) {
alert("tab nr "+index+" with title '"+title+"' was activated in tabgroup '"+id+"'");
>
]>
<?AdobeSVGViewer save="snapshot"?>
-<svg width="100%" height="100%" viewBox="0 0 1024 700" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:attrib="http://www.carto.net/attrib" xmlns:batik="http://xml.apache.org/batik/ext" onload="runSVGRepaintTest()">
+<svg width="100%" height="100%" viewBox="0 0 1024 700" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:attrib="http://www.carto.net/attrib" xmlns:batik="http://xml.apache.org/batik/ext" onload="runRepaintTest()">
<script type="text/ecmascript" xlink:href="../../fast/repaint/resources/repaint.js"></script>
<script type="text/ecmascript" xlink:href="resources/helper_functions.js"/>
<script type="text/ecmascript" xlink:href="resources/mapApp.js"/>
// to createCalled() were added to prevent a race in which the test may
// terminate before the final window decoration is added.
// See <https://bugs.webkit.org/show_bug.cgi?id=21531>.
+ if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
var numberOfWindows = 7;
var createCalls = 0;
<?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../fast/repaint/resources/repaint.js" type="text/javascript"></script>
<script type="text/javascript">
function repaintTest() {
var group = document.getElementsByTagName('g')[0];
group.style.WebkitSvgShadow = "rgba(64,64,64, 0.7) -9px -9px 6px";
- if (window.layoutTestController)
- layoutTestController.notifyDone();
}
</script>
<g id="svg-shadow-example" style="-webkit-svg-shadow: rgba(106,119,64, 0.7) 5px 5px 9px;">
var results = new Array();
function reportLoadEvent(el) {
- results.push(el.localName);
+ results.push(el.localName);
}
function runTest()
{
<?xml version="1.0"?>
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink='http://www.w3.org/1999/xlink' width="300px" height="300px" viewBox="0 0 300 300" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink='http://www.w3.org/1999/xlink' width="300px" height="300px" viewBox="0 0 300 300" onload="runRepaintTest()">
<script xlink:href="../../fast/repaint/resources/repaint.js" type="text/javascript"></script>
<script type="text/javascript">
function repaintTest() {
var moveSeg = segList.getItem(0); // This represents the M 80 40 segment (Move to)
moveSeg.x = 50;
moveSeg.y = 50;
- if (window.layoutTestController)
- layoutTestController.notifyDone();
}
</script>
<path id="smile" d="M 80 40 S 120 80 160 40" stroke="black" stroke-width="3" fill="none"/>
<?xml version="1.0" standalone="no"?>
-<svg width="600" height="500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg width="600" height="500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../fast/repaint/resources/repaint.js"></script>
<path d="M50,150 l45,-43 l24,64 l-69,-21z" fill="#FF0000" stroke="#000000" stroke-width="5"/>
<text x="10" y="20" style="font-weight:bold">Right after loading, a segment is added to the path.</text>
if(start_d == end_d) {
end.textContent += ' (failed)';
}
-
- if (window.layoutTestController)
- layoutTestController.notifyDone();
}
]]>
</script>
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../../fast/repaint/resources/repaint.js"></script>
<rect width='100' height='100' fill='red'/>
<rect id='r' width='100' height='100' rx='100' fill='green'/>
<script>
function repaintTest() {
document.getElementById('r').setAttributeNS(null, "rx", "0");
-
- if (window.layoutTestController)
- layoutTestController.notifyDone();
}
</script>
</svg>
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../fast/repaint/resources/repaint.js"></script>
<title>The rectangle should rapidly animate to green.</title>
<defs>
<script>
function repaintTest() {
document.getElementById('rect').setAttribute('fill', 'green');
-
- if (window.layoutTestController)
- layoutTestController.notifyDone();
}
</script>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../fast/repaint/resources/repaint.js"></script>
<title>There should be a single green square.</title>
<defs>
<![CDATA[
function repaintTest() {
document.getElementById("feimage").setAttributeNS("http://www.w3.org/1999/xlink", "href", "#rect2");
-
- if (window.layoutTestController)
- layoutTestController.notifyDone();
}
]]>
</script>
<?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../fast/repaint/resources/repaint.js"></script>
<title>There should be a single green 100x100 square.</title>
<defs>
var newFEImage = document.createElementNS("http://www.w3.org/2000/svg", "feImage");
newFEImage.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#green-rect");
document.getElementById("filter").appendChild(newFEImage);
-
- if (window.layoutTestController)
- layoutTestController.notifyDone();
}
]]>
</script>
<?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../fast/repaint/resources/repaint.js"></script>
<title>There should be a single green 100x100 square.</title>
<defs>
<![CDATA[
function repaintTest() {
document.getElementById("notexistant").setAttribute("id", "rect");
-
- if (window.layoutTestController)
- layoutTestController.notifyDone();
}
]]>
</script>
<?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../fast/repaint/resources/repaint.js"></script>
<title>There should be a single green 100x100 square.</title>
<defs>
<![CDATA[
function repaintTest() {
document.getElementById("feimage").setAttributeNS("http://www.w3.org/1999/xlink", "href", "#rect");
-
- if (window.layoutTestController)
- layoutTestController.notifyDone();
}
]]>
</script>
<?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../fast/repaint/resources/repaint.js"></script>
<title>There should be a single green 100x100 square.</title>
<defs>
var greenImage = document.getElementById("feimage-green");
document.getElementById("filter").removeChild(greenImage);
+ if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
setTimeout(function() {
document.getElementById("filter").appendChild(greenImage);
if (window.layoutTestController)
<?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../fast/repaint/resources/repaint.js"></script>
<title>There should be a single green 100x100 square.</title>
<defs>
<![CDATA[
function repaintTest() {
document.getElementById("filter").removeChild(document.getElementById("feimage-red"));
-
- if (window.layoutTestController)
- layoutTestController.notifyDone();
}
]]>
</script>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
- style="width:300px;height:400px" onload="runSVGRepaintTest()">
+ style="width:300px;height:400px" onload="runRepaintTest()">
<script xlink:href="../../fast/repaint/resources/repaint.js"></script>
<!-- This tests filters failing to refresh after the initial rendering
}
document.getElementById('filtered').setAttribute('filter', 'url(#toGreen)');
-
- if (window.layoutTestController)
- layoutTestController.notifyDone();
}
]]></script>
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../fast/repaint/resources/repaint.js"></script>
<defs>
<filter filterUnits="userSpaceOnUse" id="blur" x="0" y="0" width="40" height="140">
<script>
function repaintTest() {
document.getElementsByTagName("filter")[0].setAttribute("width", "140");
- if (window.layoutTestController)
- layoutTestController.notifyDone();
}
</script>
</svg>
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../fast/repaint/resources/repaint.js"></script>
<script>
<![CDATA[
var circle = document.getElementById("circle");
circle.setAttribute("cx", 100);
circle.setAttribute("cy", 100);
-
- if (window.layoutTestController)
- layoutTestController.notifyDone();
}
]]>
</script>
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="-200 -200 600 600" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="-200 -200 600 600" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../../fast/repaint/resources/repaint.js"></script>
<script type="text/javascript">
var start = new Date();
var dx = 5;
var dy = -5;
var count = 0;
+ if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
function repaintTest() {
if ((cx + r + dx > 390) || (cx - r + dx < -190))
dx =- dx;
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="-200 -200 600 600" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="-200 -200 600 600" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../../fast/repaint/resources/repaint.js"></script>
<script type="text/javascript">
var start = new Date();
var dx = 5;
var dy = -5;
var count = 0;
+ if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
function repaintTest() {
if ((cx + r + dx > 390) || (cx - r + dx < -190))
dx =- dx;
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="400" height="400" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="400" height="400" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../../fast/repaint/resources/repaint.js"></script>
<script type="text/javascript">
var start = new Date();
var maxPerBlock = Xs.length / (idealTime / delay);
var maxBlocks = Xs.length / maxPerBlock;
var count = 0;
-
+ if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
function repaintTest() {
for (var subcount = 0; subcount < maxPerBlock; subcount += 1) {
var index = count * maxPerBlock + subcount;
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="400" height="400" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="400" height="400" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../../fast/repaint/resources/repaint.js"></script>
<script type="text/javascript">
var start = new Date();
var maxPerBlock = Xs.length / (idealTime / delay);
var maxBlocks = Xs.length / maxPerBlock;
var count = 0;
-
+ if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
function repaintTest() {
for (var subcount = 0; subcount < maxPerBlock; subcount += 1) {
var index = count * maxPerBlock + subcount;
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="400" height="400" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="400" height="400" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../../fast/repaint/resources/repaint.js"></script>
<script type="text/javascript">
var start = new Date();
var maxPerBlock = Xs.length / (idealTime / delay);
var maxBlocks = Xs.length / maxPerBlock;
var count = 0;
-
+ if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
function repaintTest() {
for (var subcount = 0; subcount < maxPerBlock; subcount += 1) {
var index = count * maxPerBlock + subcount;
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="400" height="400" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="400" height="400" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../../fast/repaint/resources/repaint.js"></script>
<script type="text/javascript">
var start = new Date();
var maxPerBlock = Xs.length / (idealTime / delay);
var maxBlocks = Xs.length / maxPerBlock;
var count = 0;
-
+ if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
function repaintTest() {
for (var subcount = 0; subcount < maxPerBlock; subcount += 1) {
var index = count * maxPerBlock + subcount;
- <svg viewBox="0 0 800 400" width="200" xmlns="http://www.w3.org/2000/svg" xmlns:country="http://example.com/" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+ <svg viewBox="0 0 800 400" width="200" xmlns="http://www.w3.org/2000/svg" xmlns:country="http://example.com/" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../../fast/repaint/resources/repaint.js"></script>
<script type="text/javascript">
var start = new Date();
var delta = 60;
var current = low;
var idealTime = ((high - low) / delta) * delay;
-
+ if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
function repaintTest() {
svg.setAttribute("width", current);
if (current < high) {
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../fast/repaint/resources/repaint.js" type="text/javascript"></script>
<script type="text/javascript">
function repaintTest() {
document.getElementById('mover').setAttribute('y', 100);
- if (window.layoutTestController)
- layoutTestController.notifyDone();
}
</script>
<!-- After repositioning, the red rect should be completely hidden behind the second green rect. -->
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg width="128px" height="128px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+<svg width="128px" height="128px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../fast/repaint/resources/repaint.js" type="text/javascript"></script>
<script type="text/javascript">
function repaintTest() {
document.getElementById('poke').style.fill = 'green';
- if (window.layoutTestController)
- layoutTestController.notifyDone();
}
</script>
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runSVGRepaintTest()">
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
<script xlink:href="../../fast/repaint/resources/repaint.js" type="text/javascript"></script>
<text y="-50">200x200 green rect should be visible</text>
var greenSquare = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4gWkSUNDX1BST0ZJTEUAAQEAAAWUYXBwbAIgAABtbnRyUkdCIFhZWiAH2QACABkACwAaAAthY3NwQVBQTAAAAABhcHBsAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWFwcGwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtkZXNjAAABCAAAAG9kc2NtAAABeAAAA1ZjcHJ0AAAE0AAAADh3dHB0AAAFCAAAABRyWFlaAAAFHAAAABRnWFlaAAAFMAAAABRiWFlaAAAFRAAAABRyVFJDAAAFWAAAAA5jaGFkAAAFaAAAACxiVFJDAAAFWAAAAA5nVFJDAAAFWAAAAA5kZXNjAAAAA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UUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAf//Z";
var image = document.getElementById("image");
- if (window.layoutTestController)
+ if (window.layoutTestController) {
layoutTestController.dumpAsText(true);
+ layoutTestController.waitUntilDone();
+ }
function repaintTest() {
image.onload = function() {
var green = "data:image/gif;base64,R0lGODlhAQABAIAAAAD/AAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==";
var red = "data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==";
- var count = 0;
- function startTest() {
- if (count == 0)
- runSVGRepaintTest();
- count = count + 1;
- }
+ var count = 0;
+ function startTest() {
+ if (count == 0)
+ runRepaintTest();
+ count = count + 1;
+ }
var r = document.querySelector('#r');
var g = document.querySelector('#g');
r.setAttribute('width', size);
r.setAttribute('height', size);
g.setAttribute("transform","translate(" + offset + ",50)");
- i.setAttribute("externalResourcesRequired", "true");
+ i.setAttribute("externalResourcesRequired", "true");
i.setAttributeNS('http://www.w3.org/1999/xlink', 'href', img);
};
- if (window.layoutTestController)
+ if (window.layoutTestController) {
layoutTestController.dumpAsText(true);
+ layoutTestController.waitUntilDone();
+ }
function finishTest() {
if (window.layoutTestController)
<!-- -->
<!-- Author : Vincent Hardy, 06-Jan-2004 --><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg onload="runSVGRepaintTest()" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="tiny" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+<svg onload="runRepaintTest()" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="tiny" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
<SVGTestCase xmlns:testcase="http://www.w3.org/2000/02/svg/testsuite/description/" xmlns="http://www.w3.org/2000/02/svg/testsuite/description/" owner="VH" desc="Tests that the viewer can handle the rotate attribute on the text element" status="accepted" version="$Revision: 1.8 $" testname="$RCSfile: text-text-05-t.svg,v $">
<OperatorScript>
<Paragraph>
function repaintTest() {
document.execCommand("SelectAll");
- if (window.layoutTestController)
- layoutTestController.notifyDone();
}
</script>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
<!-- DRT uses 800x600 default, so zooming in once should not lead to visible scrollbars -->
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="480" height="360" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="480" height="360" onload="runRepaintTest()">
<rect x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
<defs>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
<!-- DRT uses 800x600 default, so zooming in three times should show up scrollbars -->
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="480" height="360" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="480" height="360" onload="runRepaintTest()">
<rect x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
<defs>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
<!-- DRT uses 800x600 default, so zooming in once should not lead to visible scrollbars -->
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" onload="runRepaintTest()">
<rect x="1%" y="1%" width="98%" height="98%" fill="none" stroke="#000000"/>
<defs>
<!-- Author : Vincent Hardy -->
<!-- Modified for svg 1.1 by Ola Andersson, 07-Mar-2002 -->
<!--======================================================================-->
-<svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" onload="runSVGRepaintTest()">
+<svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" onload="runRepaintTest()">
<SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
<OperatorScript version="$Revision: 1.6 $" testname="coords-viewattr-01-b.svg">
<Paragraph>
<?xml version="1.0"?>
-<svg xmlns="http://www.w3.org/2000/svg" onload="runSVGRepaintTest()"
+<svg xmlns="http://www.w3.org/2000/svg" onload="runRepaintTest()"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<foreignObject x="10" y="10" width="580" height="380" transform="scale(5) skewY(5) skewX(5)">
<!-- @version $Id: maskRegions.svg 475477 2006-11-15 22:44:28Z cam $ -->
<!-- ========================================================================= -->
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="body" width="450" height="500" viewBox="0 0 450 500" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="body" width="450" height="500" viewBox="0 0 450 500" onload="runRepaintTest()">
<title>Mask</title>
<!-- ============================================================= -->
<!-- Test content -->
eventSender.zoomPageIn();
}
- if (window.postZoomCallback) {
- window.postZoomCallback();
- completeDynamicTest();
- } else {
- if (window.layoutTestController)
- layoutTestController.notifyDone();
- }
+ if (!window.postZoomCallback)
+ return;
+
+ if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+ window.postZoomCallback();
+ completeDynamicTest();
}
function completeDynamicTest() {
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
<!-- DRT uses 800x600 default, so zooming in once should not lead to visible scrollbars -->
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="480" height="360" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="480" height="360" onload="runRepaintTest()">
<rect x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
<defs>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
<!-- DRT uses 800x600 default, so zooming in three times should show up scrollbars -->
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="480" height="360" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="480" height="360" onload="runRepaintTest()">
<rect x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
<defs>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
<!-- DRT uses 800x600 default, so zooming in once should not lead to visible scrollbars -->
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" onload="runSVGRepaintTest()">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" onload="runRepaintTest()">
<rect x="1%" y="1%" width="98%" height="98%" fill="none" stroke="#000000"/>
<defs>
<!-- Author : Vincent Hardy -->
<!-- Modified for svg 1.1 by Ola Andersson, 07-Mar-2002 -->
<!--======================================================================-->
-<svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" onload="runSVGRepaintTest()">
+<svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" onload="runRepaintTest()">
<SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
<OperatorScript version="$Revision: 1.6 $" testname="coords-viewattr-01-b.svg">
<Paragraph>
<?xml version="1.0"?>
-<svg xmlns="http://www.w3.org/2000/svg" onload="runSVGRepaintTest()"
+<svg xmlns="http://www.w3.org/2000/svg" onload="runRepaintTest()"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<foreignObject x="10" y="10" width="580" height="380" transform="scale(5) skewY(5) skewX(5)">
+2012-02-08 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ SVGLoad event fires too early
+ https://bugs.webkit.org/show_bug.cgi?id=78084
+
+ Reviewed by Hajime Morita.
+
+ SVGLoad event fires too early, making it impossible to use the vanilla repaint.js harness (runRepaintTest).
+
+ We're using a hack called runSVGRepaintTest() at the moment in trunk, which runs runRepaintTest() from a 0ms timer,
+ which is not reliable. The main difference between HTML onload and SVG onload is that HTMLs event is a "window event",
+ thus dispatched through DOMWindow (eg. <body onload="alert(event.target)" will yield Document,
+ <svg onload="alert(evt.target)"> will say SVGSVGElement).
+
+ Consider:
+ <svg onload="alert('1')>
+ <g onload="alert('2)">
+ <rect onload="alert('3')"/>
+ </svg>
+
+ As soon as the <rect> finishes parsing (SVGElement::finishedParsingChildren), it's SVGLoad event is fired.
+ So first you'll see '3', then '2', then '1'.
+
+ Using:
+ <svg onload="alert('1')>
+ <g onload="alert('2)">
+ <image xlink:href="someExternal.jpg" onload="alert('3')"/>
+ </svg>
+
+ will yield the same SVGLoad order. When using <image externalREsourcesRequired="true", first the '1' will fire,
+ then '3', then '2', all as expected and specified in SVG.
+
+ http://www.w3.org/TR/SVG/interact.html#LoadEvent says:
+ "The event is triggered at the point at which the user agent has fully parsed the element and its descendants and is
+ ready to act appropriately upon that element, such as being ready to render the element to the target device. Referenced
+ external resources that are required must be loaded, parsed and ready to render before the event is triggered. Optional
+ external resources are not required to be ready for the event to be triggered."
+
+ What we don't implement correctly is the second part of the first sentence: "and is ready to act appropriately upon that
+ element, such as being ready to render the element to the target device". We currently fire the SVGLoad event, right after
+ </svg> is seen, if no externalResourceRequired="true" attributes are set anywhere. This is not wrong, but not correct for
+ WebKit, as we're not yet "ready to render".
+
+ HTML fires its window onload event from Document::implicitClose(), where it calls Document::dispatchWindowLoadEvent.
+ At this point we're ready to render. So I'm now aligning the timing of the outermost <svg> elements SVGLoad event, to be
+ equal to HTML. This lets use use the repaint.js harness w/o any special SVG tricks.
+
+ Covered by existing tests.
+
+ * dom/Document.cpp:
+ (WebCore::Document::implicitClose): Dispatch SVGLoad event for outermost <svg> elements from here, as HTML does for its window onload event.
+ * svg/SVGDocumentExtensions.cpp:
+ (WebCore::SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements): Sends a SVGLoad event to all outermost <svg> elements in a document, if possible.
+ There can be multiple ones, if using <svg><foreignObject><svg>... - the <svg> in the <fO> also acts as outermost <svg> element.
+ * svg/SVGDocumentExtensions.h: Add new dispatchSVGLoadEventToOutermostSVGElements() helper.
+ * svg/SVGElement.cpp:
+ (WebCore::SVGElement::isOutermostSVGSVGElement): Moved from SVGSVGElement into SVGElement, and renamed from isOutermostSVG().
+ (WebCore::SVGElement::sendSVGLoadEventIfPossible): Don't dispatch load events to outermost <svg> elements, if Document::implicitClose() wasn't called yet.
+ (WebCore::SVGElement::finishParsingChildren): Stop using the default SVGLoad dispatching logic for outermost <svg> elements.
+ * svg/SVGElement.h: Add isOutermostSVGSVGElement().
+ * svg/SVGSVGElement.cpp: Rename isOutermostSVG to isOutermostSVGSVGElement.
+ (WebCore::SVGSVGElement::currentScale):
+ (WebCore::SVGSVGElement::setCurrentScale):
+ (WebCore::SVGSVGElement::localCoordinateSpaceTransform):
+ (WebCore::SVGSVGElement::createRenderer):
+ * svg/SVGSVGElement.h: Move isOutermostSVG() to SVGElement.
+ * svg/SVGStyledElement.cpp:
+ (WebCore::SVGStyledElement::title): Rename isOutermostSVG to isOutermostSVGSVGElement.
+
2012-02-08 Alexander Pavlov <apavlov@chromium.org>
Web Inspector: [CRASH] InspectorDOMAgent::updateTouchEventEmulationInPage()
#include "SVGDocumentExtensions.h"
#include "SVGElementFactory.h"
#include "SVGNames.h"
+#include "SVGSVGElement.h"
#include "SVGStyleElement.h"
#endif
ImageLoader::dispatchPendingBeforeLoadEvents();
ImageLoader::dispatchPendingLoadEvents();
+
+#if ENABLE(SVG)
+ // To align the HTML load event and the SVGLoad event for the outermost <svg> element, fire it from
+ // here, instead of doing it from SVGElement::finishedParsingChildren (if externalResourcesRequired="false",
+ // which is the default, for ='true' its fired at a later time, once all external resources finished loading).
+ if (svgExtensions())
+ accessSVGExtensions()->dispatchSVGLoadEventToOutermostSVGElements();
+#endif
+
dispatchWindowLoadEvent();
enqueuePageshowEvent(PageshowEventNotPersisted);
enqueuePopstateEvent(m_pendingStateObject ? m_pendingStateObject.release() : SerializedScriptValue::nullValue());
#endif
#if ENABLE(SVG)
- // FIXME: Officially, time 0 is when the outermost <svg> receives its
- // SVGLoad event, but we don't implement those yet. This is close enough
- // for now. In some cases we should have fired earlier.
if (svgExtensions())
accessSVGExtensions()->startAnimations();
#endif
(*itr)->unpauseAnimations();
}
+void SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements()
+{
+ Vector<RefPtr<SVGSVGElement> > timeContainers;
+ timeContainers.appendRange(m_timeContainers.begin(), m_timeContainers.end());
+
+ Vector<RefPtr<SVGSVGElement> >::iterator end = timeContainers.end();
+ for (Vector<RefPtr<SVGSVGElement> >::iterator it = timeContainers.begin(); it != end; ++it) {
+ SVGSVGElement* outerSVG = (*it).get();
+ if (!outerSVG->isOutermostSVGSVGElement())
+ continue;
+ outerSVG->sendSVGLoadEventIfPossible();
+ }
+}
+
bool SVGDocumentExtensions::sampleAnimationAtTime(const String& elementId, SVGSMILElement* element, double time)
{
ASSERT(element);
void pauseAnimations();
void unpauseAnimations();
bool sampleAnimationAtTime(const String& elementId, SVGSMILElement*, double time);
+ void dispatchSVGLoadEventToOutermostSVGElements();
void addAnimationElementToTarget(SVGSMILElement*, SVGElement*);
void removeAnimationElementFromTarget(SVGSMILElement*, SVGElement*);
return data;
}
+bool SVGElement::isOutermostSVGSVGElement() const
+{
+ // Element may not be in the document, pretend we're outermost for viewport(), getCTM(), etc.
+ if (!parentNode())
+ return true;
+
+ // We act like an outermost SVG element, if we're a direct child of a <foreignObject> element.
+ if (parentNode()->hasTagName(SVGNames::foreignObjectTag))
+ return true;
+
+ // This is true whenever this is the outermost SVG, even if there are HTML elements outside it
+ return !parentNode()->isSVGElement();
+}
+
void SVGElement::reportAttributeParsingError(SVGParsingError error, Attribute* attribute)
{
if (error == NoError)
if (hasLoadListener(currentTarget.get()))
currentTarget->dispatchEvent(Event::create(eventNames().loadEvent, false, false));
currentTarget = (parent && parent->isSVGElement()) ? static_pointer_cast<SVGElement>(parent) : RefPtr<SVGElement>();
+ SVGElement* element = static_cast<SVGElement*>(currentTarget.get());
+ if (!element || !element->isOutermostSVGSVGElement())
+ continue;
+
+ // Consider <svg onload="foo()"><image xlink:href="foo.png" externalResourcesRequired="true"/></svg>.
+ // If foo.png is not yet loaded, the first SVGLoad event will go to the <svg> element, sent through
+ // Document::implicitClose(). Then the SVGLoad event will fire for <image>, once its loaded.
+ ASSERT(sendParentLoadEvents);
+
+ // If the load event was not sent yet by Document::implicitClose(), but the <image> from the example
+ // above, just appeared, don't send the SVGLoad event to the outermost <svg>, but wait for the document
+ // to be "ready to render", first.
+ if (!document()->loadEventFinished())
+ break;
}
}
{
StyledElement::finishParsingChildren();
+ // The outermost SVGSVGElement SVGLoad event is fired through Document::dispatchWindowLoadEvent.
+ if (isOutermostSVGSVGElement())
+ return;
+
// finishParsingChildren() is called when the close tag is reached for an element (e.g. </svg>)
// we send SVGLoad events here if we can, otherwise they'll be sent when any required loads finish
sendSVGLoadEventIfPossible();
static PassRefPtr<SVGElement> create(const QualifiedName&, Document*);
virtual ~SVGElement();
+ bool isOutermostSVGSVGElement() const;
+
String xmlbase() const;
void setXmlbase(const String&, ExceptionCode&);
float SVGSVGElement::currentScale() const
{
- if (!inDocument() || !isOutermostSVG())
+ if (!inDocument() || !isOutermostSVGSVGElement())
return 1;
Frame* frame = document()->frame();
void SVGSVGElement::setCurrentScale(float scale)
{
- if (!inDocument() || !isOutermostSVG())
+ if (!inDocument() || !isOutermostSVGSVGElement())
return;
Frame* frame = document()->frame();
}
AffineTransform transform;
- if (!isOutermostSVG()) {
+ if (!isOutermostSVGSVGElement()) {
SVGLengthContext lengthContext(this);
transform.translate(x().value(lengthContext), y().value(lengthContext));
} else if (mode == SVGLocatable::ScreenScope) {
RenderObject* SVGSVGElement::createRenderer(RenderArena* arena, RenderStyle*)
{
- if (isOutermostSVG())
+ if (isOutermostSVGSVGElement())
return new (arena) RenderSVGRoot(this);
return new (arena) RenderSVGViewportContainer(this);
|| hasAttribute(SVGNames::viewBoxAttr);
}
-bool SVGSVGElement::isOutermostSVG() const
-{
- // Element may not be in the document, pretend we're outermost for viewport(), getCTM(), etc.
- if (!parentNode())
- return true;
-
- // We act like an outermost SVG element, if we're a direct child of a <foreignObject> element.
- if (parentNode()->hasTagName(SVGNames::foreignObjectTag))
- return true;
-
- // This is true whenever this is the outermost SVG, even if there are HTML elements outside it
- return !parentNode()->isSVGElement();
-}
-
FloatRect SVGSVGElement::currentViewBoxRect() const
{
if (useCurrentView()) {
void setupInitialView(const String& fragmentIdentifier, Element* anchorNode);
- bool isOutermostSVG() const;
-
Element* getElementById(const AtomicString&) const;
bool widthAttributeEstablishesViewport() const;
// <title> elements are the title of the document, not a tooltip) so we instantly return.
if (hasTagName(SVGNames::svgTag)) {
const SVGSVGElement* svg = static_cast<const SVGSVGElement*>(this);
- if (svg->isOutermostSVG())
+ if (svg->isOutermostSVGSVGElement())
return String();
}