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

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

Issue 1913833002: Current work-in-progress crbug.com/567021 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed html import issue. Created 4 years 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
Index: third_party/WebKit/Source/core/html/LinkStyle.cpp
diff --git a/third_party/WebKit/Source/core/html/LinkStyle.cpp b/third_party/WebKit/Source/core/html/LinkStyle.cpp
index c86b8615816157fb061714c10438ec82a1bfd9dc..cb6d4e3902bd45aed09d35b7733f904e378d3476 100644
--- a/third_party/WebKit/Source/core/html/LinkStyle.cpp
+++ b/third_party/WebKit/Source/core/html/LinkStyle.cpp
@@ -306,8 +306,7 @@ LinkStyle::LoadReturnValue LinkStyle::loadStylesheetIfNeeded(
String title = m_owner->title();
if (!title.isEmpty() && !m_owner->isAlternate() &&
m_disabledState != EnabledViaScript && m_owner->isInDocumentTree()) {
- document().styleEngine().setPreferredStylesheetSetNameIfNotSet(
- title, StyleEngine::DontUpdateActiveSheets);
+ document().styleEngine().setPreferredStylesheetSetNameIfNotSet(title);
}
bool mediaQueryMatches = true;
@@ -387,16 +386,13 @@ void LinkStyle::process() {
if (loadStylesheetIfNeeded(builder, type) == NotNeeded && m_sheet) {
// we no longer contain a stylesheet, e.g. perhaps rel or type was changed
- StyleSheet* removedSheet = m_sheet.get();
clearSheet();
- document().styleEngine().setNeedsActiveStyleUpdate(removedSheet,
- FullStyleUpdate);
+ if (m_owner->isConnected())
+ document().styleEngine().setNeedsActiveStyleUpdate(m_owner->treeScope());
}
}
-void LinkStyle::setSheetTitle(
- const String& title,
- StyleEngine::ActiveSheetsUpdate updateActiveSheets) {
+void LinkStyle::setSheetTitle(const String& title) {
if (!m_owner->isInDocumentTree() || !m_owner->relAttribute().isStyleSheet())
return;
@@ -407,10 +403,8 @@ void LinkStyle::setSheetTitle(
return;
KURL href = m_owner->getNonEmptyURLAttribute(hrefAttr);
- if (href.isValid() && !href.isEmpty()) {
- document().styleEngine().setPreferredStylesheetSetNameIfNotSet(
- title, updateActiveSheets);
- }
+ if (href.isValid() && !href.isEmpty())
+ document().styleEngine().setPreferredStylesheetSetNameIfNotSet(title);
}
void LinkStyle::ownerRemoved() {
« no previous file with comments | « third_party/WebKit/Source/core/html/LinkStyle.h ('k') | third_party/WebKit/Source/core/html/imports/HTMLImportChild.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698