ptal
masonf@: I'm unsure how much impact this change will have. We should probably have an I2S for this. If you agree, I'll make a chromestatus entry as well. Also interested in your take on making the implicit-anchor counter a sticky flag.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
LGTM - just small nits.
auto set_sheet_text = [this](HTMLElement* style_element,
nit: you could just capture `style_element` since it's the same for all cases.
bool IsImplicitAnchor() const;
Given the new logic, should this perhaps be `MayBeImplicitAnchor`?
// Returns true if any element is implicitly anchored to this element.
Maybe add a comment that there's no way to unset this, on purpose?
// This is a spec change since anchor positioning was shipped in Blink.
Would be nice to have a bug or spec issue link
[FAIL] The implicit anchor element of a pseudo-element is its originating element
This sounds like it's an existing test that is testing the new spec? If so, should this test be `.tentative`?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
difficult and error prone to do for pseudo elements. Instead use a
single flag that will never be reset once set. The assumption here is
And we're sure that nothing bad happens if an element continues to believe it's an implicit anchor, while it's actually not (anymore)?
bool IsImplicitAnchor() const;
Given the new logic, should this perhaps be `MayBeImplicitAnchor`?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
difficult and error prone to do for pseudo elements. Instead use a
single flag that will never be reset once set. The assumption here is
And we're sure that nothing bad happens if an element continues to believe it's an implicit anchor, while it's actually not (anymore)?
It's an indication that the layout code needs to propagate it as an anchor in case it is used as one.
The actual implicit anchor lookup here is not affected by the flag:
The consequence for the flag not being reset, is that if a lot of elements are temporarily being made implicit anchors and then reset again, we would have a performance degradation in that we will have to do a lot of unnecessary accounting and propagation for anchors during layout. I don't see that as a likely issue.
auto set_sheet_text = [this](HTMLElement* style_element,
nit: you could just capture `style_element` since it's the same for all cases.
Done
Anders Hartvoll RuudGiven the new logic, should this perhaps be `MayBeImplicitAnchor`?
+1
Done
// Returns true if any element is implicitly anchored to this element.
Maybe add a comment that there's no way to unset this, on purpose?
Done
// This is a spec change since anchor positioning was shipped in Blink.
Would be nice to have a bug or spec issue link
Done
[FAIL] The implicit anchor element of a pseudo-element is its originating element
This sounds like it's an existing test that is testing the new spec? If so, should this test be `.tentative`?
This matches the current version of the spec, so it shouldn't be tentative.
Ditto - should this be `.tentative`?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
bool IsImplicitAnchor() const;
I didn't do the renaming to "MayBe" here. Wasn't clear that was the right choice here.
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. |
Code-Review | +1 |
bool IsImplicitAnchor() const;
Anders Hartvoll RuudI didn't do the renaming to "MayBe" here. Wasn't clear that was the right choice here.
Acknowledged
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. |
Originating element is implicit anchor for pseudo elements
Implementation in Blink instead used the implicit anchor for the
originating element. This is a spec change in css-anchor-position-1
after Chrome shipped.
We are marking the originating element as an implicit anchor based on
the pseudo element styles to make sure they are considered as anchors
during layout.
Previously, we used a counter that was incremented/decremented for
implicit anchor, which had to be correctly balanced. This is error prone
and has lead to bugs before, and would have been increasingly more
difficult and error prone to do for pseudo elements. Instead use a
single flag that will never be reset once set. The assumption here is
that we will not make a lot of elements temporarily implicit anchors,
continuously growing the amount of anchor candidates, that would have
eventually lead to performance issues.
A use counter for pseudo elements referencing its originating element
as an implicit anchor is added to measure the impact of the changed
behavior.
Bug: 408223892
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/54744
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |