Commit c8d66aff authored by Yuki Shiino's avatar Yuki Shiino Committed by Commit Bot

bind-gen: Effectively remove named definer from HTML{Embed,Object}Element

In order to route the property access to the platform objects to
the embedding objects, HTMLEmbedElement and HTMLObjectElement are
(ab)using the named properties, hence the regular definition of
[[DefineOwnProperty]] of named properties shouldn't be applied.
(By the way, the situation is similar to CSS properties.)

This patch makes NamedPropertyDefinerCallback noop in case of
HTMLEmbedElement and HTMLObjectElement.

Bug: 1139312, 839389
Change-Id: I5089965ad766440920e4cc2d3308a2e2fae4250b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2481163Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818395}
parent b4a82389
...@@ -2942,6 +2942,13 @@ def make_named_property_definer_callback(cg_context, function_name): ...@@ -2942,6 +2942,13 @@ def make_named_property_definer_callback(cg_context, function_name):
TextNode("""\ TextNode("""\
// CSSStyleDeclaration is abusing named properties. // CSSStyleDeclaration is abusing named properties.
// Do not intercept. Fallback to OrdinaryDefineOwnProperty. // Do not intercept. Fallback to OrdinaryDefineOwnProperty.
"""))
elif cg_context.interface.identifier in ("HTMLEmbedElement",
"HTMLObjectElement"):
body.append(
TextNode("""\
// HTMLEmbedElement and HTMLObjectElement are abusing named properties.
// Do not intercept. Fallback to OrdinaryDefineOwnProperty.
""")) """))
elif not cg_context.interface.indexed_and_named_properties.named_setter: elif not cg_context.interface.indexed_and_named_properties.named_setter:
body.append( body.append(
...@@ -2986,17 +2993,7 @@ if (v8_property_desc.has_get() || v8_property_desc.has_set()) { ...@@ -2986,17 +2993,7 @@ if (v8_property_desc.has_get() || v8_property_desc.has_set()) {
} }
return; return;
} }
"""))
if cg_context.interface.identifier in ("HTMLEmbedElement",
"HTMLObjectElement"):
body.append(
TextNode("""\
// HTMLEmbedElement and HTMLObjectElement's named properties implementation
// depend on the default fallback behavior. So, just fallback.
"""))
else:
body.append(
TextNode("""\
// step 2.2.2.2. Invoke the named property setter with P and Desc.[[Value]]. // step 2.2.2.2. Invoke the named property setter with P and Desc.[[Value]].
${class_name}::NamedPropertySetterCallback( ${class_name}::NamedPropertySetterCallback(
${v8_property_name}, ${v8_property_desc}.value(), ${info}); ${v8_property_name}, ${v8_property_desc}.value(), ${info});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment