WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
157435
Add injected bundle SPI for getting favicon and touch icon URLs
https://bugs.webkit.org/show_bug.cgi?id=157435
Summary
Add injected bundle SPI for getting favicon and touch icon URLs
Anders Carlsson
Reported
2016-05-06 16:56:41 PDT
Add injected bundle SPI for getting favicon and touch icon URLs
Attachments
Patch
(26.75 KB, patch)
2016-05-06 17:00 PDT
,
Anders Carlsson
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Anders Carlsson
Comment 1
2016-05-06 17:00:48 PDT
Created
attachment 278289
[details]
Patch
Darin Adler
Comment 2
2016-05-07 09:29:29 PDT
Comment on
attachment 278289
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=278289&action=review
> Source/WebCore/html/LinkIconCollector.cpp:51 > + {
Incorrect indentation.
> Source/WebCore/html/LinkIconCollector.cpp:102 > + unsigned size = linkElement.sizes().item(0).string().stripWhiteSpace().toUInt(&ok);
It’s almost never good to use stripWhiteSpace, since it’s the wrong set of whitespace characters. We have stripLeadingAndTrailingHTMLSpaces, and we have it on both String and StringView. Here, I think we’d want to use the StringView version—why allocate a string just to convert it to an integer?
> Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:49 > +// FIXME: These should be tagged nonnull.
Why does this have to be a FIXME? We don’t have the correct macro for that?
Anders Carlsson
Comment 3
2016-05-09 12:28:55 PDT
(In reply to
comment #2
)
> > Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:49 > > +// FIXME: These should be tagged nonnull. > > Why does this have to be a FIXME? We don’t have the correct macro for that?
We do have the correct macro, but adding an annotation to one method will cause the compiler to warn unless all methods have annotations (which they don't).
Anders Carlsson
Comment 4
2016-05-09 13:38:47 PDT
(In reply to
comment #2
)
> Comment on
attachment 278289
[details]
> Patch > > > Source/WebCore/html/LinkIconCollector.cpp:102 > > + unsigned size = linkElement.sizes().item(0).string().stripWhiteSpace().toUInt(&ok); > > It’s almost never good to use stripWhiteSpace, since it’s the wrong set of > whitespace characters. We have stripLeadingAndTrailingHTMLSpaces, and we > have it on both String and StringView. Here, I think we’d want to use the > StringView version—why allocate a string just to convert it to an integer? >
It doesn't look like there's a version of stripLeadingAndTrailingHTMLSpaces that works on a StringView - I'll make sure to fix one and adopt StringView in an upcoming patch.
Anders Carlsson
Comment 5
2016-05-09 13:40:46 PDT
Committed
r200591
: <
http://trac.webkit.org/changeset/200591
>
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