Make Layout 2013 style a superset of Layout 2020 style

This is the first step toward removing the compile-time difference in
style between Layout 2020 and Layout 2013.
This commit is contained in:
Martin Robinson 2023-06-27 21:43:56 +02:00
parent a725380db0
commit d4b5fc1f65
No known key found for this signature in database
GPG key ID: D56AA4FA55EFE6F8
97 changed files with 32 additions and 349 deletions

View file

@ -73,6 +73,7 @@ use style::selector_parser::{PseudoElement, RestyleDamage};
use style::servo::restyle_damage::ServoRestyleDamage;
use style::values::computed::Image;
use style::values::generics::counters::ContentItem;
use style::LocalName;
/// The results of flow construction for a DOM node.
#[derive(Clone)]
@ -865,6 +866,15 @@ where
Box::new(UnscannedTextFragmentInfo::new(string.into(), None));
SpecificFragmentInfo::UnscannedText(info)
},
ContentItem::Attr(attr) => {
let element = node.as_element().expect("Expected an element");
let attr_val = element
.get_attr(&attr.namespace_url, &LocalName::from(&*attr.attribute));
let string = attr_val.map_or("".to_string(), |s| s.to_string());
let info =
Box::new(UnscannedTextFragmentInfo::new(string.into(), None));
SpecificFragmentInfo::UnscannedText(info)
},
content_item => {
let content_item =
Box::new(GeneratedContentInfo::ContentItem(content_item));