Skip to content
  • jchaffraix@webkit.org's avatar
    REGRESSION(r122501): replaced elements with percent width are wrongly size... · 9dca48a0
    jchaffraix@webkit.org authored
    REGRESSION(r122501): replaced elements with percent width are wrongly size when inserted inside an auto-table layout
    https://bugs.webkit.org/show_bug.cgi?id=95892
    
    Reviewed by Ojan Vafai.
    
    Source/WebCore:
    
    r122501 exposed an issue in how preferred logical widths are computed on replaced objects. The code relies on the
    logical width computation methods. Unfortunately the previous code relies on the layout information, which may not
    be up-to-date during preferred logical width computation.
    
    Test: fast/table/bad-replaced-sizing-preferred-logical-widths.html
          fast/replaced/vertical-writing-mode-max-logical-width.html
    
    * rendering/RenderReplaced.cpp:
    (WebCore::RenderReplaced::computeMaxPreferredLogicalWidth):
    Added this helper method. The main difference with the old code is that it handles the percent logical width
    properly before calling the old code path. This is not totally right but before forking the whole code, it's
    better to have more evidence that forking preferred logical widths and logical width computation is the way to go.
    
    (WebCore::RenderReplaced::computePreferredLogicalWidths):
    Changed to call computeMaxPreferredLogicalWidth. Also fixed an existing bug in vertical-writing modes where we would
    add the wrong paddings and borders.
    
    * rendering/RenderReplaced.h:
    (RenderReplaced): Added computeMaxPreferredLogicalWidth.
    
    LayoutTests:
    
    * fast/replaced/vertical-writing-mode-max-logical-width-replaced-expected.txt: Added.
    * fast/replaced/vertical-writing-mode-max-logical-width-replaced.html: Added.
    * fast/table/bad-replaced-sizing-preferred-logical-widths-expected.txt: Added.
    * fast/table/bad-replaced-sizing-preferred-logical-widths.html: Added.
    * fast/table/resources/iframe.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    9dca48a0