WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
88837
[Chromium] Add WebDocument.images
https://bugs.webkit.org/show_bug.cgi?id=88837
Summary
[Chromium] Add WebDocument.images
Jesse Greenwald
Reported
2012-06-11 22:36:08 PDT
This is an API needed for Chrome.
Attachments
Patch
(2.59 KB, patch)
2012-06-12 16:09 PDT
,
Jesse Greenwald
no flags
Details
Formatted Diff
Diff
Patch
(2.61 KB, patch)
2012-06-13 11:36 PDT
,
Jesse Greenwald
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Jesse Greenwald
Comment 1
2012-06-12 16:09:40 PDT
Created
attachment 147184
[details]
Patch
WebKit Review Bot
Comment 2
2012-06-12 16:11:52 PDT
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
.
James Robinson
Comment 3
2012-06-12 16:14:53 PDT
(In reply to
comment #0
)
> This is an API needed for Chrome.
Why?
Adam Barth
Comment 4
2012-06-12 19:43:40 PDT
Comment on
attachment 147184
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=147184&action=review
A few minor nits below. The main thing to improve about this patch is the ChangeLog. The ChangeLog should explain why we're making this change. In this case, I suspect the reason is that this API is needed by Chrome on Android for some purpose. It would be nice to elaborate a bit about that purpose, if you're able to. In the particular case of this patch, it's not a big deal because we're mirroring a long-established DOM API, but it's still a good practice when contributing to WebKit. Thanks for the patch!
> Source/WebKit/chromium/src/WebDocument.cpp:142 > +void WebDocument::images(WebVector<WebElement>& results) const
Why "const"? You're ending up const_casting the Document anyway. It seems better to model this after body() and head() and skip the const.
> Source/WebKit/chromium/src/WebDocument.cpp:150 > + // Strange but true, sometimes node can be 0.
I'd skip this comment. WebKit usually only includes comments if they something about why the code is the way it is.
Jesse Greenwald
Comment 5
2012-06-13 10:57:40 PDT
Comment on
attachment 147184
[details]
Patch I'll expand on the ChangeLog when I upload the next patch. Thanks for taking a look! View in context:
https://bugs.webkit.org/attachment.cgi?id=147184&action=review
>> Source/WebKit/chromium/src/WebDocument.cpp:142 >> +void WebDocument::images(WebVector<WebElement>& results) const > > Why "const"? You're ending up const_casting the Document anyway. It seems better to model this after body() and head() and skip the const.
I originally modeled this after forms(), which is const. Actually, isn't body() const as well? Either way, I can remove const from this method.
>> Source/WebKit/chromium/src/WebDocument.cpp:150 >> + // Strange but true, sometimes node can be 0. > > I'd skip this comment. WebKit usually only includes comments if they something about why the code is the way it is.
Ok. For reference, the comment was copied from forms().
Adam Barth
Comment 6
2012-06-13 10:59:27 PDT
Yeah, you're discovering that WebDocument.cpp was written a long time ago and we've learned a bunch since then. :)
Jesse Greenwald
Comment 7
2012-06-13 11:36:51 PDT
Created
attachment 147374
[details]
Patch
Adam Barth
Comment 8
2012-06-13 11:40:00 PDT
Comment on
attachment 147374
[details]
Patch Thanks!
WebKit Review Bot
Comment 9
2012-06-13 23:32:04 PDT
Comment on
attachment 147374
[details]
Patch Clearing flags on attachment: 147374 Committed
r120284
: <
http://trac.webkit.org/changeset/120284
>
WebKit Review Bot
Comment 10
2012-06-13 23:32:09 PDT
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