Changeset 138704 in webkit


Ignore:
Timestamp:
Jan 3, 2013 1:13:50 AM (11 years ago)
Author:
mkwst@chromium.org
Message:

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.

Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r138702 r138704  
     12013-01-03  Mike West  <mkwst@chromium.org>
     2
     3        seamless iframes don't inherit styles when srcdoc is used
     4        https://bugs.webkit.org/show_bug.cgi?id=103539
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * fast/frames/seamless/resources/span.html: Added.
     9        * fast/frames/seamless/seamless-contenteditable-not-inherited-expected.txt:
     10            Updating the previously failing expectation.
     11        * fast/frames/seamless/seamless-srcdoc-expected.txt: Added.
     12        * fast/frames/seamless/seamless-srcdoc.html: Added.
     13            Exciting new test to ensure that this doesn't regress, neither
     14            for totally simple srcdoc attriubtes, nor for slightly more
     15            complex variations.
     16
    1172013-01-02  Ryosuke Niwa  <rniwa@webkit.org>
    218
  • trunk/LayoutTests/fast/frames/seamless/seamless-contenteditable-not-inherited-expected.txt

    r138616 r138704  
    11This test ensures that content inside a seamless iframe does not inherit editability via the contenteditable attribute on a parent element, but does via a CSS rule that cascades into the frame.
    22PASS window.getComputedStyle(span).getPropertyCSSValue('-webkit-user-modify').cssText is "read-only"
    3 FAIL window.getComputedStyle(p).getPropertyCSSValue('-webkit-user-modify').cssText should be read-write. Was read-only.
     3PASS window.getComputedStyle(p).getPropertyCSSValue('-webkit-user-modify').cssText is "read-write"
    44
  • trunk/Source/WebCore/ChangeLog

    r138703 r138704  
     12013-01-03  Mike West  <mkwst@chromium.org>
     2
     3        seamless iframes don't inherit styles when srcdoc is used
     4        https://bugs.webkit.org/show_bug.cgi?id=103539
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Seamless iframes populated via a 'srcdoc' attribute should always
     9        inherit styles from their parent documents. At the moment, this is
     10        only the case when they contain a stylesheet or some other markup
     11        that forces a style recalculation on the document. Simple 'srcdoc'
     12        attributes (e.g. "srcdoc='<p>This is a comment.</p>'") bail out of
     13        recalculating style early, resulting in unstyled appearance.
     14
     15        This patch instructs WebCore to treat seamless documents as having an
     16        updated StyleResolver regardless of what actions the parser takes,
     17        which in turn ensures that the document's style is recalculated
     18        correctly.
     19
     20        Test: fast/frames/seamless/seamless-srcdoc.html
     21
     22        * dom/Document.cpp:
     23        (WebCore::Document::implicitOpen):
     24            If it's a seamless document, notify it that its StyleResolver isn't
     25            what it might have expected.
     26
    1272013-01-03  Allan Sandfeld Jensen  <allan.jensen@digia.com>
    228
  • trunk/Source/WebCore/dom/Document.cpp

    r138616 r138704  
    22552255    setCompatibilityMode(NoQuirksMode);
    22562256
     2257    // Documents rendered seamlessly should start out requiring a stylesheet
     2258    // collection update in order to ensure they inherit all the relevant data
     2259    // from their parent.
     2260    if (shouldDisplaySeamlesslyWithParent())
     2261        styleResolverChanged(DeferRecalcStyle);
     2262
    22572263    m_parser = createParser();
    22582264    setParsing(true);
Note: See TracChangeset for help on using the changeset viewer.