Consider scroll padding for URL anchors
Categories
(Core :: Layout, defect, P3)
Tracking
()
People
(Reporter: sebo, Assigned: hiro)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
2.40 KB,
text/html
|
Details |
Scroll padding needs to be applied when accessing a URL with an anchor in it.
See the related note within the specification.
I've taken Rachel Andrew's example and adjusted it a bit. Now, if you access it using #section2
as anchor, you'll see that the element is partly hidden behind the fixed header.
Though it should be completely shown like when using other scroll actions.
Note that Chrome correctly applies the scroll padding in this case.
Sebastian
Assignee | ||
Comment 1•5 years ago
|
||
I will check the test case later, but we basically support scroll-padding on anchor (see a wpt, Chrome doesn't pass the test case there)
Assignee | ||
Comment 2•5 years ago
|
||
OK, I think I know what the problem is. This is basically due to the fact our current PresShell::ScrollFrameRectIntoView was set up for position-based scrolling but it doesn't fit well to the new scroll snap based on elements. This issue is one of my concerns since I implemented the new scroll snap and I did want to fix it before implementing scroll-snap-stop, but I probably fix this before it.
Assigning to myself, but P3 for now.
Reporter | ||
Comment 3•5 years ago
|
||
The reason why Chrome fails the test is because the scroll-padding
is set on the <html> element. If it is set on the <body> element, the test passes (and still fails in Firefox). So there should probably be another web platform test created to cover that case.
Sebastian
Assignee | ||
Comment 4•2 years ago
|
||
Fixed by bug 1771830.
Reporter | ||
Comment 5•2 years ago
|
||
Thanks for the note and the fix, Hiro! I can confirm that it's working as expected now.
Sebastian
Description
•