static void PropagateChildAnchors(const PhysicalFragment& child,
Blink Style Guide: Naming - May leave obvious parameter names out of function declarations. Please consider omitting parameter names like `child`, `child_offset`, `container_object`, etc., from the function declaration in the header file as their purpose is clear from their types.
***
_To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options: \
**Done** | **Won't fix**: reason | **b/<bug_id>** | **Invalid:** reason \
\
This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent). \
AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve. \
[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_
OffsetInfo CalculateOffset(
Blink Style Guide: Prefer enums or StrongAliases to bare bools for function parameters. The boolean parameter `is_inside_fragmentation_context` makes call sites less readable. Please consider using an enum class like `enum class FragmentationContextStatus { kInside, kOutside };`.
***
_To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options: \
**Done** | **Won't fix**: reason | **b/<bug_id>** | **Invalid:** reason \
\
This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent). \
AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve. \
[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Need another stamp because I messed up TestExpectations, and now cleaned it up.
static void PropagateChildAnchors(const PhysicalFragment& child,
Blink Style Guide: Naming - May leave obvious parameter names out of function declarations. Please consider omitting parameter names like `child`, `child_offset`, `container_object`, etc., from the function declaration in the header file as their purpose is clear from their types.
***_To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options: \
**Done** | **Won't fix**: reason | **b/<bug_id>** | **Invalid:** reason \
\
This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent). \
AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve. \
[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_
What makes them obvious?
Blink Style Guide: Prefer enums or StrongAliases to bare bools for function parameters. The boolean parameter `is_inside_fragmentation_context` makes call sites less readable. Please consider using an enum class like `enum class FragmentationContextStatus { kInside, kOutside };`.
***_To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options: \
**Done** | **Won't fix**: reason | **b/<bug_id>** | **Invalid:** reason \
\
This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent). \
AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve. \
[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +2 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[anchor] Keep anchored elements within their fragmentation context.
Don't use `StitchedAnchorQueries`, or anything at all in
anchor_query_map.cc
If the containing block of an out-of-flow positioned element
participates in a fragmentation context, so does the out-of-flow
positioned element. This was violated for anchor-positioned elements. In
such cases we'd essentially let them "escape" the fragmentation context,
take a peek on the outside, to calculate the bounding box of the anchor,
and then jump back into the fragmentation context. This caused undesired
behavior, made it hard to reason about, and also caused implementation
complexity.
Anchor-positioned elements use the `anchor()` function with inset
properties, such as `top`, `right`, `bottom`, and `left`. These are
relative to the containing block for out-of-flow positioned elements,
and anchor-positioned elements should be no different. Therefore, if the
containing block is fragmented, we're in this "stitched" coordinate
system, where we imagine that all fragments have been stacked on top of
each other. This is also the case for sizing properties, such as
`block-size`. `<div style="columns:2;"><div style="block-size:100px;">`,
for instance, will not create a 100px tall child, visually, since it
will be fragmented into two columns, with 50px of content in each. Yet,
it will be 100px tall if we imagine the fragments to be "stitched"
together. If we now imagine that the `block-size:100px` DIV is
relatively positioned, and put a `position:absolute` child inside with
`top:70px`, it will not start 70px into the first column (its containing
block is fragmented). Nay, it will start 20px into the second column,
skipping the 50px of the first column, then skip the remaining 20px in
the second column. This hopefully explains the weirdness with the
previous behavior.
The fix in PhysicalBoxFragment::MutableForOofFragmentation::Merge()
should have been there in the first place, since we need to handle
anchors with the same name correctly. Previously, we'd be saved by the
duplicate logic in StitchedAnchorQuery::AddAnchorReference(), which
would clean up after this mistake. Now we need to get it right the first
time. anchor-position-multicol-012.html (and some existing, rather
convoluted, tests) would fail without this.
Update tests to match the new behavior. Changed them to reftests, since
offsetLeft & co (used by check-layout-th.js) have poor interop inside
multicol. See https://github.com/w3c/csswg-drafts/issues/11541
This change is behind a runtime enabled feature kill-switch named
CSSAnchorSimplifiedFragmentation.
See https://github.com/w3c/csswg-drafts/issues/12287 for the spec
discussion, and resolution.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |