Skip to content
  • commit-queue@webkit.org's avatar
    Breaking Float: floated block level element following inline element in... · 17761407
    commit-queue@webkit.org authored
    Breaking Float: floated block level element following inline element in floated container breaks to next line
    https://bugs.webkit.org/show_bug.cgi?id=45274
    
    Patch by ChangSeok Oh <shivamidow@gmail.com> on 2013-04-17
    Reviewed by David Hyatt.
    
    Source/WebCore:
    
    Fix position issue of floating element in floating element.
    Inner floating element has placed at next line when outer floating element has text,
    even though previous line has spaces enough to fit it.
    To solve this, the width of a space added temporarily for prohibiting duplication more than 2 empty spaces
    is subtracted when floating element is checked whether it fits on a line.
    
    Tests: css2.1/20110323/floats-001.html
           css2.1/20110323/floats-102.html
           fast/inline-block/float-both-whitespace.html
           fast/inline-block/float-leading-whitespace.html
           fast/inline-block/float-no-whitespace.html
           fast/inline-block/float-trailing-whitespace.html
           fast/inline-block/multiple-floats-with-whitespace.html
    
    * rendering/RenderBlockLineLayout.cpp:
    (WebCore::LineWidth::LineWidth):
    (WebCore::LineWidth::fitsOnLine):
    (WebCore::LineWidth::trailingWhitespaceWidth):
    (WebCore::LineWidth::setTrailingWhitespaceWidth):
    (LineWidth):
    (WebCore::RenderBlock::LineBreaker::nextSegmentBreak):
    
    LayoutTests:
    
    * css2.1/20110323/floats-001-expected.html: Added.
    * css2.1/20110323/floats-001.html: Added.
    * css2.1/20110323/floats-102-expected.html: Added.
    * css2.1/20110323/floats-102.html: Added.
    
    Tests for whitespace around floating elements.
    Following test cases are provied by Joseph Pecoraro.
    See https://bugs.webkit.org/show_bug.cgi?id=58806
    
    * fast/exclusions/shape-outside-floats/shape-outside-floats-stacked.html: Updated to match new treatment of trailing space.
    * fast/inline-block/float-both-whitespace-expected.png: Added.
    * fast/inline-block/float-both-whitespace-expected.txt: Added.
    * fast/inline-block/float-both-whitespace.html: Added.
    * fast/inline-block/float-leading-whitespace-expected.png: Added.
    * fast/inline-block/float-leading-whitespace-expected.txt: Added.
    * fast/inline-block/float-leading-whitespace.html: Added.
    * fast/inline-block/float-no-whitespace-expected.png: Added.
    * fast/inline-block/float-no-whitespace-expected.txt: Added.
    * fast/inline-block/float-no-whitespace.html: Added.
    * fast/inline-block/float-trailing-whitespace-expected.png: Added.
    * fast/inline-block/float-trailing-whitespace-expected.txt: Added.
    * fast/inline-block/float-trailing-whitespace.html: Added.
    * fast/inline-block/multiple-floats-with-whitespace-expected.png: Added.
    * fast/inline-block/multiple-floats-with-whitespace-expected.txt: Added.
    * fast/inline-block/multiple-floats-with-whitespace.html: Added.
    
    Update the following tests so that wrapping happens as it
    did before. With this change the float:left div progressed
    and could fit on an earlier line when we position after
    collapsing whitespace. This moved the float a line earlier
    and changed the results of the test. By adding a character
    to the line, the float won't fit and goes back on to the
    line that it was on before this change.
    
    * fast/multicol/float-truncation.html:
    * fast/multicol/vertical-lr/float-truncation.html:
    * fast/multicol/vertical-rl/float-truncation.html:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148622 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    17761407