|
|
Created:
4 years, 9 months ago by Julien Isorce Samsung Modified:
4 years, 8 months ago CC:
blink-reviews, blink-reviews-bindings_chromium.org, chromium-reviews Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionHandle the case where the v8 scriptable object has a property defined with value undefined.
Or with a getter that returns undefined.
Indeed V8HTMLPlugInElementCustom::getScriptableObjectProperty should only
fallback to the general HTMLObjectElement if a property does not exist.
For example if the v8 scriptable object has some properties
defined as equivalent as the following:
Object.defineProperty(
scriptableObj,
"onFoo",
{
value: undefined // default
}
);
or
Object.defineProperty(
scriptableObj,
"bar",
{
get: function () { return undefined; }
}
);
Then myHTMLObjectElement.hasOwnProperty("onFoo") or
myHTMLObjectElement.hasOwnProperty("bar") will return
false whereas they should return true.
BUG=596495
R=bashi@chromium.org, dcheng@chromium.org, haraken@chromium.org, piman@chromium.org
Committed: https://crrev.com/9e08bcbbb080114780f7d37ff4d9f3946e59d651
Cr-Commit-Position: refs/heads/master@{#383296}
Patch Set 1 #Patch Set 2 : Add layout test #Patch Set 3 : #
Total comments: 3
Patch Set 4 : #
Total comments: 1
Patch Set 5 : Use shouldBeTrue in layout test and defines testGetUndefined in blink_deprecated_test_plugin.cc #
Total comments: 1
Patch Set 6 : #
Total comments: 1
Patch Set 7 : Add doc and use v8CallBoolean instead of FromJust() #
Messages
Total messages: 52 (17 generated)
Description was changed from ========== Handle the case where the v8 scriptable object has a property defined with value undefined. Or with a getter that returns undefined. Indeed V8HTMLPlugInElementCustom::getScriptableObjectProperty should only fallback to the general HTMLObjectElement if a property does not exist. For example if the v8 scriptable object has some properties defined as equivalent as the following: Object.defineProperty( scriptableObj, "onFoo", { value: undefined // default } ); or Object.defineProperty( scriptableObj, "bar", { get: function () { return undefined; } } ); Then myHTMLObjectElement.hasOwnProperty("onFoo") or myHTMLObjectElement.hasOwnProperty("bar") will return false whereas they should return true. BUG= R=abarth@chromium.org ========== to ========== Handle the case where the v8 scriptable object has a property defined with value undefined. Or with a getter that returns undefined. Indeed V8HTMLPlugInElementCustom::getScriptableObjectProperty should only fallback to the general HTMLObjectElement if a property does not exist. For example if the v8 scriptable object has some properties defined as equivalent as the following: Object.defineProperty( scriptableObj, "onFoo", { value: undefined // default } ); or Object.defineProperty( scriptableObj, "bar", { get: function () { return undefined; } } ); Then myHTMLObjectElement.hasOwnProperty("onFoo") or myHTMLObjectElement.hasOwnProperty("bar") will return false whereas they should return true. BUG= R=bashi@chromium.org, dcheng@chromium.org ==========
j.isorce@samsung.com changed reviewers: + bashi@chromium.org, dcheng@chromium.org - abarth@chromium.org
Hi, I checked : CHROME_DEVEL_SANDBOX=out/Release/chrome_sandbox python third_party/WebKit/Tools/Scripts/run-webkit-tests --skipped=ignore --no-retry-failures plugins and there is no regression for tests that succeeds without this CL.
1) Is this specified somewhere? What does changing this fix? AFAIK, this is only exposed via pp::deprecated::ScriptableObject. As the name suggests, this is an interface we're trying to remove someday. 2) How do other browsers behave? 3) Can you write a layout test if we want this patch? You can use the PPAPI test plugin for deprecated interfaces @ //ppapi/tests/blink_deprecated_test_plugin.cc
On 2016/03/17 19:26:57, dcheng wrote: > 1) Is this specified somewhere? What does changing this fix? Hi, thx for you comments. I am not sure if it is specified somewhere but if I run the following full javascript code: <script> function A () { Object.defineProperty( scriptableObj, "onFoo", { value: undefined } ); Object.defineProperty( scriptableObj, "bar", { get: function () { return undefined; } } ); } var obj = new A; console.log(obj.hasOwnProperty("onFoo") + " " + obj.hasOwnProperty("bar")); </script> it will print: "true true", which is not the case if onFoo and bar are defined the same way for the underlying v8 object behind an HTMLObjectElement. The underlying v8 object being what is returned by the function blink::WebViewPlugin::GetV8ScriptableObject(v8::Isolate*). > AFAIK, this is only > exposed via pp::deprecated::ScriptableObject. As the name suggests, this is an > interface we're trying to remove someday. I do not use this interface though that's really interesting. I am going to have a look even it is deprecated. > > 2) How do other browsers behave? It is working fine with WebKit. I cannot tell with others. But for sure the small full javascript example above prints the same output on the 4 main browsers. > > 3) Can you write a layout test if we want this patch? You can use the PPAPI test > plugin for deprecated interfaces @ //ppapi/tests/blink_deprecated_test_plugin.cc Thx for the pointer I guess it will help in order to make a layout test. But at this point I am not sure if it is possible. I'll try and let you know.
Also FWIW the code that I am changing has been introduced by this CL https://codereview.chromium.org/230813002, especially this diff https://codereview.chromium.org/230813002/patch/70001/80004
Could you write a layout test so that I can check the behavior of other browsers?
On 2016/03/17 at 21:52:29, j.isorce wrote: > Also FWIW the code that I am changing has been introduced by this CL https://codereview.chromium.org/230813002, especially this diff https://codereview.chromium.org/230813002/patch/70001/80004 LGTM, as the author of the original patch. (I'm not a commiter, so you will need other lgtms though)
I'd like to have a layout test for this.
On 2016/03/18 06:58:57, haraken wrote: > I'd like to have a layout test for this. Patch Set 2 contains a layout test.
dcheng@chromium.org changed reviewers: + kolczyk@opera.com
Let's not add things to test plugin since we're actively trying to remove it. Can we use the PPAPI test plugin for deprecated interfaces instead? It's built from //ppapi/tests/blink_deprecated_test_plugin.cc and it shouldn't be too hard to use it instead.
On 2016/03/18 23:32:31, dcheng wrote: > Let's not add things to test plugin since we're actively trying to remove it. > Can we use the PPAPI test plugin for deprecated interfaces instead? It's built > from //ppapi/tests/blink_deprecated_test_plugin.cc and it shouldn't be too hard > to use it instead. Done. Though I could convert "Object.defineProperty( scriptableObj, "bar", { get: function () { return undefined; } } );" but not "Object.defineProperty( scriptableObj, "onFoo", { value: undefined // default } ); "
Description was changed from ========== Handle the case where the v8 scriptable object has a property defined with value undefined. Or with a getter that returns undefined. Indeed V8HTMLPlugInElementCustom::getScriptableObjectProperty should only fallback to the general HTMLObjectElement if a property does not exist. For example if the v8 scriptable object has some properties defined as equivalent as the following: Object.defineProperty( scriptableObj, "onFoo", { value: undefined // default } ); or Object.defineProperty( scriptableObj, "bar", { get: function () { return undefined; } } ); Then myHTMLObjectElement.hasOwnProperty("onFoo") or myHTMLObjectElement.hasOwnProperty("bar") will return false whereas they should return true. BUG= R=bashi@chromium.org, dcheng@chromium.org ========== to ========== Handle the case where the v8 scriptable object has a property defined with value undefined. Or with a getter that returns undefined. Indeed V8HTMLPlugInElementCustom::getScriptableObjectProperty should only fallback to the general HTMLObjectElement if a property does not exist. For example if the v8 scriptable object has some properties defined as equivalent as the following: Object.defineProperty( scriptableObj, "onFoo", { value: undefined // default } ); or Object.defineProperty( scriptableObj, "bar", { get: function () { return undefined; } } ); Then myHTMLObjectElement.hasOwnProperty("onFoo") or myHTMLObjectElement.hasOwnProperty("bar") will return false whereas they should return true. BUG=596495 R=bashi@chromium.org, dcheng@chromium.org ==========
https://codereview.chromium.org/1813823002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html (right): https://codereview.chromium.org/1813823002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html:17: "testprop": { get: function () { return undefined; } } If you rebase, can you just use testObject instead of testprop?
https://codereview.chromium.org/1813823002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html (right): https://codereview.chromium.org/1813823002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html:17: "testprop": { get: function () { return undefined; } } On 2016/03/21 17:29:21, dcheng wrote: > If you rebase, can you just use testObject instead of testprop? Do you mean renaming "testprop" to "testObject" everywhere ? (in this file and in the pepper plugin)
https://codereview.chromium.org/1813823002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html (right): https://codereview.chromium.org/1813823002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html:17: "testprop": { get: function () { return undefined; } } On 2016/03/21 at 18:02:56, j.isorce wrote: > On 2016/03/21 17:29:21, dcheng wrote: > > If you rebase, can you just use testObject instead of testprop? > > Do you mean renaming "testprop" to "testObject" everywhere ? (in this file and in the pepper plugin) https://codereview.chromium.org/1814093003 recently landed, so the deprecated test plugin already has a property (testObject) that I think you can just reuse for this test.
On 2016/03/21 18:09:15, dcheng wrote: > https://codereview.chromium.org/1813823002/diff/40001/third_party/WebKit/Layo... > File third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html (right): > > https://codereview.chromium.org/1813823002/diff/40001/third_party/WebKit/Layo... > third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html:17: "testprop": { > get: function () { return undefined; } } > On 2016/03/21 at 18:02:56, j.isorce wrote: > > On 2016/03/21 17:29:21, dcheng wrote: > > > If you rebase, can you just use testObject instead of testprop? > > > > Do you mean renaming "testprop" to "testObject" everywhere ? (in this file and > in the pepper plugin) > > https://codereview.chromium.org/1814093003 recently landed, so the deprecated > test plugin already has a property (testObject) that I think you can just reuse > for this test. I uploaded a new version using testObject. I was not able to just use it without defining new properties as you suggested. But anyway it sounded great to use it in another way. But the test does not pass, even with the fix. See the updated layout test.
https://codereview.chromium.org/1813823002/diff/60001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html (right): https://codereview.chromium.org/1813823002/diff/60001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html:22: document.getElementById('result').innerHTML = 'SUCCESS'; Printing SUCCESS is not the best way to show results. I'd suggest that using shouldBeXXX() helper functions which are defined in ../resources/js-test.js.
On 2016/03/21 23:33:15, bashi1 wrote: > https://codereview.chromium.org/1813823002/diff/60001/third_party/WebKit/Layo... > File third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html (right): > > https://codereview.chromium.org/1813823002/diff/60001/third_party/WebKit/Layo... > third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html:22: > document.getElementById('result').innerHTML = 'SUCCESS'; > Printing SUCCESS is not the best way to show results. I'd suggest that using > shouldBeXXX() helper functions which are defined in ../resources/js-test.js. Thx for the review. I uploaded "Patch Set 5" that contains what you suggested.
j.isorce@samsung.com changed reviewers: + piman@chromium.org
https://codereview.chromium.org/1813823002/diff/80001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html (right): https://codereview.chromium.org/1813823002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html:6: jsTestIsAsync = true; Why does this test need to be async?
On 2016/03/22 23:14:51, bashi1 wrote: > https://codereview.chromium.org/1813823002/diff/80001/third_party/WebKit/Layo... > File third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html (right): > > https://codereview.chromium.org/1813823002/diff/80001/third_party/WebKit/Layo... > third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html:6: jsTestIsAsync = > true; > Why does this test need to be async? It is not needed to be async, thx for pointing that. It indeed make the test to execute faster :). Please see Patch Set 6 that I just uploaded.
LGTM, however please see https://codereview.chromium.org/1821103002/ where we add documentation for the API exposed by the plugin. Could you rebase on top of it and add documentation for the new property?
haraken@chromium.org changed reviewers: + haraken@chromium.org
https://codereview.chromium.org/1813823002/diff/100001/third_party/WebKit/Sou... File third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp (right): https://codereview.chromium.org/1813823002/diff/100001/third_party/WebKit/Sou... third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp:64: if (value->IsUndefined() && !instance->Has(info.GetIsolate()->GetCurrentContext(), property).FromJust()) Would you use a v8Call macro in V8BindingMacros.h (instead of directly calling FromJust())?
Description was changed from ========== Handle the case where the v8 scriptable object has a property defined with value undefined. Or with a getter that returns undefined. Indeed V8HTMLPlugInElementCustom::getScriptableObjectProperty should only fallback to the general HTMLObjectElement if a property does not exist. For example if the v8 scriptable object has some properties defined as equivalent as the following: Object.defineProperty( scriptableObj, "onFoo", { value: undefined // default } ); or Object.defineProperty( scriptableObj, "bar", { get: function () { return undefined; } } ); Then myHTMLObjectElement.hasOwnProperty("onFoo") or myHTMLObjectElement.hasOwnProperty("bar") will return false whereas they should return true. BUG=596495 R=bashi@chromium.org, dcheng@chromium.org ========== to ========== Handle the case where the v8 scriptable object has a property defined with value undefined. Or with a getter that returns undefined. Indeed V8HTMLPlugInElementCustom::getScriptableObjectProperty should only fallback to the general HTMLObjectElement if a property does not exist. For example if the v8 scriptable object has some properties defined as equivalent as the following: Object.defineProperty( scriptableObj, "onFoo", { value: undefined // default } ); or Object.defineProperty( scriptableObj, "bar", { get: function () { return undefined; } } ); Then myHTMLObjectElement.hasOwnProperty("onFoo") or myHTMLObjectElement.hasOwnProperty("bar") will return false whereas they should return true. BUG=596495 R=bashi@chromium.org, dcheng@chromium.org, haraken@chromium.org, piman@chromium.org ==========
On 2016/03/23 20:22:00, piman wrote: > LGTM, however please see https://codereview.chromium.org/1821103002/ where we > add documentation for the API exposed by the plugin. Could you rebase on top of > it and add documentation for the new property? Thx for the review. I rebased and added doc in Patch Set 7. On 2016/03/24 02:38:09, haraken wrote: > https://codereview.chromium.org/1813823002/diff/100001/third_party/WebKit/Sou... > third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp:64: > if (value->IsUndefined() && > !instance->Has(info.GetIsolate()->GetCurrentContext(), property).FromJust()) > > Would you use a v8Call macro in V8BindingMacros.h (instead of directly calling > FromJust())? Thx for pointed that, I replaced FromJust by v8CallBoolean in Patch Set 7.
The CQ bit was checked by j.isorce@samsung.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1813823002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1813823002/120001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm
The CQ bit was checked by j.isorce@samsung.com
The patchset sent to the CQ was uploaded after l-g-t-m from kolczyk@opera.com Link to the patchset: https://codereview.chromium.org/1813823002/#ps120001 (title: "Add doc and use v8CallBoolean instead of FromJust()")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1813823002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1813823002/120001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
bindings/ LGTM.
bindings LGTM.
The CQ bit was checked by j.isorce@samsung.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1813823002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1813823002/120001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
** Presubmit ERRORS ** Missing LGTM from an OWNER for these files: ppapi/tests/blink_deprecated_test_plugin.cc
lgtm Weird, both piman and I should be OWNERS for that file.
The CQ bit was checked by dcheng@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1813823002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1813823002/120001
Message was sent while issue was closed.
Description was changed from ========== Handle the case where the v8 scriptable object has a property defined with value undefined. Or with a getter that returns undefined. Indeed V8HTMLPlugInElementCustom::getScriptableObjectProperty should only fallback to the general HTMLObjectElement if a property does not exist. For example if the v8 scriptable object has some properties defined as equivalent as the following: Object.defineProperty( scriptableObj, "onFoo", { value: undefined // default } ); or Object.defineProperty( scriptableObj, "bar", { get: function () { return undefined; } } ); Then myHTMLObjectElement.hasOwnProperty("onFoo") or myHTMLObjectElement.hasOwnProperty("bar") will return false whereas they should return true. BUG=596495 R=bashi@chromium.org, dcheng@chromium.org, haraken@chromium.org, piman@chromium.org ========== to ========== Handle the case where the v8 scriptable object has a property defined with value undefined. Or with a getter that returns undefined. Indeed V8HTMLPlugInElementCustom::getScriptableObjectProperty should only fallback to the general HTMLObjectElement if a property does not exist. For example if the v8 scriptable object has some properties defined as equivalent as the following: Object.defineProperty( scriptableObj, "onFoo", { value: undefined // default } ); or Object.defineProperty( scriptableObj, "bar", { get: function () { return undefined; } } ); Then myHTMLObjectElement.hasOwnProperty("onFoo") or myHTMLObjectElement.hasOwnProperty("bar") will return false whereas they should return true. BUG=596495 R=bashi@chromium.org, dcheng@chromium.org, haraken@chromium.org, piman@chromium.org ==========
Message was sent while issue was closed.
Committed patchset #7 (id:120001)
Message was sent while issue was closed.
Description was changed from ========== Handle the case where the v8 scriptable object has a property defined with value undefined. Or with a getter that returns undefined. Indeed V8HTMLPlugInElementCustom::getScriptableObjectProperty should only fallback to the general HTMLObjectElement if a property does not exist. For example if the v8 scriptable object has some properties defined as equivalent as the following: Object.defineProperty( scriptableObj, "onFoo", { value: undefined // default } ); or Object.defineProperty( scriptableObj, "bar", { get: function () { return undefined; } } ); Then myHTMLObjectElement.hasOwnProperty("onFoo") or myHTMLObjectElement.hasOwnProperty("bar") will return false whereas they should return true. BUG=596495 R=bashi@chromium.org, dcheng@chromium.org, haraken@chromium.org, piman@chromium.org ========== to ========== Handle the case where the v8 scriptable object has a property defined with value undefined. Or with a getter that returns undefined. Indeed V8HTMLPlugInElementCustom::getScriptableObjectProperty should only fallback to the general HTMLObjectElement if a property does not exist. For example if the v8 scriptable object has some properties defined as equivalent as the following: Object.defineProperty( scriptableObj, "onFoo", { value: undefined // default } ); or Object.defineProperty( scriptableObj, "bar", { get: function () { return undefined; } } ); Then myHTMLObjectElement.hasOwnProperty("onFoo") or myHTMLObjectElement.hasOwnProperty("bar") will return false whereas they should return true. BUG=596495 R=bashi@chromium.org, dcheng@chromium.org, haraken@chromium.org, piman@chromium.org Committed: https://crrev.com/9e08bcbbb080114780f7d37ff4d9f3946e59d651 Cr-Commit-Position: refs/heads/master@{#383296} ==========
Message was sent while issue was closed.
Patchset 7 (id:??) landed as https://crrev.com/9e08bcbbb080114780f7d37ff4d9f3946e59d651 Cr-Commit-Position: refs/heads/master@{#383296} |