Commit 1bd0f699 authored by Andrea Iacovitti's avatar Andrea Iacovitti
Browse files

Correct side-tokenizer network resources (Images,Stylesheets,Scripts)

 preloading code; actually it was never executed:
- fix ATTR checks (attribute is the local name)
- fix case sensitivity compare of attribute's value for stylesheets

This will improve page loading performance.
(Thanks to SadEagle for his suggestions to make the patch better)
parent 592178a8
...@@ -705,7 +705,7 @@ void ProspectiveTokenizer::processAttribute() ...@@ -705,7 +705,7 @@ void ProspectiveTokenizer::processAttribute()
DOMStringImpl attrDS(DOMStringImpl::ShallowCopy, m_attributeName.data(), m_attributeName.size()); DOMStringImpl attrDS(DOMStringImpl::ShallowCopy, m_attributeName.data(), m_attributeName.size());
LocalName attrLocal = LocalName::fromString(&attrDS, IDS_NormalizeLower); LocalName attrLocal = LocalName::fromString(&attrDS, IDS_NormalizeLower);
uint attribute = attrLocal.id(); uint attribute = attrLocal.id();
if (attribute == ATTR_SRC && m_urlToLoad.isEmpty()) if (attribute == localNamePart(ATTR_SRC) && m_urlToLoad.isEmpty())
m_urlToLoad = parseURL(DOMString(m_attributeValue.data(), m_attributeValue.size())); m_urlToLoad = parseURL(DOMString(m_attributeValue.data(), m_attributeValue.size()));
break; break;
} }
...@@ -714,11 +714,11 @@ void ProspectiveTokenizer::processAttribute() ...@@ -714,11 +714,11 @@ void ProspectiveTokenizer::processAttribute()
DOMStringImpl attrDS(DOMStringImpl::ShallowCopy, m_attributeName.data(), m_attributeName.size()); DOMStringImpl attrDS(DOMStringImpl::ShallowCopy, m_attributeName.data(), m_attributeName.size());
LocalName attrLocal = LocalName::fromString(&attrDS, IDS_NormalizeLower); LocalName attrLocal = LocalName::fromString(&attrDS, IDS_NormalizeLower);
uint attribute = attrLocal.id(); uint attribute = attrLocal.id();
if (attribute == ATTR_HREF && m_urlToLoad.isEmpty()) if (attribute == localNamePart(ATTR_HREF) && m_urlToLoad.isEmpty())
m_urlToLoad = parseURL(DOMString(m_attributeValue.data(), m_attributeValue.size())); m_urlToLoad = parseURL(DOMString(m_attributeValue.data(), m_attributeValue.size()));
else if (attribute == ATTR_REL) { else if (attribute == localNamePart(ATTR_REL)) {
QString val = QString::fromRawData(m_attributeValue.data(), m_attributeValue.size()); QString val = DOMStringImpl(DOMStringImpl::ShallowCopy, m_attributeValue.data(), m_attributeValue.size()).lower()->string();
m_linkIsStyleSheet = val.contains("styleSheet") && !val.contains("alternate") && !val.contains("icon"); m_linkIsStyleSheet = val.contains("stylesheet") && !val.contains("alternate") && !val.contains("icon");
} }
} }
default: default:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment