[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
japhet at chromium.org
japhet at chromium.org
Wed Jan 6 00:13:40 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit cc2650dadf4ca03bb3b88a85c1f897201a021a00
Author: japhet at chromium.org <japhet at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Dec 30 21:59:07 2009 +0000
2009-12-30 Nate Chapin <japhet at chromium.org>
Reviewed by Dimitri Glazkov.
Auto-generate V8 bindings header declarations for
property accessor getter/setters, and remove a couple of
unnecessarily custom bindings that weren't properly declared
custom anyway.
* Android.v8bindings.mk: Remove V8NavigatorCustom.cpp.
* WebCore.gypi: Remove V8NavigatorCustom.cpp.
* bindings/scripts/CodeGeneratorV8.pm:
* bindings/v8/V8DOMWrapper.cpp:
* bindings/v8/custom/V8AttrCustom.cpp:
* bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:
* bindings/v8/custom/V8ClipboardCustom.cpp:
* bindings/v8/custom/V8CoordinatesCustom.cpp:
* bindings/v8/custom/V8CustomBinding.cpp:
* bindings/v8/custom/V8CustomBinding.h:
* bindings/v8/custom/V8DOMWindowCustom.cpp:
* bindings/v8/custom/V8DocumentCustom.cpp:
* bindings/v8/custom/V8DocumentLocationCustom.cpp:
* bindings/v8/custom/V8EventCustom.cpp:
* bindings/v8/custom/V8HTMLDocumentCustom.cpp:
* bindings/v8/custom/V8HTMLFrameElementCustom.cpp:
* bindings/v8/custom/V8HTMLIFrameElementCustom.cpp:
* bindings/v8/custom/V8HTMLInputElementCustom.cpp:
* bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
* bindings/v8/custom/V8LocationCustom.cpp:
* bindings/v8/custom/V8MessageEventCustom.cpp:
* bindings/v8/custom/V8NavigatorCustom.cpp: Removed.
* bindings/v8/custom/V8SVGLengthCustom.cpp:
* bindings/v8/custom/V8WorkerContextCustom.cpp:
* bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/Android.v8bindings.mk b/WebCore/Android.v8bindings.mk
index a4b3965..a7aeaf9 100644
--- a/WebCore/Android.v8bindings.mk
+++ b/WebCore/Android.v8bindings.mk
@@ -136,7 +136,6 @@ LOCAL_SRC_FILES += \
bindings/v8/custom/V8MessageEventCustom.cpp \
bindings/v8/custom/V8NamedNodeMapCustom.cpp \
bindings/v8/custom/V8NamedNodesCollection.cpp \
- bindings/v8/custom/V8NavigatorCustom.cpp \
bindings/v8/custom/V8NodeCustom.cpp \
bindings/v8/custom/V8NodeFilterCustom.cpp \
bindings/v8/custom/V8NodeIteratorCustom.cpp \
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1c09bfd..235d86f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,38 @@
+2009-12-30 Nate Chapin <japhet at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Auto-generate V8 bindings header declarations for
+ property accessor getter/setters, and remove a couple of
+ unnecessarily custom bindings that weren't properly declared
+ custom anyway.
+
+ * Android.v8bindings.mk: Remove V8NavigatorCustom.cpp.
+ * WebCore.gypi: Remove V8NavigatorCustom.cpp.
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/v8/V8DOMWrapper.cpp:
+ * bindings/v8/custom/V8AttrCustom.cpp:
+ * bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:
+ * bindings/v8/custom/V8ClipboardCustom.cpp:
+ * bindings/v8/custom/V8CoordinatesCustom.cpp:
+ * bindings/v8/custom/V8CustomBinding.cpp:
+ * bindings/v8/custom/V8CustomBinding.h:
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ * bindings/v8/custom/V8DocumentCustom.cpp:
+ * bindings/v8/custom/V8DocumentLocationCustom.cpp:
+ * bindings/v8/custom/V8EventCustom.cpp:
+ * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+ * bindings/v8/custom/V8HTMLFrameElementCustom.cpp:
+ * bindings/v8/custom/V8HTMLIFrameElementCustom.cpp:
+ * bindings/v8/custom/V8HTMLInputElementCustom.cpp:
+ * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
+ * bindings/v8/custom/V8LocationCustom.cpp:
+ * bindings/v8/custom/V8MessageEventCustom.cpp:
+ * bindings/v8/custom/V8NavigatorCustom.cpp: Removed.
+ * bindings/v8/custom/V8SVGLengthCustom.cpp:
+ * bindings/v8/custom/V8WorkerContextCustom.cpp:
+ * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+
2009-12-30 Dimitri Glazkov <dglazkov at chromium.org>
Unreviewed, build fix.
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index d2cb40e..a336693 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -720,7 +720,6 @@
'bindings/v8/custom/V8NamedNodeMapCustom.cpp',
'bindings/v8/custom/V8NamedNodesCollection.cpp',
'bindings/v8/custom/V8NamedNodesCollection.h',
- 'bindings/v8/custom/V8NavigatorCustom.cpp',
'bindings/v8/custom/V8NodeCustom.cpp',
'bindings/v8/custom/V8NodeFilterCustom.cpp',
'bindings/v8/custom/V8NodeIteratorCustom.cpp',
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 2780f21..a2205ab 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -282,16 +282,32 @@ END
END
}
-
foreach my $function (@{$dataNode->functions}) {
my $name = $function->signature->name;
push(@headerContent, <<END);
static v8::Handle<v8::Value> ${name}Callback(const v8::Arguments&);
END
}
+
+ foreach my $attribute (@{$dataNode->attributes}) {
+ my $name = $attribute->signature->name;
+ my $attrExt = $attribute->signature->extendedAttributes;
+ if ($attrExt->{"V8CustomGetter"} || $attrExt->{"CustomGetter"}
+ || $attrExt->{"V8Custom"} || $attrExt->{"Custom"}) {
+ push(@headerContent, <<END);
+ static v8::Handle<v8::Value> ${name}AccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);
+END
+ }
+ if ($attrExt->{"V8CustomSetter"} || $attrExt->{"CustomSetter"}
+ || $attrExt->{"V8Custom"} || $attrExt->{"Custom"}) {
+ push(@headerContent, <<END);
+ static void ${name}AccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
+END
+ }
+ }
GenerateHeaderCustomCall($dataNode);
-
+
push(@headerContent, <<END);
private:
@@ -315,6 +331,15 @@ sub GenerateHeaderCustomCall
if ($dataNode->extendedAttributes->{"CustomCall"}) {
push(@headerContent, " static v8::Handle<v8::Value> callAsFunctionCallback(const v8::Arguments&);\n");
}
+ if ($dataNode->name eq "Event") {
+ push(@headerContent, " static v8::Handle<v8::Value> dataTransferAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);\n");
+ push(@headerContent, " static void valueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info);\n");
+ }
+ if ($dataNode->name eq "Location") {
+ push(@headerContent, " static v8::Handle<v8::Value> assignAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);\n");
+ push(@headerContent, " static v8::Handle<v8::Value> reloadAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);\n");
+ push(@headerContent, " static v8::Handle<v8::Value> replaceAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);\n");
+ }
}
sub GenerateSetDOMException
@@ -1053,7 +1078,7 @@ sub GenerateSingleBatchedAttribute
"";
if ($customAccessor eq 1) {
# use the naming convension, interface + (capitalize) attr name
- $customAccessor = $interfaceName . $codeGenerator->WK_ucfirst($attrName);
+ $customAccessor = $interfaceName . "::" . $attrName;
}
my $getter;
@@ -1078,7 +1103,7 @@ sub GenerateSingleBatchedAttribute
$constructorType =~ s/Constructor$//;
my $constructorIndex = uc($constructorType);
if ($customAccessor) {
- $getter = "V8Custom::v8${customAccessor}AccessorGetter";
+ $getter = "V8${customAccessor}AccessorGetter";
} else {
$data = "V8ClassIndex::${constructorIndex}";
$getter = "${interfaceName}Internal::${interfaceName}ConstructorGetter";
@@ -1094,12 +1119,12 @@ sub GenerateSingleBatchedAttribute
# Custom Setter
if ($attrExt->{"CustomSetter"} || $attrExt->{"V8CustomSetter"} || $attrExt->{"Custom"} || $attrExt->{"V8Custom"}) {
$hasCustomSetter = 1;
- $setter = "V8Custom::v8${customAccessor}AccessorSetter";
+ $setter = "V8${customAccessor}AccessorSetter";
}
# Custom Getter
if ($attrExt->{"CustomGetter"} || $attrExt->{"Custom"} || $attrExt->{"V8Custom"}) {
- $getter = "V8Custom::v8${customAccessor}AccessorGetter";
+ $getter = "V8${customAccessor}AccessorGetter";
}
}
diff --git a/WebCore/bindings/v8/V8DOMWrapper.cpp b/WebCore/bindings/v8/V8DOMWrapper.cpp
index 2ea4c1c..a9c9afb 100644
--- a/WebCore/bindings/v8/V8DOMWrapper.cpp
+++ b/WebCore/bindings/v8/V8DOMWrapper.cpp
@@ -50,6 +50,7 @@
#include "V8HTMLCollection.h"
#include "V8Index.h"
#include "V8IsolatedWorld.h"
+#include "V8Location.h"
#include "V8NodeList.h"
#include "V8Proxy.h"
#include "WebGLArray.h"
@@ -338,9 +339,9 @@ v8::Persistent<v8::FunctionTemplate> V8DOMWrapper::getTemplate(V8ClassIndex::V8W
// instead of on the prototype object to insure that they cannot
// be overwritten.
v8::Local<v8::ObjectTemplate> instance = descriptor->InstanceTemplate();
- instance->SetAccessor(v8::String::New("reload"), V8Custom::v8LocationReloadAccessorGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
- instance->SetAccessor(v8::String::New("replace"), V8Custom::v8LocationReplaceAccessorGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
- instance->SetAccessor(v8::String::New("assign"), V8Custom::v8LocationAssignAccessorGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
+ instance->SetAccessor(v8::String::New("reload"), V8Location::reloadAccessorGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
+ instance->SetAccessor(v8::String::New("replace"), V8Location::replaceAccessorGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
+ instance->SetAccessor(v8::String::New("assign"), V8Location::assignAccessorGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
break;
}
case V8ClassIndex::HISTORY:
diff --git a/WebCore/bindings/v8/custom/V8AttrCustom.cpp b/WebCore/bindings/v8/custom/V8AttrCustom.cpp
index 81f1586..929f00b 100644
--- a/WebCore/bindings/v8/custom/V8AttrCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8AttrCustom.cpp
@@ -29,18 +29,18 @@
*/
#include "config.h"
-#include "Attr.h"
+#include "V8Attr.h"
+#include "Attr.h"
#include "Element.h"
#include "ExceptionCode.h"
-
#include "V8Binding.h"
#include "V8CustomBinding.h"
#include "V8Proxy.h"
namespace WebCore {
-ACCESSOR_SETTER(AttrValue)
+void V8Attr::valueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
Attr* imp = V8DOMWrapper::convertDOMWrapperToNode<Attr>(info.Holder());
String attrValue = toWebCoreStringWithNullCheck(value);
diff --git a/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp b/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp
index 5b185bb..389d9c7 100644
--- a/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp
@@ -74,25 +74,25 @@ static PassRefPtr<CanvasStyle> toCanvasStyle(v8::Handle<v8::Value> value)
return 0;
}
-ACCESSOR_GETTER(CanvasRenderingContext2DStrokeStyle)
+v8::Handle<v8::Value> V8CanvasRenderingContext2D::strokeStyleAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
CanvasRenderingContext2D* impl = V8DOMWrapper::convertDOMWrapperToNative<CanvasRenderingContext2D>(info.Holder());
return toV8(impl->strokeStyle());
}
-ACCESSOR_SETTER(CanvasRenderingContext2DStrokeStyle)
+void V8CanvasRenderingContext2D::strokeStyleAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
CanvasRenderingContext2D* impl = V8DOMWrapper::convertDOMWrapperToNative<CanvasRenderingContext2D>(info.Holder());
impl->setStrokeStyle(toCanvasStyle(value));
}
-ACCESSOR_GETTER(CanvasRenderingContext2DFillStyle)
+v8::Handle<v8::Value> V8CanvasRenderingContext2D::fillStyleAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
CanvasRenderingContext2D* impl = V8DOMWrapper::convertDOMWrapperToNative<CanvasRenderingContext2D>(info.Holder());
return toV8(impl->fillStyle());
}
-ACCESSOR_SETTER(CanvasRenderingContext2DFillStyle)
+void V8CanvasRenderingContext2D::fillStyleAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
CanvasRenderingContext2D* impl = V8DOMWrapper::convertDOMWrapperToNative<CanvasRenderingContext2D>(info.Holder());
impl->setFillStyle(toCanvasStyle(value));
diff --git a/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp b/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp
index cbdcf13..a96a7fd 100644
--- a/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp
@@ -45,7 +45,7 @@
namespace WebCore {
-ACCESSOR_GETTER(ClipboardTypes)
+v8::Handle<v8::Value> V8Clipboard::typesAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Clipboard.types()");
Clipboard* clipboard = V8DOMWrapper::convertToNativeObject<Clipboard>(V8ClassIndex::CLIPBOARD, info.Holder());
diff --git a/WebCore/bindings/v8/custom/V8CoordinatesCustom.cpp b/WebCore/bindings/v8/custom/V8CoordinatesCustom.cpp
index 1c07f29..50e69fa 100644
--- a/WebCore/bindings/v8/custom/V8CoordinatesCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8CoordinatesCustom.cpp
@@ -24,15 +24,16 @@
*/
#include "config.h"
-#include "Coordinates.h"
+#include "V8Coordinates.h"
+#include "Coordinates.h"
#include "V8Binding.h"
#include "V8CustomBinding.h"
#include "V8Proxy.h"
namespace WebCore {
-ACCESSOR_GETTER(CoordinatesAltitude)
+v8::Handle<v8::Value> V8Coordinates::altitudeAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Coordinates.altitude._get");
v8::Handle<v8::Object> holder = info.Holder();
@@ -42,7 +43,7 @@ ACCESSOR_GETTER(CoordinatesAltitude)
return v8::Number::New(imp->altitude());
}
-ACCESSOR_GETTER(CoordinatesAltitudeAccuracy)
+v8::Handle<v8::Value> V8Coordinates::altitudeAccuracyAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Coordinates.altitudeAccuracy._get");
v8::Handle<v8::Object> holder = info.Holder();
@@ -52,7 +53,7 @@ ACCESSOR_GETTER(CoordinatesAltitudeAccuracy)
return v8::Number::New(imp->altitudeAccuracy());
}
-ACCESSOR_GETTER(CoordinatesHeading)
+v8::Handle<v8::Value> V8Coordinates::headingAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Coordinates.heading._get");
v8::Handle<v8::Object> holder = info.Holder();
@@ -62,7 +63,7 @@ ACCESSOR_GETTER(CoordinatesHeading)
return v8::Number::New(imp->heading());
}
-ACCESSOR_GETTER(CoordinatesSpeed)
+v8::Handle<v8::Value> V8Coordinates::speedAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Coordinates.speed._get");
v8::Handle<v8::Object> holder = info.Holder();
diff --git a/WebCore/bindings/v8/custom/V8CustomBinding.cpp b/WebCore/bindings/v8/custom/V8CustomBinding.cpp
index 032912e..572a51b 100644
--- a/WebCore/bindings/v8/custom/V8CustomBinding.cpp
+++ b/WebCore/bindings/v8/custom/V8CustomBinding.cpp
@@ -66,33 +66,6 @@ bool allowSettingSrcToJavascriptURL(Element* element, String name, String value)
return true;
}
-// DOMImplementation is a singleton in WebCore. If we use our normal
-// mapping from DOM objects to V8 wrappers, the same wrapper will be
-// shared for all frames in the same process. This is a major
-// security problem. Therefore, we generate a DOMImplementation
-// wrapper per document and store it in an internal field of the
-// document. Since the DOMImplementation object is a singleton, we do
-// not have to do anything to keep the DOMImplementation object alive
-// for the lifetime of the wrapper.
-ACCESSOR_GETTER(DocumentImplementation)
-{
- ASSERT(info.Holder()->InternalFieldCount() >= kDocumentMinimumInternalFieldCount);
-
- // Check if the internal field already contains a wrapper.
- v8::Local<v8::Value> implementation = info.Holder()->GetInternalField(kDocumentImplementationIndex);
- if (!implementation->IsUndefined())
- return implementation;
-
- // Generate a wrapper.
- Document* document = V8DOMWrapper::convertDOMWrapperToNative<Document>(info.Holder());
- v8::Handle<v8::Value> wrapper = V8DOMWrapper::convertDOMImplementationToV8Object(document->implementation());
-
- // Store the wrapper in the internal field.
- info.Holder()->SetInternalField(kDocumentImplementationIndex, wrapper);
-
- return wrapper;
-}
-
// --------------- Security Checks -------------------------
INDEXED_ACCESS_CHECK(History)
{
diff --git a/WebCore/bindings/v8/custom/V8CustomBinding.h b/WebCore/bindings/v8/custom/V8CustomBinding.h
index d506074..e375eb6 100644
--- a/WebCore/bindings/v8/custom/V8CustomBinding.h
+++ b/WebCore/bindings/v8/custom/V8CustomBinding.h
@@ -36,14 +36,6 @@
struct NPObject;
-#define ACCESSOR_GETTER(NAME) \
- v8::Handle<v8::Value> V8Custom::v8##NAME##AccessorGetter( \
- v8::Local<v8::String> name, const v8::AccessorInfo& info)
-
-#define ACCESSOR_SETTER(NAME) \
- void V8Custom::v8##NAME##AccessorSetter(v8::Local<v8::String> name, \
- v8::Local<v8::Value> value, const v8::AccessorInfo& info)
-
#define INDEXED_PROPERTY_GETTER(NAME) \
v8::Handle<v8::Value> V8Custom::v8##NAME##IndexedPropertyGetter( \
uint32_t index, const v8::AccessorInfo& info)
@@ -184,16 +176,6 @@ namespace WebCore {
static const int kWebSocketInternalFieldCount = kDefaultWrapperInternalFieldCount + 1;
#endif
-#define DECLARE_PROPERTY_ACCESSOR_GETTER(NAME) \
- static v8::Handle<v8::Value> v8##NAME##AccessorGetter( \
- v8::Local<v8::String> name, const v8::AccessorInfo& info)
-
-#define DECLARE_PROPERTY_ACCESSOR_SETTER(NAME) \
- static void v8##NAME##AccessorSetter(v8::Local<v8::String> name, \
- v8::Local<v8::Value> value, const v8::AccessorInfo& info)
-
-#define DECLARE_PROPERTY_ACCESSOR(NAME) DECLARE_PROPERTY_ACCESSOR_GETTER(NAME); DECLARE_PROPERTY_ACCESSOR_SETTER(NAME)
-
#define DECLARE_NAMED_PROPERTY_GETTER(NAME) \
static v8::Handle<v8::Value> v8##NAME##NamedPropertyGetter( \
v8::Local<v8::String> name, const v8::AccessorInfo& info)
@@ -244,15 +226,7 @@ namespace WebCore {
#define DECLARE_ACCESSOR_RUNTIME_ENABLER(NAME) static bool v8##NAME##Enabled()
- DECLARE_PROPERTY_ACCESSOR(CanvasRenderingContext2DStrokeStyle);
- DECLARE_PROPERTY_ACCESSOR(CanvasRenderingContext2DFillStyle);
- DECLARE_PROPERTY_ACCESSOR(DOMWindowEvent);
- DECLARE_PROPERTY_ACCESSOR_GETTER(DOMWindowCrypto);
- DECLARE_PROPERTY_ACCESSOR_SETTER(DOMWindowLocation);
- DECLARE_PROPERTY_ACCESSOR_SETTER(DOMWindowOpener);
-
#if ENABLE(VIDEO)
- DECLARE_PROPERTY_ACCESSOR_GETTER(DOMWindowAudio);
DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowAudio);
DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowHTMLMediaElement);
DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowHTMLAudioElement);
@@ -260,37 +234,12 @@ namespace WebCore {
DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowMediaError);
#endif
- DECLARE_PROPERTY_ACCESSOR_GETTER(DOMWindowImage);
- DECLARE_PROPERTY_ACCESSOR_GETTER(DOMWindowOption);
-
- DECLARE_PROPERTY_ACCESSOR(DocumentLocation);
- DECLARE_PROPERTY_ACCESSOR(DocumentImplementation);
- DECLARE_PROPERTY_ACCESSOR_GETTER(EventSrcElement);
- DECLARE_PROPERTY_ACCESSOR(EventReturnValue);
- DECLARE_PROPERTY_ACCESSOR_GETTER(EventDataTransfer);
- DECLARE_PROPERTY_ACCESSOR_GETTER(EventClipboardData);
-
- DECLARE_PROPERTY_ACCESSOR(DOMWindowEventHandler);
-
- DECLARE_PROPERTY_ACCESSOR_SETTER(HTMLFrameElementSrc);
- DECLARE_PROPERTY_ACCESSOR_SETTER(HTMLFrameElementLocation);
- DECLARE_PROPERTY_ACCESSOR_SETTER(HTMLIFrameElementSrc);
-
- DECLARE_PROPERTY_ACCESSOR_SETTER(AttrValue);
-
- DECLARE_PROPERTY_ACCESSOR(HTMLOptionsCollectionLength);
-
-
- DECLARE_PROPERTY_ACCESSOR(HTMLInputElementSelectionStart);
- DECLARE_PROPERTY_ACCESSOR(HTMLInputElementSelectionEnd);
-
DECLARE_NAMED_ACCESS_CHECK(Location);
DECLARE_INDEXED_ACCESS_CHECK(History);
DECLARE_NAMED_ACCESS_CHECK(History);
DECLARE_INDEXED_ACCESS_CHECK(Location);
- DECLARE_PROPERTY_ACCESSOR(HTMLDocumentAll);
DECLARE_NAMED_PROPERTY_GETTER(HTMLDocument);
DECLARE_NAMED_PROPERTY_DELETER(HTMLDocument);
@@ -317,39 +266,6 @@ namespace WebCore {
DECLARE_CALLBACK(WebGLUnsignedShortArrayConstructor);
#endif
- DECLARE_PROPERTY_ACCESSOR_GETTER(ClipboardTypes);
-
- DECLARE_PROPERTY_ACCESSOR_SETTER(LocationProtocol);
- DECLARE_PROPERTY_ACCESSOR_SETTER(LocationHost);
- DECLARE_PROPERTY_ACCESSOR_SETTER(LocationHostname);
- DECLARE_PROPERTY_ACCESSOR_SETTER(LocationPort);
- DECLARE_PROPERTY_ACCESSOR_SETTER(LocationPathname);
- DECLARE_PROPERTY_ACCESSOR_SETTER(LocationSearch);
- DECLARE_PROPERTY_ACCESSOR_SETTER(LocationHash);
- DECLARE_PROPERTY_ACCESSOR_SETTER(LocationHref);
- DECLARE_PROPERTY_ACCESSOR_GETTER(LocationAssign);
- DECLARE_PROPERTY_ACCESSOR_GETTER(LocationReplace);
- DECLARE_PROPERTY_ACCESSOR_GETTER(LocationReload);
-
- // We actually only need this because WebKit has
- // navigator.appVersion as custom. Our version just
- // passes through.
- DECLARE_PROPERTY_ACCESSOR(NavigatorAppVersion);
-
- DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnabort);
- DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnerror);
- DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnload);
- DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnloadstart);
- DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnprogress);
- DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnreadystatechange);
- DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestResponseText);
-
- DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestUploadOnabort);
- DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestUploadOnerror);
- DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestUploadOnload);
- DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestUploadOnloadstart);
- DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestUploadOnprogress);
-
DECLARE_NAMED_PROPERTY_GETTER(DOMWindow);
DECLARE_INDEXED_PROPERTY_GETTER(DOMWindow);
DECLARE_NAMED_ACCESS_CHECK(DOMWindow);
@@ -408,13 +324,7 @@ namespace WebCore {
DECLARE_INDEXED_PROPERTY_SETTER(WebGLUnsignedShortArray);
#endif
- DECLARE_PROPERTY_ACCESSOR_GETTER(MessageEventPorts);
-
- DECLARE_PROPERTY_ACCESSOR(MessagePortOnmessage);
- DECLARE_PROPERTY_ACCESSOR(MessagePortOnclose);
-
#if ENABLE(DATAGRID)
- DECLARE_PROPERTY_ACCESSOR(HTMLDataGridElementDataSource);
DECLARE_NAMED_PROPERTY_GETTER(DataGridColumnList);
#endif
@@ -434,33 +344,16 @@ namespace WebCore {
static v8::Handle<v8::Array> v8StorageNamedPropertyEnumerator(const v8::AccessorInfo& info);
#endif
-#if ENABLE(SVG)
- DECLARE_PROPERTY_ACCESSOR_GETTER(SVGLengthValue);
-#endif
-
#if ENABLE(WORKERS)
- DECLARE_PROPERTY_ACCESSOR(AbstractWorkerOnerror);
-
- DECLARE_PROPERTY_ACCESSOR(DedicatedWorkerContextOnmessage);
-
- DECLARE_PROPERTY_ACCESSOR(WorkerOnmessage);
DECLARE_CALLBACK(WorkerConstructor);
- DECLARE_PROPERTY_ACCESSOR_GETTER(WorkerContextSelf);
- DECLARE_PROPERTY_ACCESSOR(WorkerContextOnerror);
-
#if ENABLE(NOTIFICATIONS)
DECLARE_ACCESSOR_RUNTIME_ENABLER(WorkerContextWebkitNotifications);
#endif
#endif // ENABLE(WORKERS)
-#if ENABLE(NOTIFICATIONS)
- DECLARE_PROPERTY_ACCESSOR(NotificationEventHandler);
-#endif // ENABLE(NOTIFICATIONS)
-
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowApplicationCache);
- DECLARE_PROPERTY_ACCESSOR(DOMApplicationCacheEventHandler);
#endif
#if ENABLE(SHARED_WORKERS)
@@ -473,25 +366,13 @@ namespace WebCore {
#endif
#if ENABLE(WEB_SOCKETS)
- DECLARE_PROPERTY_ACCESSOR(WebSocketOnopen);
- DECLARE_PROPERTY_ACCESSOR(WebSocketOnmessage);
- DECLARE_PROPERTY_ACCESSOR(WebSocketOnclose);
DECLARE_CALLBACK(WebSocketConstructor);
DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowWebSocket);
#endif
- DECLARE_PROPERTY_ACCESSOR_GETTER(CoordinatesAltitude);
- DECLARE_PROPERTY_ACCESSOR_GETTER(CoordinatesAltitudeAccuracy);
- DECLARE_PROPERTY_ACCESSOR_GETTER(CoordinatesHeading);
- DECLARE_PROPERTY_ACCESSOR_GETTER(CoordinatesSpeed);
-
#undef DECLARE_INDEXED_ACCESS_CHECK
#undef DECLARE_NAMED_ACCESS_CHECK
-#undef DECLARE_PROPERTY_ACCESSOR_SETTER
-#undef DECLARE_PROPERTY_ACCESSOR_GETTER
-#undef DECLARE_PROPERTY_ACCESSOR
-
#undef DECLARE_NAMED_PROPERTY_GETTER
#undef DECLARE_NAMED_PROPERTY_SETTER
#undef DECLARE_NAMED_PROPERTY_DELETER
@@ -513,7 +394,6 @@ namespace WebCore {
#if ENABLE(SVG)
static V8ClassIndex::V8WrapperType DowncastSVGPathSeg(void* pathSeg);
#endif
- private:
static void WindowSetLocation(DOMWindow*, const String&);
};
diff --git a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index 954e272..4d895c3 100644
--- a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -167,7 +167,7 @@ static v8::Handle<v8::Value> convertBase64(const String& str, bool encode)
return v8String(String(outputCharacters.data(), outputCharacters.size()));
}
-ACCESSOR_GETTER(DOMWindowEvent)
+v8::Handle<v8::Value> V8DOMWindow::eventAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
v8::Handle<v8::Object> holder = V8DOMWrapper::lookupDOMWrapper(V8ClassIndex::DOMWINDOW, info.This());
if (holder.IsEmpty())
@@ -188,7 +188,7 @@ ACCESSOR_GETTER(DOMWindowEvent)
return jsEvent;
}
-ACCESSOR_SETTER(DOMWindowEvent)
+void V8DOMWindow::eventAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
v8::Handle<v8::Object> holder = V8DOMWrapper::lookupDOMWrapper(V8ClassIndex::DOMWINDOW, info.This());
if (holder.IsEmpty())
@@ -206,20 +206,20 @@ ACCESSOR_SETTER(DOMWindowEvent)
context->Global()->SetHiddenValue(eventSymbol, value);
}
-ACCESSOR_GETTER(DOMWindowCrypto)
+v8::Handle<v8::Value> V8DOMWindow::cryptoAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
// FIXME: Implement me.
return v8::Undefined();
}
-ACCESSOR_SETTER(DOMWindowLocation)
+void V8DOMWindow::locationAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
DOMWindow* imp = V8DOMWrapper::convertToNativeObject<DOMWindow>(V8ClassIndex::DOMWINDOW, info.Holder());
V8Custom::WindowSetLocation(imp, toWebCoreString(value));
}
-ACCESSOR_SETTER(DOMWindowOpener)
+void V8DOMWindow::openerAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
DOMWindow* imp = V8DOMWrapper::convertToNativeObject<DOMWindow>(V8ClassIndex::DOMWINDOW, info.Holder());
@@ -245,7 +245,7 @@ ACCESSOR_SETTER(DOMWindowOpener)
#if ENABLE(VIDEO)
-ACCESSOR_GETTER(DOMWindowAudio)
+v8::Handle<v8::Value> V8DOMWindow::AudioAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
DOMWindow* window = V8DOMWrapper::convertToNativeObject<DOMWindow>(V8ClassIndex::DOMWINDOW, info.Holder());
return V8DOMWrapper::getConstructor(V8ClassIndex::AUDIO, window);
@@ -325,13 +325,13 @@ ACCESSOR_RUNTIME_ENABLER(DOMWindowApplicationCache)
}
#endif
-ACCESSOR_GETTER(DOMWindowImage)
+v8::Handle<v8::Value> V8DOMWindow::ImageAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
DOMWindow* window = V8DOMWrapper::convertToNativeObject<DOMWindow>(V8ClassIndex::DOMWINDOW, info.Holder());
return V8DOMWrapper::getConstructor(V8ClassIndex::IMAGE, window);
}
-ACCESSOR_GETTER(DOMWindowOption)
+v8::Handle<v8::Value> V8DOMWindow::OptionAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
DOMWindow* window = V8DOMWrapper::convertToNativeObject<DOMWindow>(V8ClassIndex::DOMWINDOW, info.Holder());
return V8DOMWrapper::getConstructor(V8ClassIndex::OPTION, window);
diff --git a/WebCore/bindings/v8/custom/V8DocumentCustom.cpp b/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
index 1cdb122..bee5709 100644
--- a/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
@@ -104,4 +104,32 @@ v8::Handle<v8::Value> V8Document::getCSSCanvasContextCallback(const v8::Argument
return v8::Undefined();
}
+
+// DOMImplementation is a singleton in WebCore. If we use our normal
+// mapping from DOM objects to V8 wrappers, the same wrapper will be
+// shared for all frames in the same process. This is a major
+// security problem. Therefore, we generate a DOMImplementation
+// wrapper per document and store it in an internal field of the
+// document. Since the DOMImplementation object is a singleton, we do
+// not have to do anything to keep the DOMImplementation object alive
+// for the lifetime of the wrapper.
+v8::Handle<v8::Value> V8Document::implementationAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ ASSERT(info.Holder()->InternalFieldCount() >= V8Custom::kDocumentMinimumInternalFieldCount);
+
+ // Check if the internal field already contains a wrapper.
+ v8::Local<v8::Value> implementation = info.Holder()->GetInternalField(V8Custom::kDocumentImplementationIndex);
+ if (!implementation->IsUndefined())
+ return implementation;
+
+ // Generate a wrapper.
+ Document* document = V8DOMWrapper::convertDOMWrapperToNative<Document>(info.Holder());
+ v8::Handle<v8::Value> wrapper = V8DOMWrapper::convertDOMImplementationToV8Object(document->implementation());
+
+ // Store the wrapper in the internal field.
+ info.Holder()->SetInternalField(V8Custom::kDocumentImplementationIndex, wrapper);
+
+ return wrapper;
+}
+
} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp b/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp
index 440bbdc..3572aa8 100644
--- a/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp
@@ -22,17 +22,18 @@
*/
#include "config.h"
-#include "V8CustomBinding.h"
+#include "V8Document.h"
#include "DOMWindow.h"
#include "Frame.h"
#include "V8Binding.h"
+#include "V8CustomBinding.h"
#include "V8Document.h"
#include "V8Proxy.h"
namespace WebCore {
-ACCESSOR_GETTER(DocumentLocation)
+v8::Handle<v8::Value> V8Document::locationAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
Document* document = V8DOMWrapper::convertDOMWrapperToNative<Document>(info.Holder());
if (!document->frame())
@@ -42,7 +43,7 @@ ACCESSOR_GETTER(DocumentLocation)
return V8DOMWrapper::convertToV8Object(V8ClassIndex::LOCATION, window->location());
}
-ACCESSOR_SETTER(DocumentLocation)
+void V8Document::locationAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
Document* document = V8DOMWrapper::convertDOMWrapperToNative<Document>(info.Holder());
if (!document->frame())
@@ -50,7 +51,7 @@ ACCESSOR_SETTER(DocumentLocation)
DOMWindow* window = document->frame()->domWindow();
// WindowSetLocation does security checks. // XXXMB- verify!
- WindowSetLocation(window, toWebCoreString(value));
+ V8Custom::WindowSetLocation(window, toWebCoreString(value));
}
} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8EventCustom.cpp b/WebCore/bindings/v8/custom/V8EventCustom.cpp
index 8bac40f..d8b8379 100644
--- a/WebCore/bindings/v8/custom/V8EventCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8EventCustom.cpp
@@ -29,25 +29,25 @@
*/
#include "config.h"
-#include "Event.h"
+#include "V8Event.h"
#include "Clipboard.h"
#include "ClipboardEvent.h"
+#include "Event.h"
#include "MouseEvent.h"
-
#include "V8Binding.h"
#include "V8CustomBinding.h"
#include "V8Proxy.h"
namespace WebCore {
-ACCESSOR_SETTER(EventReturnValue)
+void V8Event::valueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
Event* event = V8DOMWrapper::convertDOMWrapperToNative<Event>(info.Holder());
event->setDefaultPrevented(!value->BooleanValue());
}
-ACCESSOR_GETTER(EventDataTransfer)
+v8::Handle<v8::Value> V8Event::dataTransferAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
Event* event = V8DOMWrapper::convertDOMWrapperToNative<Event>(info.Holder());
@@ -57,7 +57,7 @@ ACCESSOR_GETTER(EventDataTransfer)
return v8::Undefined();
}
-ACCESSOR_GETTER(EventClipboardData)
+v8::Handle<v8::Value> V8Event::clipboardDataAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
Event* event = V8DOMWrapper::convertDOMWrapperToNative<Event>(info.Holder());
@@ -67,16 +67,4 @@ ACCESSOR_GETTER(EventClipboardData)
return v8::Undefined();
}
-ACCESSOR_GETTER(EventSrcElement)
-{
- Event* event = V8DOMWrapper::convertDOMWrapperToNative<Event>(info.Holder());
- return V8DOMWrapper::convertEventTargetToV8Object(event->target());
-}
-
-ACCESSOR_GETTER(EventReturnValue)
-{
- Event* event = V8DOMWrapper::convertDOMWrapperToNative<Event>(info.Holder());
- return event->defaultPrevented() ? v8::False() : v8::True();
-}
-
} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp b/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
index aa2f30c..5efbcf4 100644
--- a/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
@@ -174,7 +174,7 @@ v8::Handle<v8::Value> V8HTMLDocument::openCallback(const v8::Arguments& args)
return args.Holder();
}
-ACCESSOR_GETTER(HTMLDocumentAll)
+v8::Handle<v8::Value> V8HTMLDocument::allAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.HTMLDocument.all._get");
v8::HandleScope scope;
@@ -183,12 +183,12 @@ ACCESSOR_GETTER(HTMLDocumentAll)
return V8DOMWrapper::convertToV8Object(V8ClassIndex::HTMLCOLLECTION, htmlDocument->all());
}
-ACCESSOR_SETTER(HTMLDocumentAll)
+void V8HTMLDocument::allAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.HTMLDocument.all._set");
v8::Handle<v8::Object> holder = info.Holder();
- ASSERT(info.Holder()->InternalFieldCount() == kHTMLDocumentInternalFieldCount);
- info.Holder()->SetInternalField(kHTMLDocumentShadowIndex, value);
+ ASSERT(info.Holder()->InternalFieldCount() == V8Custom::kHTMLDocumentInternalFieldCount);
+ info.Holder()->SetInternalField(V8Custom::kHTMLDocumentShadowIndex, value);
}
} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8HTMLFrameElementCustom.cpp b/WebCore/bindings/v8/custom/V8HTMLFrameElementCustom.cpp
index 2f55758..3746001 100644
--- a/WebCore/bindings/v8/custom/V8HTMLFrameElementCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLFrameElementCustom.cpp
@@ -29,9 +29,10 @@
*/
#include "config.h"
+#include "V8HTMLFrameElement.h"
+
#include "HTMLFrameElement.h"
#include "HTMLNames.h"
-
#include "V8Binding.h"
#include "V8CustomBinding.h"
#include "V8Proxy.h"
@@ -40,7 +41,7 @@ namespace WebCore {
using namespace HTMLNames;
-ACCESSOR_SETTER(HTMLFrameElementSrc)
+void V8HTMLFrameElement::srcAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
HTMLFrameElement* frame = V8DOMWrapper::convertDOMWrapperToNode<HTMLFrameElement>(info.Holder());
String srcValue = toWebCoreStringWithNullCheck(value);
@@ -51,7 +52,7 @@ ACCESSOR_SETTER(HTMLFrameElementSrc)
frame->setAttribute(srcAttr, srcValue);
}
-ACCESSOR_SETTER(HTMLFrameElementLocation)
+void V8HTMLFrameElement::locationAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
HTMLFrameElement* frame = V8DOMWrapper::convertDOMWrapperToNode<HTMLFrameElement>(info.Holder());
String locationValue = toWebCoreStringWithNullCheck(value);
diff --git a/WebCore/bindings/v8/custom/V8HTMLIFrameElementCustom.cpp b/WebCore/bindings/v8/custom/V8HTMLIFrameElementCustom.cpp
index a4863e8..5071c1f 100644
--- a/WebCore/bindings/v8/custom/V8HTMLIFrameElementCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLIFrameElementCustom.cpp
@@ -29,9 +29,10 @@
*/
#include "config.h"
+#include "V8HTMLIFrameElement.h"
+
#include "HTMLIFrameElement.h"
#include "HTMLNames.h"
-
#include "V8Binding.h"
#include "V8CustomBinding.h"
#include "V8Proxy.h"
@@ -40,7 +41,7 @@ namespace WebCore {
using namespace HTMLNames;
-ACCESSOR_SETTER(HTMLIFrameElementSrc)
+void V8HTMLIFrameElement::srcAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
HTMLIFrameElement* iframe = V8DOMWrapper::convertDOMWrapperToNode<HTMLIFrameElement>(info.Holder());
String v = toWebCoreStringWithNullCheck(value);
diff --git a/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp b/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp
index 3441bc0..3f998c5 100644
--- a/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp
@@ -39,7 +39,7 @@
namespace WebCore {
-ACCESSOR_GETTER(HTMLInputElementSelectionStart)
+v8::Handle<v8::Value> V8HTMLInputElement::selectionStartAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.HTMLInputElement.selectionStart._get");
v8::Handle<v8::Object> holder = info.Holder();
@@ -52,7 +52,7 @@ ACCESSOR_GETTER(HTMLInputElementSelectionStart)
return v8::Integer::New(v);
}
-ACCESSOR_SETTER(HTMLInputElementSelectionStart)
+void V8HTMLInputElement::selectionStartAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.HTMLInputElement.selectionStart._set");
v8::Handle<v8::Object> holder = info.Holder();
@@ -65,7 +65,7 @@ ACCESSOR_SETTER(HTMLInputElementSelectionStart)
imp->setSelectionStart(value->Int32Value());
}
-ACCESSOR_GETTER(HTMLInputElementSelectionEnd)
+v8::Handle<v8::Value> V8HTMLInputElement::selectionEndAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.HTMLInputElement.selectionEnd._get");
v8::Handle<v8::Object> holder = info.Holder();
@@ -78,7 +78,7 @@ ACCESSOR_GETTER(HTMLInputElementSelectionEnd)
return v8::Integer::New(v);
}
-ACCESSOR_SETTER(HTMLInputElementSelectionEnd)
+void V8HTMLInputElement::selectionEndAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.HTMLInputElement.selectionEnd._set");
v8::Handle<v8::Object> holder = info.Holder();
diff --git a/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp b/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp
index a84f0af..4a696f6 100644
--- a/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp
@@ -85,7 +85,7 @@ v8::Handle<v8::Value> V8HTMLOptionsCollection::addCallback(const v8::Arguments&
return v8::Undefined();
}
-ACCESSOR_GETTER(HTMLOptionsCollectionLength)
+v8::Handle<v8::Value> V8HTMLOptionsCollection::lengthAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.HTMLOptionsCollection.length._get");
HTMLOptionsCollection* imp = V8DOMWrapper::convertToNativeObject<HTMLOptionsCollection>(V8ClassIndex::HTMLOPTIONSCOLLECTION, info.Holder());
@@ -93,7 +93,7 @@ ACCESSOR_GETTER(HTMLOptionsCollectionLength)
return v8::Integer::New(v);
}
-ACCESSOR_SETTER(HTMLOptionsCollectionLength)
+void V8HTMLOptionsCollection::lengthAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.HTMLOptionsCollection.length._set");
HTMLOptionsCollection* imp = V8DOMWrapper::convertToNativeObject<HTMLOptionsCollection>(V8ClassIndex::HTMLOPTIONSCOLLECTION, info.Holder());
diff --git a/WebCore/bindings/v8/custom/V8LocationCustom.cpp b/WebCore/bindings/v8/custom/V8LocationCustom.cpp
index 9c71ad8..87541ea 100644
--- a/WebCore/bindings/v8/custom/V8LocationCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8LocationCustom.cpp
@@ -29,8 +29,16 @@
*/
#include "config.h"
-#include "Location.h"
+#include "V8Location.h"
+#include "CSSHelper.h"
+#include "Document.h"
+#include "Frame.h"
+#include "FrameLoader.h"
+#include "KURL.h"
+#include "Location.h"
+#include "PlatformString.h"
+#include "ScriptController.h"
#include "V8Binding.h"
#include "V8BindingState.h"
#include "V8CustomBinding.h"
@@ -39,14 +47,6 @@
#include "V8Utilities.h"
#include "V8Proxy.h"
-#include "PlatformString.h"
-#include "KURL.h"
-#include "Document.h"
-#include "FrameLoader.h"
-#include "ScriptController.h"
-#include "CSSHelper.h"
-#include "Frame.h"
-
namespace WebCore {
// Notes about V8/JSC porting of this file.
@@ -59,7 +59,7 @@ namespace WebCore {
// we're just making all these custom for now. The functionality is simple
// and mirrors JSLocationCustom.cpp.
-ACCESSOR_SETTER(LocationHash)
+void V8Location::hashAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Location.hash._set");
v8::Handle<v8::Object> holder = info.Holder();
@@ -82,7 +82,7 @@ ACCESSOR_SETTER(LocationHash)
navigateIfAllowed(frame, url, false, false);
}
-ACCESSOR_SETTER(LocationHost)
+void V8Location::hostAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Location.host._set");
v8::Handle<v8::Object> holder = info.Holder();
@@ -102,7 +102,7 @@ ACCESSOR_SETTER(LocationHost)
navigateIfAllowed(frame, url, false, false);
}
-ACCESSOR_SETTER(LocationHostname)
+void V8Location::hostnameAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Location.hostname._set");
v8::Handle<v8::Object> holder = info.Holder();
@@ -119,7 +119,7 @@ ACCESSOR_SETTER(LocationHostname)
navigateIfAllowed(frame, url, false, false);
}
-ACCESSOR_SETTER(LocationHref)
+void V8Location::hrefAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Location.href._set");
v8::Handle<v8::Object> holder = info.Holder();
@@ -139,7 +139,7 @@ ACCESSOR_SETTER(LocationHref)
navigateIfAllowed(frame, url, false, false);
}
-ACCESSOR_SETTER(LocationPathname)
+void V8Location::pathnameAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Location.pathname._set");
v8::Handle<v8::Object> holder = info.Holder();
@@ -156,7 +156,7 @@ ACCESSOR_SETTER(LocationPathname)
navigateIfAllowed(frame, url, false, false);
}
-ACCESSOR_SETTER(LocationPort)
+void V8Location::portAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Location.port._set");
v8::Handle<v8::Object> holder = info.Holder();
@@ -173,7 +173,7 @@ ACCESSOR_SETTER(LocationPort)
navigateIfAllowed(frame, url, false, false);
}
-ACCESSOR_SETTER(LocationProtocol)
+void V8Location::protocolAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Location.protocol._set");
v8::Handle<v8::Object> holder = info.Holder();
@@ -190,7 +190,7 @@ ACCESSOR_SETTER(LocationProtocol)
navigateIfAllowed(frame, url, false, false);
}
-ACCESSOR_SETTER(LocationSearch)
+void V8Location::searchAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Location.search._set");
v8::Handle<v8::Object> holder = info.Holder();
@@ -207,7 +207,7 @@ ACCESSOR_SETTER(LocationSearch)
navigateIfAllowed(frame, url, false, false);
}
-ACCESSOR_GETTER(LocationReload)
+v8::Handle<v8::Value> V8Location::reloadAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Location.reload._get");
static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(V8Location::reloadCallback, v8::Handle<v8::Value>(), v8::Signature::New(V8Location::GetRawTemplate())));
@@ -225,7 +225,7 @@ ACCESSOR_GETTER(LocationReload)
return privateTemplate->GetFunction();
}
-ACCESSOR_GETTER(LocationReplace)
+v8::Handle<v8::Value> V8Location::replaceAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Location.replace._get");
static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(V8Location::replaceCallback, v8::Handle<v8::Value>(), v8::Signature::New(V8Location::GetRawTemplate())));
@@ -243,7 +243,7 @@ ACCESSOR_GETTER(LocationReplace)
return privateTemplate->GetFunction();
}
-ACCESSOR_GETTER(LocationAssign)
+v8::Handle<v8::Value> V8Location::assignAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.Location.assign._get");
static v8::Persistent<v8::FunctionTemplate> privateTemplate =
diff --git a/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp b/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp
index 5c0113e..7eb10e1 100644
--- a/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp
@@ -42,7 +42,7 @@
namespace WebCore {
-ACCESSOR_GETTER(MessageEventPorts)
+v8::Handle<v8::Value> V8MessageEvent::portsAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.MessageEvent.ports");
MessageEvent* event = V8DOMWrapper::convertToNativeObject<MessageEvent>(V8ClassIndex::MESSAGEEVENT, info.Holder());
diff --git a/WebCore/bindings/v8/custom/V8NavigatorCustom.cpp b/WebCore/bindings/v8/custom/V8NavigatorCustom.cpp
deleted file mode 100644
index 6a7b209..0000000
--- a/WebCore/bindings/v8/custom/V8NavigatorCustom.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2007-2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "Navigator.h"
-
-#include "V8Binding.h"
-#include "V8CustomBinding.h"
-#include "V8Proxy.h"
-
-namespace WebCore {
-
-ACCESSOR_GETTER(NavigatorAppVersion)
-{
- INC_STATS("DOM.Navigator.appVersion");
- v8::Handle<v8::Object> holder = info.Holder();
- Navigator* navigator = V8DOMWrapper::convertToNativeObject<Navigator>(V8ClassIndex::NAVIGATOR, holder);
- return v8StringOrUndefined(navigator->appVersion());
-}
-
-} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp b/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
index 953a95d..ce345d1 100644
--- a/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
@@ -41,7 +41,7 @@
namespace WebCore {
-ACCESSOR_GETTER(SVGLengthValue)
+v8::Handle<v8::Value> V8SVGLength::valueAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.SVGLength.value");
V8SVGPODTypeWrapper<SVGLength>* wrapper = V8DOMWrapper::convertToNativeObject<V8SVGPODTypeWrapper<SVGLength> >(V8ClassIndex::SVGLENGTH, info.Holder());
diff --git a/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp b/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
index c719c7a..235fc8e 100644
--- a/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
@@ -54,13 +54,6 @@ ACCESSOR_RUNTIME_ENABLER(WorkerContextWebkitNotifications)
}
#endif
-ACCESSOR_GETTER(WorkerContextSelf)
-{
- INC_STATS(L"DOM.WorkerContext.self._get");
- WorkerContext* workerContext = V8DOMWrapper::convertDOMWrapperToNative<WorkerContext>(info.Holder());
- return WorkerContextExecutionProxy::convertWorkerContextToV8Object(workerContext);
-}
-
v8::Handle<v8::Value> SetTimeoutOrInterval(const v8::Arguments& args, bool singleShot)
{
WorkerContext* workerContext = V8DOMWrapper::convertDOMWrapperToNative<WorkerContext>(args.Holder());
diff --git a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
index 97ecd86..a75e261 100644
--- a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
@@ -45,7 +45,7 @@
namespace WebCore {
-ACCESSOR_GETTER(XMLHttpRequestResponseText)
+v8::Handle<v8::Value> V8XMLHttpRequest::responseTextAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.XMLHttpRequest.responsetext._get");
XMLHttpRequest* xmlHttpRequest = V8DOMWrapper::convertToNativeObject<XMLHttpRequest>(V8ClassIndex::XMLHTTPREQUEST, info.Holder());
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list