Skip to content
  • hbono@chromium.org's avatar
    Avoid moving child objects multiple times when vertical scrollbar are shown at the left side. · 71837dd7
    hbono@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=91756
    
    Reviewed by Tony Chang.
    
    Source/WebCore:
    
    My r123067 moves the top-left origin of an RTL element right when its vertical
    scrollbar is shown at its left side. (That is, r123067 moves all child objects
    in the RTL element right.) This change also increases RenderBox::clientLeft()
    at the same time, i.e. it also moves child objects right. Furthermore, my r109512
    moves positioned objects in an RTL element right at the same time. This makes
    WebKit move objects in an RTL element up to three times by the scrollbar width.
    (Moving an absolute object right increases the scrollWidth value and it causes
    this bug.) This change removes unnecessary code that moves objects right in my
    r109512 and RenderBox::clientLeft().
    
    Test: scrollbars/rtl/div-absolute.html
          fast/block/float/026.html
          fast/block/float/028.html
          fast/overflow/unreachable-overflow-rtl-bug.html
    
    * dom/Element.cpp:
    (WebCore::Element::clientLeft): Increase clientLeft value by the width of a vertical scrollbar as written in the CSSOM specification.
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::addOverflowFromPositionedObjects): Removed unnecessary code.
    (WebCore::RenderBlock::determineLogicalLeftPositionForChild): Removed unnecessary code.
    * rendering/RenderBox.h:
    (WebCore::RenderBox::clientLeft): Removed unnecessary code.
    
    LayoutTests:
    
    This change adds a test that compares CSSOM properties of an RTL element which
    includes positioned objects with the CSSOM properties of an LTR one. This change
    also uses clientLeft properties in offsetX-offsetY.html to remove a hard-coded
    value in the test and adds rebaselined results for Windows.
    
    * fast/events/offsetX-offsetY.html: Replaced a hard-coded value 'borderLeft' with clientLeft.
    * platform/chromium-linux/fast/block/float/026-expected.png:
    * platform/chromium-linux/fast/block/float/028-expected.png:
    * platform/chromium-win/fast/block/float/026-expected.png:
    * platform/chromium-win/fast/block/float/028-expected.png:
    * platform/chromium-win/fast/overflow/unreachable-overflow-rtl-bug-expected.png:
    * platform/chromium-win/fast/overflow/unreachable-overflow-rtl-bug-expected.txt:
    * scrollbars/rtl/div-absolute-expected.txt: Added.
    * scrollbars/rtl/div-absolute.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123572 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    71837dd7