Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make property descriptors hold named/indexed property values
  • Loading branch information
pshaughn committed Jan 10, 2020
1 parent 1d645f3 commit 111ede9
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 30 deletions.
8 changes: 3 additions & 5 deletions components/script/dom/bindings/codegen/CodegenRust.py
Expand Up @@ -5147,8 +5147,7 @@ def getBody(self):
attrs = "JSPROP_ENUMERATE"
if self.descriptor.operations['IndexedSetter'] is None:
attrs += " | JSPROP_READONLY"
# FIXME(#11868) Should assign to desc.value, desc.get() is a copy.
fillDescriptor = ("desc.get().value = result_root.get();\n"
fillDescriptor = ("desc.value = result_root.get();\n"
"fill_property_descriptor(MutableHandle::from_raw(desc), proxy.get(), (%s) as u32);\n"
"return true;" % attrs)
templateValues = {
Expand All @@ -5173,8 +5172,7 @@ def getBody(self):
attrs = " | ".join(attrs)
else:
attrs = "0"
# FIXME(#11868) Should assign to desc.value, desc.get() is a copy.
fillDescriptor = ("desc.get().value = result_root.get();\n"
fillDescriptor = ("desc.value = result_root.get();\n"
"fill_property_descriptor(MutableHandle::from_raw(desc), proxy.get(), (%s) as u32);\n"
"return true;" % attrs)
templateValues = {
Expand Down Expand Up @@ -5221,7 +5219,7 @@ def getBody(self):
}
}
""" + namedGet + """\
desc.get().obj = ptr::null_mut();
desc.obj = ptr::null_mut();
return true;"""

def definition_body(self):
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/webidls/HTMLFormElement.webidl
Expand Up @@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

// https://html.spec.whatwg.org/multipage/#htmlformelement
[Exposed=Window]
[Exposed=Window, LegacyUnenumerableNamedProperties]
interface HTMLFormElement : HTMLElement {
[HTMLConstructor] constructor();

Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/webidls/Window.webidl
Expand Up @@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

// https://html.spec.whatwg.org/multipage/#window
[Global=Window, Exposed=Window]
[Global=Window, Exposed=Window /*, LegacyUnenumerableNamedProperties */]
/*sealed*/ interface Window : GlobalScope {
// the current browsing context
[Unforgeable] readonly attribute WindowProxy window;
Expand Down
3 changes: 1 addition & 2 deletions components/script/dom/windowproxy.rs
Expand Up @@ -822,8 +822,7 @@ unsafe extern "C" fn getOwnPropertyDescriptor(

assert!(desc.obj.is_null() || desc.obj == target.get());
if desc.obj == target.get() {
// FIXME(#11868) Should assign to desc.obj, desc.get() is a copy.
desc.get().obj = proxy.get();
desc.obj = proxy.get();
}

true
Expand Down
@@ -1,14 +1,5 @@
[legacy-platform-object.html]
type: testharness
[[[GetOwnProperty\]\] with getters and no setters]
expected: FAIL

[[[GetOwnProperty\]\] with named property getters and setters]
expected: FAIL

[[[GetOwnProperty\]\] with indexed property getters and setters]
expected: FAIL

[Test [[DefineOwnProperty\]\] with no indexed property setter support.]
expected: FAIL

Expand Down
Expand Up @@ -6,6 +6,3 @@
[Trying to set an expando with an indexed property name past the end of the list]
expected: FAIL

[Trying to delete an indexed property name should never work]
expected: FAIL

Expand Up @@ -5,9 +5,3 @@
[Setting property for key 9 with accessor property on prototype]
expected: FAIL

[Getting property descriptor for key 9]
expected: FAIL

[Getting property descriptor for key x]
expected: FAIL

@@ -1,8 +1,5 @@
[form-nameditem.html]
type: testharness
[Name for a single element should work]
expected: FAIL

[All listed elements except input type=image should be present in the form]
expected: FAIL

Expand Down

0 comments on commit 111ede9

Please sign in to comment.