Title: [154326] trunk
Revision
154326
Author
[email protected]
Date
2013-08-20 08:25:04 -0700 (Tue, 20 Aug 2013)

Log Message

<https://webkit.org/b/120025> REGRESSION (r154254): fast/frames/frameset-frameborder-inheritance.html failing on Apple MountainLion Debug WK1 (Tests)

Reviewed by Anders Carlsson.

Source/WebCore: 

* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::isFrameSet):
* html/HTMLFrameElement.cpp:
(WebCore::HTMLFrameElement::didAttachRenderers):
        
    Make helper public in HTMLFrameSetElement.

* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::findContaining):
        
    Static function for finding containing frameset, if any.

(WebCore::HTMLFrameSetElement::willAttachRenderers):
        
    This broke in refactoring. We should exit the loop when the first containing frameset is found. Fix by refactoring more.

* html/HTMLFrameSetElement.h:
(WebCore::isHTMLFrameSetElement):
(WebCore::toHTMLFrameSetElement):
        
    Add casting functions.

* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::frameSet):

LayoutTests: 

* platform/mac/TestExpectations: Unskip.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (154325 => 154326)


--- trunk/LayoutTests/ChangeLog	2013-08-20 14:17:40 UTC (rev 154325)
+++ trunk/LayoutTests/ChangeLog	2013-08-20 15:25:04 UTC (rev 154326)
@@ -1,5 +1,13 @@
 2013-08-20  Antti Koivisto  <[email protected]>
 
+        <https://webkit.org/b/120025> REGRESSION (r154254): fast/frames/frameset-frameborder-inheritance.html failing on Apple MountainLion Debug WK1 (Tests)
+
+        Reviewed by Anders Carlsson.
+
+        * platform/mac/TestExpectations: Unskip.
+
+2013-08-20  Antti Koivisto  <[email protected]>
+
         <https://webkit.org/b/120023> REGRESSION(r154257): svg/custom/bug78807.svg and svg/custom/use-invalid-style.svg failing
 
         Reviewed by by Andreas Kling.

Modified: trunk/LayoutTests/platform/mac/TestExpectations (154325 => 154326)


--- trunk/LayoutTests/platform/mac/TestExpectations	2013-08-20 14:17:40 UTC (rev 154325)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2013-08-20 15:25:04 UTC (rev 154326)
@@ -1276,8 +1276,6 @@
 webkit.org/b/105988 [ Debug ] inspector/debugger/reveal-execution-line.html [ Pass Crash ]
 webkit.org/b/105988 [ Debug ] inspector/debugger/watch-expressions-preserve-expansion.html [ Pass Crash ]
 
-webkit.org/b/120025 fast/frames/frameset-frameborder-inheritance.html [ Failure ]
-
 # Fails with WebKit1 only.
 editing/secure-input/reset-state-on-navigation.html [ Failure ]
 

Modified: trunk/Source/WebCore/ChangeLog (154325 => 154326)


--- trunk/Source/WebCore/ChangeLog	2013-08-20 14:17:40 UTC (rev 154325)
+++ trunk/Source/WebCore/ChangeLog	2013-08-20 15:25:04 UTC (rev 154326)
@@ -1,5 +1,36 @@
 2013-08-20  Antti Koivisto  <[email protected]>
 
+        <https://webkit.org/b/120025> REGRESSION (r154254): fast/frames/frameset-frameborder-inheritance.html failing on Apple MountainLion Debug WK1 (Tests)
+
+        Reviewed by Anders Carlsson.
+
+        * html/HTMLDocument.cpp:
+        (WebCore::HTMLDocument::isFrameSet):
+        * html/HTMLFrameElement.cpp:
+        (WebCore::HTMLFrameElement::didAttachRenderers):
+        
+            Make helper public in HTMLFrameSetElement.
+
+        * html/HTMLFrameSetElement.cpp:
+        (WebCore::HTMLFrameSetElement::findContaining):
+        
+            Static function for finding containing frameset, if any.
+
+        (WebCore::HTMLFrameSetElement::willAttachRenderers):
+        
+            This broke in refactoring. We should exit the loop when the first containing frameset is found. Fix by refactoring more.
+
+        * html/HTMLFrameSetElement.h:
+        (WebCore::isHTMLFrameSetElement):
+        (WebCore::toHTMLFrameSetElement):
+        
+            Add casting functions.
+
+        * rendering/RenderFrameSet.cpp:
+        (WebCore::RenderFrameSet::frameSet):
+
+2013-08-20  Antti Koivisto  <[email protected]>
+
         <https://webkit.org/b/120023> REGRESSION(r154257): svg/custom/bug78807.svg and svg/custom/use-invalid-style.svg failing
 
         Reviewed by Andreas Kling.

Modified: trunk/Source/WebCore/html/HTMLDocument.cpp (154325 => 154326)


--- trunk/Source/WebCore/html/HTMLDocument.cpp	2013-08-20 14:17:40 UTC (rev 154325)
+++ trunk/Source/WebCore/html/HTMLDocument.cpp	2013-08-20 15:25:04 UTC (rev 154326)
@@ -68,6 +68,7 @@
 #include "HTMLBodyElement.h"
 #include "HTMLElementFactory.h"
 #include "HTMLFrameOwnerElement.h"
+#include "HTMLFrameSetElement.h"
 #include "HTMLNames.h"
 #include "InspectorInstrumentation.h"
 #include "KURL.h"
@@ -392,7 +393,7 @@
 bool HTMLDocument::isFrameSet() const
 {
     HTMLElement* bodyElement = body();
-    return bodyElement && bodyElement->hasTagName(framesetTag);
+    return bodyElement && isHTMLFrameSetElement(bodyElement);
 }
 
 }

Modified: trunk/Source/WebCore/html/HTMLFrameElement.cpp (154325 => 154326)


--- trunk/Source/WebCore/html/HTMLFrameElement.cpp	2013-08-20 14:17:40 UTC (rev 154325)
+++ trunk/Source/WebCore/html/HTMLFrameElement.cpp	2013-08-20 15:25:04 UTC (rev 154326)
@@ -59,15 +59,6 @@
     return new (arena) RenderFrame(this);
 }
 
-static inline HTMLFrameSetElement* containingFrameSetElement(Node* node)
-{
-    while ((node = node->parentNode())) {
-        if (node->hasTagName(framesetTag))
-            return static_cast<HTMLFrameSetElement*>(node);
-    }
-    return 0;
-}
-
 bool HTMLFrameElement::noResize() const
 {
     return hasAttribute(noresizeAttr);
@@ -76,10 +67,11 @@
 void HTMLFrameElement::didAttachRenderers()
 {
     HTMLFrameElementBase::didAttachRenderers();
-    if (HTMLFrameSetElement* frameSetElement = containingFrameSetElement(this)) {
-        if (!m_frameBorderSet)
-            m_frameBorder = frameSetElement->hasFrameBorder();
-    }
+    const HTMLFrameSetElement* containingFrameSet = HTMLFrameSetElement::findContaining(this);
+    if (!containingFrameSet)
+        return;
+    if (!m_frameBorderSet)
+        m_frameBorder = containingFrameSet->hasFrameBorder();
 }
 
 void HTMLFrameElement::parseAttribute(const QualifiedName& name, const AtomicString& value)

Modified: trunk/Source/WebCore/html/HTMLFrameSetElement.cpp (154325 => 154326)


--- trunk/Source/WebCore/html/HTMLFrameSetElement.cpp	2013-08-20 14:17:40 UTC (rev 154325)
+++ trunk/Source/WebCore/html/HTMLFrameSetElement.cpp	2013-08-20 15:25:04 UTC (rev 154326)
@@ -164,25 +164,32 @@
     return new (arena) RenderFrameSet(this);
 }
 
+HTMLFrameSetElement* HTMLFrameSetElement::findContaining(Node* node)
+{
+    for (Element* parent = node->parentElement(); parent; parent = parent->parentElement()) {
+        if (isHTMLFrameSetElement(parent))
+            return toHTMLFrameSetElement(parent);
+    }
+    return 0;
+}
+
 void HTMLFrameSetElement::willAttachRenderers()
 {
-    // Inherit default settings from parent frameset
+    // Inherit default settings from parent frameset.
     // FIXME: This is not dynamic.
-    for (ContainerNode* node = parentNode(); node; node = node->parentNode()) {
-        if (!node->hasTagName(framesetTag))
-            continue;
-        HTMLFrameSetElement* frameset = static_cast<HTMLFrameSetElement*>(node);
-        if (!m_frameborderSet)
-            m_frameborder = frameset->hasFrameBorder();
-        if (m_frameborder) {
-            if (!m_borderSet)
-                m_border = frameset->border();
-            if (!m_borderColorSet)
-                m_borderColorSet = frameset->hasBorderColor();
-        }
-        if (!m_noresize)
-            m_noresize = frameset->noResize();
+    const HTMLFrameSetElement* containingFrameSet = findContaining(this);
+    if (!containingFrameSet)
+        return;
+    if (!m_frameborderSet)
+        m_frameborder = containingFrameSet->hasFrameBorder();
+    if (m_frameborder) {
+        if (!m_borderSet)
+            m_border = containingFrameSet->border();
+        if (!m_borderColorSet)
+            m_borderColorSet = containingFrameSet->hasBorderColor();
     }
+    if (!m_noresize)
+        m_noresize = containingFrameSet->noResize();
 }
 
 void HTMLFrameSetElement::defaultEventHandler(Event* evt)

Modified: trunk/Source/WebCore/html/HTMLFrameSetElement.h (154325 => 154326)


--- trunk/Source/WebCore/html/HTMLFrameSetElement.h	2013-08-20 14:17:40 UTC (rev 154325)
+++ trunk/Source/WebCore/html/HTMLFrameSetElement.h	2013-08-20 15:25:04 UTC (rev 154326)
@@ -45,6 +45,8 @@
     const Length* rowLengths() const { return m_rowLengths.get(); }
     const Length* colLengths() const { return m_colLengths.get(); }
 
+    static HTMLFrameSetElement* findContaining(Node* descendant);
+
     // Declared virtual in Element
     DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(blur);
     DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(error);
@@ -98,6 +100,28 @@
     bool m_noresize;
 };
 
+inline bool isHTMLFrameSetElement(const Node* node)
+{
+    return node->hasTagName(HTMLNames::framesetTag);
+}
+
+inline bool isHTMLFrameSetElement(const Element* element)
+{
+    return element->hasTagName(HTMLNames::framesetTag);
+}
+
+inline HTMLFrameSetElement* toHTMLFrameSetElement(Node* node)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLFrameSetElement(node));
+    return static_cast<HTMLFrameSetElement*>(node);
+}
+
+inline const HTMLFrameSetElement* toHTMLFrameSetElement(const Node* node)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLFrameSetElement(node));
+    return static_cast<const HTMLFrameSetElement*>(node);
+}
+
 } // namespace WebCore
 
 #endif // HTMLFrameSetElement_h

Modified: trunk/Source/WebCore/rendering/RenderFrameSet.cpp (154325 => 154326)


--- trunk/Source/WebCore/rendering/RenderFrameSet.cpp	2013-08-20 14:17:40 UTC (rev 154325)
+++ trunk/Source/WebCore/rendering/RenderFrameSet.cpp	2013-08-20 15:25:04 UTC (rev 154326)
@@ -63,7 +63,7 @@
 
 inline HTMLFrameSetElement* RenderFrameSet::frameSet() const
 {
-    return static_cast<HTMLFrameSetElement*>(node());
+    return toHTMLFrameSetElement(node());
 }
 
 static Color borderStartEdgeColor()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to