Changeset 198859 in webkit
- Timestamp:
- Mar 30, 2016 3:19:08 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r198858 r198859 1 2016-03-30 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [OS X] [RTL Scrollbars] Overlay RTL scrollbars animate in from the wrong side 4 https://bugs.webkit.org/show_bug.cgi?id=155962 5 6 Reviewed by Darin Adler. 7 8 This test only prints the "RTL" token when running on certain OSes. 9 10 * fast/scrolling/rtl-scrollbars-animation-property.html: Added. 11 * platform/mac/fast/scrolling/rtl-scrollbars-animation-property-expected.txt: Added. 12 1 13 2016-03-30 Sam Weinig <sam@webkit.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r198858 r198859 1 2016-03-30 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [OS X] [RTL Scrollbars] Overlay RTL scrollbars animate in from the wrong side 4 https://bugs.webkit.org/show_bug.cgi?id=155962 5 6 Reviewed by Darin Adler. 7 8 We can control the animation direction with the NSScrollerImp property 9 userInterfaceLayoutDirection. 10 11 This patch also adds an Internals function to set whether or not we 12 should mock the scrollbars. Not mocking the scrollbars is required 13 to use NSScrollerImps. 14 15 Test: fast/scrolling/rtl-scrollbars-animation-property.html 16 17 * platform/ScrollableArea.h: Use nullptr instead of 0. 18 (WebCore::ScrollableArea::horizontalScrollbar): 19 (WebCore::ScrollableArea::verticalScrollbar): 20 (WebCore::ScrollableArea::tiledBacking): 21 (WebCore::ScrollableArea::layerForHorizontalScrollbar): 22 (WebCore::ScrollableArea::layerForVerticalScrollbar): 23 (WebCore::ScrollableArea::layerForScrolling): 24 (WebCore::ScrollableArea::layerForScrollCorner): 25 (WebCore::ScrollableArea::layerForOverhangAreas): 26 * platform/mac/ScrollAnimatorMac.mm: 27 (WebCore::ScrollAnimatorMac::updateScrollerStyle): Set the direction 28 of the new NSScrollerImps. 29 * platform/mac/ScrollbarThemeMac.h: 30 * platform/mac/ScrollbarThemeMac.mm: 31 (WebCore::ScrollbarThemeMac::didCreateScrollerImp): Set the direction 32 of an NSScrollerImp. 33 (WebCore::ScrollbarThemeMac::registerScrollbar): Call 34 didCreateScrollerImp(). 35 (WebCore::ScrollbarThemeMac::isLayoutDirectionRTL): Used for testing, 36 to tell if the scroller's direction is RTL. 37 * platform/spi/mac/NSScrollerImpSPI.h: 38 * rendering/RenderTreeAsText.cpp: 39 (WebCore::write): 40 * testing/Internals.cpp: 41 (WebCore::Internals::setMockScrollbarsEnabled): Used for testing. 42 * testing/Internals.h: 43 * testing/Internals.idl: 44 1 45 2016-03-30 Sam Weinig <sam@webkit.org> 2 46 -
trunk/Source/WebCore/platform/ScrollableArea.h
r198841 r198859 181 181 WEBCORE_EXPORT IntSize scrollbarIntrusion() const; 182 182 183 virtual Scrollbar* horizontalScrollbar() const { return 0; }184 virtual Scrollbar* verticalScrollbar() const { return 0; }183 virtual Scrollbar* horizontalScrollbar() const { return nullptr; } 184 virtual Scrollbar* verticalScrollbar() const { return nullptr; } 185 185 186 186 const IntPoint& scrollOrigin() const { return m_scrollOrigin; } … … 294 294 #endif 295 295 296 virtual TiledBacking* tiledBacking() const { return 0; }296 virtual TiledBacking* tiledBacking() const { return nullptr; } 297 297 298 298 // True if scrolling happens by moving compositing layers. … … 301 301 virtual bool usesAsyncScrolling() const { return false; } 302 302 303 virtual GraphicsLayer* layerForHorizontalScrollbar() const { return 0; }304 virtual GraphicsLayer* layerForVerticalScrollbar() const { return 0; }303 virtual GraphicsLayer* layerForHorizontalScrollbar() const { return nullptr; } 304 virtual GraphicsLayer* layerForVerticalScrollbar() const { return nullptr; } 305 305 306 306 bool hasLayerForHorizontalScrollbar() const; … … 328 328 329 329 friend class ScrollingCoordinator; 330 virtual GraphicsLayer* layerForScrolling() const { return 0; }331 virtual GraphicsLayer* layerForScrollCorner() const { return 0; }330 virtual GraphicsLayer* layerForScrolling() const { return nullptr; } 331 virtual GraphicsLayer* layerForScrollCorner() const { return nullptr; } 332 332 #if ENABLE(RUBBER_BANDING) 333 virtual GraphicsLayer* layerForOverhangAreas() const { return 0; }333 virtual GraphicsLayer* layerForOverhangAreas() const { return nullptr; } 334 334 #endif 335 335 -
trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
r198817 r198859 1304 1304 [m_scrollerImpPair setVerticalScrollerImp:newVerticalPainter]; 1305 1305 macTheme->setNewPainterForScrollbar(*verticalScrollbar, newVerticalPainter); 1306 macTheme->didCreateScrollerImp(*verticalScrollbar); 1306 1307 1307 1308 // The different scrollbar styles have different thicknesses, so we must re-set the … … 1320 1321 [m_scrollerImpPair setHorizontalScrollerImp:newHorizontalPainter]; 1321 1322 macTheme->setNewPainterForScrollbar(*horizontalScrollbar, newHorizontalPainter); 1323 macTheme->didCreateScrollerImp(*horizontalScrollbar); 1322 1324 1323 1325 // The different scrollbar styles have different thicknesses, so we must re-set the -
trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h
r198078 r198859 65 65 static void setIsCurrentlyDrawingIntoLayer(bool); 66 66 67 void didCreateScrollerImp(Scrollbar&); 68 bool isLayoutDirectionRTL(Scrollbar&); 69 67 70 #if ENABLE(RUBBER_BANDING) 68 71 WEBCORE_EXPORT static void setUpOverhangAreaBackground(CALayer *, const Color& customBackgroundColor = Color()); -
trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm
r198817 r198859 154 154 } 155 155 156 void ScrollbarThemeMac::didCreateScrollerImp(Scrollbar& scrollbar) 157 { 158 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 159 NSScrollerImp *scrollerImp = painterForScrollbar(scrollbar); 160 ASSERT(scrollerImp); 161 scrollerImp.userInterfaceLayoutDirection = scrollbar.scrollableArea().verticalScrollbarIsOnLeft() ? NSUserInterfaceLayoutDirectionRightToLeft : NSUserInterfaceLayoutDirectionLeftToRight; 162 #else 163 UNUSED_PARAM(scrollbar); 164 #endif 165 } 166 156 167 void ScrollbarThemeMac::registerScrollbar(Scrollbar& scrollbar) 157 168 { … … 162 173 NSScrollerImp *scrollerImp = [NSScrollerImp scrollerImpWithStyle:recommendedScrollerStyle() controlSize:scrollbarControlSizeToNSControlSize(scrollbar.controlSize()) horizontal:isHorizontal replacingScrollerImp:nil]; 163 174 scrollbarMap()->add(&scrollbar, scrollerImp); 175 didCreateScrollerImp(scrollbar); 164 176 updateEnabledState(scrollbar); 165 177 updateScrollbarOverlayStyle(scrollbar); … … 181 193 { 182 194 return scrollbarMap()->get(&scrollbar).get(); 195 } 196 197 bool ScrollbarThemeMac::isLayoutDirectionRTL(Scrollbar& scrollbar) 198 { 199 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 200 NSScrollerImp *scrollerImp = painterForScrollbar(scrollbar); 201 ASSERT(scrollerImp); 202 return scrollerImp.userInterfaceLayoutDirection == NSUserInterfaceLayoutDirectionRightToLeft; 203 #else 204 UNUSED_PARAM(scrollbar); 205 return false; 206 #endif 183 207 } 184 208 -
trunk/Source/WebCore/platform/spi/mac/NSScrollerImpSPI.h
r198817 r198859 80 80 @property(readonly) CGFloat knobOverlapEndInset; 81 81 @property(readonly) CGFloat trackOverlapEndInset; 82 @property NSUserInterfaceLayoutDirection userInterfaceLayoutDirection; 82 83 - (NSRect)rectForPart:(NSScrollerPart)partCode; 83 84 - (void)drawKnobSlotInRect:(NSRect)slotRect highlight:(BOOL)flag alpha:(CGFloat)alpha; -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r196244 r198859 73 73 #include <wtf/unicode/CharacterNames.h> 74 74 75 #if PLATFORM(MAC) 76 #include "ScrollbarThemeMac.h" 77 #endif 78 75 79 namespace WebCore { 76 80 … … 622 626 if (layer.renderBox() && roundToInt(layer.renderBox()->clientHeight()) != layer.scrollHeight()) 623 627 ts << " scrollHeight " << layer.scrollHeight(); 628 #if PLATFORM(MAC) 629 ScrollbarTheme& scrollbarTheme = ScrollbarTheme::theme(); 630 if (!scrollbarTheme.isMockTheme() && layer.hasVerticalScrollbar()) { 631 ScrollbarThemeMac& macTheme = *static_cast<ScrollbarThemeMac*>(&scrollbarTheme); 632 if (macTheme.isLayoutDirectionRTL(*layer.verticalScrollbar())) 633 ts << " scrollbarHasRTLLayoutDirection"; 634 } 635 #endif 624 636 } 625 637 -
trunk/Source/WebCore/testing/Internals.cpp
r198492 r198859 2738 2738 } 2739 2739 2740 void Internals::setMockScrollbarsEnabled(bool enabled) 2741 { 2742 WebCore::Settings::setMockScrollbarsEnabled(enabled); 2743 } 2744 2740 2745 void Internals::forceReload(bool endToEnd) 2741 2746 { -
trunk/Source/WebCore/testing/Internals.h
r198492 r198859 349 349 bool isFromCurrentWorld(Deprecated::ScriptValue) const; 350 350 351 void setUsesOverlayScrollbars(bool enabled); 352 void setUsesMockScrollAnimator(bool enabled); 351 void setUsesOverlayScrollbars(bool); 352 void setUsesMockScrollAnimator(bool); 353 void setMockScrollbarsEnabled(bool); 353 354 354 355 String getCurrentCursorInfo(ExceptionCode&); -
trunk/Source/WebCore/testing/Internals.idl
r198833 r198859 352 352 void setUsesOverlayScrollbars(boolean enabled); 353 353 void setUsesMockScrollAnimator(boolean enabled); 354 void setMockScrollbarsEnabled(boolean enabled); 354 355 355 356 void forceReload(boolean endToEnd);
Note: See TracChangeset
for help on using the changeset viewer.