Changeset 123785 in webkit


Ignore:
Timestamp:
Jul 26, 2012, 1:10:26 PM (13 years ago)
Author:
mitz@apple.com
Message:

<svg> element with no intrinsic size and max-width gets sized incorrectly
https://bugs.webkit.org/show_bug.cgi?id=92410

Reviewed by Dean Jackson.

Source/WebCore:

Test: svg/css/max-width-2.html

  • rendering/RenderReplaced.cpp:

(WebCore::RenderReplaced::computeReplacedLogicalWidth): The rule for computing the width for
elements whose computed width and height are both auto and which have no intrinsic size, but
have an intrinsic ratio was applied only to elements with a content renderer (such as <img>
with an SVG source). Removed the requirement to have a content renderer, so that it will
apply to all elements including <svg>.

LayoutTests:

  • svg/css/max-width-2-expected.html: Added.
  • svg/css/max-width-2.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r123783 r123785  
     12012-07-26  Dan Bernstein  <mitz@apple.com>
     2
     3        <svg> element with no intrinsic size and max-width gets sized incorrectly
     4        https://bugs.webkit.org/show_bug.cgi?id=92410
     5
     6        Reviewed by Dean Jackson.
     7
     8        * svg/css/max-width-2-expected.html: Added.
     9        * svg/css/max-width-2.html: Added.
     10
    1112012-07-26  Tony Chang  <tony@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r123783 r123785  
     12012-07-26  Dan Bernstein  <mitz@apple.com>
     2
     3        <svg> element with no intrinsic size and max-width gets sized incorrectly
     4        https://bugs.webkit.org/show_bug.cgi?id=92410
     5
     6        Reviewed by Dean Jackson.
     7
     8        Test: svg/css/max-width-2.html
     9
     10        * rendering/RenderReplaced.cpp:
     11        (WebCore::RenderReplaced::computeReplacedLogicalWidth): The rule for computing the width for
     12        elements whose computed width and height are both auto and which have no intrinsic size, but
     13        have an intrinsic ratio was applied only to elements with a content renderer (such as <img>
     14        with an SVG source). Removed the requirement to have a content renderer, so that it will
     15        apply to all elements including <svg>.
     16
    1172012-07-26  Tony Chang  <tony@chromium.org>
    218
  • trunk/Source/WebCore/rendering/RenderReplaced.cpp

    r123294 r123785  
    366366            // 'width' is undefined in CSS 2.1. However, it is suggested that, if the containing block's width does not itself depend on the replaced element's width, then
    367367            // the used value of 'width' is calculated from the constraint equation used for block-level, non-replaced elements in normal flow.
    368             if (heightIsAuto && !hasIntrinsicWidth && !hasIntrinsicHeight && contentRenderer) {
     368            if (heightIsAuto && !hasIntrinsicWidth && !hasIntrinsicHeight) {
    369369                // The aforementioned 'constraint equation' used for block-level, non-replaced elements in normal flow:
    370370                // 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' = width of containing block
Note: See TracChangeset for help on using the changeset viewer.