Changeset 171207 in webkit
- Timestamp:
- Jul 17, 2014 4:49:21 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r171203 r171207 1 2014-07-17 Beth Dakin <bdakin@apple.com> 2 3 Fixed position elements are misplaced when a WK1 view has contentInsets set 4 https://bugs.webkit.org/show_bug.cgi?id=135031 5 -and corresponding- 6 <rdar://problem/17682335> 7 8 Reviewed by Tim Horton. 9 10 [NSScrollView documentVisibleRect] is not the rect that we are looking for when 11 this function is called. WebCore is interested in the rect that does not include 12 content that is within the inset region. 13 14 Implement contract() to avoid the awkwardness of calling expand() with negative 15 values. 16 * platform/graphics/IntSize.h: 17 (WebCore::IntSize::contract): 18 19 Use _insetBounds instead of documentVisibleRect, and when it’s necessary to use 20 the frame’s dimensions, extract the inset from that size. 21 * platform/mac/ScrollViewMac.mm: 22 (WebCore::ScrollView::platformVisibleContentRect): 23 (WebCore::ScrollView::platformVisibleContentSize): 24 1 25 2014-07-17 Enrica Casucci <enrica@apple.com> 2 26 -
trunk/Source/WebCore/platform/graphics/IntSize.h
r166582 r171207 82 82 } 83 83 84 void contract(int width, int height) 85 { 86 m_width -= width; 87 m_height -= height; 88 } 89 84 90 void scale(float widthScale, float heightScale) 85 91 { -
trunk/Source/WebCore/platform/mac/ScrollViewMac.mm
r165676 r171207 35 35 #import "WebCoreFrameView.h" 36 36 37 @interface NSClipView (Details) 38 - (NSRect)_insetBounds; 39 @end 40 41 @interface NSScrollView (Details) 42 - (NSEdgeInsets)contentInsets; 43 @end 44 37 45 @interface NSWindow (WebWindowDetails) 38 46 - (BOOL)_needsToResetDragMargins; … … 108 116 { 109 117 BEGIN_BLOCK_OBJC_EXCEPTIONS; 110 IntRect result = enclosingIntRect([scrollView() documentVisibleRect]); 111 if (includeScrollbars) 112 result.setSize(IntSize([scrollView() frame].size)); 113 return result; 114 END_BLOCK_OBJC_EXCEPTIONS; 118 119 IntRect visibleContentRect; 120 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 10100 121 visibleContentRect = enclosingIntRect([[scrollView() contentView] _insetBounds]); 122 #else 123 visibleContentRect = enclosingIntRect([scrollView() documentVisibleRect]); 124 #endif 125 126 if (includeScrollbars) { 127 IntSize frameSize([scrollView() frame].size); 128 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 10100 129 frameSize.contract(scrollView().contentInsets.left + scrollView().contentInsets.right, scrollView().contentInsets.top + scrollView().contentInsets.bottom); 130 #endif 131 visibleContentRect.setSize(frameSize); 132 } 133 134 return visibleContentRect; 135 END_BLOCK_OBJC_EXCEPTIONS; 136 115 137 return IntRect(); 116 138 } … … 118 140 IntSize ScrollView::platformVisibleContentSize(bool includeScrollbars) const 119 141 { 120 BEGIN_BLOCK_OBJC_EXCEPTIONS; 121 if (includeScrollbars) 122 return IntSize([scrollView() frame].size); 123 124 return expandedIntSize(FloatSize([scrollView() documentVisibleRect].size)); 125 END_BLOCK_OBJC_EXCEPTIONS; 126 return IntSize(); 142 return platformVisibleContentRect(includeScrollbars).size(); 127 143 } 128 144
Note: See TracChangeset
for help on using the changeset viewer.