Implement Node.baseURI

This commit is contained in:
Kevin Ball 2015-07-05 15:29:04 -07:00
parent 0fb6604cb3
commit dbbab3b113
4 changed files with 38 additions and 6 deletions

View file

@ -993,7 +993,7 @@ impl<'a> NodeHelpers for &'a Node {
fn summarize(self) -> NodeInfo {
NodeInfo {
uniqueId: self.get_unique_id(),
baseURI: self.GetBaseURI().unwrap_or("".to_owned()),
baseURI: self.BaseURI(),
parent: self.GetParentNode().map(|node| node.r().get_unique_id()).unwrap_or("".to_owned()),
nodeType: self.NodeType(),
namespaceURI: "".to_owned(), //FIXME
@ -1956,9 +1956,8 @@ impl<'a> NodeMethods for &'a Node {
}
// https://dom.spec.whatwg.org/#dom-node-baseuri
fn GetBaseURI(self) -> Option<DOMString> {
// FIXME (#1824) implement.
None
fn BaseURI(self) -> DOMString {
self.owner_doc().URL()
}
// https://dom.spec.whatwg.org/#dom-node-ownerdocument

View file

@ -26,7 +26,7 @@ interface Node : EventTarget {
readonly attribute DOMString nodeName;
[Pure]
readonly attribute DOMString? baseURI;
readonly attribute DOMString baseURI;
[Pure]
readonly attribute Document? ownerDocument;