[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

simon.fraser at apple.com simon.fraser at apple.com
Wed Dec 22 11:36:50 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 2ae4ee90346916fb54206665801136415f05d415
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 30 23:02:18 2010 +0000

    2010-07-30  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Darin Adler.
    
            connect-compositing-iframe2.html test sometimes shows blank iframe content
            https://bugs.webkit.org/show_bug.cgi?id=42046
    
            Hooking up compositing iframes requires setNeedsStyleRecalc(SyntheticStyleChange) to
            always result in a call to RenderLayer::styleChanged(). However, the semantics of
            setNeedsStyleRecalc() was that each call would overwrite the existing styleChangeType,
            allowing a "lesser" style change to override a "greater" one. In the test content,
            SyntheticStyleChange was being replaced by FullStyleChange when the classname changed.
            This resulted in RenderLayer::styleChanged() not being called.
    
            Fix by changing the behavior of setNeedsStyleRecalc() to only touch the style change
            type if a "lesser" change is being replaced with a "greater" one. This required adding
            a new clearNeedsStyleRecalc() method to reset the style change type to NoStyleChange.
    
            In addition, in Node::setNeedsStyleRecalc(), only propagate the childNeedsStyleRecalc
            up the parent change if the node was not already needing recalc. In order to fix issues
            with attaching, this required new call to clearNeedsStyleRecalc() at the end of attach().
    
            * manual-tests/compositing/missing-iframe-contents.html: Added.
            * manual-tests/compositing/resources/composited-subframe.html: Copied from LayoutTests/compositing/iframes/resources/composited-subframe.html.
    
            * dom/Document.cpp:
            (WebCore::Document::recalcStyle): Call clearNeedsStyleRecalc().
            * dom/Element.cpp:
            (WebCore::Element::recalcStyle): Call clearNeedsStyleRecalc().
    
            * dom/Node.h:
            (WebCore::Node::clearNeedsStyleRecalc): New method.
            * dom/Node.cpp:
            (WebCore::Node::setNeedsStyleRecalc): Only call setStyleChange() if the change type
            is greater than the current change type.
            (WebCore::Node::attach): After attaching, we can call clearNeedsStyleRecalc().
    
            * dom/Text.cpp:
            (WebCore::Text::recalcStyle): Call clearNeedsStyleRecalc().
            * html/HTMLFrameSetElement.cpp:
            (WebCore::HTMLFrameSetElement::recalcStyle): Call clearNeedsStyleRecalc().
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64383 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9f4d2e6..2fef436 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,45 @@
+2010-07-30  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Darin Adler.
+
+        connect-compositing-iframe2.html test sometimes shows blank iframe content
+        https://bugs.webkit.org/show_bug.cgi?id=42046
+
+        Hooking up compositing iframes requires setNeedsStyleRecalc(SyntheticStyleChange) to
+        always result in a call to RenderLayer::styleChanged(). However, the semantics of 
+        setNeedsStyleRecalc() was that each call would overwrite the existing styleChangeType,
+        allowing a "lesser" style change to override a "greater" one. In the test content,
+        SyntheticStyleChange was being replaced by FullStyleChange when the classname changed.
+        This resulted in RenderLayer::styleChanged() not being called.
+        
+        Fix by changing the behavior of setNeedsStyleRecalc() to only touch the style change
+        type if a "lesser" change is being replaced with a "greater" one. This required adding
+        a new clearNeedsStyleRecalc() method to reset the style change type to NoStyleChange.
+        
+        In addition, in Node::setNeedsStyleRecalc(), only propagate the childNeedsStyleRecalc
+        up the parent change if the node was not already needing recalc. In order to fix issues
+        with attaching, this required new call to clearNeedsStyleRecalc() at the end of attach().
+
+        * manual-tests/compositing/missing-iframe-contents.html: Added.
+        * manual-tests/compositing/resources/composited-subframe.html: Copied from LayoutTests/compositing/iframes/resources/composited-subframe.html.
+
+        * dom/Document.cpp:
+        (WebCore::Document::recalcStyle): Call clearNeedsStyleRecalc().
+        * dom/Element.cpp:
+        (WebCore::Element::recalcStyle): Call clearNeedsStyleRecalc().
+
+        * dom/Node.h:
+        (WebCore::Node::clearNeedsStyleRecalc): New method.
+        * dom/Node.cpp:
+        (WebCore::Node::setNeedsStyleRecalc): Only call setStyleChange() if the change type
+        is greater than the current change type.
+        (WebCore::Node::attach): After attaching, we can call clearNeedsStyleRecalc().
+
+        * dom/Text.cpp:
+        (WebCore::Text::recalcStyle): Call clearNeedsStyleRecalc().
+        * html/HTMLFrameSetElement.cpp:
+        (WebCore::HTMLFrameSetElement::recalcStyle): Call clearNeedsStyleRecalc().
+
 2010-07-30  W. James MacLean  <wjmaclean at google.com>
 
         Reviewed by Nikolas Zimmermann.
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index 848a9f5..91efe9e 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -1451,7 +1451,7 @@ void Document::recalcStyle(StyleChange change)
 #endif
 
 bail_out:
-    setNeedsStyleRecalc(NoStyleChange);
+    clearNeedsStyleRecalc();
     clearChildNeedsStyleRecalc();
     unscheduleStyleRecalc();
 
diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp
index a1ff56d..d6b8d55 100644
--- a/WebCore/dom/Element.cpp
+++ b/WebCore/dom/Element.cpp
@@ -905,7 +905,7 @@ void Element::recalcStyle(StyleChange change)
                 detach();
             attach(); // FIXME: The style gets computed twice by calling attach. We could do better if we passed the style along.
             // attach recalulates the style for all children. No need to do it twice.
-            setNeedsStyleRecalc(NoStyleChange);
+            clearNeedsStyleRecalc();
             clearChildNeedsStyleRecalc();
             return;
         }
@@ -971,7 +971,7 @@ void Element::recalcStyle(StyleChange change)
             forceCheckOfNextElementSibling = childRulesChanged && hasDirectAdjacentRules;
     }
 
-    setNeedsStyleRecalc(NoStyleChange);
+    clearNeedsStyleRecalc();
     clearChildNeedsStyleRecalc();
 }
 
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index df9dcfb..e0f04de 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -726,15 +726,18 @@ inline void Node::setStyleChange(StyleChangeType changeType)
 
 void Node::setNeedsStyleRecalc(StyleChangeType changeType)
 {
-    if ((changeType != NoStyleChange) && !attached()) // changed compared to what?
+    ASSERT(changeType != NoStyleChange);
+    if (!attached()) // changed compared to what?
         return;
 
-    if (!(changeType == InlineStyleChange && (styleChangeType() == FullStyleChange || styleChangeType() == SyntheticStyleChange)))
+    StyleChangeType existingChangeType = styleChangeType();
+    if (changeType > existingChangeType)
         setStyleChange(changeType);
 
-    if (styleChangeType() != NoStyleChange) {
+    if (existingChangeType == NoStyleChange) {
         for (Node* p = parentNode(); p && !p->childNeedsStyleRecalc(); p = p->parentNode())
             p->setChildNeedsStyleRecalc();
+
         if (document()->childNeedsStyleRecalc())
             document()->scheduleStyleRecalc();
     }
@@ -1256,6 +1259,7 @@ void Node::attach()
     }
 
     setAttached();
+    clearNeedsStyleRecalc();
 }
 
 void Node::willRemove()
diff --git a/WebCore/dom/Node.h b/WebCore/dom/Node.h
index ebc6e5f..e3c1910 100644
--- a/WebCore/dom/Node.h
+++ b/WebCore/dom/Node.h
@@ -309,7 +309,10 @@ public:
 
     void setInActiveChain() { setFlag(InActiveChainFlag); }
     void clearInActiveChain() { clearFlag(InActiveChainFlag); }
+
     void setNeedsStyleRecalc(StyleChangeType changeType = FullStyleChange);
+    void clearNeedsStyleRecalc() { m_nodeFlags &= ~StyleChangeMask; }
+
     void setIsLink(bool f) { setFlag(f, IsLinkFlag); }
     void setIsLink() { setFlag(IsLinkFlag); }
     void clearIsLink() { clearFlag(IsLinkFlag); }
diff --git a/WebCore/dom/Text.cpp b/WebCore/dom/Text.cpp
index 1589b11..928b975 100644
--- a/WebCore/dom/Text.cpp
+++ b/WebCore/dom/Text.cpp
@@ -284,7 +284,7 @@ void Text::recalcStyle(StyleChange change)
             attach();
         }
     }
-    setNeedsStyleRecalc(NoStyleChange);
+    clearNeedsStyleRecalc();
 }
 
 bool Text::childTypeAllowed(NodeType)
diff --git a/WebCore/html/HTMLFrameSetElement.cpp b/WebCore/html/HTMLFrameSetElement.cpp
index 3b736b4..aee6e13 100644
--- a/WebCore/html/HTMLFrameSetElement.cpp
+++ b/WebCore/html/HTMLFrameSetElement.cpp
@@ -208,7 +208,7 @@ void HTMLFrameSetElement::recalcStyle(StyleChange ch)
 {
     if (needsStyleRecalc() && renderer()) {
         renderer()->setNeedsLayout(true);
-        setNeedsStyleRecalc(NoStyleChange);
+        clearNeedsStyleRecalc();
     }
     HTMLElement::recalcStyle(ch);
 }
diff --git a/WebCore/manual-tests/compositing/missing-iframe-contents.html b/WebCore/manual-tests/compositing/missing-iframe-contents.html
new file mode 100644
index 0000000..d769e43
--- /dev/null
+++ b/WebCore/manual-tests/compositing/missing-iframe-contents.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <style type="text/css" media="screen">
+    iframe {
+        border: 10px solid black;
+        padding: 5px;
+        margin: 20px;
+        height: 150px;
+        width: 300px;
+        -webkit-box-shadow: 0 0 20px black;
+        -webkit-transform: translateZ(0);
+    }
+    
+  </style>
+  <script type="text/javascript" charset="utf-8">
+    function doTest()
+    {
+      document.getElementById('iframe').className = 'dummy';
+    }
+    
+    window.addEventListener('load', doTest, false);
+  </script>
+</head>
+<body>
+
+    <iframe id="iframe" src="resources/composited-subframe.html"></iframe>
+    
+    <p><a href="https://bugs.webkit.org/show_bug.cgi?id=42046">https://bugs.webkit.org/show_bug.cgi?id=42046</a><br>
+      You should see a blue rectangle inside the iframe when the page loads.</p>
+</body>
+</html>
diff --git a/LayoutTests/compositing/iframes/resources/composited-subframe.html b/WebCore/manual-tests/compositing/resources/composited-subframe.html
similarity index 100%
copy from LayoutTests/compositing/iframes/resources/composited-subframe.html
copy to WebCore/manual-tests/compositing/resources/composited-subframe.html

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list