Skip to content

Commit

Permalink
HTMLStyleElement should be able to fire the load event more than once
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=228975

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline WPT test that is now passing. This test was already passing in both Firefox and Chrome.

* web-platform-tests/html/semantics/document-metadata/the-style-element/style_load_event-expected.txt:

Source/WebCore:

HTMLStyleElement should be able to fire the load event more than once. WebKit has a flag
preventing the load event to fire more than once but this behavior is not present in the
HTML specification and doesn't match other browsers.

No new tests, rebaselined existing test.

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

LayoutTests:

Unskip test that is no longer timing out.

* TestExpectations:


Canonical link: https://commits.webkit.org/240826@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281443 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
cdumez committed Aug 23, 2021
1 parent d027ba2 commit 6f1d674
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 8 deletions.
11 changes: 11 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
2021-08-23 Chris Dumez <cdumez@apple.com>

HTMLStyleElement should be able to fire the load event more than once
https://bugs.webkit.org/show_bug.cgi?id=228975

Reviewed by Youenn Fablet.

Unskip test that is no longer timing out.

* TestExpectations:

2021-08-23 Xan Lopez <xan@igalia.com>

Skip failing test on 32bit (ARMv7/MIPS)
Expand Down
1 change: 0 additions & 1 deletion LayoutTests/TestExpectations
Expand Up @@ -540,7 +540,6 @@ imported/w3c/web-platform-tests/html/interaction/focus/sequential-focus-navigati
imported/w3c/web-platform-tests/html/interaction/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-order.html [ Skip ]
imported/w3c/web-platform-tests/html/interaction/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-positive.html [ Skip ]
imported/w3c/web-platform-tests/html/interaction/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-zero.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/document-metadata/the-style-element/style_load_event.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/playing-the-media-resource/loop-from-ended.tentative.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/src_object_blob.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/track-cue-rendering-empty-cue.html [ Skip ]
Expand Down
11 changes: 11 additions & 0 deletions LayoutTests/imported/w3c/ChangeLog
@@ -1,3 +1,14 @@
2021-08-23 Chris Dumez <cdumez@apple.com>

HTMLStyleElement should be able to fire the load event more than once
https://bugs.webkit.org/show_bug.cgi?id=228975

Reviewed by Youenn Fablet.

Rebaseline WPT test that is now passing. This test was already passing in both Firefox and Chrome.

* web-platform-tests/html/semantics/document-metadata/the-style-element/style_load_event-expected.txt:

2021-08-22 Myles C. Maxfield <mmaxfield@apple.com>

Control characters (Unicode category Cc) should be rendered visibly
Expand Down
@@ -1,5 +1,3 @@

Harness Error (TIMEOUT), message = null

TIMEOUT style load event should fire when textContent changed Test timed out
PASS style load event should fire when textContent changed

17 changes: 17 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,20 @@
2021-08-23 Chris Dumez <cdumez@apple.com>

HTMLStyleElement should be able to fire the load event more than once
https://bugs.webkit.org/show_bug.cgi?id=228975

Reviewed by Youenn Fablet.

HTMLStyleElement should be able to fire the load event more than once. WebKit has a flag
preventing the load event to fire more than once but this behavior is not present in the
HTML specification and doesn't match other browsers.

No new tests, rebaselined existing test.

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

2021-08-23 Alicia Boya García <aboya@igalia.com>

[MSE][GStreamer] Implement multi-track support
Expand Down
3 changes: 0 additions & 3 deletions Source/WebCore/html/HTMLStyleElement.cpp
Expand Up @@ -139,11 +139,8 @@ void HTMLStyleElement::dispatchPendingEvent(StyleEventSender* eventSender)

void HTMLStyleElement::notifyLoadedSheetAndAllCriticalSubresources(bool errorOccurred)
{
if (m_firedLoad)
return;
m_loadedSheet = !errorOccurred;
styleLoadEventSender().dispatchEventSoon(*this);
m_firedLoad = true;
}

void HTMLStyleElement::addSubresourceAttributeURLs(ListHashSet<URL>& urls) const
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/html/HTMLStyleElement.h
Expand Up @@ -68,7 +68,6 @@ class HTMLStyleElement final : public HTMLElement {
void addSubresourceAttributeURLs(ListHashSet<URL>&) const final;

InlineStyleSheetOwner m_styleSheetOwner;
bool m_firedLoad { false };
bool m_loadedSheet { false };
};

Expand Down

0 comments on commit 6f1d674

Please sign in to comment.