summaryrefslogtreecommitdiffstats
path: root/WebCore/html/HTMLLinkElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/html/HTMLLinkElement.cpp')
-rw-r--r--WebCore/html/HTMLLinkElement.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/WebCore/html/HTMLLinkElement.cpp b/WebCore/html/HTMLLinkElement.cpp
index a1ebbc5..aa6360b 100644
--- a/WebCore/html/HTMLLinkElement.cpp
+++ b/WebCore/html/HTMLLinkElement.cpp
@@ -123,7 +123,7 @@ void HTMLLinkElement::parseMappedAttribute(MappedAttribute *attr)
#endif
process();
} else if (attr->name() == hrefAttr) {
- m_url = document()->completeURL(parseURL(attr->value()));
+ m_url = document()->completeURL(deprecatedParseURL(attr->value()));
process();
} else if (attr->name() == typeAttr) {
m_type = attr->value();
@@ -202,9 +202,11 @@ void HTMLLinkElement::process()
if (m_isDNSPrefetch && m_url.isValid() && !m_url.isEmpty())
prefetchDNS(m_url.host());
+ bool acceptIfTypeContainsTextCSS = document()->page() && document()->page()->settings() && document()->page()->settings()->treatsAnyTextCSSLinkAsStylesheet();
+
// Stylesheet
// This was buggy and would incorrectly match <link rel="alternate">, which has a different specified meaning. -dwh
- if (m_disabledState != 2 && m_isStyleSheet && document()->frame() && m_url.isValid()) {
+ if (m_disabledState != 2 && (m_isStyleSheet || acceptIfTypeContainsTextCSS && type.contains("text/css")) && document()->frame() && m_url.isValid()) {
// also, don't load style sheets for standalone documents
// Add ourselves as a pending sheet, but only if we aren't an alternate
// stylesheet. Alternate stylesheets don't hold up render tree construction.
@@ -246,11 +248,11 @@ void HTMLLinkElement::removedFromDocument()
{
HTMLElement::removedFromDocument();
+ document()->removeStyleSheetCandidateNode(this);
+
// FIXME: It's terrible to do a synchronous update of the style selector just because a <style> or <link> element got removed.
- if (document()->renderer()) {
- document()->removeStyleSheetCandidateNode(this);
+ if (document()->renderer())
document()->updateStyleSelector();
- }
}
void HTMLLinkElement::finishParsingChildren()