- a/Source/WebCore/ChangeLog +22 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2012-05-14  Eric Seidel  <eric@webkit.org>
2
3
        Styles are not recalculated when the seamless attribute is dynamically added/removed
4
        https://bugs.webkit.org/show_bug.cgi?id=86315
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Covered by fast/frames/seamless/seamless-css-cascade.html.
9
10
        * html/HTMLIFrameElement.cpp:
11
        (WebCore::HTMLIFrameElement::isPresentationAttribute):
12
         - Make seamless a presentational attribute, which means style on the <iframe> will
13
           be forced to recalculate when it changes.  This is correct, but not observable
14
           until the layout changes are landed (as then the iframe should correctly revert to not
15
           being sized to fit its content if seamless is removed).
16
        (WebCore::HTMLIFrameElement::parseAttribute):
17
         - When the seamless attribute is added or remove, force the content document to recalc
18
           its style resolver, which will refresh the list of inherited stylesheets from the
19
           parent.  This doesn't need to happen synchronously.  When the layout changes land
20
           the content document will actually cause that recalc to redirect to the parent document
21
           in the seamless case anyway, but it's more correct to ask the content document directly.
22
1
2012-05-14  Takashi Sakamoto  <tasak@google.com>
23
2012-05-14  Takashi Sakamoto  <tasak@google.com>
2
24
3
        Crash in WebCore::RenderObject::repaint
25
        Crash in WebCore::RenderObject::repaint
- a/Source/WebCore/html/HTMLIFrameElement.cpp -2 / +6 lines
Lines 51-57 PassRefPtr<HTMLIFrameElement> HTMLIFrameElement::create(const QualifiedName& tag a/Source/WebCore/html/HTMLIFrameElement.cpp_sec1
51
51
52
bool HTMLIFrameElement::isPresentationAttribute(const QualifiedName& name) const
52
bool HTMLIFrameElement::isPresentationAttribute(const QualifiedName& name) const
53
{
53
{
54
    if (name == widthAttr || name == heightAttr || name == alignAttr || name == frameborderAttr)
54
    if (name == widthAttr || name == heightAttr || name == alignAttr || name == frameborderAttr || name == seamlessAttr)
55
        return true;
55
        return true;
56
    return HTMLFrameElementBase::isPresentationAttribute(name);
56
    return HTMLFrameElementBase::isPresentationAttribute(name);
57
}
57
}
Lines 87-93 void HTMLIFrameElement::parseAttribute(Attribute* attr) a/Source/WebCore/html/HTMLIFrameElement.cpp_sec2
87
        m_name = newName;
87
        m_name = newName;
88
    } else if (attr->name() == sandboxAttr)
88
    } else if (attr->name() == sandboxAttr)
89
        setSandboxFlags(attr->isNull() ? SandboxNone : SecurityContext::parseSandboxPolicy(attr->value()));
89
        setSandboxFlags(attr->isNull() ? SandboxNone : SecurityContext::parseSandboxPolicy(attr->value()));
90
    else
90
    else if (attr->name() == seamlessAttr) {
91
        // If we're adding or removing the seamless attribute, we need to force the content document to recalculate its StyleResolver.
92
        if (contentDocument())
93
            contentDocument()->styleResolverChanged(DeferRecalcStyle);
94
    } else
91
        HTMLFrameElementBase::parseAttribute(attr);
95
        HTMLFrameElementBase::parseAttribute(attr);
92
}
96
}
93
97
- a/LayoutTests/ChangeLog +12 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2012-05-14  Eric Seidel  <eric@webkit.org>
2
3
        Styles are not recalculated when the seamless attribute is dynamically added/removed
4
        https://bugs.webkit.org/show_bug.cgi?id=86315
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Add a subtest to cover this case.
9
10
        * fast/frames/seamless/seamless-css-cascade-expected.txt:
11
        * fast/frames/seamless/seamless-css-cascade.html:
12
1
2012-05-14  Takashi Sakamoto  <tasak@google.com>
13
2012-05-14  Takashi Sakamoto  <tasak@google.com>
2
14
3
        Crash in WebCore::RenderObject::repaint
15
        Crash in WebCore::RenderObject::repaint
- a/LayoutTests/fast/frames/seamless/seamless-css-cascade-expected.txt +3 lines
Lines 5-8 PASS window.getComputedStyle(three).color is "rgb(255, 255, 255)" a/LayoutTests/fast/frames/seamless/seamless-css-cascade-expected.txt_sec1
5
PASS window.getComputedStyle(rootElement).color is "rgb(255, 165, 0)"
5
PASS window.getComputedStyle(rootElement).color is "rgb(255, 165, 0)"
6
PASS window.getComputedStyle(rootElement).color is "rgb(1, 2, 3)"
6
PASS window.getComputedStyle(rootElement).color is "rgb(1, 2, 3)"
7
PASS window.getComputedStyle(one).color is "rgb(3, 2, 1)"
7
PASS window.getComputedStyle(one).color is "rgb(3, 2, 1)"
8
PASS window.getComputedStyle(one).color is "rgb(0, 0, 0)"
9
PASS window.getComputedStyle(two).color is "rgb(128, 0, 128)"
10
PASS window.getComputedStyle(three).color is "rgb(0, 0, 0)"
8
11
- a/LayoutTests/fast/frames/seamless/seamless-css-cascade.html +6 lines
Lines 42-46 window.onload = function () { a/LayoutTests/fast/frames/seamless/seamless-css-cascade.html_sec1
42
    document.head.appendChild(styleSheet);
42
    document.head.appendChild(styleSheet);
43
    // #one's style is only specified by this parent, so adding a later sheet should override the color and update the child frame.
43
    // #one's style is only specified by this parent, so adding a later sheet should override the color and update the child frame.
44
    shouldBeEqualToString("window.getComputedStyle(one).color", "rgb(3, 2, 1)");
44
    shouldBeEqualToString("window.getComputedStyle(one).color", "rgb(3, 2, 1)");
45
46
    // Test that removing the seamless attribute recalculates the child's style.
47
    window.iframe.removeAttribute("seamless");
48
    shouldBeEqualToString("window.getComputedStyle(one).color", "rgb(0, 0, 0)"); // black, default.
49
    shouldBeEqualToString("window.getComputedStyle(two).color", "rgb(128, 0, 128)"); // purple, selector in child.
50
    shouldBeEqualToString("window.getComputedStyle(three).color", "rgb(0, 0, 0)"); // black, default.
45
}
51
}
46
</script>
52
</script>

Return to Bug 86315