summaryrefslogtreecommitdiffstats
path: root/webkit/port
diff options
context:
space:
mode:
authorukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-30 00:50:44 +0000
committerukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-30 00:50:44 +0000
commit2e8d1b025c993d70ec8145060f5448997b8238db (patch)
tree3432072ab489b60b0745b733538544f5cc70bb8d /webkit/port
parentc01639b7d1dfe57d3242cb26b1169e6c7ba8f797 (diff)
downloadchromium_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
Diffstat (limited to 'webkit/port')
-rw-r--r--webkit/port/bindings/v8/v8_custom.h3
-rw-r--r--webkit/port/bindings/v8/v8_proxy.cpp4
-rw-r--r--webkit/port/bindings/v8/v8_proxy.h1
3 files changed, 8 insertions, 0 deletions
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;