Skip to content

Commit

Permalink
Revert 252943@main for causing constant flickering on aa.com
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=244879

Unreviewed. Reverts 252943@main.

* LayoutTests/TestExpectations:
* LayoutTests/fast/dom/HTMLLinkElement/link-preload-load-once-expected.txt: Removed.
* LayoutTests/fast/dom/HTMLLinkElement/link-preload-load-once.html: Removed.
* LayoutTests/fast/dom/HTMLLinkElement/link-stylesheet-load-once-expected.txt: Removed.
* LayoutTests/fast/dom/HTMLLinkElement/link-stylesheet-load-once.html: Removed.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-multiple-error-events-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-multiple-load-events-expected.txt:
* LayoutTests/platform/mac-wk1/fast/dom/HTMLLinkElement/link-preload-load-once-expected.txt: Removed.
* LayoutTests/platform/win/fast/dom/HTMLLinkElement/link-preload-load-once-expected.txt: Removed.
* Source/WebCore/html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::HTMLLinkElement):
(WebCore::HTMLLinkElement::parseAttribute):
(WebCore::HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources):
* Source/WebCore/html/HTMLLinkElement.h:
* Source/WebCore/html/LinkRelAttribute.h:
(WebCore::operator==): Deleted.
(WebCore::operator!=): Deleted.

Canonical link: https://commits.webkit.org/254213@main
  • Loading branch information
rniwa committed Sep 7, 2022
1 parent 4aba78c commit 319d922
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 147 deletions.
2 changes: 2 additions & 0 deletions LayoutTests/TestExpectations
Expand Up @@ -672,6 +672,8 @@ imported/w3c/web-platform-tests/html/browsers/sandboxing/sandbox-disallow-script
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/embedded-content-rendering-rules/audio-controls-002.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 ]
Expand Down

This file was deleted.

39 changes: 0 additions & 39 deletions LayoutTests/fast/dom/HTMLLinkElement/link-preload-load-once.html

This file was deleted.

This file was deleted.

This file was deleted.

@@ -1,3 +1,5 @@

PASS Check if the <link>'s error event fires for each stylesheet it fails to load
Harness Error (TIMEOUT), message = null

TIMEOUT Check if the <link>'s error event fires for each stylesheet it fails to load Test timed out

@@ -1,3 +1,5 @@

PASS Check if the <link>'s load event fires for each stylesheet it loads
Harness Error (TIMEOUT), message = null

TIMEOUT Check if the <link>'s load event fires for each stylesheet it loads Test timed out

This file was deleted.

This file was deleted.

11 changes: 6 additions & 5 deletions Source/WebCore/html/HTMLLinkElement.cpp
Expand Up @@ -92,6 +92,7 @@ inline HTMLLinkElement::HTMLLinkElement(const QualifiedName& tagName, Document&
, m_disabledState(Unset)
, m_loading(false)
, m_createdByParser(createdByParser)
, m_firedLoad(false)
, m_loadedResource(false)
, m_isHandlingBeforeLoad(false)
, m_allowPrefetchLoadAndErrorForTesting(false)
Expand Down Expand Up @@ -166,13 +167,10 @@ void HTMLLinkElement::setDisabledState(bool disabled)
void HTMLLinkElement::parseAttribute(const QualifiedName& name, const AtomString& value)
{
if (name == relAttr) {
auto parsedRel = LinkRelAttribute(document(), value);
auto didMutateRel = parsedRel != m_relAttribute;
m_relAttribute = parsedRel;
m_relAttribute = LinkRelAttribute(document(), value);
if (m_relList)
m_relList->associatedAttributeValueChanged(value);
if (didMutateRel)
process();
process();
return;
}
if (name == hrefAttr) {
Expand Down Expand Up @@ -561,8 +559,11 @@ DOMTokenList& HTMLLinkElement::relList()

void HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources(bool errorOccurred)
{
if (m_firedLoad)
return;
m_loadedResource = !errorOccurred;
linkLoadEventSender().dispatchEventSoon(*this);
m_firedLoad = true;
}

void HTMLLinkElement::startLoadingDynamicSheet()
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/html/HTMLLinkElement.h
Expand Up @@ -152,6 +152,7 @@ class HTMLLinkElement final : public HTMLElement, public CachedStyleSheetClient,
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;
Expand Down
20 changes: 0 additions & 20 deletions Source/WebCore/html/LinkRelAttribute.h
Expand Up @@ -58,24 +58,4 @@ struct LinkRelAttribute {
static bool isSupported(Document&, StringView);
};

inline bool operator==(const LinkRelAttribute& left, const LinkRelAttribute& right)
{
return left.iconType == right.iconType
&& left.isStyleSheet == right.isStyleSheet
&& left.isAlternate == right.isAlternate
&& left.isDNSPrefetch == right.isDNSPrefetch
&& left.isLinkPreload == right.isLinkPreload
&& left.isLinkPreconnect == right.isLinkPreconnect
&& left.isLinkPrefetch == right.isLinkPrefetch
#if ENABLE(APPLICATION_MANIFEST)
&& left.isApplicationManifest == right.isApplicationManifest
#endif
;
}

inline bool operator!=(const LinkRelAttribute& left, const LinkRelAttribute& right)
{
return !(left == right);
}

}

0 comments on commit 319d922

Please sign in to comment.