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 1b3522c8253f293e26488f4f24af88eb155cfbf4..e14947e1e14d2aec02625d1e0dcd069e8f13f5d1 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp |
@@ -481,6 +481,7 @@ LinkStyle::LinkStyle(HTMLLinkElement* owner) |
, m_firedLoad(false) |
, m_loadedSheet(false) |
, m_fetchFollowingCORS(false) |
+ , m_beforeBody(false) |
{ |
} |
@@ -622,7 +623,8 @@ void LinkStyle::addPendingSheet(PendingSheetType type) |
if (m_pendingSheetType == NonBlocking) |
return; |
- m_owner->document().styleEngine().addPendingSheet(); |
+ m_beforeBody = m_beforeBody || !m_owner->document().body(); |
+ m_owner->document().styleEngine().addPendingSheet(m_beforeBody); |
} |
void LinkStyle::removePendingSheet() |
@@ -638,7 +640,7 @@ void LinkStyle::removePendingSheet() |
return; |
} |
- m_owner->document().styleEngine().removePendingSheet(m_owner); |
+ m_owner->document().styleEngine().removePendingSheet(m_owner, m_beforeBody); |
} |
void LinkStyle::setDisabledState(bool disabled) |