[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bkdelibs/KDE/4=2E7=5D_khtml/html=3A_Correct_side-tok?=
From:       Andrea Iacovitti <aiacovitti () libero ! it>
Date:       2011-07-09 16:45:47
Message-ID: 20110709164547.49948A60A6 () git ! kde ! org
[Download RAW message or body]

Git commit 93a773aad9d5410d61b8bfb72c14cda51b92fde0 by Andrea Iacovitti.
Committed on 09/07/2011 at 18:40.
Pushed by aiacovitti into branch 'KDE/4.7'.

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)

M  +5    -5    khtml/html/htmlprospectivetokenizer.cpp     

http://commits.kde.org/kdelibs/93a773aad9d5410d61b8bfb72c14cda51b92fde0

diff --git a/khtml/html/htmlprospectivetokenizer.cpp \
b/khtml/html/htmlprospectivetokenizer.cpp index 2985f5f..0e58709 100644
--- a/khtml/html/htmlprospectivetokenizer.cpp
+++ b/khtml/html/htmlprospectivetokenizer.cpp
@@ -705,7 +705,7 @@ void ProspectiveTokenizer::processAttribute()
         DOMStringImpl attrDS(DOMStringImpl::ShallowCopy, m_attributeName.data(), \
                m_attributeName.size());
         LocalName attrLocal = LocalName::fromString(&attrDS, IDS_NormalizeLower);
         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()));  break;
     }
@@ -714,11 +714,11 @@ void ProspectiveTokenizer::processAttribute()
         DOMStringImpl attrDS(DOMStringImpl::ShallowCopy, m_attributeName.data(), \
                m_attributeName.size());
         LocalName attrLocal = LocalName::fromString(&attrDS, IDS_NormalizeLower);
         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()));
-        else if (attribute == ATTR_REL) {
-            QString val = QString::fromRawData(m_attributeValue.data(), \
                m_attributeValue.size());
-            m_linkIsStyleSheet = val.contains("styleSheet") && \
!val.contains("alternate") && !val.contains("icon"); +        else if (attribute == \
localNamePart(ATTR_REL)) { +            QString val = \
DOMStringImpl(DOMStringImpl::ShallowCopy, m_attributeValue.data(), \
m_attributeValue.size()).lower()->string(); +            m_linkIsStyleSheet = \
val.contains("stylesheet") && !val.contains("alternate") && !val.contains("icon");  }
     }
     default:


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic