Changeset 154326 in webkit


Ignore:
Timestamp:
Aug 20, 2013, 8:25:04 AM (11 years ago)
Author:
Antti Koivisto
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.
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r154323 r154326  
     12013-08-20  Antti Koivisto  <antti@apple.com>
     2
     3        <https://webkit.org/b/120025> REGRESSION (r154254): fast/frames/frameset-frameborder-inheritance.html failing on Apple MountainLion Debug WK1 (Tests)
     4
     5        Reviewed by Anders Carlsson.
     6
     7        * platform/mac/TestExpectations: Unskip.
     8
    192013-08-20  Antti Koivisto  <antti@apple.com>
    210
  • trunk/LayoutTests/platform/mac/TestExpectations

    r154295 r154326  
    12771277webkit.org/b/105988 [ Debug ] inspector/debugger/watch-expressions-preserve-expansion.html [ Pass Crash ]
    12781278
    1279 webkit.org/b/120025 fast/frames/frameset-frameborder-inheritance.html [ Failure ]
    1280 
    12811279# Fails with WebKit1 only.
    12821280editing/secure-input/reset-state-on-navigation.html [ Failure ]
  • trunk/Source/WebCore/ChangeLog

    r154323 r154326  
     12013-08-20  Antti Koivisto  <antti@apple.com>
     2
     3        <https://webkit.org/b/120025> REGRESSION (r154254): fast/frames/frameset-frameborder-inheritance.html failing on Apple MountainLion Debug WK1 (Tests)
     4
     5        Reviewed by Anders Carlsson.
     6
     7        * html/HTMLDocument.cpp:
     8        (WebCore::HTMLDocument::isFrameSet):
     9        * html/HTMLFrameElement.cpp:
     10        (WebCore::HTMLFrameElement::didAttachRenderers):
     11       
     12            Make helper public in HTMLFrameSetElement.
     13
     14        * html/HTMLFrameSetElement.cpp:
     15        (WebCore::HTMLFrameSetElement::findContaining):
     16       
     17            Static function for finding containing frameset, if any.
     18
     19        (WebCore::HTMLFrameSetElement::willAttachRenderers):
     20       
     21            This broke in refactoring. We should exit the loop when the first containing frameset is found. Fix by refactoring more.
     22
     23        * html/HTMLFrameSetElement.h:
     24        (WebCore::isHTMLFrameSetElement):
     25        (WebCore::toHTMLFrameSetElement):
     26       
     27            Add casting functions.
     28
     29        * rendering/RenderFrameSet.cpp:
     30        (WebCore::RenderFrameSet::frameSet):
     31
    1322013-08-20  Antti Koivisto  <antti@apple.com>
    233
  • trunk/Source/WebCore/html/HTMLDocument.cpp

    r154122 r154326  
    6969#include "HTMLElementFactory.h"
    7070#include "HTMLFrameOwnerElement.h"
     71#include "HTMLFrameSetElement.h"
    7172#include "HTMLNames.h"
    7273#include "InspectorInstrumentation.h"
     
    393394{
    394395    HTMLElement* bodyElement = body();
    395     return bodyElement && bodyElement->hasTagName(framesetTag);
    396 }
    397 
    398 }
     396    return bodyElement && isHTMLFrameSetElement(bodyElement);
     397}
     398
     399}
  • trunk/Source/WebCore/html/HTMLFrameElement.cpp

    r154254 r154326  
    6060}
    6161
    62 static inline HTMLFrameSetElement* containingFrameSetElement(Node* node)
    63 {
    64     while ((node = node->parentNode())) {
    65         if (node->hasTagName(framesetTag))
    66             return static_cast<HTMLFrameSetElement*>(node);
    67     }
    68     return 0;
    69 }
    70 
    7162bool HTMLFrameElement::noResize() const
    7263{
     
    7768{
    7869    HTMLFrameElementBase::didAttachRenderers();
    79     if (HTMLFrameSetElement* frameSetElement = containingFrameSetElement(this)) {
    80         if (!m_frameBorderSet)
    81             m_frameBorder = frameSetElement->hasFrameBorder();
    82     }
     70    const HTMLFrameSetElement* containingFrameSet = HTMLFrameSetElement::findContaining(this);
     71    if (!containingFrameSet)
     72        return;
     73    if (!m_frameBorderSet)
     74        m_frameBorder = containingFrameSet->hasFrameBorder();
    8375}
    8476
  • trunk/Source/WebCore/html/HTMLFrameSetElement.cpp

    r154254 r154326  
    165165}
    166166
     167HTMLFrameSetElement* HTMLFrameSetElement::findContaining(Node* node)
     168{
     169    for (Element* parent = node->parentElement(); parent; parent = parent->parentElement()) {
     170        if (isHTMLFrameSetElement(parent))
     171            return toHTMLFrameSetElement(parent);
     172    }
     173    return 0;
     174}
     175
    167176void HTMLFrameSetElement::willAttachRenderers()
    168177{
    169     // Inherit default settings from parent frameset
     178    // Inherit default settings from parent frameset.
    170179    // FIXME: This is not dynamic.
    171     for (ContainerNode* node = parentNode(); node; node = node->parentNode()) {
    172         if (!node->hasTagName(framesetTag))
    173             continue;
    174         HTMLFrameSetElement* frameset = static_cast<HTMLFrameSetElement*>(node);
    175         if (!m_frameborderSet)
    176             m_frameborder = frameset->hasFrameBorder();
    177         if (m_frameborder) {
    178             if (!m_borderSet)
    179                 m_border = frameset->border();
    180             if (!m_borderColorSet)
    181                 m_borderColorSet = frameset->hasBorderColor();
    182         }
    183         if (!m_noresize)
    184             m_noresize = frameset->noResize();
    185     }
     180    const HTMLFrameSetElement* containingFrameSet = findContaining(this);
     181    if (!containingFrameSet)
     182        return;
     183    if (!m_frameborderSet)
     184        m_frameborder = containingFrameSet->hasFrameBorder();
     185    if (m_frameborder) {
     186        if (!m_borderSet)
     187            m_border = containingFrameSet->border();
     188        if (!m_borderColorSet)
     189            m_borderColorSet = containingFrameSet->hasBorderColor();
     190    }
     191    if (!m_noresize)
     192        m_noresize = containingFrameSet->noResize();
    186193}
    187194
  • trunk/Source/WebCore/html/HTMLFrameSetElement.h

    r154254 r154326  
    4545    const Length* rowLengths() const { return m_rowLengths.get(); }
    4646    const Length* colLengths() const { return m_colLengths.get(); }
     47
     48    static HTMLFrameSetElement* findContaining(Node* descendant);
    4749
    4850    // Declared virtual in Element
     
    99101};
    100102
     103inline bool isHTMLFrameSetElement(const Node* node)
     104{
     105    return node->hasTagName(HTMLNames::framesetTag);
     106}
     107
     108inline bool isHTMLFrameSetElement(const Element* element)
     109{
     110    return element->hasTagName(HTMLNames::framesetTag);
     111}
     112
     113inline HTMLFrameSetElement* toHTMLFrameSetElement(Node* node)
     114{
     115    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLFrameSetElement(node));
     116    return static_cast<HTMLFrameSetElement*>(node);
     117}
     118
     119inline const HTMLFrameSetElement* toHTMLFrameSetElement(const Node* node)
     120{
     121    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLFrameSetElement(node));
     122    return static_cast<const HTMLFrameSetElement*>(node);
     123}
     124
    101125} // namespace WebCore
    102126
  • trunk/Source/WebCore/rendering/RenderFrameSet.cpp

    r154219 r154326  
    6464inline HTMLFrameSetElement* RenderFrameSet::frameSet() const
    6565{
    66     return static_cast<HTMLFrameSetElement*>(node());
     66    return toHTMLFrameSetElement(node());
    6767}
    6868
Note: See TracChangeset for help on using the changeset viewer.