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

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

Issue 2239353002: Ignored title in shadow should cause StyleSheet.title = null. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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 5a9d71fb75063c7ea70baf978b181de4b6595559..211e788f07cf79774ca859f35eb98dac317a5083 100644
--- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
@@ -472,7 +472,8 @@ void LinkStyle::setCSSStyleSheet(const String& href, const KURL& baseURL, const
clearSheet();
m_sheet = CSSStyleSheet::create(restoredSheet, m_owner);
m_sheet->setMediaQueries(MediaQuerySet::create(m_owner->media()));
- m_sheet->setTitle(m_owner->title());
+ if (m_owner->isInDocumentTree())
+ m_sheet->setTitle(m_owner->title());
setCrossOriginStylesheetStatus(m_sheet.get());
m_loading = false;
@@ -493,7 +494,8 @@ void LinkStyle::setCSSStyleSheet(const String& href, const KURL& baseURL, const
m_sheet = CSSStyleSheet::create(styleSheet, m_owner);
m_sheet->setMediaQueries(MediaQuerySet::create(m_owner->media()));
- m_sheet->setTitle(m_owner->title());
+ if (m_owner->isInDocumentTree())
+ m_sheet->setTitle(m_owner->title());
setCrossOriginStylesheetStatus(m_sheet.get());
styleSheet->parseAuthorStyleSheet(cachedStyleSheet, m_owner->document().getSecurityOrigin());
@@ -709,7 +711,7 @@ void LinkStyle::process()
void LinkStyle::setSheetTitle(const String& title)
{
- if (m_sheet)
+ if (m_sheet && m_owner->isInDocumentTree())
m_sheet->setTitle(title);
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.cpp ('k') | third_party/WebKit/Source/core/html/HTMLStyleElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698