Summary: | WKThumbnailView doesn't quite work with topContentInset | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Tim Horton <thorton> | ||||
Component: | WebKit2 | Assignee: | Tim Horton <thorton> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | bdakin, simon.fraser | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Tim Horton
2014-04-22 01:47:12 PDT
Created attachment 229871 [details]
patch
Comment on attachment 229871 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=229871&action=review > Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm:90 > + _lastSnapshotScale = 0; Could consider NaN instead for uses like this. > Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm:126 > - IntRect snapshotRect(IntPoint(), _webPageProxy->viewSize()); > + IntRect snapshotRect(IntPoint(), IntSize(_webPageProxy->viewSize().width(), _webPageProxy->viewSize().height() - _webPageProxy->topContentInset())); Is there a way to write this math simpler? Like maybe this: IntRect snapshotRect(IntPoint(), _webPageProxy->viewSize() - IntSize(0, _webPageProxy->topContentInset())); (In reply to comment #2) > (From update of attachment 229871 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=229871&action=review > > > Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm:90 > > + _lastSnapshotScale = 0; > > Could consider NaN instead for uses like this. I had really never considered using NaN for a comparison-that-always-fails case like this. That's neat. > > Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm:126 > > - IntRect snapshotRect(IntPoint(), _webPageProxy->viewSize()); > > + IntRect snapshotRect(IntPoint(), IntSize(_webPageProxy->viewSize().width(), _webPageProxy->viewSize().height() - _webPageProxy->topContentInset())); > > Is there a way to write this math simpler? Like maybe this: > > IntRect snapshotRect(IntPoint(), _webPageProxy->viewSize() - IntSize(0, _webPageProxy->topContentInset())); Sure. Thanks, Darin! |