<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:darin@apple.com" title="Darin Adler <darin@apple.com>"> <span class="fn">Darin Adler</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - Initial Link preload support"
href="https://bugs.webkit.org/show_bug.cgi?id=156334">bug 156334</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #275944 Flags</td>
<td>review?
</td>
<td>review+
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Initial Link preload support"
href="https://bugs.webkit.org/show_bug.cgi?id=156334#c26">Comment # 26</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Initial Link preload support"
href="https://bugs.webkit.org/show_bug.cgi?id=156334">bug 156334</a>
from <span class="vcard"><a class="email" href="mailto:darin@apple.com" title="Darin Adler <darin@apple.com>"> <span class="fn">Darin Adler</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=275944&action=diff" name="attach_275944" title="Patch">attachment 275944</a> <a href="attachment.cgi?id=275944&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=275944&action=review">https://bugs.webkit.org/attachment.cgi?id=275944&action=review</a>
Looks OK. No test coverage for the various types of preloading, which seems like a problem to me.
<span class="quote">> Source/WebCore/loader/LinkLoader.cpp:104
> + String lowerAs = as.convertToASCIILowercase();
> + if (lowerAs == "image")
> + return CachedResource::ImageResource;
> + if (lowerAs == "script")
> + return CachedResource::Script;
> + if (lowerAs == "style")
> + return CachedResource::CSSStyleSheet;
> + if (lowerAs == "media")
> + return CachedResource::MediaResource;
> + if (lowerAs == "font")
> + return CachedResource::FontResource;
> + if (lowerAs == "track")
> + return CachedResource::TextTrackResource;</span >
This should use equalLettersIgnoringASCIICase and not allocate a lowercased copy of the string.
<span class="quote">> Source/WebCore/loader/LinkLoader.cpp:114
> + if (!href.isValid() || href.isEmpty()) {</span >
I found other code doing checks like this, but there is no need to check isEmpty after checking isValid. Empty URLs are always also invalid.
<span class="quote">> Source/WebCore/loader/LinkLoader.cpp:118
> + Optional<CachedResource::Type> type = LinkLoader::getResourceTypeFromAsAttribute(as);</span >
I think this reads better with the type "auto" instead of writing out the Optional type.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>