Changeset 123067 in webkit


Ignore:
Timestamp:
Jul 18, 2012 7:51:39 PM (12 years ago)
Author:
hbono@chromium.org
Message:

Move contents right when a vertical scrollbar is shown at the left side of an RTL element.
https://bugs.webkit.org/show_bug.cgi?id=85856

Reviewed by Hajime Morita.

Source/WebCore:

This change prevents the scrollWidth value from being cropped by the width of a
scrollbar when a vertical scrollbar is shown at the left side of an RTL element.
This change also increases the clientLeft value by this scrollbar width and move
contents right to improve compliance with CSSOM <http://www.w3.org/TR/cssom-view>.

Tests: scrollbars/rtl/div-horizontal.html

scrollbars/rtl/div-vertical.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::paintObject): Move contents to the right.

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::topLeftLocationOffset): Move the top-left corner to the right to prevent WebKit from cropping scrollWidth.

  • rendering/RenderBox.h:

(WebCore::RenderBox::clientLeft): Increase clientLeft by the width of a scrollbar.

LayoutTests:

This changes adds a couple of tests that verify CSSOM properties of RTL elements
are compliant with <http://www.w3.org/TR/cssom-view> regardless of their
scrollbar positions.

  • platform/chromium/TestExpectations:
  • scrollbars/rtl: Added.
  • scrollbars/rtl/div-horizontal-expected.txt: Added.
  • scrollbars/rtl/div-horizontal.html: Added.
  • scrollbars/rtl/div-vertical-expected.txt: Added.
  • scrollbars/rtl/div-vertical.html: Added.
Location:
trunk
Files:
5 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r123066 r123067  
     12012-07-18  Hironori Bono  <hbono@chromium.org>
     2
     3        Move contents right when a vertical scrollbar is shown at the left side of an RTL element.
     4        https://bugs.webkit.org/show_bug.cgi?id=85856
     5
     6        Reviewed by Hajime Morita.
     7
     8        This changes adds a couple of tests that verify CSSOM properties of RTL elements
     9        are compliant with <http://www.w3.org/TR/cssom-view> regardless of their
     10        scrollbar positions.
     11
     12        * platform/chromium/TestExpectations:
     13        * scrollbars/rtl: Added.
     14        * scrollbars/rtl/div-horizontal-expected.txt: Added.
     15        * scrollbars/rtl/div-horizontal.html: Added.
     16        * scrollbars/rtl/div-vertical-expected.txt: Added.
     17        * scrollbars/rtl/div-vertical.html: Added.
     18
    1192012-07-18  Kent Tamura  <tkent@chromium.org>
    220
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r123045 r123067  
    36463646BUGWK90469 WIN : storage/websql/multiple-databases-garbage-collection.html = PASS CRASH
    36473647
     3648// Require rebaselines when Bug 85856 is fixed. (The left side of their RTL elements are cropped due to this bug.)
     3649BUGWK85856 : fast/block/float/028.html = IMAGE
     3650BUGWK85856 : fast/overflow/unreachable-overflow-rtl-bug.html = IMAGE
     3651BUGWK85856 : fast/block/float/026.html = IMAGE
     3652
    36483653// Require rebaseline after bug 88171
    36493654BUGWK88171 WIN : css1/formatting_model/floating_elements.html = IMAGE
  • trunk/Source/WebCore/ChangeLog

    r123066 r123067  
     12012-07-18  Hironori Bono  <hbono@chromium.org>
     2
     3        Move contents right when a vertical scrollbar is shown at the left side of an RTL element.
     4        https://bugs.webkit.org/show_bug.cgi?id=85856
     5
     6        Reviewed by Hajime Morita.
     7
     8        This change prevents the scrollWidth value from being cropped by the width of a
     9        scrollbar when a vertical scrollbar is shown at the left side of an RTL element.
     10        This change also increases the clientLeft value by this scrollbar width and move
     11        contents right to improve compliance with CSSOM <http://www.w3.org/TR/cssom-view>.
     12
     13        Tests: scrollbars/rtl/div-horizontal.html
     14               scrollbars/rtl/div-vertical.html
     15
     16        * rendering/RenderBlock.cpp:
     17        (WebCore::RenderBlock::paintObject): Move contents to the right.
     18        * rendering/RenderBox.cpp:
     19        (WebCore::RenderBox::topLeftLocationOffset): Move the top-left corner to the right to prevent WebKit from cropping scrollWidth.
     20        * rendering/RenderBox.h:
     21        (WebCore::RenderBox::clientLeft): Increase clientLeft by the width of a scrollbar.
     22
    1232012-07-18  Kent Tamura  <tkent@chromium.org>
    224
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r123025 r123067  
    29682968    // Adjust our painting position if we're inside a scrolled layer (e.g., an overflow:auto div).
    29692969    LayoutPoint scrolledOffset = paintOffset;
    2970     if (hasOverflowClip())
     2970    if (hasOverflowClip()) {
    29712971        scrolledOffset.move(-scrolledContentOffset());
     2972        if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
     2973            scrolledOffset.move(verticalScrollbarWidth(), 0);
     2974    }
    29722975
    29732976    // 2. paint contents
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r123062 r123067  
    39393939   
    39403940    LayoutRect rect(frameRect());
     3941    if (containerBlock->style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
     3942        rect.move(containerBlock->verticalScrollbarWidth(), 0);
    39413943    containerBlock->flipForWritingMode(rect); // FIXME: This is wrong if we are an absolutely positioned object enclosed by a relative-positioned inline.
    39423944    return LayoutSize(rect.x(), rect.y());
  • trunk/Source/WebCore/rendering/RenderBox.h

    r122761 r123067  
    198198    // More IE extensions.  clientWidth and clientHeight represent the interior of an object
    199199    // excluding border and scrollbar.  clientLeft/Top are just the borderLeftWidth and borderTopWidth.
    200     LayoutUnit clientLeft() const { return borderLeft(); }
     200    LayoutUnit clientLeft() const { return borderLeft() + (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ? verticalScrollbarWidth() : 0); }
    201201    LayoutUnit clientTop() const { return borderTop(); }
    202202    LayoutUnit clientWidth() const;
Note: See TracChangeset for help on using the changeset viewer.