Title: [216023] trunk
Revision
216023
Author
[email protected]
Date
2017-05-01 13:40:23 -0700 (Mon, 01 May 2017)

Log Message

Do not dispatch SVG load event in frameless documents
https://bugs.webkit.org/show_bug.cgi?id=171505
<rdar://problem/31799776>

Reviewed by Andreas Kling.

Source/WebCore:

We should not dispatch SVG load events in frameless documents. <https://trac.webkit.org/changeset/173028/webkit>
took care of most load events but forgot the SVG load event.

Test: fast/dom/domparser-parsefromstring-svg-load-event.html

* dom/Document.cpp:
(WebCore::Document::implicitClose):

LayoutTests:

Add layout test coverage. I have verified that this test passes on both Firefox and Chrome.

* fast/dom/domparser-parsefromstring-svg-load-event-expected.txt: Added.
* fast/dom/domparser-parsefromstring-svg-load-event.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (216022 => 216023)


--- trunk/LayoutTests/ChangeLog	2017-05-01 18:50:33 UTC (rev 216022)
+++ trunk/LayoutTests/ChangeLog	2017-05-01 20:40:23 UTC (rev 216023)
@@ -1,3 +1,16 @@
+2017-05-01  Chris Dumez  <[email protected]>
+
+        Do not dispatch SVG load event in frameless documents
+        https://bugs.webkit.org/show_bug.cgi?id=171505
+        <rdar://problem/31799776>
+
+        Reviewed by Andreas Kling.
+
+        Add layout test coverage. I have verified that this test passes on both Firefox and Chrome.
+
+        * fast/dom/domparser-parsefromstring-svg-load-event-expected.txt: Added.
+        * fast/dom/domparser-parsefromstring-svg-load-event.html: Added.
+
 2017-05-01  Ryan Haddad  <[email protected]>
 
         Skip editing/execCommand/show-modal-dialog-during-execCommand.html on mac-wk1.

Added: trunk/LayoutTests/fast/dom/domparser-parsefromstring-svg-load-event-expected.txt (0 => 216023)


--- trunk/LayoutTests/fast/dom/domparser-parsefromstring-svg-load-event-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/domparser-parsefromstring-svg-load-event-expected.txt	2017-05-01 20:40:23 UTC (rev 216023)
@@ -0,0 +1,9 @@
+Tests that SVG load events are not fired in frameless documents. This test passes if you do not see a FAIL alert message.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/dom/domparser-parsefromstring-svg-load-event.html (0 => 216023)


--- trunk/LayoutTests/fast/dom/domparser-parsefromstring-svg-load-event.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/domparser-parsefromstring-svg-load-event.html	2017-05-01 20:40:23 UTC (rev 216023)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<script>
+description("Tests that SVG load events are not fired in frameless documents. This test passes if you do not see a FAIL alert message.");
+jsTestIsAsync = true;
+
+new DOMParser().parseFromString('<svg _onload_=alert("FAIL")>', 'text/html');
+
+setTimeout(finishJSTest, 0);
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (216022 => 216023)


--- trunk/Source/WebCore/ChangeLog	2017-05-01 18:50:33 UTC (rev 216022)
+++ trunk/Source/WebCore/ChangeLog	2017-05-01 20:40:23 UTC (rev 216023)
@@ -1,5 +1,21 @@
 2017-05-01  Chris Dumez  <[email protected]>
 
+        Do not dispatch SVG load event in frameless documents
+        https://bugs.webkit.org/show_bug.cgi?id=171505
+        <rdar://problem/31799776>
+
+        Reviewed by Andreas Kling.
+
+        We should not dispatch SVG load events in frameless documents. <https://trac.webkit.org/changeset/173028/webkit>
+        took care of most load events but forgot the SVG load event.
+
+        Test: fast/dom/domparser-parsefromstring-svg-load-event.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::implicitClose):
+
+2017-05-01  Chris Dumez  <[email protected]>
+
         Remove some usage of PassRefPtr in editing code
         https://bugs.webkit.org/show_bug.cgi?id=171490
 

Modified: trunk/Source/WebCore/dom/Document.cpp (216022 => 216023)


--- trunk/Source/WebCore/dom/Document.cpp	2017-05-01 18:50:33 UTC (rev 216022)
+++ trunk/Source/WebCore/dom/Document.cpp	2017-05-01 20:40:23 UTC (rev 216023)
@@ -2647,14 +2647,14 @@
         ImageLoader::dispatchPendingErrorEvents();
         HTMLLinkElement::dispatchPendingLoadEvents();
         HTMLStyleElement::dispatchPendingLoadEvents();
+
+        // 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 ='' its fired at a later time, once all external resources finished loading).
+        if (svgExtensions())
+            accessSVGExtensions().dispatchSVGLoadEventToOutermostSVGElements();
     }
 
-    // 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 ='' its fired at a later time, once all external resources finished loading).
-    if (svgExtensions())
-        accessSVGExtensions().dispatchSVGLoadEventToOutermostSVGElements();
-
     dispatchWindowLoadEvent();
     dispatchPageshowEvent(PageshowEventNotPersisted);
     if (m_pendingStateObject)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to