seamless iframes don't inherit styles when srcdoc is used
authormkwst@chromium.org <mkwst@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Jan 2013 09:13:50 +0000 (09:13 +0000)
committermkwst@chromium.org <mkwst@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Jan 2013 09:13:50 +0000 (09:13 +0000)
commit97594f52a9ba0c0f57f2fe4eb189156f2bb4a32b
tree141a1fad31f3313055e765b3827640c5f395e02b
parentb3d48199e34d3a3d8b6c37bf4c562eb269c71b41
seamless iframes don't inherit styles when srcdoc is used
https://bugs.webkit.org/show_bug.cgi?id=103539

Reviewed by Antti Koivisto.

Source/WebCore:

Seamless iframes populated via a 'srcdoc' attribute should always
inherit styles from their parent documents. At the moment, this is
only the case when they contain a stylesheet or some other markup
that forces a style recalculation on the document. Simple 'srcdoc'
attributes (e.g. "srcdoc='<p>This is a comment.</p>'") bail out of
recalculating style early, resulting in unstyled appearance.

This patch instructs WebCore to treat seamless documents as having an
updated StyleResolver regardless of what actions the parser takes,
which in turn ensures that the document's style is recalculated
correctly.

Test: fast/frames/seamless/seamless-srcdoc.html

* dom/Document.cpp:
(WebCore::Document::implicitOpen):
    If it's a seamless document, notify it that its StyleResolver isn't
    what it might have expected.

LayoutTests:

* fast/frames/seamless/resources/span.html: Added.
* fast/frames/seamless/seamless-contenteditable-not-inherited-expected.txt:
    Updating the previously failing expectation.
* fast/frames/seamless/seamless-srcdoc-expected.txt: Added.
* fast/frames/seamless/seamless-srcdoc.html: Added.
    Exciting new test to ensure that this doesn't regress, neither
    for totally simple srcdoc attriubtes, nor for slightly more
    complex variations.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@138704 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/frames/seamless/resources/span.html [new file with mode: 0644]
LayoutTests/fast/frames/seamless/seamless-contenteditable-not-inherited-expected.txt
LayoutTests/fast/frames/seamless/seamless-srcdoc-expected.txt [new file with mode: 0644]
LayoutTests/fast/frames/seamless/seamless-srcdoc.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp