[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

hyatt hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:20:46 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 8f5c7f000e7490aca5515444485e21dc14e768c5
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 21 23:54:31 2003 +0000

    	Fix for the 2.5% perf regression from the descendant rules
    	changes.  This patch does 3 things:
    	(1) Fix the descendant rule check in the CSS parser. It
    	was incorrect.
    	(2) Fix DOM insertion/removal from setting the parent as needing
    	a style re-resolve.
    	(3) Fix whitespace inside <html> so that it doesn't make a premature
    	<body>.
    
            Reviewed by mjs
    
            * khtml/css/cssparser.cpp:
            (StyleBaseImpl::parseSelector):
            * khtml/html/htmlparser.cpp:
            (KHTMLParser::insertNode):
            * khtml/xml/dom_elementimpl.cpp:
            (ElementImpl::recalcStyle):
            * khtml/xml/dom_nodeimpl.cpp:
            (NodeBaseImpl::insertBefore):
            (NodeBaseImpl::replaceChild):
            (NodeBaseImpl::removeChild):
            (NodeBaseImpl::appendChild):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3372 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 47562c3..99222a2 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,28 @@
+2003-01-21  David Hyatt  <hyatt at apple.com>
+
+	Fix for the 2.5% perf regression from the descendant rules
+	changes.  This patch does 3 things:
+	(1) Fix the descendant rule check in the CSS parser. It
+	was incorrect.
+	(2) Fix DOM insertion/removal from setting the parent as needing
+	a style re-resolve.
+	(3) Fix whitespace inside <html> so that it doesn't make a premature
+	<body>.
+	
+        Reviewed by mjs
+
+        * khtml/css/cssparser.cpp:
+        (StyleBaseImpl::parseSelector):
+        * khtml/html/htmlparser.cpp:
+        (KHTMLParser::insertNode):
+        * khtml/xml/dom_elementimpl.cpp:
+        (ElementImpl::recalcStyle):
+        * khtml/xml/dom_nodeimpl.cpp:
+        (NodeBaseImpl::insertBefore):
+        (NodeBaseImpl::replaceChild):
+        (NodeBaseImpl::removeChild):
+        (NodeBaseImpl::appendChild):
+
 2003-01-21  Darin Adler  <darin at apple.com>
 
         Reviewed by Richard.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 47562c3..99222a2 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,28 @@
+2003-01-21  David Hyatt  <hyatt at apple.com>
+
+	Fix for the 2.5% perf regression from the descendant rules
+	changes.  This patch does 3 things:
+	(1) Fix the descendant rule check in the CSS parser. It
+	was incorrect.
+	(2) Fix DOM insertion/removal from setting the parent as needing
+	a style re-resolve.
+	(3) Fix whitespace inside <html> so that it doesn't make a premature
+	<body>.
+	
+        Reviewed by mjs
+
+        * khtml/css/cssparser.cpp:
+        (StyleBaseImpl::parseSelector):
+        * khtml/html/htmlparser.cpp:
+        (KHTMLParser::insertNode):
+        * khtml/xml/dom_elementimpl.cpp:
+        (ElementImpl::recalcStyle):
+        * khtml/xml/dom_nodeimpl.cpp:
+        (NodeBaseImpl::insertBefore):
+        (NodeBaseImpl::replaceChild):
+        (NodeBaseImpl::removeChild):
+        (NodeBaseImpl::appendChild):
+
 2003-01-21  Darin Adler  <darin at apple.com>
 
         Reviewed by Richard.
diff --git a/WebCore/khtml/css/cssparser.cpp b/WebCore/khtml/css/cssparser.cpp
index 537ef83..06c93fc 100644
--- a/WebCore/khtml/css/cssparser.cpp
+++ b/WebCore/khtml/css/cssparser.cpp
@@ -689,25 +689,33 @@ StyleBaseImpl::parseSelector(const QChar *curP, const QChar *endP)
                 slist->setAutoDelete(true);
             }
             slist->append(selector);
-            if (!sawDescendantRule && 
-                (selector->relation == CSSSelector::Descendant || 
-                 selector->relation == CSSSelector::Child)) {
-                // We encountered a descendant rule.  Get our document and set its
-                // descendant rule flag to true.
-                sawDescendantRule = true;
-                StyleBaseImpl *b = this;
-                StyleBaseImpl *root = this;
-                while (b) {
-                    root = b;
-                    b = b->m_parent;
-                }
-            
-                if (root && root->isStyleSheet()) {
-                    StyleSheetImpl *sheet = static_cast<StyleSheetImpl *>(root);
-                    if (sheet->ownerNode()) {
-                        DocumentImpl *doc = sheet->ownerNode()->getDocument();
-                        doc->setUsesDescendantRules(true);
+            if (!sawDescendantRule) {
+                CSSSelector* sel = selector;
+                CSSSelector::Relation relation = sel->relation;
+                while ((sel = sel->tagHistory)) {
+                    if (relation == CSSSelector::Descendant || 
+                        relation == CSSSelector::Child) {
+                        // We encountered a descendant rule.  Get our document and set its
+                        // descendant rule flag to true.
+                        sawDescendantRule = true;
+                        StyleBaseImpl *b = this;
+                        StyleBaseImpl *root = this;
+                        while (b) {
+                            root = b;
+                            b = b->m_parent;
+                        }
+                    
+                        if (root && root->isStyleSheet()) {
+                            StyleSheetImpl *sheet = static_cast<StyleSheetImpl *>(root);
+                            if (sheet->ownerNode()) {
+                                DocumentImpl *doc = sheet->ownerNode()->getDocument();
+                                if (!doc->usesDescendantRules())
+                                    doc->setUsesDescendantRules(true);
+                            }
+                        }
+                        break;
                     }
+                    relation = sel->relation;
                 }
             }
         }
diff --git a/WebCore/khtml/html/htmlparser.cpp b/WebCore/khtml/html/htmlparser.cpp
index 29076d3..7d82f3f 100644
--- a/WebCore/khtml/html/htmlparser.cpp
+++ b/WebCore/khtml/html/htmlparser.cpp
@@ -566,6 +566,12 @@ bool KHTMLParser::insertNode(NodeImpl *n, bool flat)
                     handled = true;
                 }
                 break;
+            case ID_TEXT: {
+                TextImpl *t = static_cast<TextImpl *>(n);
+                if (t->containsOnlyWhitespace())
+                    return false;
+                /* Fall through to default */
+            }
             default:
                 if ( haveFrameSet ) break;
                 e = new HTMLBodyElementImpl(document);
diff --git a/WebCore/khtml/xml/dom_elementimpl.cpp b/WebCore/khtml/xml/dom_elementimpl.cpp
index bd6b32d..4a95c63 100644
--- a/WebCore/khtml/xml/dom_elementimpl.cpp
+++ b/WebCore/khtml/xml/dom_elementimpl.cpp
@@ -329,6 +329,8 @@ void ElementImpl::recalcStyle( StyleChange change )
 {
     // ### should go away and be done in renderobject
     RenderStyle* _style = m_render ? m_render->style() : 0;
+    bool hasParentRenderer = parent() ? parent()->renderer() : false;
+    
 #if 0
     const char* debug;
     switch(change) {
@@ -343,7 +345,7 @@ void ElementImpl::recalcStyle( StyleChange change )
     }
     qDebug("recalcStyle(%d: %s)[%p: %s]", change, debug, this, tagName().string().latin1());
 #endif
-    if ( change >= Inherit || changed() ) {
+    if ( hasParentRenderer && (change >= Inherit || changed()) ) {
         EDisplay oldDisplay = _style ? _style->display() : NONE;
 
         RenderStyle *newStyle = getDocument()->styleSelector()->styleForElement(this);
diff --git a/WebCore/khtml/xml/dom_nodeimpl.cpp b/WebCore/khtml/xml/dom_nodeimpl.cpp
index 1963042..fe08fba 100644
--- a/WebCore/khtml/xml/dom_nodeimpl.cpp
+++ b/WebCore/khtml/xml/dom_nodeimpl.cpp
@@ -1164,8 +1164,7 @@ NodeImpl *NodeBaseImpl::insertBefore ( NodeImpl *newChild, NodeImpl *refChild, i
         child = nextChild;
     }
 
-    // ### set style in case it's attached
-    setChanged(true);
+    getDocument()->setDocumentChanged(true);
     dispatchSubtreeModifiedEvent();
     return newChild;
 }
@@ -1240,7 +1239,7 @@ NodeImpl *NodeBaseImpl::replaceChild ( NodeImpl *newChild, NodeImpl *oldChild, i
     }
 
     // ### set style in case it's attached
-    setChanged(true);
+    getDocument()->setDocumentChanged(true);
     dispatchSubtreeModifiedEvent();
     return oldChild;
 }
@@ -1292,7 +1291,7 @@ NodeImpl *NodeBaseImpl::removeChild ( NodeImpl *oldChild, int &exceptioncode )
     oldChild->setNextSibling(0);
     oldChild->setParent(0);
 
-    setChanged(true);
+    getDocument()->setDocumentChanged(true);
 
     // Dispatch post-removal mutation events
     dispatchSubtreeModifiedEvent();
@@ -1391,7 +1390,7 @@ NodeImpl *NodeBaseImpl::appendChild ( NodeImpl *newChild, int &exceptioncode )
         child = nextChild;
     }
 
-    setChanged(true);
+    getDocument()->setDocumentChanged(true);
     // ### set style in case it's attached
     dispatchSubtreeModifiedEvent();
     return newChild;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list