Sticky postioned table-caption elements draw at wrong position after scrolling back up
Categories
(Core :: Layout: Positioned, defect, P3)
Tracking
()
People
(Reporter: m.gamper, Assigned: emilio)
References
(Blocks 1 open bug)
Details
(Keywords: regression)
Attachments
(4 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:63.0) Gecko/20100101 Firefox/63.0 Build ID: 20180701220749 Steps to reproduce: A table's caption element who is positioned sticky works fine if I scroll down. If I scroll up, the element remains in it's last position and covers the table element. Actual results: If I scroll up, the element remains in it's last position and covers parts of the table element. Expected results: The caption element sould stay sticky until it reached is original position where it should scroll with the rest of the content.
Comment 1•6 years ago
|
||
Do you have a link to the HTML, or an HTML testcase you could attach?
Reporter | ||
Comment 2•6 years ago
|
||
Here's a live example: https://www.frauenfeld.ch/politik-verwaltung/verwaltung/online-schalter.html/344/l/de And an isolated test case is here: https://codepen.io/macgamper/pen/mKvoyL
Comment 3•6 years ago
|
||
I can reproduce this using the codepen. mozregression got me this range, which is where this testcase goes from "no sticky positioning at all" to "broken sticky positioning": https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=0843e4e6cb1d6e32a35ce4d7014bd250c24f74fa&tochange=d20967c26da559a7781db467741bb240af9bfe5c That indicates that this started when bug 975644 landed (that's where we added support for sticky-positioned table captions).
Comment 4•6 years ago
|
||
Comment 5•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 6•6 years ago
|
||
I find it's a bit easier to trigger the problem when using attachment 8990827 [details] (the version with an iframe). However, I can trigger it with the standalone file (attachment 8990825 [details]) if I simply scroll down & back to the top, and then switch to a different tab and back. So -- this seems to be an invalidation bug of some sort.
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 7•2 years ago
|
||
I’ve run into the same bug, see https://codepen.io/gunnarbittersmann/pen/PoOeKvO?editors=0100
Is there some work-around until this bug will eventuelly be fixed?
(In reply to gunnar@bittersmann.de from comment #7)
I’ve run into the same bug, see https://codepen.io/gunnarbittersmann/pen/PoOeKvO?editors=0100
Is there some work-around until this bug will eventuelly be fixed?
I have found one:
<style>
@keyframes chwidth {
0% { width: 100%; } 50% { width: 0%; } 100% { width: 100%; }
}
.chwidth {
max-width: 0;
animation: 1s chwidth infinite;
}
</style>
<table>
<caption style="position:sticky;top:0">SomeCaption<div class="chwidth"></div></caption>
<tr><td>someval1</td><td>someval2</td></tr>
</table>
The animation does nothing, but makes ff think changes are large enough to force an invalidation every frame.
This works very reliably for scrolling with the scrollbar or gestures. For scrolling using the mouse weel the caption jumps around somewhat, which is visually iritating but otherwise harmless.
Assignee | ||
Comment 9•2 years ago
|
||
If I understand correctly sticky when scrolling is mostly dealt with in APZ, but feel free to bounce back if this ends up being a layout bug after all...
Assignee | ||
Comment 10•2 years ago
|
||
Actually looking a bit deeper into it it does look like a layout bug.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 11•2 years ago
|
||
Captions should be relatively-positioned (other browsers support this as
well). This ensures we correctly save their normal positions and thus
that the sticky scroll container knows how to reposition them correctly.
Avoid registering inner table frames with the sticky scroll container to
make the assertion sound in cases of sticky-positioned tables.
Assignee | ||
Updated•2 years ago
|
Comment 12•2 years ago
|
||
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e3377838e213 Sticky/relative position fixes in nsTableWrapperFrame. r=dholbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/34174 for changes under testing/web-platform/tests
Comment 14•2 years ago
•
|
||
Backed out for causing multiple failures related to StickyScrollContainer.
Failure log for debug-crashtest
Failure log for reftest
Failure log for wpt
Upstream PR was closed without merging
Comment 16•2 years ago
|
||
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cf63538fe82c Sticky/relative position fixes in nsTableWrapperFrame. r=dholbert
Comment 17•2 years ago
|
||
bugherder |
Upstream PR merged by moz-wptsync-bot
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Description
•