Changeset 171509 in webkit


Ignore:
Timestamp:
Jul 23, 2014 10:17:43 PM (10 years ago)
Author:
Simon Fraser
Message:

[iOS WK2] Some help.apple.com pages not scrollable
https://bugs.webkit.org/show_bug.cgi?id=135228
<rdar://problem/17790792>

Reviewed by Benjamin Poulain.

On pages which size their document to the device size, the WKContentView size
never changes after it's created. In this situation, we never set a bounds
on the _rootContentView, so it remains zero-sized which breaks hit testing
on all enclosed UIScrollViews for overflow:scroll.

Fix by making the _rootContentView and the _inspectorIndicationView use autosizing
so they are always the size of their parent view, and remove the explicit setting
of their bounds.

  • UIProcess/ios/WKContentView.mm:

(-[WKContentView initWithFrame:context:configuration:webView:]):
(-[WKContentView setShowingInspectorIndication:]):
(-[WKContentView _didCommitLayerTree:]):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r171507 r171509  
     12014-07-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] Some help.apple.com pages not scrollable
     4        https://bugs.webkit.org/show_bug.cgi?id=135228
     5        <rdar://problem/17790792>
     6
     7        Reviewed by Benjamin Poulain.
     8       
     9        On pages which size their document to the device size, the WKContentView size
     10        never changes after it's created. In this situation, we never set a bounds
     11        on the _rootContentView, so it remains zero-sized which breaks hit testing
     12        on all enclosed UIScrollViews for overflow:scroll.
     13       
     14        Fix by making the _rootContentView and the _inspectorIndicationView use autosizing
     15        so they are always the size of their parent view, and remove the explicit setting
     16        of their bounds.
     17
     18        * UIProcess/ios/WKContentView.mm:
     19        (-[WKContentView initWithFrame:context:configuration:webView:]):
     20        (-[WKContentView setShowingInspectorIndication:]):
     21        (-[WKContentView _didCommitLayerTree:]):
     22
    1232014-07-23  Benjamin Poulain  <bpoulain@apple.com>
    224
  • trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm

    r171191 r171509  
    207207    _rootContentView = adoptNS([[UIView alloc] init]);
    208208    [_rootContentView layer].masksToBounds = NO;
    209    
     209    [_rootContentView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
     210
    210211    _fixedClippingView = adoptNS([[UIView alloc] init]);
    211212    [_fixedClippingView layer].masksToBounds = YES;
     
    314315        if (!_inspectorIndicationView) {
    315316            _inspectorIndicationView = adoptNS([[WKInspectorIndicationView alloc] initWithFrame:[self bounds]]);
     317            [_inspectorIndicationView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
    316318            [self insertSubview:_inspectorIndicationView.get() aboveSubview:_rootContentView.get()];
    317319        }
     
    444446
    445447    BOOL boundsChanged = !CGRectEqualToRect(oldBounds, contentBounds);
    446     if (boundsChanged) {
     448    if (boundsChanged)
    447449        [self setBounds:contentBounds];
    448         [_rootContentView setFrame:contentBounds];
    449         [_inspectorIndicationView setFrame:contentBounds];
    450     }
    451450
    452451    [_webView _didCommitLayerTree:layerTreeTransaction];
Note: See TracChangeset for help on using the changeset viewer.