Changeset 153810 in webkit
- Timestamp:
- Aug 7, 2013 7:00:07 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r153809 r153810 1 2013-08-07 Simon Fraser <simon.fraser@apple.com> 2 3 Avoid spurious "all repaint" layouts when scrolling WebViews on Retina displays 4 https://bugs.webkit.org/show_bug.cgi?id=119564 5 6 Reviewed by Beth Dakin. 7 8 When scrolling WebViews on Macs with Retina displays, AppKit uses 9 device pixels for the scroll offset, so [scrollView() documentVisibleRect] 10 can return a CGRect with non-integral origin. This rect is used by layout, 11 via layoutSize(), to decide whether the view size changed, which prompts 12 a full repaint. However, FrameView gets a value which has been rounded 13 by enclosingIntRect(), which increases the height or width by 1px if the 14 y or x offset is on a half-pixel, causing spurious full repaints. 15 16 Fix by plumbing through platformVisibleContentSize(), which just 17 gets the size of the -documentVisibleRect. 18 19 * page/FrameView.cpp: 20 (WebCore::FrameView::layout): Don't get layoutHeight and layoutWidth 21 separately, since that is two calls down into platformVisibleContentSize. 22 * platform/ScrollView.cpp: 23 (WebCore::ScrollView::unscaledVisibleContentSize): 24 (WebCore::ScrollView::platformVisibleContentSize): 25 * platform/ScrollView.h: 26 * platform/mac/ScrollViewMac.mm: 27 (WebCore::ScrollView::platformVisibleContentSize): 28 1 29 2013-08-07 Simon Fraser <simon.fraser@apple.com> 2 30 -
trunk/Source/WebCore/page/FrameView.cpp
r153701 r153810 1294 1294 LayoutSize oldSize = m_size; 1295 1295 1296 m_size = LayoutSize(layoutWidth(), layoutHeight());1296 m_size = layoutSize(); 1297 1297 1298 1298 if (oldSize != m_size) { -
trunk/Source/WebCore/platform/ScrollView.cpp
r152265 r153810 222 222 { 223 223 if (platformWidget()) 224 return platformVisibleContent Rect(scrollbarInclusion == IncludeScrollbars).size();224 return platformVisibleContentSize(scrollbarInclusion == IncludeScrollbars); 225 225 226 226 if (!m_fixedVisibleContentRect.isEmpty()) … … 1413 1413 } 1414 1414 1415 IntSize ScrollView::platformVisibleContentSize(bool) const 1416 { 1417 return IntSize(); 1418 } 1419 1415 1420 void ScrollView::platformSetContentsSize() 1416 1421 { -
trunk/Source/WebCore/platform/ScrollView.h
r149417 r153810 389 389 bool platformCanBlitOnScroll() const; 390 390 IntRect platformVisibleContentRect(bool includeScrollbars) const; 391 IntSize platformVisibleContentSize(bool includeScrollbars) const; 391 392 void platformSetContentsSize(); 392 393 IntRect platformContentsToScreen(const IntRect&) const; -
trunk/Source/WebCore/platform/mac/ScrollViewMac.mm
r149980 r153810 29 29 #import "BlockExceptions.h" 30 30 #import "FloatRect.h" 31 #import "FloatSize.h" 31 32 #import "IntRect.h" 32 33 #import "Logging.h" … … 117 118 } 118 119 120 IntSize ScrollView::platformVisibleContentSize(bool includeScrollbars) const 121 { 122 BEGIN_BLOCK_OBJC_EXCEPTIONS; 123 if (includeScrollbars) 124 return IntSize([scrollView() frame].size); 125 126 return expandedIntSize(FloatSize([scrollView() documentVisibleRect].size)); 127 END_BLOCK_OBJC_EXCEPTIONS; 128 return IntSize(); 129 } 130 119 131 void ScrollView::platformSetContentsSize() 120 132 {
Note: See TracChangeset
for help on using the changeset viewer.