Changeset 109512 in webkit
- Timestamp:
- Mar 1, 2012 10:33:00 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r109510 r109512 1 2012-03-01 Hironori Bono <hbono@chromium.org> 2 3 Render overflow controls of an RTL element to its left-side. 4 https://bugs.webkit.org/show_bug.cgi?id=54623 5 6 This change adds a new flag WTF_USE_RTL_SCROLLBAR and render the 7 vertical scrollbars and resizers of RTL elements to their left side if 8 this new flag is enabled. 9 10 Reviewed by Ryosuke Niwa. 11 12 * platform/chromium/fast/events/rtl-scrollbar-expected.txt: Added. 13 * platform/chromium/fast/events/rtl-scrollbar.html: Added. 14 1 15 2012-03-01 Dirk Pranke <dpranke@chromium.org> 2 16 -
trunk/Source/WebCore/ChangeLog
r109503 r109512 1 2012-03-01 Hironori Bono <hbono@chromium.org> 2 3 Render overflow controls of an RTL element to its left-side. 4 https://bugs.webkit.org/show_bug.cgi?id=54623 5 6 This change adds a new flag WTF_USE_RTL_SCROLLBAR and render the 7 vertical scrollbars and resizers of RTL elements to their left side if 8 this new flag is enabled. 9 10 Reviewed by Ryosuke Niwa. 11 12 Test: platform/chromium/fast/events/rtl-scrollbar.html 13 14 * rendering/RenderBlock.cpp: 15 (WebCore::RenderBlock::addOverflowFromPositionedObjects): Move child elements right. 16 (WebCore::RenderBlock::determineLogicalLeftPositionForChild): ditto. 17 * rendering/RenderBox.cpp: 18 (WebCore::RenderBox::overflowClipRect): Move the content rectangle right. 19 * rendering/RenderLayer.cpp: 20 (WebCore::cornerStart): Added a function that calculates the X position of a resizer. 21 (WebCore): 22 (WebCore::cornerRect): Use cornerStart to move a resizer. 23 (WebCore::RenderLayer::verticalScrollbarStart): Added a function that calculates 24 the X position of a vertical scrollbar. 25 (WebCore::RenderLayer::horizontalScrollbarStart): Added a function that calculates 26 the X position of a horizontal scrollbar. 27 (WebCore::RenderLayer::scrollbarOffset): Render a vertical scrollbar to the left side 28 and move a horizontal scrollbar right by the width of the vertical scrollbar. 29 (WebCore::RenderLayer::invalidateScrollbarRect): ditto. 30 (WebCore::RenderLayer::positionOverflowControls): ditto. 31 (WebCore::RenderLayer::hitTestOverflowControls): ditto. 32 * rendering/RenderLayer.h: 33 (RenderLayer): 34 * rendering/style/RenderStyle.h: Added shouldPlaceBlockDirectionScrollbarOnLogicalLeft, 35 which returns if we need to move a left scrollbar to its right side. 36 1 37 2012-03-01 Kent Tamura <tkent@chromium.org> 2 38 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r109383 r109512 1653 1653 1654 1654 // Fixed positioned elements don't contribute to layout overflow, since they don't scroll with the content. 1655 if (positionedObject->style()->position() != FixedPosition) 1656 addOverflowFromChild(positionedObject); 1655 if (positionedObject->style()->position() != FixedPosition) { 1656 int x = positionedObject->x(); 1657 if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 1658 x -= verticalScrollbarWidth(); 1659 addOverflowFromChild(positionedObject, IntSize(x, positionedObject->y())); 1660 } 1657 1661 } 1658 1662 } … … 2050 2054 { 2051 2055 LayoutUnit startPosition = borderStart() + paddingStart(); 2056 if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 2057 startPosition -= verticalScrollbarWidth(); 2052 2058 LayoutUnit totalAvailableLogicalWidth = borderAndPaddingLogicalWidth() + availableLogicalWidth(); 2053 2059 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r109383 r109512 1233 1233 1234 1234 // Subtract out scrollbars if we have them. 1235 if (layer()) 1235 if (layer()) { 1236 if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 1237 clipRect.move(layer()->verticalScrollbarWidth(relevancy), 0); 1236 1238 clipRect.contract(layer()->verticalScrollbarWidth(relevancy), layer()->horizontalScrollbarHeight(relevancy)); 1239 } 1237 1240 1238 1241 return clipRect; -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r109378 r109512 1835 1835 } 1836 1836 1837 static LayoutUnit cornerStart(const RenderLayer* layer, int minX, int maxX, int thickness) 1838 { 1839 if (layer->renderer()->style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 1840 return minX + layer->renderer()->style()->borderLeftWidth(); 1841 return maxX - thickness - layer->renderer()->style()->borderRightWidth(); 1842 } 1843 1837 1844 static IntRect cornerRect(const RenderLayer* layer, const IntRect& bounds) 1838 1845 { … … 1854 1861 verticalThickness = layer->horizontalScrollbar()->height(); 1855 1862 } 1856 return IntRect( bounds.maxX() - horizontalThickness - layer->renderer()->style()->borderRightWidth(),1863 return IntRect(cornerStart(layer, bounds.x(), bounds.maxX(), horizontalThickness), 1857 1864 bounds.maxY() - verticalThickness - layer->renderer()->style()->borderBottomWidth(), 1858 1865 horizontalThickness, verticalThickness); … … 1977 1984 } 1978 1985 1986 LayoutUnit RenderLayer::verticalScrollbarStart(int minX, int maxX) const 1987 { 1988 const RenderBox* box = renderBox(); 1989 if (renderer()->style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 1990 return minX + box->borderLeft(); 1991 return maxX - box->borderRight() - m_vBar->width(); 1992 } 1993 1994 LayoutUnit RenderLayer::horizontalScrollbarStart(int minX) const 1995 { 1996 const RenderBox* box = renderBox(); 1997 int x = minX + box->borderLeft(); 1998 if (renderer()->style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 1999 x += m_vBar ? m_vBar->width() : resizerCornerRect(this, box->borderBoxRect()).width(); 2000 return x; 2001 } 2002 1979 2003 IntSize RenderLayer::scrollbarOffset(const Scrollbar* scrollbar) const 1980 2004 { … … 1982 2006 1983 2007 if (scrollbar == m_vBar.get()) 1984 return IntSize( box->width() - box->borderRight() - scrollbar->width(), box->borderTop());2008 return IntSize(verticalScrollbarStart(0, box->width()), box->borderTop()); 1985 2009 1986 2010 if (scrollbar == m_hBar.get()) 1987 return IntSize( box->borderLeft(), box->height() - box->borderBottom() - scrollbar->height());2011 return IntSize(horizontalScrollbarStart(0), box->height() - box->borderBottom() - scrollbar->height()); 1988 2012 1989 2013 ASSERT_NOT_REACHED(); … … 2010 2034 ASSERT(box); 2011 2035 if (scrollbar == m_vBar.get()) 2012 scrollRect.move( box->width() - box->borderRight() - scrollbar->width(), box->borderTop());2036 scrollRect.move(verticalScrollbarStart(0, box->width()), box->borderTop()); 2013 2037 else 2014 scrollRect.move( box->borderLeft(), box->height() - box->borderBottom() - scrollbar->height());2038 scrollRect.move(horizontalScrollbarStart(0), box->height() - box->borderBottom() - scrollbar->height()); 2015 2039 renderer()->repaintRectangle(scrollRect); 2016 2040 } … … 2177 2201 IntRect absBounds(borderBox.location() + offsetFromLayer, borderBox.size()); 2178 2202 if (m_vBar) 2179 m_vBar->setFrameRect(IntRect( absBounds.maxX() - box->borderRight() - m_vBar->width(),2203 m_vBar->setFrameRect(IntRect(verticalScrollbarStart(absBounds.x(), absBounds.maxX()), 2180 2204 absBounds.y() + box->borderTop(), 2181 2205 m_vBar->width(), … … 2183 2207 2184 2208 if (m_hBar) 2185 m_hBar->setFrameRect(IntRect( absBounds.x() + box->borderLeft(),2209 m_hBar->setFrameRect(IntRect(horizontalScrollbarStart(absBounds.x()), 2186 2210 absBounds.maxY() - box->borderBottom() - m_hBar->height(), 2187 2211 absBounds.width() - (box->borderLeft() + box->borderRight()) - scrollCorner.width(), … … 2594 2618 2595 2619 if (m_vBar && m_vBar->shouldParticipateInHitTesting()) { 2596 LayoutRect vBarRect( box->width() - box->borderRight() - m_vBar->width(),2620 LayoutRect vBarRect(verticalScrollbarStart(0, box->width()), 2597 2621 box->borderTop(), 2598 2622 m_vBar->width(), … … 2606 2630 resizeControlSize = max(resizeControlRect.width(), 0); 2607 2631 if (m_hBar && m_hBar->shouldParticipateInHitTesting()) { 2608 LayoutRect hBarRect( box->borderLeft(),2632 LayoutRect hBarRect(horizontalScrollbarStart(0), 2609 2633 box->height() - box->borderBottom() - m_hBar->height(), 2610 2634 box->width() - (box->borderLeft() + box->borderRight()) - (m_vBar ? m_vBar->width() : resizeControlSize), -
trunk/Source/WebCore/rendering/RenderLayer.h
r108382 r109512 756 756 } 757 757 758 LayoutUnit verticalScrollbarStart(int minX, int maxX) const; 759 LayoutUnit horizontalScrollbarStart(int minX) const; 760 758 761 protected: 759 762 // The bitfields are up here so they will fall into the padding from ScrollableArea on 64-bit. -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r109311 r109512 970 970 #else 971 971 bool hasFilter() const { return false; } 972 #endif 973 974 #if USE(RTL_SCROLLBAR) 975 bool shouldPlaceBlockDirectionScrollbarOnLogicalLeft() const { return !isLeftToRightDirection() && isHorizontalWritingMode(); } 976 #else 977 bool shouldPlaceBlockDirectionScrollbarOnLogicalLeft() const { return false; } 972 978 #endif 973 979 -
trunk/Source/WebKit/chromium/ChangeLog
r109466 r109512 1 2012-03-01 Hironori Bono <hbono@chromium.org> 2 3 Render overflow controls of an RTL element to its left-side. 4 https://bugs.webkit.org/show_bug.cgi?id=54623 5 6 This change adds a new flag WTF_USE_RTL_SCROLLBAR and render the 7 vertical scrollbars and resizers of RTL elements to their left side if 8 this new flag is enabled. 9 10 Reviewed by Ryosuke Niwa. 11 12 * features.gypi: Set WTF_USE_RTL_SCROLLBAR to 1 on Chromium. 13 1 14 2012-03-01 James Robinson <jamesr@chromium.org> 2 15 -
trunk/Source/WebKit/chromium/features.gypi
r108474 r109512 107 107 # in Debug or release_valgrind_build=1 builds. 108 108 'WTF_USE_OPENTYPE_SANITIZER=1', 109 'WTF_USE_RTL_SCROLLBAR=1', 109 110 'WTF_USE_SKIA_TEXT=<(enable_skia_text)', 110 111 'WTF_USE_WEBP=1',
Note: See TracChangeset
for help on using the changeset viewer.