aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/browsingcontext.rs
diff options
context:
space:
mode:
authorMs2ger <Ms2ger@gmail.com>2016-07-04 16:24:09 +0200
committerMs2ger <Ms2ger@gmail.com>2016-07-28 13:05:56 +0200
commit89efccc4267706eec8d1cd32043bb25d7f37f9b2 (patch)
treed64ac6286bf487cb16e22639e658bc4eaaa35816 /components/script/dom/browsingcontext.rs
parenta0c502261dc2bd710e31dcbbbd2d81d2a2c53724 (diff)
downloadservo-89efccc4267706eec8d1cd32043bb25d7f37f9b2.tar.gz
servo-89efccc4267706eec8d1cd32043bb25d7f37f9b2.zip
Update SpiderMonkey to m-c bcf4ff0c3eef.
This currently breaks Servo on Android, because there are a number of interdependent changes that cannot easily land serially in a way that keeps it working throughout. We expect to fix this in the near future.
Diffstat (limited to 'components/script/dom/browsingcontext.rs')
-rw-r--r--components/script/dom/browsingcontext.rs25
1 files changed, 24 insertions, 1 deletions
diff --git a/components/script/dom/browsingcontext.rs b/components/script/dom/browsingcontext.rs
index 4c0914ddf3c..878d376ca66 100644
--- a/components/script/dom/browsingcontext.rs
+++ b/components/script/dom/browsingcontext.rs
@@ -22,7 +22,7 @@ use js::jsapi::{Handle, HandleId, HandleObject, HandleValue, JSAutoCompartment};
use js::jsapi::{JSContext, JSPROP_READONLY, JSErrNum, JSObject, PropertyDescriptor, JS_DefinePropertyById};
use js::jsapi::{JS_ForwardGetPropertyTo, JS_ForwardSetPropertyTo, JS_GetClass, JSTracer, FreeOp};
use js::jsapi::{JS_GetOwnPropertyDescriptorById, JS_HasPropertyById, MutableHandle};
-use js::jsapi::{MutableHandleValue, ObjectOpResult};
+use js::jsapi::{MutableHandleObject, MutableHandleValue, ObjectOpResult};
use js::jsval::{UndefinedValue, PrivateValue};
use msg::constellation_msg::{PipelineId, SubpageId};
use std::cell::Cell;
@@ -354,6 +354,28 @@ unsafe extern "C" fn set(cx: *mut JSContext,
res)
}
+#[allow(unsafe_code)]
+unsafe extern "C" fn get_prototype_if_ordinary(_: *mut JSContext,
+ _: HandleObject,
+ is_ordinary: *mut bool,
+ _: MutableHandleObject)
+ -> bool {
+ // Window's [[GetPrototypeOf]] trap isn't the ordinary definition:
+ //
+ // https://html.spec.whatwg.org/multipage/#windowproxy-getprototypeof
+ //
+ // We nonetheless can implement it with a static [[Prototype]], because
+ // wrapper-class handlers (particularly, XOW in FilteringWrapper.cpp) supply
+ // all non-ordinary behavior.
+ //
+ // But from a spec point of view, it's the exact same object in both cases --
+ // only the observer's changed. So this getPrototypeIfOrdinary trap on the
+ // non-wrapper object *must* report non-ordinary, even if static [[Prototype]]
+ // usually means ordinary.
+ *is_ordinary = false;
+ return true;
+}
+
static PROXY_HANDLER: ProxyTraps = ProxyTraps {
enter: None,
getOwnPropertyDescriptor: Some(getOwnPropertyDescriptor),
@@ -361,6 +383,7 @@ static PROXY_HANDLER: ProxyTraps = ProxyTraps {
ownPropertyKeys: None,
delete_: None,
enumerate: None,
+ getPrototypeIfOrdinary: Some(get_prototype_if_ordinary),
preventExtensions: None,
isExtensible: None,
has: Some(has),