Bug 136010

Summary: REGRESSION (r167856): adobe.com no longer able to launch Create Cloud app using a URL with a custom scheme
Product: WebKit Reporter: Andy Estes <aestes>
Component: New BugsAssignee: Andy Estes <aestes>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, commit-queue, darin, dbates, ddkilzer, japhet
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch darin: review+

Andy Estes
Reported 2014-08-15 18:52:14 PDT
REGRESSION (r167856): adobe.com no longer able to launch Create Cloud app using a URL with a custom scheme
Attachments
Patch (33.55 KB, patch)
2014-08-15 19:34 PDT, Andy Estes
no flags
Patch (33.82 KB, patch)
2014-08-16 01:38 PDT, Andy Estes
no flags
Patch (33.83 KB, patch)
2014-08-16 01:46 PDT, Andy Estes
no flags
Patch (65.64 KB, patch)
2014-08-18 06:14 PDT, Andy Estes
darin: review+
Andy Estes
Comment 1 2014-08-15 19:00:55 PDT
http://trac.webkit.org/changeset/167856 caused WebCore to stop scheduling navigations to invalid URLs in some cases (window.location changes, meta-refresh, and some calls to window.open). As a result, the client's policy delegate is no longer called for such navigations. Adobe.com is relying on Safari's navigation policy delegate to launch Create Cloud on navigations to its aam: scheme (but otherwise ignore the navigation), and unfortunately they use URLs that aren't valid to do so.
Andy Estes
Comment 2 2014-08-15 19:34:38 PDT
Andy Estes
Comment 3 2014-08-16 01:38:23 PDT
Andy Estes
Comment 4 2014-08-16 01:46:31 PDT
Darin Adler
Comment 5 2014-08-16 13:32:15 PDT
Comment on attachment 236707 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=236707&action=review > Source/WebCore/loader/FrameLoader.cpp:2901 > + bool willRedirectToInvalidURL = m_quickRedirectComing && !request.url().isValid(); What about non-redirect requests that are for an invalid URL? The code in NavigationScheduler applies for scheduleLocationChange, not just scheduleRedirect.
Andy Estes
Comment 6 2014-08-17 21:32:54 PDT
Andy Estes
Comment 7 2014-08-17 21:38:12 PDT
Andy Estes
Comment 8 2014-08-17 22:12:55 PDT
(In reply to comment #5) > (From update of attachment 236707 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=236707&action=review > > > Source/WebCore/loader/FrameLoader.cpp:2901 > > + bool willRedirectToInvalidURL = m_quickRedirectComing && !request.url().isValid(); > > What about non-redirect requests that are for an invalid URL? The code in NavigationScheduler applies for scheduleLocationChange, not just scheduleRedirect. Oh, thanks for pointing this out. scheduleLocationChange is handled as a redirect in some cases, but not in others. The two cases I didn't cover are fragment navigations and non-quick redirects. I'll post a second patch that addresses these cases.
Andy Estes
Comment 9 2014-08-17 22:14:17 PDT
(In reply to comment #8) > > scheduleLocationChange is handled as a redirect in some cases, but not in others. As a quick redirect, that is.
Darin Adler
Comment 10 2014-08-18 00:21:10 PDT
For that matter, scheduleRedirect is not always handled as a quick redirect either. Sometimes it’s a non-quick redirect.
Andy Estes
Comment 11 2014-08-18 00:36:27 PDT
Reverted r172697 in <http://trac.webkit.org/changeset/172699> since the change also made some layout tests flaky.
Andy Estes
Comment 12 2014-08-18 06:08:12 PDT
There were at least two problems with the patch that was rolled out: 1. As discussed, it did not disallow non-quick redirects to invalid URLs like r167856 did. 2. A navigation other than the one started by NavigationScheduler could be incorrectly disallowed, for instance if a load is started from the API while the NavigationScheduler's timer is active (because m_quickRedirectComing would be true even for the API load). Instead of relying on m_quickRedirectComing I added an AllowNavigationToInvalidURL enum and piped it down to continueLoadAfterNavigationPolicy. Only the scheduled navigation types checked by r167856 (ScheduledRedirect and ScheduledLocationChange) use the AllowNavigationToInvalidURL::No value.
Andy Estes
Comment 13 2014-08-18 06:14:06 PDT
Darin Adler
Comment 14 2014-08-18 08:55:19 PDT
Comment on attachment 236761 [details] Patch I’ll have to take your word for the fact that this is right and covers all the cases. I can’t follow all the different paths from reading the code. I suppose test coverage also may make it sufficiently clear. But the logic here is quite hard to follow. I am hoping that later we can disallow invalid URLs in even more cases, while allowing them in the few cases that we need to; I hope that eventually the default behavior can be No instead of Yes. It also seems like a serious problem that the frame loader has so many different load calls.
Andy Estes
Comment 15 2014-08-18 10:49:20 PDT
Andy Estes
Comment 16 2014-08-18 13:31:58 PDT
(In reply to comment #14) > (From update of attachment 236761 [details]) > I’ll have to take your word for the fact that this is right and covers all the cases. I can’t follow all the different paths from reading the code. I suppose test coverage also may make it sufficiently clear. But the logic here is quite hard to follow. I am hoping that later we can disallow invalid URLs in even more cases, while allowing them in the few cases that we need to; I hope that eventually the default behavior can be No instead of Yes. It also seems like a serious problem that the frame loader has so many different load calls. I agree that the many different load calls is a serious problem. I was disappointed with the amount of plumbing necessary to get a value from NavigationScheduler to the right FrameLoader function. I intentionally avoided using a default value for the AllowNavigationToInvalidURL arguments so that finding the additional places where we can disallow invalid URLs just requires looking for AllowNavigationToInvalidURL::Yes. I hope this makes it easier to migrate more loading code paths over to disallowing invalid URLs.
Darin Adler
Comment 17 2014-08-18 14:42:15 PDT
(In reply to comment #16) > I intentionally avoided using a default value for the AllowNavigationToInvalidURL arguments so that finding the additional places where we can disallow invalid URLs just requires looking for AllowNavigationToInvalidURL::Yes. Except for changeLocation. Also note that sometimes the function’s job is so abstract that it’s really hard to understand if Yes or No is correct.
Note You need to log in before you can comment on or make changes to this bug.