Summary: | Fix loader/go-back-cached-main-resource.html test | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Manuel Rego Casasnovas <rego> | ||||
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | ap, cgarcia, commit-queue, darin | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Manuel Rego Casasnovas
2013-05-23 07:19:16 PDT
Created attachment 202708 [details]
Patch
Comment on attachment 202708 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=202708&action=review Getting rid of the timeout is a very welcome improvement, so r=me. Please consider the suggestion below. > LayoutTests/loader/resources/first-page.html:21 > +<body onpageshow="registerListeners();"> This is quite misleading. We only need to register listeners on first load, they are already present when restoring from cache. But the function does more than its name says, which is why it's necessary to call it every time! One way to clean this up would be to rename the function to "didShowPage", and use event.persisted property to check if we are handling the initial load. Or just use an anonymous function, and register it as window.onpageshow = function (event) { ... } Comment on attachment 202708 [details] Patch Clearing flags on attachment: 202708 Committed r150594: <http://trac.webkit.org/changeset/150594> All reviewed patches have been landed. Closing bug. (In reply to comment #2) > (From update of attachment 202708 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=202708&action=review > > Getting rid of the timeout is a very welcome improvement, so r=me. Please consider the suggestion below. Thanks for the review. > > LayoutTests/loader/resources/first-page.html:21 > > +<body onpageshow="registerListeners();"> > > This is quite misleading. We only need to register listeners on first load, they are already present when restoring from cache. But the function does more than its name says, which is why it's necessary to call it every time! > > One way to clean this up would be to rename the function to "didShowPage", and use event.persisted property to check if we are handling the initial load. Or just use an anonymous function, and register it as window.onpageshow = function (event) { ... } Thanks for the information, I've changed the test in a new bug #116709 in order to register listeners only on initial load. |