Commit 8a4fe2fc authored by jochen's avatar jochen Committed by Commit bot

Don't try to correctly notify V8 from the plugin interceptor

Instead, I modified V8 to just cope with this behavior

BUG=chromium:679345
R=haraken@chromium.org

Review-Url: https://codereview.chromium.org/2625643002
Cr-Commit-Position: refs/heads/master@{#443212}
parent 0dde99ab
......@@ -173,20 +173,20 @@ FAIL object.typeMustMatch: setAttribute() to object "test-toString" assert_equal
FAIL object.typeMustMatch: setAttribute() to object "test-valueOf" assert_equals: IDL get expected (boolean) true but got (undefined) undefined
FAIL object.typeMustMatch: setAttribute() to "typeMustMatch" assert_equals: IDL get expected (boolean) true but got (undefined) undefined
FAIL object.typeMustMatch: IDL set to "" assert_equals: hasAttribute() expected false but got true
FAIL object.typeMustMatch: IDL set to " foo " assert_equals: IDL get expected (boolean) true but got (undefined) undefined
FAIL object.typeMustMatch: IDL set to " foo " assert_equals: IDL get expected (boolean) true but got (string) " foo "
FAIL object.typeMustMatch: IDL set to undefined assert_equals: hasAttribute() expected false but got true
FAIL object.typeMustMatch: IDL set to null assert_equals: hasAttribute() expected false but got true
FAIL object.typeMustMatch: IDL set to 7 assert_equals: IDL get expected (boolean) true but got (undefined) undefined
FAIL object.typeMustMatch: IDL set to 1.5 assert_equals: IDL get expected (boolean) true but got (undefined) undefined
FAIL object.typeMustMatch: IDL set to true assert_equals: IDL get expected (boolean) true but got (undefined) undefined
FAIL object.typeMustMatch: IDL set to 7 assert_equals: IDL get expected (boolean) true but got (number) 7
FAIL object.typeMustMatch: IDL set to 1.5 assert_equals: IDL get expected (boolean) true but got (number) 1.5
PASS object.typeMustMatch: IDL set to true
FAIL object.typeMustMatch: IDL set to false assert_equals: hasAttribute() expected false but got true
FAIL object.typeMustMatch: IDL set to object "[object Object]" assert_equals: IDL get expected (boolean) true but got (undefined) undefined
FAIL object.typeMustMatch: IDL set to object "[object Object]" assert_equals: IDL get expected (boolean) true but got (object) object "[object Object]"
FAIL object.typeMustMatch: IDL set to NaN assert_equals: hasAttribute() expected false but got true
FAIL object.typeMustMatch: IDL set to Infinity assert_equals: IDL get expected (boolean) true but got (undefined) undefined
FAIL object.typeMustMatch: IDL set to -Infinity assert_equals: IDL get expected (boolean) true but got (undefined) undefined
FAIL object.typeMustMatch: IDL set to "\0" assert_equals: IDL get expected (boolean) true but got (undefined) undefined
FAIL object.typeMustMatch: IDL set to object "test-toString" assert_equals: IDL get expected (boolean) true but got (undefined) undefined
FAIL object.typeMustMatch: IDL set to object "test-valueOf" assert_equals: IDL get expected (boolean) true but got (undefined) undefined
FAIL object.typeMustMatch: IDL set to Infinity assert_equals: IDL get expected (boolean) true but got (number) Infinity
FAIL object.typeMustMatch: IDL set to -Infinity assert_equals: IDL get expected (boolean) true but got (number) -Infinity
FAIL object.typeMustMatch: IDL set to "\0" assert_equals: IDL get expected (boolean) true but got (string) "\0"
FAIL object.typeMustMatch: IDL set to object "test-toString" assert_equals: IDL get expected (boolean) true but got (object) object "test-toString"
FAIL object.typeMustMatch: IDL set to object "test-valueOf" assert_equals: IDL get expected (boolean) true but got (object) object "test-valueOf"
PASS object.name: 32 tests
PASS object.useMap: 32 tests
PASS object.width: 32 tests
......
<!DOCTYPE html>
<html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
test(function() {
var obj = document.createElement("object");
obj.foo = 1;
assert_equals(obj.foo, 1, "Setting an expando on an <object> works");
}, "setting an expando");
</script>
......@@ -82,22 +82,25 @@ void setScriptableObjectProperty(
HTMLPlugInElement* impl = ElementType::toImpl(info.Holder());
RefPtr<SharedPersistent<v8::Object>> wrapper = impl->pluginWrapper();
v8::Local<v8::Object> instance;
if (wrapper)
instance = wrapper->newLocal(info.GetIsolate());
if (!instance.IsEmpty()) {
// FIXME: The gTalk pepper plugin is the only plugin to make use of
// SetProperty and that is being deprecated. This can be removed as soon as
// it goes away.
// Call SetProperty on a pepper plugin's scriptable object. Note that we
// never set the return value here which would indicate that the plugin has
// intercepted the SetProperty call, which means that the property on the
// DOM element will also be set. For plugin's that don't intercept the call
// (all except gTalk) this makes no difference at all. For gTalk the fact
// that the property on the DOM element also gets set is inconsequential.
v8CallBoolean(instance->CreateDataProperty(
info.GetIsolate()->GetCurrentContext(), v8Name, value));
}
if (!wrapper)
return;
v8::Local<v8::Object> instance = wrapper->newLocal(info.GetIsolate());
if (instance.IsEmpty())
return;
// FIXME: The gTalk pepper plugin is the only plugin to make use of
// SetProperty and that is being deprecated. This can be removed as soon as
// it goes away.
// Call SetProperty on a pepper plugin's scriptable object. Note that we
// never set the return value here which would indicate that the plugin has
// intercepted the SetProperty call, which means that the property on the
// DOM element will also be set. For plugin's that don't intercept the call
// (all except gTalk) this makes no difference at all. For gTalk the fact
// that the property on the DOM element also gets set is inconsequential.
v8CallBoolean(instance->CreateDataProperty(
info.GetIsolate()->GetCurrentContext(), v8Name, value));
v8SetReturnValue(info, value);
}
......
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