Changeset 123572 in webkit
- Timestamp:
- Jul 24, 2012 9:51:55 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r123571 r123572 1 2012-07-24 Hironori Bono <hbono@chromium.org> 2 3 Avoid moving child objects multiple times when vertical scrollbar are shown at the left side. 4 https://bugs.webkit.org/show_bug.cgi?id=91756 5 6 Reviewed by Tony Chang. 7 8 This change adds a test that compares CSSOM properties of an RTL element which 9 includes positioned objects with the CSSOM properties of an LTR one. This change 10 also uses clientLeft properties in offsetX-offsetY.html to remove a hard-coded 11 value in the test and adds rebaselined results for Windows. 12 13 * fast/events/offsetX-offsetY.html: Replaced a hard-coded value 'borderLeft' with clientLeft. 14 * platform/chromium-linux/fast/block/float/026-expected.png: 15 * platform/chromium-linux/fast/block/float/028-expected.png: 16 * platform/chromium-win/fast/block/float/026-expected.png: 17 * platform/chromium-win/fast/block/float/028-expected.png: 18 * platform/chromium-win/fast/overflow/unreachable-overflow-rtl-bug-expected.png: 19 * platform/chromium-win/fast/overflow/unreachable-overflow-rtl-bug-expected.txt: 20 * scrollbars/rtl/div-absolute-expected.txt: Added. 21 * scrollbars/rtl/div-absolute.html: Added. 22 1 23 2012-07-24 Dan Bernstein <mitz@apple.com> 2 24 -
trunk/LayoutTests/fast/events/offsetX-offsetY.html
r121735 r123572 77 77 positions = sumPositions(content); 78 78 var inside = document.getElementById('inside-overflow'); 79 var borderLeft = 2;80 clientX = positions.offsetLeft + borderLeft + content.clientWidth - inside.clientWidth - window.scrollX + offsetX;79 var overflow = document.getElementById('overflow'); 80 clientX = positions.offsetLeft + overflow.clientLeft + content.clientWidth - inside.clientWidth - window.scrollX + offsetX; 81 81 dispatchEvent(clientX, clientY, 'inside-overflow', offsetX, offsetY); 82 82 -
trunk/LayoutTests/platform/chromium-win/fast/overflow/unreachable-overflow-rtl-bug-expected.txt
r109591 r123572 12 12 layer at (8,28) size 106x106 clip at (11,31) size 85x85 scrollWidth 220 scrollHeight 270 13 13 RenderBlock (relative positioned) {DIV} at (0,20) size 106x106 [border: (3px solid #000000)] 14 layer at (8,154) size 106x106 clip at (26,157) size 85x85 scrollX 1 50 scrollWidth 235scrollHeight 27014 layer at (8,154) size 106x106 clip at (26,157) size 85x85 scrollX 135 scrollWidth 220 scrollHeight 270 15 15 RenderBlock (relative positioned) {DIV} at (0,146) size 106x106 [border: (3px solid #000000)] -
trunk/Source/WebCore/ChangeLog
r123571 r123572 1 2012-07-24 Hironori Bono <hbono@chromium.org> 2 3 Avoid moving child objects multiple times when vertical scrollbar are shown at the left side. 4 https://bugs.webkit.org/show_bug.cgi?id=91756 5 6 Reviewed by Tony Chang. 7 8 My r123067 moves the top-left origin of an RTL element right when its vertical 9 scrollbar is shown at its left side. (That is, r123067 moves all child objects 10 in the RTL element right.) This change also increases RenderBox::clientLeft() 11 at the same time, i.e. it also moves child objects right. Furthermore, my r109512 12 moves positioned objects in an RTL element right at the same time. This makes 13 WebKit move objects in an RTL element up to three times by the scrollbar width. 14 (Moving an absolute object right increases the scrollWidth value and it causes 15 this bug.) This change removes unnecessary code that moves objects right in my 16 r109512 and RenderBox::clientLeft(). 17 18 Test: scrollbars/rtl/div-absolute.html 19 fast/block/float/026.html 20 fast/block/float/028.html 21 fast/overflow/unreachable-overflow-rtl-bug.html 22 23 * dom/Element.cpp: 24 (WebCore::Element::clientLeft): Increase clientLeft value by the width of a vertical scrollbar as written in the CSSOM specification. 25 * rendering/RenderBlock.cpp: 26 (WebCore::RenderBlock::addOverflowFromPositionedObjects): Removed unnecessary code. 27 (WebCore::RenderBlock::determineLogicalLeftPositionForChild): Removed unnecessary code. 28 * rendering/RenderBox.h: 29 (WebCore::RenderBox::clientLeft): Removed unnecessary code. 30 1 31 2012-07-24 Dan Bernstein <mitz@apple.com> 2 32 -
trunk/Source/WebCore/dom/Element.cpp
r123071 r123572 413 413 document()->updateLayoutIgnorePendingStylesheets(); 414 414 415 if (RenderBox* renderer = renderBox()) 416 return adjustForAbsoluteZoom(roundToInt(renderer->clientLeft()), renderer); 415 if (RenderBox* renderer = renderBox()) { 416 LayoutUnit clientLeft = renderer->clientLeft(); 417 if (renderer->style() && renderer->style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 418 clientLeft += renderer->verticalScrollbarWidth(); 419 return adjustForAbsoluteZoom(roundToInt(clientLeft), renderer); 420 } 417 421 return 0; 418 422 } -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r123571 r123572 1670 1670 1671 1671 // Fixed positioned elements don't contribute to layout overflow, since they don't scroll with the content. 1672 if (positionedObject->style()->position() != FixedPosition) { 1673 int x = positionedObject->x(); 1674 if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 1675 x -= verticalScrollbarWidth(); 1676 addOverflowFromChild(positionedObject, IntSize(x, positionedObject->y())); 1677 } 1672 if (positionedObject->style()->position() != FixedPosition) 1673 addOverflowFromChild(positionedObject, IntSize(positionedObject->x(), positionedObject->y())); 1678 1674 } 1679 1675 } … … 2209 2205 { 2210 2206 LayoutUnit startPosition = borderStart() + paddingStart(); 2211 if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())2212 startPosition -= verticalScrollbarWidth();2213 2207 LayoutUnit totalAvailableLogicalWidth = borderAndPaddingLogicalWidth() + availableLogicalWidth(); 2214 2208 -
trunk/Source/WebCore/rendering/RenderBox.h
r123067 r123572 198 198 // More IE extensions. clientWidth and clientHeight represent the interior of an object 199 199 // excluding border and scrollbar. clientLeft/Top are just the borderLeftWidth and borderTopWidth. 200 LayoutUnit clientLeft() const { return borderLeft() + (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ? verticalScrollbarWidth() : 0); }200 LayoutUnit clientLeft() const { return borderLeft(); } 201 201 LayoutUnit clientTop() const { return borderTop(); } 202 202 LayoutUnit clientWidth() const;
Note: See TracChangeset
for help on using the changeset viewer.