SVGLoad event fires too early
authorzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 10:21:49 +0000 (10:21 +0000)
committerzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 10:21:49 +0000 (10:21 +0000)
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

64 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/repaint/resources/repaint.js
LayoutTests/platform/chromium/test_expectations.txt
LayoutTests/platform/mac/svg/custom/SVGPoint-matrixTransform-expected.png
LayoutTests/platform/mac/svg/custom/SVGPoint-matrixTransform-expected.txt
LayoutTests/platform/mac/svg/custom/getTransformToElement-expected.png
LayoutTests/platform/mac/svg/custom/getTransformToElement-expected.txt
LayoutTests/platform/mac/svg/custom/polyline-setattribute-points-null-expected.png
LayoutTests/platform/mac/svg/custom/polyline-setattribute-points-null-expected.txt
LayoutTests/platform/mac/svg/custom/text-ctm-expected.png
LayoutTests/platform/mac/svg/custom/text-ctm-expected.txt
LayoutTests/platform/mac/svg/custom/text-hit-test-expected.png
LayoutTests/platform/mac/svg/custom/text-hit-test-expected.txt
LayoutTests/platform/mac/svg/filters/filter-refresh-expected.png
LayoutTests/svg/carto.net/tabgroup.svg
LayoutTests/svg/carto.net/window.svg
LayoutTests/svg/css/shadow-changes.svg
LayoutTests/svg/custom/loadevents-externalresourcesrequired.svg
LayoutTests/svg/dom/SVGPathSegList-segment-modification.svg
LayoutTests/svg/dom/SVGPathSegList-xml-dom-synchronization2.xhtml
LayoutTests/svg/dom/SVGRectElement/rect-modify-rx.svg
LayoutTests/svg/filters/animate-fill.svg
LayoutTests/svg/filters/feImage-reference-invalidation.svg
LayoutTests/svg/filters/feImage-target-add-to-document.svg
LayoutTests/svg/filters/feImage-target-changes-id.svg
LayoutTests/svg/filters/feImage-target-id-change.svg
LayoutTests/svg/filters/feImage-target-reappend-to-document.svg
LayoutTests/svg/filters/feImage-target-remove-from-document.svg
LayoutTests/svg/filters/filter-refresh.svg
LayoutTests/svg/filters/filter-width-update.svg
LayoutTests/svg/filters/invalidate-on-child-layout.svg
LayoutTests/svg/hixie/perf/001.xml
LayoutTests/svg/hixie/perf/002.xml
LayoutTests/svg/hixie/perf/003.xml
LayoutTests/svg/hixie/perf/004.xml
LayoutTests/svg/hixie/perf/005.xml
LayoutTests/svg/hixie/perf/006.xml
LayoutTests/svg/hixie/perf/007.xml
LayoutTests/svg/repaint/container-repaint.svg
LayoutTests/svg/repaint/filter-child-repaint.svg
LayoutTests/svg/repaint/image-href-change.svg
LayoutTests/svg/repaint/image-with-clip-path.svg
LayoutTests/svg/text/text-text-05-t.svg
LayoutTests/svg/zoom/page/absolute-sized-document-no-scrollbars.svg
LayoutTests/svg/zoom/page/absolute-sized-document-scrollbars.svg
LayoutTests/svg/zoom/page/relative-sized-document-scrollbars.svg
LayoutTests/svg/zoom/page/zoom-coords-viewattr-01-b.svg
LayoutTests/svg/zoom/page/zoom-foreignObject.svg
LayoutTests/svg/zoom/page/zoom-mask-with-percentages.svg
LayoutTests/svg/zoom/resources/testPageZoom.js
LayoutTests/svg/zoom/text/absolute-sized-document-no-scrollbars.svg
LayoutTests/svg/zoom/text/absolute-sized-document-scrollbars.svg
LayoutTests/svg/zoom/text/relative-sized-document-scrollbars.svg
LayoutTests/svg/zoom/text/zoom-coords-viewattr-01-b.svg
LayoutTests/svg/zoom/text/zoom-foreignObject.svg
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/svg/SVGDocumentExtensions.cpp
Source/WebCore/svg/SVGDocumentExtensions.h
Source/WebCore/svg/SVGElement.cpp
Source/WebCore/svg/SVGElement.h
Source/WebCore/svg/SVGSVGElement.cpp
Source/WebCore/svg/SVGSVGElement.h
Source/WebCore/svg/SVGStyledElement.cpp

index d349fb86c1138d2e0f1d123bdb43d3343d4f14df..bce47e10cc385eb0812a7f873a64ae1086ff54ca 100644 (file)
@@ -1,3 +1,70 @@
+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
index 3e8eab1777ce79b1d2c48698a6d1bf6637ef8cb8..c92c7504039a14b0aee3c5ed663682412d4c8b3a 100644 (file)
@@ -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();
-}
index cdd543474f6143a9692c52be172e54168a5ab06a..c78e25c2016b2e455a687f36f205a3744d62f0da 100644 (file)
@@ -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
index 5d7a7c7a4714a3cabf357d8c2ebcdddf8537965d..1afc5f70741300172fb48cec0cbf8fbd13fd0ec6 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/custom/SVGPoint-matrixTransform-expected.png and b/LayoutTests/platform/mac/svg/custom/SVGPoint-matrixTransform-expected.png differ
index d4f4bcb96236e6ca974f0fe6ee8f4f6acae6464c..0e659bc65c799a83c2c2aa5c947984e68b087005 100644 (file)
@@ -1,7 +1,7 @@
 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"
index d6ac5b1e0fffd81c9a0bab8620344249654dba67..8635ce57c0f33057fdd85b638feea63c40030b01 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/custom/getTransformToElement-expected.png and b/LayoutTests/platform/mac/svg/custom/getTransformToElement-expected.png differ
index 74828a2be1631b213467c2381b155fff4cccfd43..c6e0ab18a379bd0ec9ed373c8e90b1708fd2df02 100644 (file)
@@ -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]
index 7cf2d00609e3e1727effd470175b7ed7a7055a61..b6da2f3b3d70f44913b9f3cbceacc9aed418deab 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/custom/polyline-setattribute-points-null-expected.png and b/LayoutTests/platform/mac/svg/custom/polyline-setattribute-points-null-expected.png differ
index b1475516fcdef85a071c68fb400a11ae497a8776..defc6c2fc403f954e2d8a8114955b62555ba1501 100644 (file)
@@ -1,4 +1,4 @@
-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
index 4bba224849943701b47916686c3483e0a2a6a209..1f53a23fd5f1afc3353dc37acd39c7e8dbc40ac7 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/custom/text-ctm-expected.png and b/LayoutTests/platform/mac/svg/custom/text-ctm-expected.png differ
index 8188799e5a2a57af2dee347f3d21aa367d1f457d..4bd9d4af6ee7bb5e2a0daf29d1a891d0ffb31b10 100644 (file)
@@ -1,9 +1,9 @@
 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"
index 407d6ecbc335f3105b0b5debd76425e0c14c3981..304174d98662f07134d3f57144806077116806be 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/custom/text-hit-test-expected.png and b/LayoutTests/platform/mac/svg/custom/text-hit-test-expected.png differ
index d488cdc1de8847f491322200d4b9b1a3a6c8ccf6..a36576a9d4ce6d3813bee07b273c92420521c66d 100644 (file)
@@ -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
index 5deed5eeac243dcf77af54ef8ce77e9cfb224e8c..62be4f5dcde1c4b3cf52b45d7ebd0b57bb9fdaac 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/filters/filter-refresh-expected.png and b/LayoutTests/platform/mac/svg/filters/filter-refresh-expected.png differ
index 098316f3748a765d2017b1c2e36afa342c9db52c..e8a87e44318ebeeed52d49bc81137a8df551f8d9 100644 (file)
@@ -1,7 +1,7 @@
 <?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+"'");
index 0500523f016a746a86ad7f1c7f8f154923e4c1d1..ed24d1fa22b978c95d3ce35f130948004a7b204d 100644 (file)
@@ -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;
index aa02b060805ec327ca28b554ce177c6448b2849a..b0554952898273e8880f1584b4a0d46ad51ccc08 100644 (file)
@@ -1,12 +1,10 @@
 <?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;">
index 3656a3c9542a4b5bca5364f0f8a859664515387a..bb377de97297fa46ad1dc235d30dab5d8f33c1c0 100644 (file)
@@ -7,7 +7,7 @@
       var results = new Array();
 
       function reportLoadEvent(el) {
-        results.push(el.localName);
+               results.push(el.localName);
       }
       function runTest()
       {
index 8a584ee94ee4b3f99246be9e43fe0a2848eb807b..2cda2aa375e7ea76cf3cba63005b732379762c6a 100644 (file)
@@ -1,5 +1,5 @@
 <?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"/>
index c5d90a2abdf3765339138a8061ca9e3feb041dab..b471ad06e9b73c6d5c501ebe567ea7b3d52ac66b 100644 (file)
@@ -1,5 +1,5 @@
 <?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>
index 7c4ffe7d258a1e245647672c23a7fc51aebb39ab..be6b0f5dac30b363d82be4e45be30cbbbb87c06c 100644 (file)
@@ -1,13 +1,10 @@
-<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>
index 22c5ab2d73927703f441768f84f49d0625fd8914..3a74899c7eec1718441926f47acf8778e72b3d9c 100644 (file)
@@ -1,4 +1,4 @@
-<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>
index 9036654ea5e18b4f59657893e9ea31600479fc67..5b9d98c3faed4afa37f4223be44d95b7b78af934 100644 (file)
@@ -1,5 +1,5 @@
 <?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>
index 32cdb9759c1a8e16b88b99efd143c6ded66770c7..6155fc837270e04104a0724e129da881bdfe92f9 100644 (file)
@@ -1,5 +1,5 @@
 <?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>
index ce1e17b4da98924413a9b07d82512e8c4f247e93..bb63464dbd2da307de504128c96c5c50da42a3fc 100644 (file)
@@ -1,5 +1,5 @@
 <?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>
index 20818c0c83e685761171641241abd0a3b2fd7fca..5622d571263a5d5ecd25ac37ca6403dcdb20fc3a 100644 (file)
@@ -1,5 +1,5 @@
 <?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>
index 02f2768e03799a44d9c93f0c22f8bbbc9bfd2cf2..69d796610588e3393d385fdb3ca04e62e6d582ad 100644 (file)
@@ -1,5 +1,5 @@
 <?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)
index c6f5a5bcc238c4e6bb2443e4cd8d69acde67bd45..286eed48fe8861f4797533857d3da4794bf7d4b2 100644 (file)
@@ -1,5 +1,5 @@
 <?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>
index a6deaae1c75f8cfd97d3e991eef3225f7d9c136b..43fa89454ef3391453c6ae71f7ecfe1d2be945fb 100644 (file)
@@ -1,5 +1,5 @@
 <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>
 
index 9c27c2315672e31b613bd6276797e6fb08319d75..deadf2446664fdc6cccad2dac0dd74ee007f240d 100644 (file)
@@ -1,4 +1,4 @@
-<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>
index 46c21ddc48bf8705258f966a4332f2fb37630c95..024a0e2fab0ef7a143520b852d3796824fc51c2d 100644 (file)
@@ -1,4 +1,4 @@
-<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>
index 802386ccc3feaaa5d836304a85ab77fcf24cd6f3..e05ec1780b0dbb93c8884f2fb49232b1c924c3de 100644 (file)
@@ -1,4 +1,4 @@
-<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;
index 884a9abd5dd99b597ce6d122232049fd9c40e64c..404d04b2f44c383496fe12d9f6a6fcc0bb437c3d 100644 (file)
@@ -1,4 +1,4 @@
-<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;
index 23a223612e33bd93dfee3e5dde1c937aef054ab3..06679b6ce7d9b4e993fae7eb58a1e932e0bc8b6e 100644 (file)
@@ -1,4 +1,4 @@
-<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;
index 07925c76f654bbf6421fbab26a32d4f790c3916b..808e4e9f88f0161624fa637e87d970f78dc2a0f6 100644 (file)
@@ -1,4 +1,4 @@
-<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;
index e96f1e3ad8522d035d380819939e20fa21053598..f08e08c97e735240419d8f0a8f203ea50456391b 100644 (file)
@@ -1,4 +1,4 @@
-<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;
index 1bea2f69b1bfd58c8cf6205653781de2cf17956c..e746689a5534d4490882890d9257f44922d06f43 100644 (file)
@@ -1,4 +1,4 @@
-<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;
index 1c53f60ad06844fdfcf7b91fc1514800ed58fc81..869748af9f5ec6521d64be5b24f5f398113915bc 100644 (file)
@@ -1,4 +1,4 @@
- <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) {
index f258ef7200519ac0335ba64b1b22cea785e28d5d..a4e7c1f75760e4bdd246ec7bfa4904292f8a5be5 100644 (file)
@@ -1,10 +1,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() {
       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. -->
index c7b0e4b785a1f2913ab3178e8924410e23ecd427..3714eb3a66f574f36416cee150addb8d70b06701 100644 (file)
@@ -1,12 +1,10 @@
 <?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>
  
index 7485414aa715fdeecd30a385b6c8b9a7ab4c0bac..6b0fc8c05a9c0a05cd89acada8f98e6f06f9d11e 100644 (file)
@@ -1,4 +1,4 @@
- <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/4gWkSUNDX1BST0ZJTEUAAQEAAAWUYXBwbAIgAABtbnRyUkdCIFhZWiAH2QACABkACwAaAAthY3NwQVBQTAAAAABhcHBsAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWFwcGwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtkZXNjAAABCAAAAG9kc2NtAAABeAAAA1ZjcHJ0AAAE0AAAADh3dHB0AAAFCAAAABRyWFlaAAAFHAAAABRnWFlaAAAFMAAAABRiWFlaAAAFRAAAABRyVFJDAAAFWAAAAA5jaGFkAAAFaAAAACxiVFJDAAAFWAAAAA5nVFJDAAAFWAAAAA5kZXNjAAAAAAAAABRHZW5lcmljIFJHQiBQcm9maWxlAAAAAAAAAAAAAAAUR2VuZXJpYyBSR0IgUHJvZmlsZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbWx1YwAAAAAAAAATAAAADHB0QlIAAAAmAAAA9GZyRlUAAAAoAAABGnpoVFcAAAAWAAABQml0SVQAAAAoAAABWG5iTk8AAAAmAAABgGtvS1IAAAAWAAABpmRlREUAAAAsAAABvHN2U0UAAAAmAAABgHpoQ04AAAAWAAAB6GphSlAAAAAaAAAB/nB0UE8AAAAmAAACGG5sTkwAAAAoAAACPmVzRVMAAAAmAAACGGZpRkkAAAAoAAACZnBsUEwAAAAsAAACjnJ1UlUAAAAiAAACumFyRUcAAAAmAAAC3GVuVVMAAAAmAAADAmRhREsAAAAuAAADKABQAGUAcgBmAGkAbAAgAFIARwBCACAARwBlAG4A6QByAGkAYwBvAFAAcgBvAGYAaQBsACAAZwDpAG4A6QByAGkAcQB1AGUAIABSAFYAQpAadSgAIABSAEcAQgAggnJfaWPPj/AAUAByAG8AZgBpAGwAbwAgAFIARwBCACAAZwBlAG4AZQByAGkAYwBvAEcAZQBuAGUAcgBpAHMAawAgAFIARwBCAC0AcAByAG8AZgBpAGzHfLwYACAAUgBHAEIAINUEuFzTDMd8AEEAbABsAGcAZQBtAGUAaQBuAGUAcwAgAFIARwBCAC0AUAByAG8AZgBpAGxmbpAaACAAUgBHAEIAIGPPj/Blh072TgCCLAAgAFIARwBCACAw1zDtMNUwoTCkMOsAUABlAHIAZgBpAGwAIABSAEcAQgAgAGcAZQBuAOkAcgBpAGMAbwBBAGwAZwBlAG0AZQBlAG4AIABSAEcAQgAtAHAAcgBvAGYAaQBlAGwAWQBsAGUAaQBuAGUAbgAgAFIARwBCAC0AcAByAG8AZgBpAGkAbABpAFUAbgBpAHcAZQByAHMAYQBsAG4AeQAgAHAAcgBvAGYAaQBsACAAUgBHAEIEHgQxBEkEOAQ5ACAEPwRABD4ERAQ4BDsETAAgAFIARwBCBkUGRAZBACAGKgY5BjEGSgZBACAAUgBHAEIAIAYnBkQGOQYnBkUARwBlAG4AZQByAGkAYwAgAFIARwBCACAAUAByAG8AZgBpAGwAZQBHAGUAbgBlAHIAZQBsACAAUgBHAEIALQBiAGUAcwBrAHIAaQB2AGUAbABzAGUAAHRleHQAAAAAQ29weXJpZ2h0IDIwMDcgQXBwbGUgSW5jLiwgYWxsIHJpZ2h0cyByZXNlcnZlZC4AWFlaIAAAAAAAAPNSAAEAAAABFs9YWVogAAAAAAAAdE0AAD3uAAAD0FhZWiAAAAAAAABadQAArHMAABc0WFlaIAAAAAAAACgaAAAVnwAAuDZjdXJ2AAAAAAAAAAEBzQAAc2YzMgAAAAAAAQxCAAAF3v//8yYAAAeSAAD9kf//+6L///2jAAAD3AAAwGz/4QCARXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAKgAgAEAAAAAQAAAMigAwAEAAAAAQAAAMgAAAAA/9sAQwAgFhgcGBQgHBocJCIgJjBQNDAsLDBiRko6UHRmenhyZnBugJC4nICIropucKDaoq6+xM7Qznya4vLgyPC4ys7G/9sAQwEiJCQwKjBeNDRexoRwhMbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbG/8AAEQgAyADIAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/aAAwDAQACEQMRAD8ApUUUVynGFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAf//Z";
 
     var image = document.getElementById("image");
-    if (window.layoutTestController)
+    if (window.layoutTestController) {
         layoutTestController.dumpAsText(true);
+        layoutTestController.waitUntilDone();
+    }
 
     function repaintTest() {
         image.onload = function() {
index c71173a1b03e0e19ac324cf238ccec9f9b0e2e42..e41ca70d7bc9483f31c3897b1c216faf96d60617 100644 (file)
     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)
index 5186b75391288a1605aa307aea5c1f3ee96aedcb..bf7be1673556b7f0998f35d4af77bd08476fd951 100644 (file)
@@ -8,7 +8,7 @@
 <!--                                                                      -->
 <!-- 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>
@@ -165,8 +165,6 @@ if (window.layoutTestController)
 
 function repaintTest() {
     document.execCommand("SelectAll");
-    if (window.layoutTestController)
-        layoutTestController.notifyDone();
 }
 </script>
 </svg>
index d58001b41e73ce9d116499a1ad980804f71ace3e..2f585b6e3ffa4f18ed13ba776d3624d785b675c1 100644 (file)
@@ -1,7 +1,7 @@
 <?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>
index f6b338c1ec987cc6f0022429c125c3d8c6070953..600b0e7ce832eb730aa876cfca33ef4c671fbb11 100644 (file)
@@ -1,7 +1,7 @@
 <?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>
index d6b7208c6727179cdc93a6d2b0bf2492cd62dd0e..e308cce91a81af0a510ef2f57ecc925d7987b21d 100644 (file)
@@ -1,7 +1,7 @@
 <?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>
index deac2d4f7e2042e6bfa1f770a2b1cfa1bbb5da8c..d096f35ecf0713c62f22127a4ab11b09bee5b114 100644 (file)
@@ -28,7 +28,7 @@ fill='none' stroke='blue'/>">
 <!-- 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>
index 2b3d10fbb2923147dafcd3633c09e1493d574fd7..83e25b7d1a2e8f4ff47a3b24f8f9afbee5044d62 100644 (file)
@@ -1,5 +1,5 @@
 <?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)">
index 8123a55de00d492967c55f3780fc22d248102735..f380e604a83ecc9718b0b0550f947a79689536e2 100644 (file)
@@ -26,7 +26,7 @@
 <!-- @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                                                  -->
index 222965a70aa09f4521c82c3ea1b29fda621a63c8..93130ba272f8556435027f7b25c168989264b464 100644 (file)
@@ -9,13 +9,14 @@ function repaintTest() {
             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() {
index ae7d3d051c5554a0eaa37750de8d436dcfc51048..3efc547e5813cc6ce7a57f7a063c5ba72bcb7db9 100644 (file)
@@ -1,7 +1,7 @@
 <?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>
index 75d481da0994d44e1c20a14758426f1384b0135a..b9662028bb616a87bf75f4261e1bbc1eea2d5a85 100644 (file)
@@ -1,7 +1,7 @@
 <?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>
index fd48d4e38fd1a5f5b7b820dc4e3e1bfd6423398d..ada871b8309f777c4fbb5c250d0ffedc590caff6 100644 (file)
@@ -1,7 +1,7 @@
 <?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>
index c61b2c95ffd82b29db55e1cfafe00fcea0dce3d8..2aeeb5ea4b2a8e58903b5ba1c867dbaacd3beda5 100644 (file)
@@ -28,7 +28,7 @@ fill='none' stroke='blue'/>">
 <!-- 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>
index 299e059b61d5e13209a46a96cc33660f10bd4ce4..cb35666d6305bf3dd96c3741f619d834cd201a73 100644 (file)
@@ -1,5 +1,5 @@
 <?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)">
index 3bba57686e820853b6e6bd1dbd7a793fb95ce09f..0d0413173bae65fcf09e35d5bc484becc3415e6b 100644 (file)
@@ -1,3 +1,72 @@
+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()
index 647377ecbba0523d47fbc404c30b79fd234a9255..39a97b2c4d8a5be363b581a0a50a7d3c59817228 100644 (file)
 #include "SVGDocumentExtensions.h"
 #include "SVGElementFactory.h"
 #include "SVGNames.h"
+#include "SVGSVGElement.h"
 #include "SVGStyleElement.h"
 #endif
 
@@ -2257,6 +2258,15 @@ void Document::implicitClose()
 
     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());
@@ -2326,9 +2336,6 @@ void Document::implicitClose()
 #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
index 1dd61608caa540f3b7d76f14edadb910ebcd7935..71161102983f965f2876cdae8f549a0978930e13 100644 (file)
@@ -117,6 +117,20 @@ void SVGDocumentExtensions::unpauseAnimations()
         (*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);
index 459ff0647515feacc914a23cbe23aa7c3a021687..db608bdb2a9a8145b82783a8b6504c95282daed2 100644 (file)
@@ -57,6 +57,7 @@ public:
     void pauseAnimations();
     void unpauseAnimations();
     bool sampleAnimationAtTime(const String& elementId, SVGSMILElement*, double time);
+    void dispatchSVGLoadEventToOutermostSVGElements();
     
     void addAnimationElementToTarget(SVGSMILElement*, SVGElement*);
     void removeAnimationElementFromTarget(SVGSMILElement*, SVGElement*);
index b1a162dcf7c824b28451467012007508a27f6932..a617f91781538d38e9963f10f168a255649476d7 100644 (file)
@@ -105,6 +105,20 @@ SVGElementRareData* SVGElement::ensureRareSVGData()
     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)
@@ -340,6 +354,20 @@ void SVGElement::sendSVGLoadEventIfPossible(bool sendParentLoadEvents)
         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;
     }
 }
 
@@ -347,6 +375,10 @@ void SVGElement::finishParsingChildren()
 {
     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();
index 06fac050d78997ac1f52d807c28ddcd2c49fad41..c5c5ac55f44a420192419ed818581df49c981238 100644 (file)
@@ -46,6 +46,8 @@ public:
     static PassRefPtr<SVGElement> create(const QualifiedName&, Document*);
     virtual ~SVGElement();
 
+    bool isOutermostSVGSVGElement() const;
+
     String xmlbase() const;
     void setXmlbase(const String&, ExceptionCode&);
 
index f889d63bc6ae259a4a76bee19eb3dbf9590d4f4e..590eec9a32f7b05739433e24bd8e96e313ff275e 100644 (file)
@@ -186,7 +186,7 @@ SVGViewSpec* SVGSVGElement::currentView() const
 
 float SVGSVGElement::currentScale() const
 {
-    if (!inDocument() || !isOutermostSVG())
+    if (!inDocument() || !isOutermostSVGSVGElement())
         return 1;
 
     Frame* frame = document()->frame();
@@ -204,7 +204,7 @@ float SVGSVGElement::currentScale() const
 
 void SVGSVGElement::setCurrentScale(float scale)
 {
-    if (!inDocument() || !isOutermostSVG())
+    if (!inDocument() || !isOutermostSVGSVGElement())
         return;
 
     Frame* frame = document()->frame();
@@ -428,7 +428,7 @@ AffineTransform SVGSVGElement::localCoordinateSpaceTransform(SVGLocatable::CTMSc
     }
 
     AffineTransform transform;
-    if (!isOutermostSVG()) {
+    if (!isOutermostSVGSVGElement()) {
         SVGLengthContext lengthContext(this);
         transform.translate(x().value(lengthContext), y().value(lengthContext));
     } else if (mode == SVGLocatable::ScreenScope) {
@@ -455,7 +455,7 @@ AffineTransform SVGSVGElement::localCoordinateSpaceTransform(SVGLocatable::CTMSc
 
 RenderObject* SVGSVGElement::createRenderer(RenderArena* arena, RenderStyle*)
 {
-    if (isOutermostSVG())
+    if (isOutermostSVGSVGElement())
         return new (arena) RenderSVGRoot(this);
 
     return new (arena) RenderSVGViewportContainer(this);
@@ -512,20 +512,6 @@ bool SVGSVGElement::selfHasRelativeLengths() const
         || 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()) {
index c14b9c757780f6257ec7f2f2b8da01a0b07240c8..10c59c2851a8211b05788d874deb41004542d74e 100644 (file)
@@ -126,8 +126,6 @@ public:
 
     void setupInitialView(const String& fragmentIdentifier, Element* anchorNode);
 
-    bool isOutermostSVG() const;
-
     Element* getElementById(const AtomicString&) const;
 
     bool widthAttributeEstablishesViewport() const;
index 45a4dce1a9917885b08d16a6a09dbb3daff4e866..518b5b3eed294cba747377f1795a9b9bda93fd4e 100644 (file)
@@ -84,7 +84,7 @@ String SVGStyledElement::title() 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();
     }