summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/html/HTMLLinkElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/html/HTMLLinkElement.cpp')
-rw-r--r--Source/WebCore/html/HTMLLinkElement.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/WebCore/html/HTMLLinkElement.cpp b/Source/WebCore/html/HTMLLinkElement.cpp
index 8b2ae08..04cfda4 100644
--- a/Source/WebCore/html/HTMLLinkElement.cpp
+++ b/Source/WebCore/html/HTMLLinkElement.cpp
@@ -56,6 +56,7 @@ inline HTMLLinkElement::HTMLLinkElement(const QualifiedName& tagName, Document*
, m_disabledState(Unset)
, m_loading(false)
, m_createdByParser(createdByParser)
+ , m_isInShadowTree(false)
, m_pendingSheetType(None)
{
ASSERT(hasTagName(linkTag));
@@ -204,7 +205,7 @@ void HTMLLinkElement::tokenizeRelAttribute(const AtomicString& rel, RelAttribute
void HTMLLinkElement::process()
{
- if (!inDocument()) {
+ if (!inDocument() || m_isInShadowTree) {
ASSERT(!m_sheet);
return;
}
@@ -247,7 +248,7 @@ void HTMLLinkElement::process()
String charset = getAttribute(charsetAttr);
if (charset.isEmpty() && document()->frame())
- charset = document()->frame()->loader()->writer()->encoding();
+ charset = document()->charset();
if (m_cachedSheet) {
removePendingSheet();
@@ -298,6 +299,11 @@ void HTMLLinkElement::process()
void HTMLLinkElement::insertedIntoDocument()
{
HTMLElement::insertedIntoDocument();
+
+ m_isInShadowTree = isInShadowTree();
+ if (m_isInShadowTree)
+ return;
+
document()->addStyleSheetCandidateNode(this, m_createdByParser);
process();
@@ -307,6 +313,10 @@ void HTMLLinkElement::removedFromDocument()
{
HTMLElement::removedFromDocument();
+ if (m_isInShadowTree) {
+ ASSERT(!m_sheet);
+ return;
+ }
document()->removeStyleSheetCandidateNode(this);
if (m_sheet) {