diff options
author | ukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-30 00:50:44 +0000 |
---|---|---|
committer | ukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-30 00:50:44 +0000 |
commit | 2e8d1b025c993d70ec8145060f5448997b8238db (patch) | |
tree | 3432072ab489b60b0745b733538544f5cc70bb8d | |
parent | c01639b7d1dfe57d3242cb26b1169e6c7ba8f797 (diff) | |
download | chromium_src-2e8d1b025c993d70ec8145060f5448997b8238db.zip chromium_src-2e8d1b025c993d70ec8145060f5448997b8238db.tar.gz chromium_src-2e8d1b025c993d70ec8145060f5448997b8238db.tar.bz2 |
ClientRectList must provide indexed access method that acts like item() method.
On translate.google.com, it fails to show balloon, because of JavaScript
exception in following code:
p=a.getClientRects(); ... p[0].top // p[0] is undefined!
Current v8 binding misses indexed access method in ClientRectList.
CSSOM View Module draft says
http://dev.w3.org/csswg/cssom-view/#clientrectlist
In ECMAScript implimentations, objects that implement the ClientRectList
interface must also have a [[GET]] method that, when invoked with a number,
acts like the item() method would when invoked with that argument.
BUG=10697
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14925 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/build/V8Bindings/V8Bindings.vcproj | 4 | ||||
-rw-r--r-- | webkit/port/bindings/v8/v8_custom.h | 3 | ||||
-rw-r--r-- | webkit/port/bindings/v8/v8_proxy.cpp | 4 | ||||
-rw-r--r-- | webkit/port/bindings/v8/v8_proxy.h | 1 | ||||
-rw-r--r-- | webkit/webkit.gyp | 1 |
5 files changed, 13 insertions, 0 deletions
diff --git a/webkit/build/V8Bindings/V8Bindings.vcproj b/webkit/build/V8Bindings/V8Bindings.vcproj index 0321eba..f6b87d7 100644 --- a/webkit/build/V8Bindings/V8Bindings.vcproj +++ b/webkit/build/V8Bindings/V8Bindings.vcproj @@ -132,6 +132,10 @@ > </File> <File + RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\v8\custom\V8ClientRectListCustom.cpp" + > + </File> + <File RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\v8\custom\V8ClipboardCustom.cpp" > </File> diff --git a/webkit/port/bindings/v8/v8_custom.h b/webkit/port/bindings/v8/v8_custom.h index d61b95d..a2783c5 100644 --- a/webkit/port/bindings/v8/v8_custom.h +++ b/webkit/port/bindings/v8/v8_custom.h @@ -510,6 +510,9 @@ DECLARE_CALLBACK(DatabaseTransaction) DECLARE_CALLBACK(SQLTransactionExecuteSql) DECLARE_CALLBACK(SQLResultSetRowListItem) +// ClientRectList +DECLARE_INDEXED_PROPERTY_GETTER(ClientRectList) + // SVG custom properties and callbacks #if ENABLE(SVG) DECLARE_PROPERTY_ACCESSOR_GETTER(SVGLengthValue) diff --git a/webkit/port/bindings/v8/v8_proxy.cpp b/webkit/port/bindings/v8/v8_proxy.cpp index fa2a348..07da396 100644 --- a/webkit/port/bindings/v8/v8_proxy.cpp +++ b/webkit/port/bindings/v8/v8_proxy.cpp @@ -1563,6 +1563,10 @@ v8::Persistent<v8::FunctionTemplate> V8Proxy::GetTemplate( case V8ClassIndex::XSLTPROCESSOR: desc->SetCallHandler(USE_CALLBACK(XSLTProcessorConstructor)); break; + case V8ClassIndex::CLIENTRECTLIST: + desc->InstanceTemplate()->SetIndexedPropertyHandler( + USE_INDEXED_PROPERTY_GETTER(ClientRectList)); + break; default: break; } diff --git a/webkit/port/bindings/v8/v8_proxy.h b/webkit/port/bindings/v8/v8_proxy.h index 1a7c13d..d254e0f 100644 --- a/webkit/port/bindings/v8/v8_proxy.h +++ b/webkit/port/bindings/v8/v8_proxy.h @@ -36,6 +36,7 @@ namespace WebCore { class CSSStyleDeclaration; +class ClientRectList; class DOMImplementation; class Element; class Event; diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp index 6177f43..e6f9dc1 100644 --- a/webkit/webkit.gyp +++ b/webkit/webkit.gyp @@ -983,6 +983,7 @@ # V8 bindings not generated from .idl source. '../third_party/WebKit/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp', + '../third_party/WebKit/WebCore/bindings/v8/custom/V8ClientRectListCustom.cpp', '../third_party/WebKit/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp', '../third_party/WebKit/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp', '../third_party/WebKit/WebCore/bindings/v8/custom/V8CustomBinding.h', |