<rdar://problem/16642127>
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!
http://trac.webkit.org/changeset/167662