mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
layout: Do not inherit node and fragment flags in anonymous boxes (#31586)
This doesn't really have observable behavior right now, as much as I tried to trigger some kind of bug. On the other hand, it's just wrong and is very obvious when you dump the Fragment tree. If you create a `display: table-cell` that is a child of the `<body>` all parts of the anonymous table are flagged as if they are the `<body>` element.
This commit is contained in:
parent
55f908653f
commit
1f23ec2b27
7 changed files with 73 additions and 38 deletions
|
@ -2,6 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use log::warn;
|
||||
use style::properties::longhands::list_style_type::computed_value::T as ListStyleType;
|
||||
use style::properties::style_structs;
|
||||
use style::values::computed::Image;
|
||||
|
@ -20,12 +21,19 @@ where
|
|||
Node: NodeExt<'dom>,
|
||||
{
|
||||
let style = info.style.get_list();
|
||||
let node = match info.node {
|
||||
Some(node) => node,
|
||||
None => {
|
||||
warn!("Tried to make a marker for an anonymous node!");
|
||||
return None;
|
||||
},
|
||||
};
|
||||
|
||||
// https://drafts.csswg.org/css-lists/#marker-image
|
||||
let marker_image = || match &style.list_style_image {
|
||||
Image::Url(url) => Some(vec![
|
||||
PseudoElementContentItem::Replaced(ReplacedContent::from_image_url(
|
||||
info.node, context, url,
|
||||
node, context, url,
|
||||
)?),
|
||||
PseudoElementContentItem::Text(" ".into()),
|
||||
]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue