mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
script: Use xpath ns resolver to resolve namespace prefixes (#39321)
The xpath resolver is a function provided by the user to resolve namespace prefixes. Previously, we were ignoring the argument. Testing: New web platform tests start to pass Part of https://github.com/servo/servo/issues/34527 --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
f3d5617349
commit
1898a740a8
9 changed files with 164 additions and 132 deletions
|
@ -3988,13 +3988,10 @@ impl NodeMethods<crate::DomTypeHolder> for Node {
|
|||
|
||||
/// <https://dom.spec.whatwg.org/#dom-node-lookupnamespaceuri>
|
||||
fn LookupNamespaceURI(&self, prefix: Option<DOMString>) -> Option<DOMString> {
|
||||
// Step 1.
|
||||
let prefix = match prefix {
|
||||
Some(ref p) if p.is_empty() => None,
|
||||
pre => pre,
|
||||
};
|
||||
// Step 1. If prefix is the empty string, then set it to null.
|
||||
let prefix = prefix.filter(|prefix| !prefix.is_empty());
|
||||
|
||||
// Step 2.
|
||||
// Step 2. Return the result of running locate a namespace for this using prefix.
|
||||
Node::namespace_to_string(Node::locate_namespace(self, prefix))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue