New issue
Advanced search Search tips

Issue 596495 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Mar 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

On plugins, hasOwnProperty wrongly return false if getter return undefined

Project Member Reported by j.iso...@samsung.com, Mar 21 2016

Issue description

Version: 51.0.2682.0 (Developer Build) (64-bit)
OS: Linux

What steps will reproduce the problem?
(1) With v8 or pp API defines a property "testprop" with its getter returning undefined.
(2) Call plugin.hasOwnProperty("testprop") from javascript

What is the expected output? 
hasOwnProperty return true.

What do you see instead?
hasOwnProperty return false.


 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 25 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9e08bcbbb080114780f7d37ff4d9f3946e59d651

commit 9e08bcbbb080114780f7d37ff4d9f3946e59d651
Author: j.isorce <j.isorce@samsung.com>
Date: Fri Mar 25 17:13:12 2016

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

Review URL: https://codereview.chromium.org/1813823002

Cr-Commit-Position: refs/heads/master@{#383296}

[modify] https://crrev.com/9e08bcbbb080114780f7d37ff4d9f3946e59d651/ppapi/tests/blink_deprecated_test_plugin.cc
[add] https://crrev.com/9e08bcbbb080114780f7d37ff4d9f3946e59d651/third_party/WebKit/LayoutTests/plugins/plugin-scriptable-expected.txt
[add] https://crrev.com/9e08bcbbb080114780f7d37ff4d9f3946e59d651/third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html
[modify] https://crrev.com/9e08bcbbb080114780f7d37ff4d9f3946e59d651/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment