Bug 137988 - [iOS WK2] Protect WKWebView dynamic viewport change against empty sizes
Summary: [iOS WK2] Protect WKWebView dynamic viewport change against empty sizes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
: 136522 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-10-22 16:41 PDT by Benjamin Poulain
Modified: 2014-10-24 12:19 PDT (History)
2 users (show)

See Also:


Attachments
Patch (5.43 KB, patch)
2014-10-22 16:51 PDT, Benjamin Poulain
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2014-10-22 16:41:44 PDT
[iOS WK2] Protect WKWebView dynamic viewport change against empty sizes
Comment 1 Benjamin Poulain 2014-10-22 16:51:58 PDT
Created attachment 240305 [details]
Patch
Comment 2 Simon Fraser (smfr) 2014-10-22 17:18:38 PDT
Comment on attachment 240305 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=240305&action=review

> Source/WebKit2/ChangeLog:21
> +        For the target values, things are trickier. We do not know what the values are gonna be before we execute

going to be

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:2227
> +    if (CGRectIsEmpty(newBounds) || newMinimumLayoutSize.isEmpty() || newMinimumLayoutSizeForMinimalUI.isEmpty() || CGRectIsEmpty(futureUnobscuredRectInSelfCoordinates)) {
> +        _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing;

Maybe you should assert here. It seems odd to pass empty rects to things like setViewportConfigurationMinimumLayoutSize
Comment 3 Benjamin Poulain 2014-10-22 19:26:54 PDT
(In reply to comment #2)
> > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:2227
> > +    if (CGRectIsEmpty(newBounds) || newMinimumLayoutSize.isEmpty() || newMinimumLayoutSizeForMinimalUI.isEmpty() || CGRectIsEmpty(futureUnobscuredRectInSelfCoordinates)) {
> > +        _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing;
> 
> Maybe you should assert here. It seems odd to pass empty rects to things
> like setViewportConfigurationMinimumLayoutSize

That's a good point, there is not valid use case for empty layout size here.
Comment 4 Benjamin Poulain 2014-10-22 19:40:02 PDT
Committed r175081: <http://trac.webkit.org/changeset/175081>
Comment 5 David Kilzer (:ddkilzer) 2014-10-24 12:19:12 PDT
*** Bug 136522 has been marked as a duplicate of this bug. ***