Commit 3d2114c5 authored by zimmermann@webkit.org's avatar zimmermann@webkit.org

SVGLoad event fires too early

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: http://svn.webkit.org/repository/webkit/trunk@107057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4c2a7593
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
......@@ -3,8 +3,8 @@ function runRepaintTest()
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();
......@@ -12,14 +12,3 @@ function runRepaintTest()
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();
}
......@@ -4042,5 +4042,13 @@ BUGWK77736 : svg/zoom/text/zoom-hixie-mixed-008.xml = IMAGE+TEXT
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"
......@@ -3,9 +3,9 @@ layer at (0,0) size 800x600
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"
......@@ -9,7 +9,7 @@ layer at (0,0) size 800x600
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>
......@@ -39,8 +39,6 @@
//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+"'");
......
......@@ -9,7 +9,7 @@
>
]>
<?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"/>
......@@ -21,6 +21,8 @@
// 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;">
......
......@@ -7,7 +7,7 @@
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() {
......@@ -8,8 +8,6 @@
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>
......@@ -29,9 +29,6 @@
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>
......@@ -10,9 +10,6 @@
<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>
......@@ -15,9 +15,6 @@
<![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>
......@@ -18,9 +18,6 @@
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>
......@@ -14,9 +14,6 @@
<![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>
......@@ -14,9 +14,6 @@
<![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>
......@@ -19,6 +19,9 @@
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>
......@@ -16,9 +16,6 @@
<![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
......@@ -110,9 +110,6 @@ There should be no red squares in the output. -->
}
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">
......@@ -11,8 +11,6 @@
<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[
......@@ -6,9 +6,6 @@ function repaintTest() {
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();
......@@ -264,6 +264,8 @@
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();
......@@ -264,6 +264,8 @@
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();
......@@ -46,7 +46,8 @@
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();
......@@ -46,7 +46,8 @@
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();
......@@ -52,7 +52,8 @@
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();
......@@ -52,7 +52,8 @@
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();
......@@ -258,7 +258,8 @@
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>
......@@ -11,8 +11,10 @@
var greenSquare = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4gWkSUNDX1BST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