Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(425)

Unified Diff: third_party/WebKit/Source/core/html/HTMLLinkElement.cpp

Issue 2169803002: Remove HTMLLinkElement::m_isInShadowTree member variable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLLinkElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
index 28ca25829ed1b4b720c415227712120d0e590ad3..41f52b25d9b9dea4a12ca5c594dfc44a443dea96 100644
--- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
@@ -81,7 +81,6 @@ inline HTMLLinkElement::HTMLLinkElement(Document& document, bool createdByParser
, m_sizes(DOMTokenList::create(this))
, m_relList(RelList::create(this))
, m_createdByParser(createdByParser)
- , m_isInShadowTree(false)
{
}
@@ -144,7 +143,7 @@ bool HTMLLinkElement::loadLink(const String& type, const String& as, const Strin
LinkResource* HTMLLinkElement::linkResourceToProcess()
{
- bool visible = isConnected() && !m_isInShadowTree;
+ bool visible = isConnected() && !isInShadowTree();
if (!visible) {
ASSERT(!linkStyle() || !linkStyle()->hasSheet());
return nullptr;
@@ -205,8 +204,7 @@ Node::InsertionNotificationRequest HTMLLinkElement::insertedInto(ContainerNode*
if (!insertionPoint->isConnected())
return InsertionDone;
- m_isInShadowTree = isInShadowTree();
- if (m_isInShadowTree) {
+ if (isInShadowTree()) {
String message = "HTML element <link> is ignored in shadow tree.";
document().addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, message));
return InsertionDone;
@@ -224,13 +222,15 @@ Node::InsertionNotificationRequest HTMLLinkElement::insertedInto(ContainerNode*
void HTMLLinkElement::removedFrom(ContainerNode* insertionPoint)
{
+ // Store the result of isInShadowTree() here before Node::removedFrom(..) clears the flags.
+ bool wasInShadowTree = isInShadowTree();
HTMLElement::removedFrom(insertionPoint);
if (!insertionPoint->isConnected())
return;
m_linkLoader->released();
- if (m_isInShadowTree) {
+ if (wasInShadowTree) {
ASSERT(!linkStyle() || !linkStyle()->hasSheet());
return;
}
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLLinkElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698