scroll position sometimes is not saved inside display: contents
Categories
(Core :: Layout: Scrolling and Overflow, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: wcpan, Assigned: wcpan)
References
Details
Attachments
(4 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:64.0) Gecko/20100101 Firefox/64.0 Steps to reproduce: 1. Make a div display: contents, let's say its name is A. 2. Make a scroll-able div, put it inside the div A. 3. Use history.pushState/popstate to change the div A to display: none. For more testing please see the attached file. Actual results: The scroll position does not restored. Expected results: The scroll position should be restored.
Assignee | ||
Comment 1•5 years ago
|
||
Just a WIP that works, but I don't think it's optimal. The reason why I cannot use IsDisplayContents is that at the time we call it in nsCSSFrameConstructor::RecreateFramesForContent, the flag has been unset. :emilio, do you know we have any flags in servo to distinguish "display: contents" and "display: none" in this case?
Updated•5 years ago
|
Comment 2•5 years ago
|
||
display: contents is not a flag, but by the time you get there we have already forgotten of the old style. So we need to walk the content tree in a similar fashion in ContentRemoved: https://searchfox.org/mozilla-central/rev/9528360768d81b1fc84258b5fb3601b5d4f40076/layout/base/nsCSSFrameConstructor.cpp#7451 So looks to me that all the ContentRemoved callers which aren't ContentRemoved itself and are REMOVE_FOR_RECONSTRUCTION call CaptureStateForFramesOf on their own. It would make sense to move the CaptureStateForFramesOf to ContentRemoved itself, and change the REMOVE_FOR_RECONSTRUCTION flag here: https://searchfox.org/mozilla-central/rev/9528360768d81b1fc84258b5fb3601b5d4f40076/layout/base/nsCSSFrameConstructor.cpp#7463 For aFlags. I think that's more correct anyway, actually.
Assignee | ||
Comment 3•5 years ago
|
||
Move CaptureStateForFramesOf into ContentRemoved, so we can traverse frames which were under display: contents as well.
Assignee | ||
Comment 4•5 years ago
|
||
Depends on D15319
Assignee | ||
Comment 5•5 years ago
|
||
Unfortunately I've lost my ssh key to push to try or autoland. But the testcase passed on my machine.
Comment 6•5 years ago
|
||
(In reply to Wei-Cheng Pan [:wcpan] [:wcp] [:legnaleurc] (left Mozilla) from comment #5) > Unfortunately I've lost my ssh key to push to try or autoland. Here's a try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=657e3158cb9632fd3260aadf8e00932e46124821
Assignee | ||
Comment 7•5 years ago
|
||
(In reply to Cameron McCormack (:heycam) (away Jan 1) from comment #6) > Here's a try run: > > https://treeherder.mozilla.org/#/ > jobs?repo=try&revision=657e3158cb9632fd3260aadf8e00932e46124821 Thanks! I guess the assertion is a little bit aggressive. I will try to get my try server key back, would be better.
Updated•5 years ago
|
Assignee | ||
Comment 8•5 years ago
|
||
Assignee | ||
Comment 9•5 years ago
|
||
Since :mats is blocking review now, and I'm not sure when will he be available again, do we have other victim to review this bug?
Thanks.
Comment 10•5 years ago
|
||
(In reply to Wei-Cheng Pan [:wcpan] [:wcp] [:legnaleurc] (left Mozilla) from comment #9)
Since :mats is blocking review now, and I'm not sure when will he be available again, do we have other victim to review this bug?
Thanks.
I suspect he just missed the Phabricator review request.
Comment 11•5 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #10)
(In reply to Wei-Cheng Pan [:wcpan] [:wcp] [:legnaleurc] (left Mozilla) from comment #9)
Since :mats is blocking review now, and I'm not sure when will he be available again, do we have other victim to review this bug?
Thanks.I suspect he just missed the Phabricator review request.
Hmm, I have no clue why it says I'm blocking review requests.
My bugzilla account certainly isn't blocking requests.
Does Phabricator also have setting for that? I couldn't find one...
Updated•5 years ago
|
Comment 12•5 years ago
|
||
Pushed by legnaleurc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/46591113989e Capture frame state in nsCSSFrameConstructor::ContentRemoved. r=emilio,mats https://hg.mozilla.org/integration/autoland/rev/47cafac7c288 Add testcase. r=emilio
Assignee | ||
Comment 13•5 years ago
|
||
Thanks so much for your help! :)
Comment 14•5 years ago
|
||
(In reply to Mats Palmgren (:mats) from comment #11)
Hmm, I have no clue why it says I'm blocking review requests.
My bugzilla account certainly isn't blocking requests.
Does Phabricator also have setting for that? I couldn't find one...
In Phabricator there are two kinds of reviewers, blocking and non-blocking. Blocking reviewers need to approve the patch for it to land, non-blocking reviewers don't, as long as at least one of them have approved the patch.
So tagging you and Daniel both as a blocking reviewer, for example, would mean that I need review from both, tagging you both as a non-blocking reviewers means that I need review from at least one of you.
Updated•5 years ago
|
Comment 15•5 years ago
|
||
(In reply to Wei-Cheng Pan [:wcpan] [:wcp] [:legnaleurc] (left Mozilla) from comment #13)
Thanks so much for your help! :)
NP, thank you for fixing it!
Comment 16•5 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #14)
In Phabricator there are two kinds of reviewers, blocking and non-blocking. Blocking reviewers need to approve the patch for it to land, non-blocking reviewers don't, as long as at least one of them have approved the patch.
Ah, Wei-Cheng's comment makes sense now. Thanks.
Comment 17•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/46591113989e
https://hg.mozilla.org/mozilla-central/rev/47cafac7c288
Description
•