Title: [216523] branches/safari-603-branch

Diff

Modified: branches/safari-603-branch/LayoutTests/ChangeLog (216522 => 216523)


--- branches/safari-603-branch/LayoutTests/ChangeLog	2017-05-09 18:05:11 UTC (rev 216522)
+++ branches/safari-603-branch/LayoutTests/ChangeLog	2017-05-09 18:05:14 UTC (rev 216523)
@@ -1,5 +1,22 @@
 2017-05-09  Matthew Hanson  <matthew_han...@apple.com>
 
+        Cherry-pick r216023. rdar://problem/31971371
+
+    2017-05-01  Chris Dumez  <cdu...@apple.com>
+
+            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-09  Matthew Hanson  <matthew_han...@apple.com>
+
         Cherry-pick r215971. rdar://problem/31971140
 
     2017-04-28  Per Arne Vollan  <pvol...@apple.com>

Added: branches/safari-603-branch/LayoutTests/fast/dom/domparser-parsefromstring-svg-load-event-expected.txt (0 => 216523)


--- branches/safari-603-branch/LayoutTests/fast/dom/domparser-parsefromstring-svg-load-event-expected.txt	                        (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/dom/domparser-parsefromstring-svg-load-event-expected.txt	2017-05-09 18:05:14 UTC (rev 216523)
@@ -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: branches/safari-603-branch/LayoutTests/fast/dom/domparser-parsefromstring-svg-load-event.html (0 => 216523)


--- branches/safari-603-branch/LayoutTests/fast/dom/domparser-parsefromstring-svg-load-event.html	                        (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/dom/domparser-parsefromstring-svg-load-event.html	2017-05-09 18:05:14 UTC (rev 216523)
@@ -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: branches/safari-603-branch/Source/WebCore/ChangeLog (216522 => 216523)


--- branches/safari-603-branch/Source/WebCore/ChangeLog	2017-05-09 18:05:11 UTC (rev 216522)
+++ branches/safari-603-branch/Source/WebCore/ChangeLog	2017-05-09 18:05:14 UTC (rev 216523)
@@ -1,5 +1,25 @@
 2017-05-09  Matthew Hanson  <matthew_han...@apple.com>
 
+        Cherry-pick r216023. rdar://problem/31971371
+
+    2017-05-01  Chris Dumez  <cdu...@apple.com>
+
+            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-09  Matthew Hanson  <matthew_han...@apple.com>
+
         Cherry-pick r215971. rdar://problem/31971140
 
     2017-04-28  Per Arne Vollan  <pvol...@apple.com>

Modified: branches/safari-603-branch/Source/WebCore/dom/Document.cpp (216522 => 216523)


--- branches/safari-603-branch/Source/WebCore/dom/Document.cpp	2017-05-09 18:05:11 UTC (rev 216522)
+++ branches/safari-603-branch/Source/WebCore/dom/Document.cpp	2017-05-09 18:05:14 UTC (rev 216523)
@@ -2707,14 +2707,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
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to