aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/construct.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2023-06-27 21:43:56 +0200
committerMartin Robinson <mrobinson@igalia.com>2023-06-28 16:06:07 +0200
commitd4b5fc1f653b4575202416263155ec17083828a6 (patch)
tree0a6944aafdbdcc6078eda8d3239e419ee2f619f1 /components/layout/construct.rs
parenta725380db0b9fba31993409f7d0f4b2d11ca8f7d (diff)
downloadservo-d4b5fc1f653b4575202416263155ec17083828a6.tar.gz
servo-d4b5fc1f653b4575202416263155ec17083828a6.zip
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.
Diffstat (limited to 'components/layout/construct.rs')
-rw-r--r--components/layout/construct.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index c3ebed7d1a3..d9531be391f 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -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));