Index: third_party/WebKit/Source/core/html/HTMLStyleElement.cpp |
diff --git a/third_party/WebKit/Source/core/html/HTMLStyleElement.cpp b/third_party/WebKit/Source/core/html/HTMLStyleElement.cpp |
index c8a3610e2611e74e7fa6731a83a17effb02f76b5..f989a925f3050392b98a21fe86cac27fe04e65f7 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLStyleElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLStyleElement.cpp |
@@ -60,7 +60,7 @@ HTMLStyleElement* HTMLStyleElement::create(Document& document, bool createdByPar |
void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& value) |
{ |
- if (name == titleAttr && m_sheet) { |
+ if (name == titleAttr && m_sheet && isInDocumentTree()) { |
m_sheet->setTitle(value); |
} else if (name == mediaAttr && isConnected() && document().isActive() && m_sheet) { |
m_sheet->setMediaQueries(MediaQuerySet::create(value)); |