mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Replace Namespace components which map to the default namespace with DefaultNamespace.
It seems we don't need to preserve the original prefix name, and this conveniently leads to_css to now implement CSSOM's requirement to elide the namespace prefix during serialization when it maps to the default namespace. https://drafts.csswg.org/cssom/#serialize-a-simple-selector
This commit is contained in:
parent
8e14d93602
commit
bd5ff3b4ce
1 changed files with 4 additions and 1 deletions
|
@ -1017,7 +1017,10 @@ fn parse_type_selector<'i, 't, P, E, Impl, S>(parser: &P, input: &mut CssParser<
|
|||
sink.push(Component::DefaultNamespace(url))
|
||||
}
|
||||
QNamePrefix::ExplicitNamespace(prefix, url) => {
|
||||
sink.push(Component::Namespace(prefix, url))
|
||||
sink.push(match parser.default_namespace() {
|
||||
Some(ref default_url) if url == *default_url => Component::DefaultNamespace(url),
|
||||
_ => Component::Namespace(prefix, url),
|
||||
})
|
||||
}
|
||||
QNamePrefix::ExplicitNoNamespace => {
|
||||
sink.push(Component::ExplicitNoNamespace)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue