Changeset 150532 in webkit
- Timestamp:
- May 22, 2013 12:48:26 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r150521 r150532 1 2013-05-22 Tim Horton <timothy_horton@apple.com> 2 3 [wk2] Should be able to make tiled WKViews clip to the view's exposed rect without using autolayout 4 https://bugs.webkit.org/show_bug.cgi?id=116625 5 <rdar://problem/13962816> 6 7 Reviewed by Anders Carlsson. 8 9 The two modes are not dependent; it should be possible to enable 10 clips-to-exposed-rect without using autolayout. This enables apps to 11 make very large tiled WKViews that don't create tiles for the whole 12 area of the view (and also disables scrolling, since that is currently 13 incompatible with clipping to the exposed rect). 14 15 * UIProcess/API/mac/WKView.mm: 16 (-[WKView setFrameSize:]): 17 (-[WKView _updateWindowAndViewFrames]): 18 (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]): 19 (-[WKView enableFrameSizeUpdates]): 20 (-[WKView forceAsyncDrawingAreaSizeUpdate:]): 21 Rename _expandsToFitContentViaAutoLayout to _clipsToVisibleRect for accuracy. 22 23 (-[WKView setMinimumWidthForAutoLayout:]): 24 Factor clips-to-sisible-rect toggle out into setShouldClipToVisibleRect. 25 26 (-[WKView shouldClipToVisibleRect]): 27 (-[WKView setShouldClipToVisibleRect:]): 28 Allow setting clips-to-visible-rect without autolayout. 29 30 * UIProcess/API/mac/WKViewPrivate.h: 31 Add shouldClipToVisibleRect property. 32 1 33 2013-05-22 Alexey Proskuryakov <ap@apple.com> 2 34 -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r150291 r150532 236 236 237 237 NSSize _intrinsicContentSize; 238 BOOL _ expandsToFitContentViaAutoLayout;238 BOOL _clipsToVisibleRect; 239 239 240 240 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 … … 427 427 428 428 if (frameSizeUpdatesEnabled) { 429 if (_data->_ expandsToFitContentViaAutoLayout)429 if (_data->_clipsToVisibleRect) 430 430 _data->_page->viewExposedRectChanged([self visibleRect]); 431 431 [self _setDrawingAreaSize:size]; … … 439 439 440 440 _data->_page->windowAndViewFramesChanged(viewFrameInWindowCoordinates, accessibilityPosition); 441 if (_data->_ expandsToFitContentViaAutoLayout)441 if (_data->_clipsToVisibleRect) 442 442 _data->_page->viewExposedRectChanged([self visibleRect]); 443 443 } … … 3067 3067 _data->_mouseDownEvent = nil; 3068 3068 _data->_ignoringMouseDraggedEvents = NO; 3069 _data->_ expandsToFitContentViaAutoLayout = NO;3069 _data->_clipsToVisibleRect = NO; 3070 3070 3071 3071 _data->_intrinsicContentSize = NSMakeSize(NSViewNoInstrinsicMetric, NSViewNoInstrinsicMetric); … … 3172 3172 3173 3173 if (!(--_data->_frameSizeUpdatesDisabledCount)) { 3174 if (_data->_ expandsToFitContentViaAutoLayout)3174 if (_data->_clipsToVisibleRect) 3175 3175 _data->_page->viewExposedRectChanged([self visibleRect]); 3176 3176 [self _setDrawingAreaSize:[self frame].size]; … … 3230 3230 BOOL expandsToFit = minimumLayoutWidth > 0; 3231 3231 3232 _data->_expandsToFitContentViaAutoLayout = expandsToFit;3233 3232 _data->_page->setMinimumLayoutWidth(minimumLayoutWidth); 3234 3233 3235 if (expandsToFit) 3234 [self setShouldClipToVisibleRect:expandsToFit]; 3235 } 3236 3237 - (BOOL)shouldClipToVisibleRect 3238 { 3239 return _data->_clipsToVisibleRect; 3240 } 3241 3242 - (void)setShouldClipToVisibleRect:(BOOL)clipsToVisibleRect 3243 { 3244 _data->_clipsToVisibleRect = clipsToVisibleRect; 3245 3246 if (clipsToVisibleRect) 3236 3247 _data->_page->viewExposedRectChanged([self visibleRect]); 3237 3248 3238 _data->_page->setMainFrameIsScrollable(! expandsToFit);3249 _data->_page->setMainFrameIsScrollable(!clipsToVisibleRect); 3239 3250 } 3240 3251 … … 3354 3365 - (void)forceAsyncDrawingAreaSizeUpdate:(NSSize)size 3355 3366 { 3356 if (_data->_ expandsToFitContentViaAutoLayout)3367 if (_data->_clipsToVisibleRect) 3357 3368 _data->_page->viewExposedRectChanged([self visibleRect]); 3358 3369 [self _setDrawingAreaSize:size]; -
trunk/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h
r148901 r150532 61 61 @property (readwrite) CGFloat minimumLayoutWidth; 62 62 @property (readwrite) CGFloat minimumWidthForAutoLayout; 63 @property (readwrite) BOOL shouldClipToVisibleRect; 63 64 64 65 @property(copy, nonatomic) NSColor *underlayColor;
Note: See TracChangeset
for help on using the changeset viewer.