mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-30 02:57:29 +09:00
Issue #146 - Part 5: Treat table row groups as containing blocks.
This aligns our behavior with Gecko/Blink.
This commit is contained in:
parent
babd256e10
commit
af75c920b0
2 changed files with 11 additions and 0 deletions
|
|
@ -176,6 +176,14 @@ StickyScrollContainer::ComputeStickyLimits(nsIFrame* aFrame, nsRect* aStick,
|
||||||
nsRect rect =
|
nsRect rect =
|
||||||
nsLayoutUtils::GetAllInFlowRectsUnion(aFrame, aFrame->GetParent());
|
nsLayoutUtils::GetAllInFlowRectsUnion(aFrame, aFrame->GetParent());
|
||||||
|
|
||||||
|
// Note: Table row groups aren't supposed to be containing blocks, but we treat
|
||||||
|
// them as such anyway.
|
||||||
|
// Not having this basically disables position:sticky on table cells, which
|
||||||
|
// would be really unfortunate, and doesn't match what other browsers do.
|
||||||
|
if (cbFrame != scrolledFrame && cbFrame->GetType() == nsGkAtoms::tableRowGroupFrame) {
|
||||||
|
cbFrame = cbFrame->GetContainingBlock();
|
||||||
|
}
|
||||||
|
|
||||||
// Containing block limits for the position of aFrame relative to its parent.
|
// Containing block limits for the position of aFrame relative to its parent.
|
||||||
// The margin box of the sticky element stays within the content box of the
|
// The margin box of the sticky element stays within the content box of the
|
||||||
// contaning-block element.
|
// contaning-block element.
|
||||||
|
|
|
||||||
|
|
@ -6629,6 +6629,9 @@ GetNearestBlockContainer(nsIFrame* frame)
|
||||||
// Since the parent of such a block is either a normal block or
|
// Since the parent of such a block is either a normal block or
|
||||||
// another such pseudo, this shouldn't cause anything bad to happen.
|
// another such pseudo, this shouldn't cause anything bad to happen.
|
||||||
// Also the anonymous blocks inside table cells are not containing blocks.
|
// Also the anonymous blocks inside table cells are not containing blocks.
|
||||||
|
//
|
||||||
|
// If we ever start skipping table row groups from being containing blocks,
|
||||||
|
// we need to remove the containing block assignment in StickyScrollContainer .
|
||||||
while (frame->IsFrameOfType(nsIFrame::eLineParticipant) ||
|
while (frame->IsFrameOfType(nsIFrame::eLineParticipant) ||
|
||||||
frame->IsBlockWrapper() ||
|
frame->IsBlockWrapper() ||
|
||||||
// Table rows are not containing blocks either
|
// Table rows are not containing blocks either
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue