mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Implement WindowOrWorkerGlobalScope.origin
The test document_domain_setter.html now fails, but AFAIK the origin comparison can never be true (document.origin is the unprefixed domain, while the loaded iframe is from www1.…), and that test fails in all major browsers because of security exceptions anyway.
This commit is contained in:
parent
88a0265c00
commit
73b5bf201f
7 changed files with 18 additions and 21 deletions
|
@ -22,7 +22,7 @@ use dom::bindings::num::Finite;
|
|||
use dom::bindings::refcounted::Trusted;
|
||||
use dom::bindings::reflector::DomObject;
|
||||
use dom::bindings::root::{Dom, DomRoot, MutNullableDom};
|
||||
use dom::bindings::str::DOMString;
|
||||
use dom::bindings::str::{DOMString, USVString};
|
||||
use dom::bindings::structuredclone::StructuredCloneData;
|
||||
use dom::bindings::trace::RootedTraceableBox;
|
||||
use dom::bindings::utils::{GlobalStaticData, WindowProxyHandler};
|
||||
|
@ -1038,6 +1038,11 @@ impl WindowMethods for Window {
|
|||
fn Name(&self) -> DOMString {
|
||||
self.window_proxy().get_name()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-origin
|
||||
fn Origin(&self) -> USVString {
|
||||
USVString(self.origin().immutable().ascii_serialization())
|
||||
}
|
||||
}
|
||||
|
||||
impl Window {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue