Changeset 150532 in webkit


Ignore:
Timestamp:
May 22, 2013 12:48:26 PM (11 years ago)
Author:
timothy_horton@apple.com
Message:

[wk2] Should be able to make tiled WKViews clip to the view's exposed rect without using autolayout
https://bugs.webkit.org/show_bug.cgi?id=116625
<rdar://problem/13962816>

Reviewed by Anders Carlsson.

The two modes are not dependent; it should be possible to enable
clips-to-exposed-rect without using autolayout. This enables apps to
make very large tiled WKViews that don't create tiles for the whole
area of the view (and also disables scrolling, since that is currently
incompatible with clipping to the exposed rect).

  • UIProcess/API/mac/WKView.mm:

(-[WKView setFrameSize:]):
(-[WKView _updateWindowAndViewFrames]):
(-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
(-[WKView enableFrameSizeUpdates]):
(-[WKView forceAsyncDrawingAreaSizeUpdate:]):
Rename _expandsToFitContentViaAutoLayout to _clipsToVisibleRect for accuracy.

(-[WKView setMinimumWidthForAutoLayout:]):
Factor clips-to-sisible-rect toggle out into setShouldClipToVisibleRect.

(-[WKView shouldClipToVisibleRect]):
(-[WKView setShouldClipToVisibleRect:]):
Allow setting clips-to-visible-rect without autolayout.

  • UIProcess/API/mac/WKViewPrivate.h:

Add shouldClipToVisibleRect property.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r150521 r150532  
     12013-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
    1332013-05-22  Alexey Proskuryakov  <ap@apple.com>
    234
  • trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm

    r150291 r150532  
    236236   
    237237    NSSize _intrinsicContentSize;
    238     BOOL _expandsToFitContentViaAutoLayout;
     238    BOOL _clipsToVisibleRect;
    239239
    240240#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     
    427427
    428428    if (frameSizeUpdatesEnabled) {
    429         if (_data->_expandsToFitContentViaAutoLayout)
     429        if (_data->_clipsToVisibleRect)
    430430            _data->_page->viewExposedRectChanged([self visibleRect]);
    431431        [self _setDrawingAreaSize:size];
     
    439439   
    440440    _data->_page->windowAndViewFramesChanged(viewFrameInWindowCoordinates, accessibilityPosition);
    441     if (_data->_expandsToFitContentViaAutoLayout)
     441    if (_data->_clipsToVisibleRect)
    442442        _data->_page->viewExposedRectChanged([self visibleRect]);
    443443}
     
    30673067    _data->_mouseDownEvent = nil;
    30683068    _data->_ignoringMouseDraggedEvents = NO;
    3069     _data->_expandsToFitContentViaAutoLayout = NO;
     3069    _data->_clipsToVisibleRect = NO;
    30703070
    30713071    _data->_intrinsicContentSize = NSMakeSize(NSViewNoInstrinsicMetric, NSViewNoInstrinsicMetric);
     
    31723172   
    31733173    if (!(--_data->_frameSizeUpdatesDisabledCount)) {
    3174         if (_data->_expandsToFitContentViaAutoLayout)
     3174        if (_data->_clipsToVisibleRect)
    31753175            _data->_page->viewExposedRectChanged([self visibleRect]);
    31763176        [self _setDrawingAreaSize:[self frame].size];
     
    32303230    BOOL expandsToFit = minimumLayoutWidth > 0;
    32313231
    3232     _data->_expandsToFitContentViaAutoLayout = expandsToFit;
    32333232    _data->_page->setMinimumLayoutWidth(minimumLayoutWidth);
    32343233
    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)
    32363247        _data->_page->viewExposedRectChanged([self visibleRect]);
    32373248
    3238     _data->_page->setMainFrameIsScrollable(!expandsToFit);
     3249    _data->_page->setMainFrameIsScrollable(!clipsToVisibleRect);
    32393250}
    32403251
     
    33543365- (void)forceAsyncDrawingAreaSizeUpdate:(NSSize)size
    33553366{
    3356     if (_data->_expandsToFitContentViaAutoLayout)
     3367    if (_data->_clipsToVisibleRect)
    33573368        _data->_page->viewExposedRectChanged([self visibleRect]);
    33583369    [self _setDrawingAreaSize:size];
  • trunk/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h

    r148901 r150532  
    6161@property (readwrite) CGFloat minimumLayoutWidth;
    6262@property (readwrite) CGFloat minimumWidthForAutoLayout;
     63@property (readwrite) BOOL shouldClipToVisibleRect;
    6364
    6465@property(copy, nonatomic) NSColor *underlayColor;
Note: See TracChangeset for help on using the changeset viewer.