Bug 139400 - [iOS] YouTube plug-in replacement should support partial urls
Summary: [iOS] YouTube plug-in replacement should support partial urls
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-08 08:41 PST by Eric Carlson
Modified: 2014-12-08 14:55 PST (History)
2 users (show)

See Also:


Attachments
Proposed patch. (1.43 KB, patch)
2014-12-08 08:57 PST, Eric Carlson
ap: review-
Details | Formatted Diff | Diff
Updated patch. (1.50 KB, patch)
2014-12-08 13:45 PST, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2014-12-08 08:41:10 PST
Some sites use urls that begin with just "//" for YouTube iFrames, so the YouTube plug-in replacement should support them.
Comment 1 Eric Carlson 2014-12-08 08:57:31 PST
Created attachment 242816 [details]
Proposed patch.
Comment 2 Alexey Proskuryakov 2014-12-08 09:24:44 PST
Comment on attachment 242816 [details]
Proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=242816&action=review

> Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp:289
> +    if (srcString.startsWith("//"))
> +        srcURL = URL(URL(), "http:" + srcString);
> +    else
> +        srcURL = URL(URL(), srcString);

This does not look right, because for https pages, it should almost certainly use https, too.

I'm only guessing about what and Flash/YouTube do, my instinct is that we should use Document::completeURL to handle any relative URLs, not just those without a scheme.
Comment 3 Eric Carlson 2014-12-08 13:44:20 PST
(In reply to comment #2)
> Comment on attachment 242816 [details]
> Proposed patch.
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=242816&action=review
> 
> > Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp:289
> > +    if (srcString.startsWith("//"))
> > +        srcURL = URL(URL(), "http:" + srcString);
> > +    else
> > +        srcURL = URL(URL(), srcString);
> 
> This does not look right, because for https pages, it should almost
> certainly use https, too.
> 
> I'm only guessing about what and Flash/YouTube do, my instinct is that we
> should use Document::completeURL to handle any relative URLs, not just those
> without a scheme.

This is an excellent suggestion, thanks!
Comment 4 Eric Carlson 2014-12-08 13:45:11 PST
Created attachment 242845 [details]
Updated patch.
Comment 5 WebKit Commit Bot 2014-12-08 14:55:31 PST
Comment on attachment 242845 [details]
Updated patch.

Clearing flags on attachment: 242845

Committed r176977: <http://trac.webkit.org/changeset/176977>
Comment 6 WebKit Commit Bot 2014-12-08 14:55:34 PST
All reviewed patches have been landed.  Closing bug.