Get the Page from the global object for ResolveProperty.

This commit is contained in:
Ms2ger 2014-03-04 15:28:12 +01:00
parent 99574f14d9
commit 8acf36c6d4

View file

@ -4293,13 +4293,13 @@ class CGXrayHelper(CGAbstractExternMethod):
def definition_body(self): def definition_body(self):
varNames = self.properties.variableNames(True) varNames = self.properties.variableNames(True)
setup = "let page = page_from_context(cx);\n" setup = ("let window = global_object_for_js_object(wrapper);\n"
"let js_info = window.get().page().js_info();\n")
methods = self.properties.methods methods = self.properties.methods
if methods.hasNonChromeOnly() or methods.hasChromeOnly(): if methods.hasNonChromeOnly() or methods.hasChromeOnly():
methodArgs = "Some(zip_copies(%(methods)s, *method_ids))" % varNames methodArgs = "Some(zip_copies(%(methods)s, *method_ids))" % varNames
setup += "let mut js_info = (*page).js_info();\n" \ setup += "let method_ids = js_info.get().get_ref().dom_static.method_ids.get(&(PrototypeList::id::ClientRect as uint));\n"
"let method_ids = js_info.get().get_ref().dom_static.method_ids.get(&(PrototypeList::id::ClientRect as uint));\n"
else: else:
methodArgs = "None" methodArgs = "None"
methodArgs = CGGeneric(methodArgs) methodArgs = CGGeneric(methodArgs)
@ -4307,8 +4307,7 @@ class CGXrayHelper(CGAbstractExternMethod):
attrs = self.properties.attrs attrs = self.properties.attrs
if attrs.hasNonChromeOnly() or attrs.hasChromeOnly(): if attrs.hasNonChromeOnly() or attrs.hasChromeOnly():
attrArgs = "Some(zip_copies(%(attrs)s, *attr_ids))" % varNames attrArgs = "Some(zip_copies(%(attrs)s, *attr_ids))" % varNames
setup += "let mut js_info = (*page).js_info();\n" \ setup += "let attr_ids = js_info.get().get_ref().dom_static.attribute_ids.get(&(PrototypeList::id::ClientRect as uint));\n"
"let attr_ids = js_info.get().get_ref().dom_static.attribute_ids.get(&(PrototypeList::id::ClientRect as uint));\n"
else: else:
attrArgs = "None" attrArgs = "None"
attrArgs = CGGeneric(attrArgs) attrArgs = CGGeneric(attrArgs)
@ -4316,8 +4315,7 @@ class CGXrayHelper(CGAbstractExternMethod):
consts = self.properties.consts consts = self.properties.consts
if consts.hasNonChromeOnly() or consts.hasChromeOnly(): if consts.hasNonChromeOnly() or consts.hasChromeOnly():
constArgs = "Some(zip_copies(%(consts)s, *const_ids))" % varNames constArgs = "Some(zip_copies(%(consts)s, *const_ids))" % varNames
setup += "let mut js_info = (*page).js_info();\n" \ setup += "let const_ids = js_info.get().get_ref().dom_static.constant_ids.get(&(PrototypeList::id::ClientRect as uint));\n"
"let const_ids = js_info.get().get_ref().dom_static.constant_ids.get(&(PrototypeList::id::ClientRect as uint));\n"
else: else:
constArgs = "None" constArgs = "None"
constArgs = CGGeneric(constArgs) constArgs = CGGeneric(constArgs)