-
Notifications
You must be signed in to change notification settings - Fork 23
HTML spec should call visibilitychange algorithms directly. #51
Comments
Isn't this an issue on the HTML spec to expose those things? |
It could be :) I was just too lazy to file them/send-PRs-to HTML for them. |
@toddreifsteck please ensure that HTML spec issues are opened for these references. |
In relation to #55, I filed whatwg/html#4892 (comment). @domenic responded with:
|
I've read over this and have a good grip on how to make these updates.. but I need another half day of free time and my day job has taken me elsewhere. I'd like to complete this and expect to do so this Saturday 10/12 in my off hours. If I'm unable, I'll need to hand this off. I'll share update here. |
Unfortunately, I haven't had time to take this on. Removing my name to allow another good soul to complete this. |
Caught up on the history here, and seems to me like a more substantial update to the way this spec is defined. Should this be L2 blocking, or L3? This wording was already present in L1, which is already a recommendation. |
From discussion at WebPerf WG, this need not block L2 since it is spec-health related and not affecting functionality/testing/implementation, plus the same wording already existings in L1 which is already published. @yoavweiss Is that correct? (Also: I am not sure if I can update milestone tag on this issue.) |
That's frustrating. In general, foundational spec health issues should be addressed as soon as possible, and not pushed off because they've been unhealthy for a long time. |
I agree with @domenic. Incorrect layering to HTML will more than likely lead to implementation issues. Having said that, republishing a CR seems appropriate as we address these issues - but we should make a small push to address them before we start talking about any L3 stuff. |
The intent is not to push this off, just not have it blocking the re-publishing of L2. |
OK, so IIUC, what we want to do here is:
|
I think you probably want to run it between 4.6.2 and 4.6.4? I.e., you want to run it at precisely the place that HTML currently calls out to "session history document visibility change steps". In particular you don't want to fire "visibilitychange" if the document is moving from page showing = true to page showing = true. Also, you want to run it as part of the same task, probably. So I think you want to define "session history document visibility change steps", given document, as something like:
(although as a separate issue it might be good to remove the latter...) Similarly you would want to define the "unloading document visibility change steps" given document as something like:
Once you have those two in place, HTML could link to them directly, instead of using our current inverted layering where HTML defines the term and Page Visibility links to it.
Agreed. And at that point you can simplify it, by removing steps 2.1 and 3.1 (as well as part of the predicate of step 3). |
Thanks folks for the help and detailed concrete suggestions. I'll try to take a stab at writing this up. (Heads up, I'm partially OOO this week, so ETA is next week) |
Thanks!! :) |
Thanks @domenic for the concrete steps. After spending some time diving into this, and discussing with folks during Web Perf Hackathon, here's the status:
This leaves a few questions/options:
I'm taking a stab are replacing all with explicit calls, and using a single algorithm. (I could re-add distinct shown/hidden algorithms in terms of the common one if useful) |
My preference is to have explicit calls. My guess is that these hooks were added in the early days of web standardization, when we had some dream that things might be layered, with HTML not explicitly referencing other specs. Such a dream, if it ever existed, is long gone.
A single algorithm sounds good to me! |
Just to make sure my understanding is right, our plan is to have this:
So the ScreenOrientation algorithm invoked from PageVisibility could be as simple as setting a boolean flag, and then in HTML in the event loop the HTML would invoke another algorithm from ScreenOrientation which would perform the steps if the flag is set, and would always unset the flag. |
I didn't think the ScreenOrientation change would need to be any more complicated than PageVisibility just calling an algorithm (which they would need to expose first). But I see, you are pointing out that ScreenOrientation has a second "monkey patch", into HTML, and that they'll need to expose a call there, too? Thanks for investigating that! The first change here, would not add anything for ScreenOrientation at all, I think. It will just do your first 2 bullets, and undo the current hooks that were exposed in #47. (I will re-open the issue(s) for improving ScreenOrientation integration afterwards, suggesting the steps you listed above) |
Can we maybe change the title for this issue? I'm tracking a big list of issues and it's hard to understand from the title what it's about. |
Woops I missed that @yoavweiss already updated the title (darn github has such subtle changelog for these things). |
Fire the event when unloading or traversing history, instead of relying on hooks in other specs. See w3c/page-visibility#51 and w3c/page-visibility#73
Fire the event when unloading or traversing history, instead of relying on hooks in other specs. See w3c/page-visibility#51 and w3c/page-visibility#73
Fire the event when unloading or traversing history, instead of relying on hooks in other specs. See w3c/page-visibility#51 and w3c/page-visibility#73.
Done |
Fire the event when unloading or traversing history, instead of relying on hooks in other specs. See w3c/page-visibility#51 and w3c/page-visibility#73.
Fire the event when unloading or traversing history, instead of relying on hooks in other specs. See w3c/page-visibility#51 and w3c/page-visibility#73.
The spec currently depends on:
But for whatever reason those are not being exported from the HTML spec. The second one should definitely be exported, but folks here should check with the HTML editors if there is some reason they didn't export "session history entry".
The text was updated successfully, but these errors were encountered: