mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
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:
parent
a725380db0
commit
d4b5fc1f65
97 changed files with 32 additions and 349 deletions
|
@ -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));
|
||||
|
|
|
@ -198,10 +198,6 @@ impl<'a, 'b> ResolveGeneratedContentFragmentMutator<'a, 'b> {
|
|||
RenderingMode::Suffix(".\u{00a0}"),
|
||||
)
|
||||
},
|
||||
GeneratedContentInfo::Empty |
|
||||
GeneratedContentInfo::ContentItem(ContentItem::String(_)) => {
|
||||
// Nothing to do here.
|
||||
},
|
||||
GeneratedContentInfo::ContentItem(ContentItem::Counter(
|
||||
ref counter_name,
|
||||
counter_style,
|
||||
|
@ -272,8 +268,11 @@ impl<'a, 'b> ResolveGeneratedContentFragmentMutator<'a, 'b> {
|
|||
self.traversal.quote -= 1
|
||||
}
|
||||
},
|
||||
GeneratedContentInfo::Empty |
|
||||
GeneratedContentInfo::ContentItem(ContentItem::String(_)) |
|
||||
GeneratedContentInfo::ContentItem(ContentItem::Attr(_)) |
|
||||
GeneratedContentInfo::ContentItem(ContentItem::Image(..)) => {
|
||||
unreachable!("Servo doesn't parse content: url(..) nor image-set(..) yet")
|
||||
// Nothing to do here.
|
||||
},
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue