|
|
DescriptionDon't abort the PDF stream if a navigation is intiated within the same page.
If a PDF file is loaded via a link click with a history.replacestate call
in the pagehide/pageshow event for the main html page, we get a DidStartNavigation
notification on the guest webcontents created for the EmbeddedObserver.
Currently we abort the stream if it is a top level navigation.
It seems like we should not abort the stream if the navigation is within the same page.
The problem does not occur if the PDF is opened in a different tab or window
Should fix the black PDF issues with M55.
BUG=677580
TEST=Covered by browser test PDFExtensionTest.OpenPDFOnLinkClickWithReplaceState
Review-Url: https://codereview.chromium.org/2611643004
Cr-Commit-Position: refs/heads/master@{#441857}
Committed: https://chromium.googlesource.com/chromium/src/+/52df16bebd27db88af89d12460db4b4c857aeebb
Patch Set 1 #Patch Set 2 : Update test #
Total comments: 6
Patch Set 3 : Address review comments #Patch Set 4 : Fix redness. #
Messages
Total messages: 47 (31 generated)
ananta@chromium.org changed reviewers: + lazyboy@chromium.org
The CQ bit was checked by ananta@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
ananta@chromium.org changed reviewers: + creis@chromium.org
Description was changed from ========== Don't abort the PDF stream if a navigation is intiated within the same page. If a PDF file is loaded via a link click for e.g. we get a navigation started notification for the frame. We should not abort the stream here as this is the same navigation which created the stream. Should fix the black PDF issues with M55. BUG=677580 ========== to ========== Don't abort the PDF stream if a navigation is intiated within the same page. If a PDF file is loaded via a link click with a history.replacestate call in the pagehide event for the main html page, we get a DidStartNavigation notification on the guest webcontents created for the EmbeddedObserver. Currently we abort the stream if it is a top level navigation. It seems like we should not abort the stream if the navigation is within the same page. Should fix the black PDF issues with M55. BUG=677580 ==========
Description was changed from ========== Don't abort the PDF stream if a navigation is intiated within the same page. If a PDF file is loaded via a link click with a history.replacestate call in the pagehide event for the main html page, we get a DidStartNavigation notification on the guest webcontents created for the EmbeddedObserver. Currently we abort the stream if it is a top level navigation. It seems like we should not abort the stream if the navigation is within the same page. Should fix the black PDF issues with M55. BUG=677580 ========== to ========== Don't abort the PDF stream if a navigation is intiated within the same page. If a PDF file is loaded via a link click with a history.replacestate call in the pagehide event for the main html page, we get a DidStartNavigation notification on the guest webcontents created for the EmbeddedObserver. Currently we abort the stream if it is a top level navigation. It seems like we should not abort the stream if the navigation is within the same page. The problem does not occur if the PDF is opened in a different tab or window Should fix the black PDF issues with M55. BUG=677580 ==========
Description was changed from ========== Don't abort the PDF stream if a navigation is intiated within the same page. If a PDF file is loaded via a link click with a history.replacestate call in the pagehide event for the main html page, we get a DidStartNavigation notification on the guest webcontents created for the EmbeddedObserver. Currently we abort the stream if it is a top level navigation. It seems like we should not abort the stream if the navigation is within the same page. The problem does not occur if the PDF is opened in a different tab or window Should fix the black PDF issues with M55. BUG=677580 ========== to ========== Don't abort the PDF stream if a navigation is intiated within the same page. If a PDF file is loaded via a link click with a history.replacestate call in the pagehide/pageshow event for the main html page, we get a DidStartNavigation notification on the guest webcontents created for the EmbeddedObserver. Currently we abort the stream if it is a top level navigation. It seems like we should not abort the stream if the navigation is within the same page. The problem does not occur if the PDF is opened in a different tab or window Should fix the black PDF issues with M55. BUG=677580 ==========
On 2017/01/04 02:12:08, ananta wrote: Thanks to lazyboy for bringing up the possibility of this bug occurring with the pageshow event as well and for the test case. We verified that the patch fixes it for both cases.
On 2017/01/04 03:20:00, ananta wrote: > On 2017/01/04 02:12:08, ananta wrote: > > Thanks to lazyboy for bringing up the possibility of this bug occurring with the > pageshow event as well and for the test case. We verified that > the patch fixes it for both cases. From my digging around, this seems fine, although a bit tricky for me to be entirely comfortable reviewing this. I suggested ananta@ to add Charlie in case there are other edge cases to worry about. For reference, the pagehide example is: From main page: window.addEventListener('pagehide', function(e) { history.replaceState({time:+new Date}, ''); }); then open a <a href="any pdf">..</a> link from main page. And the pageshow example is: From a main page button's event handler, do: var w = window.open('same_site_pdf_link') w.addEventListener('pageshow', function(e) { history.replaceState({time: +new Date}, ''); }); In both cases, history.replaceState ends up producing a WCO::DidStartNavigation with NavigationHandle::IsSamePage() = true
Seems reasonable to me-- for any same-page navigation, we won't be leaving the page, and thus the stream is still needed. LGTM, but please add a browser test for it if you can (since there's a simple HTML file to repro it).
Description was changed from ========== Don't abort the PDF stream if a navigation is intiated within the same page. If a PDF file is loaded via a link click with a history.replacestate call in the pagehide/pageshow event for the main html page, we get a DidStartNavigation notification on the guest webcontents created for the EmbeddedObserver. Currently we abort the stream if it is a top level navigation. It seems like we should not abort the stream if the navigation is within the same page. The problem does not occur if the PDF is opened in a different tab or window Should fix the black PDF issues with M55. BUG=677580 ========== to ========== Don't abort the PDF stream if a navigation is intiated within the same page. If a PDF file is loaded via a link click with a history.replacestate call in the pagehide/pageshow event for the main html page, we get a DidStartNavigation notification on the guest webcontents created for the EmbeddedObserver. Currently we abort the stream if it is a top level navigation. It seems like we should not abort the stream if the navigation is within the same page. The problem does not occur if the PDF is opened in a different tab or window Should fix the black PDF issues with M55. BUG=677580 TEST=Covered by browser test PDFExtensionTest.OpenPDFOnLinkClickWithReplaceState ==========
On 2017/01/04 18:38:43, Charlie Reis wrote: > Seems reasonable to me-- for any same-page navigation, we won't be leaving the > page, and thus the stream is still needed. LGTM, but please add a browser test > for it if you can (since there's a simple HTML file to repro it). Added a test
The CQ bit was checked by ananta@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...)
lgtm w/ nits https://codereview.chromium.org/2611643004/diff/20001/chrome/browser/pdf/pdf_... File chrome/browser/pdf/pdf_extension_test.cc (right): https://codereview.chromium.org/2611643004/diff/20001/chrome/browser/pdf/pdf_... chrome/browser/pdf/pdf_extension_test.cc:927: std::string pdf_link_click = "document.getElementById('link').click();"; nit: kPdfLinkClick https://codereview.chromium.org/2611643004/diff/20001/chrome/browser/pdf/pdf_... chrome/browser/pdf/pdf_extension_test.cc:932: ASSERT_TRUE(current_url.spec().find("pdf/test-link.pdf") != current_url.path() == "/pdf/test-link.pdf" https://codereview.chromium.org/2611643004/diff/20001/chrome/browser/pdf/pdf_... chrome/browser/pdf/pdf_extension_test.cc:972: ASSERT_EQ(std::string("http://www.example.com/"), url.spec()); nit: Maybe ASSERT_EQ(GURL("http://www.example.com"), url) is better?
https://codereview.chromium.org/2611643004/diff/20001/chrome/browser/pdf/pdf_... File chrome/browser/pdf/pdf_extension_test.cc (right): https://codereview.chromium.org/2611643004/diff/20001/chrome/browser/pdf/pdf_... chrome/browser/pdf/pdf_extension_test.cc:927: std::string pdf_link_click = "document.getElementById('link').click();"; On 2017/01/05 04:03:14, lazyboy wrote: > nit: kPdfLinkClick Done. https://codereview.chromium.org/2611643004/diff/20001/chrome/browser/pdf/pdf_... chrome/browser/pdf/pdf_extension_test.cc:932: ASSERT_TRUE(current_url.spec().find("pdf/test-link.pdf") != On 2017/01/05 04:03:14, lazyboy wrote: > current_url.path() == "/pdf/test-link.pdf" Done. https://codereview.chromium.org/2611643004/diff/20001/chrome/browser/pdf/pdf_... chrome/browser/pdf/pdf_extension_test.cc:972: ASSERT_EQ(std::string("http://www.example.com/"), url.spec()); On 2017/01/05 04:03:14, lazyboy wrote: > nit: Maybe ASSERT_EQ(GURL("http://www.example.com"), url) is better? Done.
The CQ bit was checked by ananta@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by ananta@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by ananta@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from creis@chromium.org, lazyboy@chromium.org Link to the patchset: https://codereview.chromium.org/2611643004/#ps60001 (title: "Fix redness.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
ananta@chromium.org changed reviewers: + thestig@chromium.org
+thestig for chrome\browser\pdf owners
ananta@chromium.org changed reviewers: + dsinclair@chromium.org
+dsinclair for pdf owners
ananta@chromium.org changed reviewers: + jochen@chromium.org
+jochen for the pdf test changes
pdf lgtm
The CQ bit was checked by ananta@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 60001, "attempt_start_ts": 1483671297002970, "parent_rev": "ed3ef90ecc3c01246a3d838fbeefdab72c94c228", "commit_rev": "52df16bebd27db88af89d12460db4b4c857aeebb"}
Message was sent while issue was closed.
Description was changed from ========== Don't abort the PDF stream if a navigation is intiated within the same page. If a PDF file is loaded via a link click with a history.replacestate call in the pagehide/pageshow event for the main html page, we get a DidStartNavigation notification on the guest webcontents created for the EmbeddedObserver. Currently we abort the stream if it is a top level navigation. It seems like we should not abort the stream if the navigation is within the same page. The problem does not occur if the PDF is opened in a different tab or window Should fix the black PDF issues with M55. BUG=677580 TEST=Covered by browser test PDFExtensionTest.OpenPDFOnLinkClickWithReplaceState ========== to ========== Don't abort the PDF stream if a navigation is intiated within the same page. If a PDF file is loaded via a link click with a history.replacestate call in the pagehide/pageshow event for the main html page, we get a DidStartNavigation notification on the guest webcontents created for the EmbeddedObserver. Currently we abort the stream if it is a top level navigation. It seems like we should not abort the stream if the navigation is within the same page. The problem does not occur if the PDF is opened in a different tab or window Should fix the black PDF issues with M55. BUG=677580 TEST=Covered by browser test PDFExtensionTest.OpenPDFOnLinkClickWithReplaceState Review-Url: https://codereview.chromium.org/2611643004 Cr-Commit-Position: refs/heads/master@{#441857} Committed: https://chromium.googlesource.com/chromium/src/+/52df16bebd27db88af89d12460db... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/52df16bebd27db88af89d12460db... |