Summary: | [iOS] Allow SPI clients to lay out at arbitrarily scaled sizes and scale to fit the view | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Wenson Hsieh <wenson_hsieh> | ||||||||
Component: | WebKit API | Assignee: | Wenson Hsieh <wenson_hsieh> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | bdakin, commit-queue, simon.fraser, thorton, webkit-bug-importer | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Wenson Hsieh
2018-10-11 18:50:47 PDT
Created attachment 352130 [details]
First pass
Created attachment 352136 [details]
Fix WPE/GTK builds
Comment on attachment 352136 [details] Fix WPE/GTK builds View in context: https://bugs.webkit.org/attachment.cgi?id=352136&action=review > Source/WebCore/page/ViewportConfiguration.cpp:434 > + m_configuration.initialScale *= m_layoutSizeScaleFactor; Hi-larious > Source/WebCore/page/ViewportConfiguration.cpp:549 > + ts.dumpProperty("initialScaleIgnoringLayoutScaleFactor", parameters.initialScaleIgnoringLayoutScaleFactor); Probably also print out m_layoutSizeScaleFactor?? > Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:5166 > if (viewScale <= 0 || isnan(viewScale) || isinf(viewScale)) > [NSException raise:NSInvalidArgumentException format:@"View scale should be a positive number"]; Why is this in the !PLATFORM(MAC) section > Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:180 > +@property (nonatomic, setter=_setViewScale:) CGFloat _viewScale WK_API_AVAILABLE(macosx(10.11), ios(9.0)); Whoops > Tools/ChangeLog:22 > + Add a new file for UIScriptController methods on Cocoa platforms. Noice. There's some other stuff we can move here. Comment on attachment 352136 [details] Fix WPE/GTK builds View in context: https://bugs.webkit.org/attachment.cgi?id=352136&action=review >> Source/WebCore/page/ViewportConfiguration.cpp:549 >> + ts.dumpProperty("initialScaleIgnoringLayoutScaleFactor", parameters.initialScaleIgnoringLayoutScaleFactor); > > Probably also print out m_layoutSizeScaleFactor?? Yes! >> Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:5166 >> [NSException raise:NSInvalidArgumentException format:@"View scale should be a positive number"]; > > Why is this in the !PLATFORM(MAC) section Can't think of a good reason! Interestingly, WebViewImpl::setViewScale throws this same exception. I'll lift this `+[NSException raise:]` call out of !MAC for now, and move the identical macOS exception throwing logic from WebViewImpl to WKView. >> Tools/ChangeLog:22 >> + Add a new file for UIScriptController methods on Cocoa platforms. > > Noice. There's some other stuff we can move here. Indeed! Will move cross-macOS-iOS functionality here in a followup. > LayoutTests/resources/ui-helper.js:348 > + return new Promise(resolve => testRunner.runUIScript(`uiController.setViewScale(${scale})`, () => resolve())); Note to self: I should just pass `resolve` here rather than wrapping it in another callback. Created attachment 352206 [details]
Patch for EWS
Comment on attachment 352206 [details] Patch for EWS Clearing flags on attachment: 352206 Committed r237087: <https://trac.webkit.org/changeset/237087> |