mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
layout: Resolve canvas background properties during painting (#36917)
Instead of resolving the canvas background properties (essentially keeping a possible reference to the `<body>`'s style) during fragment tree construction, wait until painting to possibly find the style on an appropriate `<body>` fragment. This is possible now because `Fragment` keeps a list of flags with relevant information about the root and `<body>` elements. A benefit of this approach is that styles aren't cached in the fragment tree, which would be problematic for incremental layout. In addition, the old code was making an effort to transform the `<body>`'s background by the root element's transform. Only Safari does this and there was a resolution the WG that this should not happen in https://github.com/w3c/csswg-drafts/issues/6683. Testing: - `/css/css-transforms/transform-translate-background-001.html` - `/css/css-transforms/transform-translate-background-002.html` - `/css/CSS2/floats/float-root.html` Fixes: #30475. Closes: #30569. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
c6f61e6b6e
commit
53be79a5b5
9 changed files with 116 additions and 195 deletions
|
@ -32,10 +32,8 @@ impl BaseFragment {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns true if this fragment is non-anonymous and it is for the given
|
||||
/// OpaqueNode, regardless of the pseudo element.
|
||||
pub(crate) fn is_for_node(&self, node: OpaqueNode) -> bool {
|
||||
self.tag.map(|tag| tag.node == node).unwrap_or(false)
|
||||
pub(crate) fn is_anonymous(&self) -> bool {
|
||||
self.tag.is_none()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue