Commit 927b66db authored by antti@apple.com's avatar antti@apple.com
Browse files

<https://webkit.org/b/120025> REGRESSION (r154254):...

<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.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154326 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6a0bf880
2013-08-20 Antti Koivisto <antti@apple.com>
<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 <antti@apple.com>
 
<https://webkit.org/b/120023> REGRESSION(r154257): svg/custom/bug78807.svg and svg/custom/use-invalid-style.svg failing
......@@ -1276,8 +1276,6 @@ webkit.org/b/105988 [ Debug ] inspector/debugger/properties-special.html [ Pass
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 ]
......
2013-08-20 Antti Koivisto <antti@apple.com>
<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 <antti@apple.com>
 
<https://webkit.org/b/120023> REGRESSION(r154257): svg/custom/bug78807.svg and svg/custom/use-invalid-style.svg failing
......@@ -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 @@ void HTMLDocument::clear()
bool HTMLDocument::isFrameSet() const
{
HTMLElement* bodyElement = body();
return bodyElement && bodyElement->hasTagName(framesetTag);
return bodyElement && isHTMLFrameSetElement(bodyElement);
}
}
......@@ -59,15 +59,6 @@ RenderObject* HTMLFrameElement::createRenderer(RenderArena* arena, RenderStyle*)
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 @@ bool HTMLFrameElement::noResize() const
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)
......
......@@ -164,25 +164,32 @@ RenderObject *HTMLFrameSetElement::createRenderer(RenderArena *arena, RenderStyl
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)
......
......@@ -45,6 +45,8 @@ public:
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 @@ private:
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
......@@ -63,7 +63,7 @@ RenderFrameSet::GridAxis::GridAxis()
inline HTMLFrameSetElement* RenderFrameSet::frameSet() const
{
return static_cast<HTMLFrameSetElement*>(node());
return toHTMLFrameSetElement(node());
}
static Color borderStartEdgeColor()
......
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