Summary: | Pending API Request URL is wrong after reloading | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> | ||||||||
Component: | WebKit2 | Assignee: | Nobody <webkit-unassigned> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | andersca, ap, beidson, commit-queue, darin, kling, mcatanzaro, sam | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Bug Depends on: | 136916 | ||||||||||
Bug Blocks: | |||||||||||
Attachments: |
|
Description
Carlos Garcia Campos
2014-12-06 09:58:41 PST
Created attachment 242716 [details] Patch I've reused the new test I added for bug #136916 to test this. Owners? Comment on attachment 242716 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=242716&action=review I’m saying review+ but I am not 100% sure this is right. > Source/WebKit2/UIProcess/WebPageProxy.cpp:902 > + String url = m_pageLoadState.activeURL(); > + if (url.isEmpty() && m_backForwardList->currentItem()) > + url = m_backForwardList->currentItem()->url(); > + > + if (!url.isEmpty()) { Seems a little peculiar here to use isEmpty rather than isNull. I’m generally concerned that this code is trying to figure out what URL the other process will reload; we are not sending the URL over, so this is trying to predict what the other process will do? If so, then it seems that to be correct this has to match the logic in FrameLoader::reload and other loader logic inside WebCore, and it seems to me that adding this one thing it’s still far from matching it! It’s nice to fix this one particular case, but what about: - The case where there is an unreachableURL. - If a window is created by javascript, its main frame can have an empty but non-nil URL. We need to test that case. I’d like to hear Anders’s opinion. (In reply to comment #3) > Comment on attachment 242716 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=242716&action=review > > I’m saying review+ but I am not 100% sure this is right. > > > Source/WebKit2/UIProcess/WebPageProxy.cpp:902 > > + String url = m_pageLoadState.activeURL(); > > + if (url.isEmpty() && m_backForwardList->currentItem()) > > + url = m_backForwardList->currentItem()->url(); > > + > > + if (!url.isEmpty()) { > > Seems a little peculiar here to use isEmpty rather than isNull. > > I’m generally concerned that this code is trying to figure out what URL the > other process will reload; we are not sending the URL over, so this is > trying to predict what the other process will do? If so, then it seems that > to be correct this has to match the logic in FrameLoader::reload and other > loader logic inside WebCore, and it seems to me that adding this one thing > it’s still far from matching it! Note that this only affects the pending API request URL. This is to ensure that getting the active URL right after load or reload returns a valid URL, in case of load methods the one passed to the load. In case of reload that URL should always be the current active URL of the web view, since that's what we want to reload. If the web process ends up loading a different URL it doesn't really matter, because as soon as provisional load starts, the provisional url is used instead of the pending api request one. > It’s nice to fix this one particular case, > but what about: > > - The case where there is an unreachableURL. This case is covered by this patch, because PageLoadState::activeURL() returns the unreachable URL if there's one. > - If a window is created by javascript, its main frame can have an empty but > non-nil URL. We need to test that case. Yes, I would need to check what happens in this particular case. > I’d like to hear Anders’s opinion. Created attachment 276622 [details]
Patch for landing
Attachment 276622 [details] did not pass style-queue:
ERROR: Tools/TestWebKitAPI/Tests/WebKit2/PendingAPIRequestURL.cpp:44: More than one command on the same line [whitespace/newline] [4]
Total errors found: 1 in 4 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 276629 [details]
Rebased patch
Attachment 276629 [details] did not pass style-queue:
ERROR: Tools/TestWebKitAPI/Tests/WebKit2/PendingAPIRequestURL.cpp:47: More than one command on the same line [whitespace/newline] [4]
Total errors found: 1 in 4 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Committed r199664: <http://trac.webkit.org/changeset/199664> |