Changeset 98263 in webkit


Ignore:
Timestamp:
Oct 24, 2011 11:56:16 AM (12 years ago)
Author:
leviw@chromium.org
Message:

<svg> fails to use explicit width and height inside <html> inside IFRAME
https://bugs.webkit.org/show_bug.cgi?id=64823

Reviewed by Nikolas Zimmermann.

Source/WebCore:

Checking that embedded SVG is in an SVG document before negotiating size
with the host document.

Test: svg/as-object/svg-embedded-in-html-in-iframe.html

  • rendering/svg/RenderSVGRoot.cpp:

(WebCore::isEmbeddedThroughFrameContainingSVGDocument):
(WebCore::RenderSVGRoot::computeReplacedLogicalWidth):
(WebCore::RenderSVGRoot::computeReplacedLogicalHeight):

LayoutTests:

Fixing a bug where SVG negotiated size when embedded in html inside an iframe.

  • platform/chromium/test_expectations.txt: Will update with results on other platforms.
  • platform/mac/svg/as-object/svg-embedded-in-html-in-iframe-expected.png: Added.
  • platform/mac/svg/as-object/svg-embedded-in-html-in-iframe-expected.txt: Added.
  • svg/as-object/svg-embedded-in-html-in-iframe.html: Added.
Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r98260 r98263  
     12011-10-24  Levi Weintraub  <leviw@chromium.org>
     2
     3        <svg> fails to use explicit width and height inside <html> inside IFRAME
     4        https://bugs.webkit.org/show_bug.cgi?id=64823
     5
     6        Reviewed by Nikolas Zimmermann.
     7
     8        Fixing a bug where SVG negotiated size when embedded in html inside an iframe.
     9
     10        * platform/chromium/test_expectations.txt: Will update with results on other platforms.
     11        * platform/mac/svg/as-object/svg-embedded-in-html-in-iframe-expected.png: Added.
     12        * platform/mac/svg/as-object/svg-embedded-in-html-in-iframe-expected.txt: Added.
     13        * svg/as-object/svg-embedded-in-html-in-iframe.html: Added.
     14
    1152011-10-24  Julien Chaffraix  <jchaffraix@webkit.org>
    216
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r98260 r98263  
    38203820BUGWK70704 SNOWLEOPARD : fast/writing-mode/fallback-orientation.html = TEXT
    38213821BUGWK70704 SNOWLEOPARD : fast/backgrounds/background-leakage-transforms.html = TEXT
     3822
     3823// Will rebaseline
     3824BUGLEVIW : svg/as-object/svg-embedded-in-html-in-iframe.html = FAIL
     3825
  • trunk/Source/WebCore/ChangeLog

    r98262 r98263  
     12011-10-24  Levi Weintraub  <leviw@chromium.org>
     2
     3        <svg> fails to use explicit width and height inside <html> inside IFRAME
     4        https://bugs.webkit.org/show_bug.cgi?id=64823
     5
     6        Reviewed by Nikolas Zimmermann.
     7
     8        Checking that embedded SVG is in an SVG document before negotiating size
     9        with the host document.
     10
     11        Test: svg/as-object/svg-embedded-in-html-in-iframe.html
     12
     13        * rendering/svg/RenderSVGRoot.cpp:
     14        (WebCore::isEmbeddedThroughFrameContainingSVGDocument):
     15        (WebCore::RenderSVGRoot::computeReplacedLogicalWidth):
     16        (WebCore::RenderSVGRoot::computeReplacedLogicalHeight):
     17
    1182011-10-24  Rafael Weinstein  <rafaelw@chromium.org>
    219
  • trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp

    r97870 r98263  
    131131}
    132132
     133static inline bool isEmbeddedThroughFrameContainingSVGDocument(const Frame* frame)
     134{
     135    ASSERT(frame);
     136    ASSERT(frame->document());
     137    // If our frame has an owner renderer, we're embedded through eg. object/embed/iframe,
     138    // but we only negotiate if we're in an SVG document.
     139    return !frame->ownerRenderer() || !frame->document()->isSVGDocument();
     140}
     141
    133142LayoutUnit RenderSVGRoot::computeReplacedLogicalWidth(bool includeMaxWidth) const
    134143{
     
    138147        return computeIntrinsicWidth(replacedWidth);
    139148
    140     // If our frame has an owner renderer, we're embedded through eg. object/embed.
     149    if (isEmbeddedThroughFrameContainingSVGDocument(frame))
     150        return computeIntrinsicWidth(replacedWidth);
     151
    141152    RenderPart* ownerRenderer = frame->ownerRenderer();
    142     if (!ownerRenderer)
    143         return computeIntrinsicWidth(replacedWidth);
    144 
    145153    RenderStyle* ownerRendererStyle = ownerRenderer->style();
    146154    ASSERT(ownerRendererStyle);
     
    180188        return computeIntrinsicHeight(replacedHeight);
    181189
    182     // If our frame has an owner renderer, we're embedded through eg. object/embed.
     190    if (isEmbeddedThroughFrameContainingSVGDocument(frame))
     191        return computeIntrinsicHeight(replacedHeight);
     192
    183193    RenderPart* ownerRenderer = frame->ownerRenderer();
    184     if (!ownerRenderer)
    185         return computeIntrinsicHeight(replacedHeight);
    186 
    187194    RenderStyle* ownerRendererStyle = ownerRenderer->style();
    188195    ASSERT(ownerRendererStyle);
Note: See TracChangeset for help on using the changeset viewer.