Commit Graph

10 Commits

Author SHA1 Message Date
Ryan Hunt
a3916a4e4e Bug 1520344 - Store last scroll anchor position in writing-mode relative coordinates. r=dholbert
This commit changes ScrollAnchorContainer to store the offset between the scroll anchoring
bounding rect start edge and the scroll-port start edge in the block axis of the scroll frame.

The logic to clamp the negative portions of scroll anchor bounding rect is also amended
to only clamp the portion that is beyond the border start edge in the block axis of the
scroll frame.

Differential Revision: https://phabricator.services.mozilla.com/D16757

--HG--
extra : rebase_source : 43b5bc4ece7f90cb38e3a7186a764d9cddac90f9
extra : source : f26d953d76fcfb02a5fa46cb62e389f852592fe9
2019-01-16 15:13:12 -06:00
Ryan Hunt
43b7ef66cb Bug 1305957 part 8 - Suppress scroll offset adjustment when some layout affecting properties are changed on scroll anchor or its ancestors. r=hiro
This commit implements the first half of the heuristics to detect style changes
that could lead to feedback loops with scroll anchoring. [1]

When these style changes are made, a suppression flag is added to the anchor
container to ignore any adjustments that would be made at the next layout flush
and to invalidate the anchor at that time.

[1] https://drafts.csswg.org/css-scroll-anchoring/#suppression-triggers

Differential Revision: https://phabricator.services.mozilla.com/D13271

--HG--
extra : rebase_source : db0bf373e51325b7ef537c4c245ede4b4219d0d7
extra : source : d9445a5f3458b560fbdb7aee5faabb5a7a9327f3
2018-11-27 15:38:43 -06:00
Ryan Hunt
43e96a0c82 Bug 1305957 part 7 - Adjust scroll offset to match change in relative position of scroll anchor after reflow. r=hiro,dbaron
This commit implements anchor offset adjustment. When the position of a frame
that is an anchor is changed during reflow, we notify the anchor container. The
anchor container will then post a reflow callback.

Then when reflow is completed, the anchor container will perform a scroll to
keep the anchor node in the same relative position.

Differential Revision: https://phabricator.services.mozilla.com/D13270

--HG--
extra : rebase_source : 9d40a5d5b73777d0da3799f162eeb85bb8e6d8f0
extra : source : d9052f7b34d9857863b66d64797f8b0b82504bec
2018-12-21 10:26:10 -06:00
Ryan Hunt
47ee617d1e Bug 1305957 part 5 - Add implementation of scroll anchor selection and invalidation. r=hiro,dbaron,dholbert
This commit implements candidate selection for a scroll frame using a frame tree
traversal. It roughly tries to follow the algorithm given in the scroll
anchoring draft specification, adapted to operate on the frame tree [1].

Some details, such as not selecting an anchor if the user hasn't scrolled are
not currently in the specification but will be to match Blink's implementation.

Once a scroll anchor has been selected, we maintain a bit on it and its ancestor
frame's states. This is used in a later commit to detect changes to position
during a reflow so the scroll frame can perform an adjustment.

A scroll anchor will be invalidated when the user scrolls the frame or the
scroll anchor is destroyed. Later commits will add logic to drive selection and
invalidation appropriately.

[1] https://drafts.csswg.org/css-scroll-anchoring/#anchor-node-selection

Differential Revision: https://phabricator.services.mozilla.com/D13268

--HG--
extra : rebase_source : e05ba48662aafef5957322def33ddc5d93f3ca5a
extra : source : bdb766faa8679386bf4e9740781262ea4bb36544
2018-11-27 15:45:16 -06:00
Ryan Hunt
91f41f3a0a Bug 1305957 part 4 - Add basic ScrollAnchorContainer implementation. r=hiro
This commit adds a barebones class called 'ScrollAnchorContainer' that will
contain most of the logic for scroll anchoring. It is owned as a member of
ScrollFrameHelper, and has the same lifetime.

Differential Revision: https://phabricator.services.mozilla.com/D13267

--HG--
extra : rebase_source : 41f6f7691af60401f18f98a89f1878cfad2e74d3
extra : source : 3033401ef320414ef5f489c53526d015c38a89d7
2018-11-27 15:18:03 -06:00
Bogdan Tara
6d78d1e2c9 Backed out 15 changesets (bug 1305957) for ASAN failures CLOSED TREE
Backed out changeset 4d5eb85d3155 (bug 1305957)
Backed out changeset 51c86d025ecb (bug 1305957)
Backed out changeset d8eef8f3e396 (bug 1305957)
Backed out changeset 950bf6ad1ef2 (bug 1305957)
Backed out changeset b4cb2cbebdb6 (bug 1305957)
Backed out changeset bfca5019a9cc (bug 1305957)
Backed out changeset e76b842c7b7f (bug 1305957)
Backed out changeset d9445a5f3458 (bug 1305957)
Backed out changeset d9052f7b34d9 (bug 1305957)
Backed out changeset e7124fecb721 (bug 1305957)
Backed out changeset bdb766faa867 (bug 1305957)
Backed out changeset 3033401ef320 (bug 1305957)
Backed out changeset 6b96050386f6 (bug 1305957)
Backed out changeset c66c00f73296 (bug 1305957)
Backed out changeset 6bd0bdab93cb (bug 1305957)
2019-01-10 18:49:22 +02:00
Ryan Hunt
bb67558065 Bug 1305957 part 8 - Suppress scroll offset adjustment when some layout affecting properties are changed on scroll anchor or its ancestors. r=hiro
This commit implements the first half of the heuristics to detect style changes
that could lead to feedback loops with scroll anchoring. [1]

When these style changes are made, a suppression flag is added to the anchor
container to ignore any adjustments that would be made at the next layout flush
and to invalidate the anchor at that time.

[1] https://drafts.csswg.org/css-scroll-anchoring/#suppression-triggers

Differential Revision: https://phabricator.services.mozilla.com/D13271

--HG--
extra : rebase_source : 7919443bdad49ce3623e5b082decb4f5c4a54158
extra : histedit_source : a2283cc31060103ef0929ae11624b45f95113810
2018-11-27 15:38:43 -06:00
Ryan Hunt
a2c95c01f0 Bug 1305957 part 7 - Adjust scroll offset to match change in relative position of scroll anchor after reflow. r=hiro,dbaron
This commit implements anchor offset adjustment. When the position of a frame
that is an anchor is changed during reflow, we notify the anchor container. The
anchor container will then post a reflow callback.

Then when reflow is completed, the anchor container will perform a scroll to
keep the anchor node in the same relative position.

Differential Revision: https://phabricator.services.mozilla.com/D13270

--HG--
extra : rebase_source : 44797fcf6585d5912f83baea90a8e554f39618b5
extra : histedit_source : c4354ba8aac99e0d083f40b515369db6a95f997d
2018-12-21 10:26:10 -06:00
Ryan Hunt
a67a2f7b0b Bug 1305957 part 5 - Add implementation of scroll anchor selection and invalidation. r=hiro,dbaron,dholbert
This commit implements candidate selection for a scroll frame using a frame tree
traversal. It roughly tries to follow the algorithm given in the scroll
anchoring draft specification, adapted to operate on the frame tree [1].

Some details, such as not selecting an anchor if the user hasn't scrolled are
not currently in the specification but will be to match Blink's implementation.

Once a scroll anchor has been selected, we maintain a bit on it and its ancestor
frame's states. This is used in a later commit to detect changes to position
during a reflow so the scroll frame can perform an adjustment.

A scroll anchor will be invalidated when the user scrolls the frame or the
scroll anchor is destroyed. Later commits will add logic to drive selection and
invalidation appropriately.

[1] https://drafts.csswg.org/css-scroll-anchoring/#anchor-node-selection

Differential Revision: https://phabricator.services.mozilla.com/D13268

--HG--
extra : rebase_source : 02ace6a966dd1c4bd42b7472501d05c412d6deb8
extra : histedit_source : 84bed6b2d13a308f4aea91c631b8792df293c76a
2018-11-27 15:45:16 -06:00
Ryan Hunt
18d5058194 Bug 1305957 part 4 - Add basic ScrollAnchorContainer implementation. r=hiro
This commit adds a barebones class called 'ScrollAnchorContainer' that will
contain most of the logic for scroll anchoring. It is owned as a member of
ScrollFrameHelper, and has the same lifetime.

Differential Revision: https://phabricator.services.mozilla.com/D13267

--HG--
extra : rebase_source : 4d58b51aa6b893392d7c152d27750ebda059f784
extra : histedit_source : 9a2841931c47c4358e15d2fa6514ed347e3d0dad
2018-11-27 15:18:03 -06:00