Title: [284883] trunk
Revision
284883
Author
cdu...@apple.com
Date
2021-10-26 11:26:50 -0700 (Tue, 26 Oct 2021)

Log Message

<link> elements should be able to fire more than one load / error event
https://bugs.webkit.org/show_bug.cgi?id=232309

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline WPT tests that are now passing.

* web-platform-tests/html/semantics/document-metadata/the-link-element/link-multiple-error-events-expected.txt:
* web-platform-tests/html/semantics/document-metadata/the-link-element/link-multiple-load-events-expected.txt:

Source/WebCore:

We had logic to only fire a single load / error event for <link> elements, even
though they could do several loads. This logic is not part of the specification
and was causing us to fail some WPT tests.

No new tests, unskipped existing tests.

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::HTMLLinkElement):
(WebCore::HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources):
* html/HTMLLinkElement.h:

LayoutTests:

Unskip tests that are no longer timing out.

* TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (284882 => 284883)


--- trunk/LayoutTests/ChangeLog	2021-10-26 18:19:44 UTC (rev 284882)
+++ trunk/LayoutTests/ChangeLog	2021-10-26 18:26:50 UTC (rev 284883)
@@ -1,3 +1,14 @@
+2021-10-26  Chris Dumez  <cdu...@apple.com>
+
+        <link> elements should be able to fire more than one load / error event
+        https://bugs.webkit.org/show_bug.cgi?id=232309
+
+        Reviewed by Darin Adler.
+
+        Unskip tests that are no longer timing out.
+
+        * TestExpectations:
+
 2021-10-26  Eric Hutchison  <ehutchi...@apple.com>
 
         [ Windows EWS ] imported/mozilla/svg/viewBox-and-pattern-03.svg is a flaky crash.

Modified: trunk/LayoutTests/TestExpectations (284882 => 284883)


--- trunk/LayoutTests/TestExpectations	2021-10-26 18:19:44 UTC (rev 284882)
+++ trunk/LayoutTests/TestExpectations	2021-10-26 18:26:50 UTC (rev 284883)
@@ -612,8 +612,6 @@
 imported/w3c/web-platform-tests/html/browsers/sandboxing/sandbox-disallow-scripts-via-unsandboxed-popup.tentative.html [ Skip ]
 imported/w3c/web-platform-tests/html/canvas/element/fill-and-stroke-styles/2d.pattern.transform.infinity.html [ Skip ]
 imported/w3c/web-platform-tests/html/rendering/replaced-elements/svg-inline-sizing/svg-inline.html [ Skip ]
-imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-multiple-error-events.html [ Skip ]
-imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-multiple-load-events.html [ Skip ]
 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_navigate_ancestor-1.sub.html [ Skip ]
 imported/w3c/web-platform-tests/html/semantics/forms/historical-search-event.html [ Skip ]
 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-summary-element/anchor-with-inline-element.html [ Skip ]

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (284882 => 284883)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-10-26 18:19:44 UTC (rev 284882)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-10-26 18:26:50 UTC (rev 284883)
@@ -1,3 +1,15 @@
+2021-10-26  Chris Dumez  <cdu...@apple.com>
+
+        <link> elements should be able to fire more than one load / error event
+        https://bugs.webkit.org/show_bug.cgi?id=232309
+
+        Reviewed by Darin Adler.
+
+        Rebaseline WPT tests that are now passing.
+
+        * web-platform-tests/html/semantics/document-metadata/the-link-element/link-multiple-error-events-expected.txt:
+        * web-platform-tests/html/semantics/document-metadata/the-link-element/link-multiple-load-events-expected.txt:
+
 2021-10-26  Ziran Sun  <z...@igalia.com>
 
         Fix CSS serialization affecting grid-auto-flow

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-multiple-error-events-expected.txt (284882 => 284883)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-multiple-error-events-expected.txt	2021-10-26 18:19:44 UTC (rev 284882)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-multiple-error-events-expected.txt	2021-10-26 18:26:50 UTC (rev 284883)
@@ -1,5 +1,3 @@
 
-Harness Error (TIMEOUT), message = null
+PASS Check if the <link>'s error event fires for each stylesheet it fails to load
 
-TIMEOUT Check if the <link>'s error event fires for each stylesheet it fails to load Test timed out
-

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-multiple-load-events-expected.txt (284882 => 284883)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-multiple-load-events-expected.txt	2021-10-26 18:19:44 UTC (rev 284882)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-multiple-load-events-expected.txt	2021-10-26 18:26:50 UTC (rev 284883)
@@ -1,5 +1,3 @@
 
-Harness Error (TIMEOUT), message = null
+PASS Check if the <link>'s load event fires for each stylesheet it loads
 
-TIMEOUT Check if the <link>'s load event fires for each stylesheet it loads Test timed out
-

Modified: trunk/Source/WebCore/ChangeLog (284882 => 284883)


--- trunk/Source/WebCore/ChangeLog	2021-10-26 18:19:44 UTC (rev 284882)
+++ trunk/Source/WebCore/ChangeLog	2021-10-26 18:26:50 UTC (rev 284883)
@@ -1,3 +1,21 @@
+2021-10-26  Chris Dumez  <cdu...@apple.com>
+
+        <link> elements should be able to fire more than one load / error event
+        https://bugs.webkit.org/show_bug.cgi?id=232309
+
+        Reviewed by Darin Adler.
+
+        We had logic to only fire a single load / error event for <link> elements, even
+        though they could do several loads. This logic is not part of the specification
+        and was causing us to fail some WPT tests.
+
+        No new tests, unskipped existing tests.
+
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::HTMLLinkElement):
+        (WebCore::HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources):
+        * html/HTMLLinkElement.h:
+
 2021-10-26  Ziran Sun  <z...@igalia.com>
 
         Fix CSS serialization affecting grid-auto-flow

Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (284882 => 284883)


--- trunk/Source/WebCore/html/HTMLLinkElement.cpp	2021-10-26 18:19:44 UTC (rev 284882)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp	2021-10-26 18:26:50 UTC (rev 284883)
@@ -92,7 +92,6 @@
     , m_disabledState(Unset)
     , m_loading(false)
     , m_createdByParser(createdByParser)
-    , m_firedLoad(false)
     , m_loadedResource(false)
     , m_isHandlingBeforeLoad(false)
     , m_allowPrefetchLoadAndErrorForTesting(false)
@@ -564,11 +563,8 @@
 
 void HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources(bool errorOccurred)
 {
-    if (m_firedLoad)
-        return;
     m_loadedResource = !errorOccurred;
     linkLoadEventSender().dispatchEventSoon(*this);
-    m_firedLoad = true;
 }
 
 void HTMLLinkElement::startLoadingDynamicSheet()

Modified: trunk/Source/WebCore/html/HTMLLinkElement.h (284882 => 284883)


--- trunk/Source/WebCore/html/HTMLLinkElement.h	2021-10-26 18:19:44 UTC (rev 284882)
+++ trunk/Source/WebCore/html/HTMLLinkElement.h	2021-10-26 18:26:50 UTC (rev 284883)
@@ -148,7 +148,6 @@
     LinkRelAttribute m_relAttribute;
     bool m_loading : 1;
     bool m_createdByParser : 1;
-    bool m_firedLoad : 1;
     bool m_loadedResource : 1;
     bool m_isHandlingBeforeLoad : 1;
     bool m_allowPrefetchLoadAndErrorForTesting : 1;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to