Closed Bug 1988030 Opened 9 months ago Closed 7 months ago

Add a way to determine if all scroll frames containing the anchor are active or not at the time of the BuildDisplayList call for the anchored element

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
147 Branch
Tracking Status
firefox147 --- fixed

People

(Reporter: dshin, Assigned: tnikkel)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

(Whiteboard: [anchorpositioning:graphics])

Attachments

(6 files)

Blocks: 1923392
Whiteboard: [anchorpositioning:triage] → [anchorpositioning:graphics]
Depends on: 1995759
Depends on: 1998812

We want to assign the ASR of the anchor to the anchored content. That means we are changing the ASR chain so we need to adjust the functions that walk the async scrollable ancestors chain. In this patch we adjust nsLayoutUtils::GetAsyncScrollableAncestorFrame.

Assignee: nobody → tnikkel
Status: NEW → ASSIGNED

We want to assign the ASR of the anchor to the anchored content. That means we are changing the ASR chain so we need to adjust the functions that walk the async scrollable ancestors chain. In this patch we adjust DisplayPortUtils::OneStepInAsyncScrollableAncestorChain.

With CSS anchor pos we know that the anchor is in the containing block of the anchored content. We use that to limit a walk up the frame tree in subsequent patches and make the computation simpler. So we need OneStepInAsyncScrollableAncestorChain to obey that limit too.

I want this so I can assert things in subsequent patches.

WantAsyncScroll and mWillBuildScrollableLayer are completely independent of each other, ie it's possible to have all four combinations of them being true/false.

This is the most complicated and intricate patch in this series.

We want to assign the ASR of the anchor to the anchored content. But there is no painting relationship between them. Meaning that BuildDisplayList for the anchor might be called before or after BuildDisplayList for the anchored content.

If BuildDisplayList is called for the anchor before the anchored content we want to make sure that any scroll frames containing the anchor are activated. This is easy on desktop as all scroll frames that want it are activated. But on android we don't do that yet. That's where bug 1995759 comes in to activate all scroll frames when anchor pos is used.

If BuildDisplayList is called for the anchor after the anchored content then we want to activate any scroll frames containing the anchor during the BuildDisplayList call for the anchored content. That's one of the main things that this patch does. We create a new function DecideScrollableLayerEnsureDisplayport that always set a minimal display port to do that for us (it's a simplified version of DecideScrollableLayer).

Then we use our knowledge that the anchor is in the containing block of the anchored content to walk the scroll frame ancestors of the anchor until we reach the anchored content's containing block. Once we've collected all the scroll frames we can create the ASR structs.

Depends on: 1995750
Depends on: 1999697
Attachment #9525369 - Attachment description: Bug 1988030. Create nsLayoutUtils::GetActivatedScrollableAncestorFrame that walks only scroll frames that are currently async scrollable. r?botond,hiro → Bug 1988030. Create nsLayoutUtils::GetASRAncestorFrame and OneStepInASRChain that walks only scroll frames that are currently async scrollable in the ASR order. r?botond,hiro
Attachment #9525368 - Attachment description: Bug 1988030. Allow passing a limit ancestor to DisplayPortUtils::OneStepInAsyncScrollableAncestorChain that we don't walk past. r?#layout-reviewers,botond,hiro → Bug 1988030. Allow passing a limit ancestor to DisplayPortUtils::OneStepInASRChain that we don't walk past. r?#layout-reviewers,botond,hiro
Depends on: 2001613
Depends on: 2001616

This should be the case but due to spec issues that we are still getting sorted out in bug 1997026 it does not currently hold with our existing code that accurately implemented an older version of the spec. The anchor pos async scroll code in this bug depends on this condition even if other anchor pos code seems to be okay without it as of now.

See Also: → 2002160
Pushed by tnikkel@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/537725a5c4aa https://hg.mozilla.org/integration/autoland/rev/8ac63a73e64d Adjust nsLayoutUtils::GetAsyncScrollableAncestorFrame to be CSS anchor pos aware. r=layout-reviewers,layout-anchor-positioning-reviewers,hiro,emilio https://github.com/mozilla-firefox/firefox/commit/e7619a7efccc https://hg.mozilla.org/integration/autoland/rev/d2942a47bde5 Adjust DisplayPortUtils::OneStepInAsyncScrollableAncestorChain to be CSS anchor pos aware. r=hiro,layout-reviewers,layout-anchor-positioning-reviewers,emilio https://github.com/mozilla-firefox/firefox/commit/e53645f574d4 https://hg.mozilla.org/integration/autoland/rev/83e77e1ff562 Create nsLayoutUtils::GetASRAncestorFrame and OneStepInASRChain that walks only scroll frames that are currently async scrollable in the ASR order. r=botond,hiro,layout-reviewers,layout-anchor-positioning-reviewers,emilio https://github.com/mozilla-firefox/firefox/commit/7cd59a61c6a0 https://hg.mozilla.org/integration/autoland/rev/420f945b4828 Allow passing a limit ancestor to DisplayPortUtils::OneStepInASRChain that we don't walk past. r=hiro,layout-reviewers https://github.com/mozilla-firefox/firefox/commit/1816a3d49caa https://hg.mozilla.org/integration/autoland/rev/b5dfa95f5b43 Create a function that activates and creates ASRs for scrollframes of the anchor of anchored content. r=hiro,layout-reviewers,layout-anchor-positioning-reviewers,botond,emilio https://github.com/mozilla-firefox/firefox/commit/237e8563f656 https://hg.mozilla.org/integration/autoland/rev/7359f809caf5 Detect and reject an anchor that is outside of the positioned frame's containing block. r=layout-reviewers,emilio

Backed out for causing build bustages

Flags: needinfo?(tnikkel)
Flags: needinfo?(tnikkel)
Pushed by tnikkel@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/0793c4b404d9 https://hg.mozilla.org/integration/autoland/rev/7df984ea1a2d Adjust nsLayoutUtils::GetAsyncScrollableAncestorFrame to be CSS anchor pos aware. r=layout-reviewers,layout-anchor-positioning-reviewers,hiro,emilio https://github.com/mozilla-firefox/firefox/commit/3a7c8be81f6e https://hg.mozilla.org/integration/autoland/rev/b589662e09f5 Adjust DisplayPortUtils::OneStepInAsyncScrollableAncestorChain to be CSS anchor pos aware. r=hiro,layout-reviewers,layout-anchor-positioning-reviewers,emilio https://github.com/mozilla-firefox/firefox/commit/5b42ac4317bf https://hg.mozilla.org/integration/autoland/rev/cba51c6f762b Create nsLayoutUtils::GetASRAncestorFrame and OneStepInASRChain that walks only scroll frames that are currently async scrollable in the ASR order. r=botond,hiro,layout-reviewers,layout-anchor-positioning-reviewers,emilio https://github.com/mozilla-firefox/firefox/commit/1d3aea828626 https://hg.mozilla.org/integration/autoland/rev/6d1306b4671c Allow passing a limit ancestor to DisplayPortUtils::OneStepInASRChain that we don't walk past. r=hiro,layout-reviewers https://github.com/mozilla-firefox/firefox/commit/827aa14e00b3 https://hg.mozilla.org/integration/autoland/rev/9769ef682f6b Create a function that activates and creates ASRs for scrollframes of the anchor of anchored content. r=hiro,layout-reviewers,layout-anchor-positioning-reviewers,botond,emilio https://github.com/mozilla-firefox/firefox/commit/970db2137c09 https://hg.mozilla.org/integration/autoland/rev/fa7ec7d8ecb5 Detect and reject an anchor that is outside of the positioned frame's containing block. r=layout-reviewers,emilio https://github.com/mozilla-firefox/firefox/commit/5d654d58219b https://hg.mozilla.org/integration/autoland/rev/7049e5052189 1988032: apply code formatting via Lando
Regressions: 2004600
QA Whiteboard: [qa-triage-done-c148/b147]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: