isTrusted attribute doesn't exist in some Event subclasses |
|||||
Issue descriptionChrome Version: 60 canary OS: All What steps will reproduce the problem? (1) Open http://w3c-test.org/dom/nodes/Document-createEvent.html or (1) Run the following code in DevTools Console: var e = document.createEvent('CloseEvent'); e.isTrusted What is the expected result? isTrusted attribute exists in all Event subclasses. What happens instead? *Some* subclasses don't have it. e.g. CloseEvent DeviceMotionEvent DeviceOrientationEvent IDBVersionChangeEvent StorageEvent WebGLContextEvent http://w3c-test.org/dom/nodes/Document-createEvent.html shows "isTrusted should be initialized to false expected (boolean) false but got (undefined) undefined" for them. Please use labels and text to provide additional information. bashi@ said we might need special handling for [Unforgeable] and modules.
,
Apr 17 2017
,
Apr 21 2017
I had a quick look. The code that implements inheriting of Unforgeable attributes simply makes sure that the inheritance only happens between interfaces in the same component. So an event interface in a module just won't get isTrusted.
I'm not sure why this restriction is there. For e.g. CloseEvent, letting the attribute be inherited, produces an attribute getter that looks like this:
static void isTrustedAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Object> holder = info.Holder();
CloseEvent* impl = V8CloseEvent::toImpl(holder);
V8SetReturnValueBool(info, impl->isTrusted());
}
Surely there's no component-crossing error there?
,
May 11 2017
,
May 12 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2a32710d5f0e31cf648120a9724d5c8b0d8e5a88 commit 2a32710d5f0e31cf648120a9724d5c8b0d8e5a88 Author: jl <jl@opera.com> Date: Fri May 12 12:36:29 2017 Inherit [Unforgeable] attributes between components Specifically, when an interface in modules/ inherits an interface in core/ that defines an [Unforgeable] attribute, the interface in modules/ should still have the attribute. BUG= 712070 Review-Url: https://codereview.chromium.org/2874153003 Cr-Commit-Position: refs/heads/master@{#471284} [modify] https://crrev.com/2a32710d5f0e31cf648120a9724d5c8b0d8e5a88/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/Document-createEvent-expected.txt [modify] https://crrev.com/2a32710d5f0e31cf648120a9724d5c8b0d8e5a88/third_party/WebKit/Source/bindings/scripts/compute_interfaces_info_individual.py [modify] https://crrev.com/2a32710d5f0e31cf648120a9724d5c8b0d8e5a88/third_party/WebKit/Source/bindings/scripts/interface_dependency_resolver.py [add] https://crrev.com/2a32710d5f0e31cf648120a9724d5c8b0d8e5a88/third_party/WebKit/Source/bindings/tests/idls/modules/TestSubObject.idl [add] https://crrev.com/2a32710d5f0e31cf648120a9724d5c8b0d8e5a88/third_party/WebKit/Source/bindings/tests/results/modules/V8TestSubObject.cpp [add] https://crrev.com/2a32710d5f0e31cf648120a9724d5c8b0d8e5a88/third_party/WebKit/Source/bindings/tests/results/modules/V8TestSubObject.h
,
May 12 2017
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by bashi@chromium.org
, Apr 17 2017Status: Available (was: Untriaged)