WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
108311
[chromium] Add WebFrame::visibleContentRect()
https://bugs.webkit.org/show_bug.cgi?id=108311
Summary
[chromium] Add WebFrame::visibleContentRect()
Tien-Ren Chen
Reported
2013-01-30 01:38:07 PST
[chromium] Add convenience functions for geometry query
Attachments
Patch
(5.70 KB, patch)
2013-01-30 01:40 PST
,
Tien-Ren Chen
no flags
Details
Formatted Diff
Diff
Patch
(2.76 KB, patch)
2013-01-30 16:01 PST
,
Tien-Ren Chen
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Tien-Ren Chen
Comment 1
2013-01-30 01:40:14 PST
Created
attachment 185435
[details]
Patch
WebKit Review Bot
Comment 2
2013-01-30 01:42:20 PST
Please wait for approval from
abarth@webkit.org
,
dglazkov@chromium.org
,
fishd@chromium.org
,
jamesr@chromium.org
or
tkent@chromium.org
before submitting, as this patch contains changes to the Chromium public API. See also
https://trac.webkit.org/wiki/ChromiumWebKitAPI
.
Adam Barth
Comment 3
2013-01-30 11:26:52 PST
@jamesr: Would you be willing to review this patch?
James Robinson
Comment 4
2013-01-30 13:40:23 PST
Comment on
attachment 185435
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=185435&action=review
> Source/WebKit/chromium/public/WebFrame.h:172 > + // Returns the visible content rect (minus scrollbars, in absolute coordinate)
blank line before new functions how does this interact with contentsSize() + scrollOffset() ?
> Source/WebKit/chromium/src/WebViewImpl.cpp:4378 > + physicalWindowRect.scale(deviceScaleFactor() * pageScaleFactor());
I don't understand this function. device and page scale factors are exposed through the WebKit API, why do we need another WebKit API entry point just to multiply them together?
Tien-Ren Chen
Comment 5
2013-01-30 14:03:26 PST
(In reply to
comment #4
)
> (From update of
attachment 185435
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=185435&action=review
> > > Source/WebKit/chromium/public/WebFrame.h:172 > > + // Returns the visible content rect (minus scrollbars, in absolute coordinate) > > blank line before new functions > > how does this interact with contentsSize() + scrollOffset() ?
Nothing to do with contentsSize. It is the current visible area of the frame, in absolute coordinate. In current implementation it would be the same value as IntRect(scrollOffset, ceil(webView()->size() / pageScaleFactor))
> > Source/WebKit/chromium/src/WebViewImpl.cpp:4378 > > + physicalWindowRect.scale(deviceScaleFactor() * pageScaleFactor()); > > I don't understand this function. device and page scale factors are exposed through the WebKit API, why do we need another WebKit API entry point just to multiply them together?
Because it is much less error-prone and easier to understand this way. Saying "foo = bar * deviceScaleFactor * pageScaleFactor;" can be understood by the compiler, but doesn't really translate well to English. While saying "foo = WebViewImpl->physicalWindowFromClient(bar);" even your grandmother can understand what are you trying to do here. Consider the more complex case, what if we need to convert between absolute and client coordinates? Inner and outer viewport coordinates? Should we add or substract the offset? Translate before scale or after? Doing this all the times kills lots of brain cells.
Tien-Ren Chen
Comment 6
2013-01-30 16:01:31 PST
Created
attachment 185607
[details]
Patch
Tien-Ren Chen
Comment 7
2013-01-30 16:03:00 PST
Per offline discussion, we decided not to over-grow WebView API with bunch of conversion functions, but there is probably no alternative for WebFrame::visibleContentRect().
WebKit Review Bot
Comment 8
2013-01-30 17:41:10 PST
Comment on
attachment 185607
[details]
Patch Clearing flags on attachment: 185607 Committed
r141352
: <
http://trac.webkit.org/changeset/141352
>
WebKit Review Bot
Comment 9
2013-01-30 17:41:14 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug