Tree-scope resolution of anchor names
Categories
(Core :: CSS Parsing and Computation, enhancement)
Tracking
()
People
(Reporter: dshin, Assigned: jari)
References
(Blocks 1 open bug)
Details
(Whiteboard: [anchorpositioning:backlog])
Attachments
(13 obsolete files)
Anchor references does not cross shadow boundary, and visibility is based on where the declaration sits on the shadow boundary.
Updated•4 months ago
|
Comment 1•3 months ago
|
||
So to fix this we need to make the computed value of tree scoped identifiers include the tree they came from. So, initially, I thought that the easiest thing to do would be to pull from the CascadeLevel of the current declaration we're applying. That works for most things, except animations.
Animations might not have a tree at all, and I guess we should use the value where they came from.
So, maybe something like:
pub struct TreeScoped<T> {
value: T,
scope: CascadeLevel, // Or could be a i8 or so. default to SameTreeAuthorNormal
}
impl<T: ToComputedValue> ToComputedValue for TreeScoped<T> {
type ComputedValue = TreeScopedName<T::ComputedValue>;
fn to_computed_value(&self, context: &computed::Context) -> Self::ComputedValue {
TreeScoped {
value: self.value.to_computed_value(context),
scope: if context.current_scope().is_tree() {
context.current_scope()
} else {
// This, combined with the from_computed_value, is needed to "preserve" the scope with keyframes
self.scope
}
}
}
fn from_computed_value(computed: Self::ComputedValue) -> Self {
Self {
value: ToComputedValue::from_computed_value(self.value),
scope: self.scope,
}
}
}
Then the tricky thing is to plumb current_scope properly from the cascade. I think you have all the relevant info here, so maybe just a matter of setting it properly.
Updated•3 months ago
|
| Assignee | ||
Updated•3 months ago
|
| Assignee | ||
Comment 2•25 days ago
|
||
This commit introduces the TreeScoped generic type for representing values
scoped to a specific cascade level in the shadow tree hierarchy. It also
makes CascadeLevel serializable by adding SpecifiedValueInfo and
ToResolvedValue derives.
| Assignee | ||
Comment 3•25 days ago
|
||
| Assignee | ||
Comment 4•25 days ago
|
||
| Assignee | ||
Comment 5•25 days ago
|
||
| Assignee | ||
Comment 6•25 days ago
|
||
| Assignee | ||
Comment 7•25 days ago
|
||
| Assignee | ||
Comment 8•25 days ago
|
||
| Assignee | ||
Comment 9•25 days ago
|
||
| Assignee | ||
Comment 10•25 days ago
|
||
| Assignee | ||
Comment 11•25 days ago
|
||
| Assignee | ||
Comment 12•25 days ago
|
||
| Assignee | ||
Comment 13•25 days ago
|
||
| Assignee | ||
Comment 14•25 days ago
|
||
Updated•24 days ago
|
Comment 15•19 days ago
|
||
Comment on attachment 9537394 [details]
Bug 1988038: Add TreeScoped type to attach CascadeLevel to AnchorNames. r=#anchor-positioning-reviewers
Revision D278919 was moved to bug 2006964. Setting attachment 9537394 [details] to obsolete.
Comment 16•19 days ago
|
||
Comment on attachment 9537395 [details]
Bug 1988038: Make generated StyleCascadeLevel trivial. r=#anchor-positioning-reviewers
Revision D278920 was moved to bug 2006964. Setting attachment 9537395 [details] to obsolete.
Comment 17•19 days ago
|
||
Comment on attachment 9537397 [details]
Bug 1988038: Augment AnchorNames with tree scope. r=#anchor-positioning-reviewers
Revision D278922 was moved to bug 2006964. Setting attachment 9537397 [details] to obsolete.
Comment 18•19 days ago
|
||
Comment on attachment 9537398 [details]
Bug 1988038: Augment PositionAnchors with tree scope. r=#anchor-positioning-reviewers
Revision D278923 was moved to bug 2006964. Setting attachment 9537398 [details] to obsolete.
Comment 19•19 days ago
|
||
Comment on attachment 9537399 [details]
Bug 1988038: Augment AnchorFunctions with tree scope. r=#anchor-positioning-reviewers
Revision D278924 was moved to bug 2006964. Setting attachment 9537399 [details] to obsolete.
Comment 20•19 days ago
|
||
Comment on attachment 9537400 [details]
Bug 1988038: Use tree-scoped anchor names in Gecko code. r=#anchor-positioning-reviewers
Revision D278925 was moved to bug 2006964. Setting attachment 9537400 [details] to obsolete.
Comment 21•19 days ago
|
||
Comment on attachment 9537401 [details]
Bug 1988038: Switch ResolutionMap to use scoped atom as hash key. r=#anchor-positioning-reviewers
Revision D278926 was moved to bug 2006964. Setting attachment 9537401 [details] to obsolete.
Comment 22•19 days ago
|
||
Comment on attachment 9537402 [details]
Bug 1988038: Introduce logic to match tree-scoped references and names of anchors. r=#anchor-positioning-reviewers
Revision D278927 was moved to bug 2006964. Setting attachment 9537402 [details] to obsolete.
Comment 23•19 days ago
|
||
Comment on attachment 9537403 [details]
Bug 1988038: Augment AnchorScopes with tree scopes. r=#anchor-positioning-reviewers
Revision D278928 was moved to bug 2006964. Setting attachment 9537403 [details] to obsolete.
Comment 24•19 days ago
|
||
Comment on attachment 9537405 [details]
Bug 1988038: Fix test for :host anchor scopes. r=#anchor-positioning-reviewers
Revision D278930 was moved to bug 2006964. Setting attachment 9537405 [details] to obsolete.
Comment 25•19 days ago
|
||
Comment on attachment 9537406 [details]
Bug 1988038: Fix test for :host pseudo elements. r=#anchor-positioning-reviewers
Revision D278931 was moved to bug 2006964. Setting attachment 9537406 [details] to obsolete.
Updated•19 days ago
|
Comment 26•4 days ago
|
||
Fixed in bug 1987926.
Description
•