top level:
Conditionalize cross-document messaging support
The cross-document messaging parts of HTML 5 are in flux and we want
ports to be able to turn off the support as needed.
Note that the support is turned off by default right now. A subsequent
commit will turn it on by default.
Reviewed by Darin.
* configure.ac:
WebCore:
Conditionalize cross-document messaging support
The cross-document messaging parts of HTML 5 are in flux and we want
ports to be able to turn off the support as needed.
Note that the support is turned off by default right now. A subsequent
commit will turn it on by default.
Reviewed by Darin.
* GNUmakefile.am:
* WebCore.vcproj/build-generated-files.sh:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::customGetOwnPropertySlot):
* bindings/js/JSEventCustom.cpp:
(WebCore::toJS):
* dom/Event.cpp:
(WebCore::Event::isMessageEvent):
* dom/Event.h:
* dom/MessageEvent.cpp:
* dom/MessageEvent.h:
* dom/MessageEvent.idl:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessage):
* page/DOMWindow.h:
* page/DOMWindow.idl:
WebKitTools:
Conditionalize cross-document messaging support
The cross-document messaging parts of HTML 5 are in flux and we want
ports to be able to turn off the support as needed.
Note that the support is turned off by default right now. A subsequent
commit will turn it on by default.
Reviewed by Darin.
* Scripts/build-webkit:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@30269
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2008-02-14 Adam Roben <aroben@apple.com>
+
+ Conditionalize cross-document messaging support
+
+ The cross-document messaging parts of HTML 5 are in flux and we want
+ ports to be able to turn off the support as needed.
+
+ Note that the support is turned off by default right now. A subsequent
+ commit will turn it on by default.
+
+ Reviewed by Darin.
+
+ * configure.ac:
+
2008-02-12 Rodney Dawes <dobey@wayofthemonkey.com>
Reviewed by Alp Toker.
* storage/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::deleteDatabaseFile):
+2008-02-14 Adam Roben <aroben@apple.com>
+
+ Conditionalize cross-document messaging support
+
+ The cross-document messaging parts of HTML 5 are in flux and we want
+ ports to be able to turn off the support as needed.
+
+ Note that the support is turned off by default right now. A subsequent
+ commit will turn it on by default.
+
+ Reviewed by Darin.
+
+ * GNUmakefile.am:
+ * WebCore.vcproj/build-generated-files.sh:
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::JSDOMWindow::customGetOwnPropertySlot):
+ * bindings/js/JSEventCustom.cpp:
+ (WebCore::toJS):
+ * dom/Event.cpp:
+ (WebCore::Event::isMessageEvent):
+ * dom/Event.h:
+ * dom/MessageEvent.cpp:
+ * dom/MessageEvent.h:
+ * dom/MessageEvent.idl:
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::postMessage):
+ * page/DOMWindow.h:
+ * page/DOMWindow.idl:
+
2008-02-14 Adam Roben <aroben@apple.com>
Improve the efficiency of SecurityOriginHash
endif # END USE_CURL
+# ----
+# Cross-document messaging support
+# ----
+
+if ENABLE_CROSS_DOCUMENT_MESSAGING
+FEATURE_DEFINES_JAVASCRIPT += ENABLE_CROSS_DOCUMENT_MESSAGING=1
+
+webcore_built_sources += \
+ DerivedSources/JSMessageEvent.h
+ DerivedSources/JSMessageEvent.cpp
+
+IDL_BINDINGS += \
+ WebCore/dom/MessageEvent.idl
+
+webcore_cppflags += \
+ -DENABLE_CROSS_DOCUMENT_MESSAGING=1
+
+endif # END ENABLE_CROSS_DOCUMENT_MESSAGING
+
# ----
# Database Support
# ----
cd "${BUILT_PRODUCTS_DIR}/DerivedSources"
export WebCore="${XSRCROOT}"
-export FEATURE_DEFINES="ENABLE_DATABASE ENABLE_ICONDATABASE ENABLE_XPATH ENABLE_SVG ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_AS_IMAGE ENABLE_SVG_USE ENABLE_VIDEO"
+export FEATURE_DEFINES="ENABLE_CROSS_DOCUMENT_MESSAGING ENABLE_DATABASE ENABLE_ICONDATABASE ENABLE_XPATH ENABLE_SVG ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_AS_IMAGE ENABLE_SVG_USE ENABLE_VIDEO"
make -f "$WebCore/DerivedSources.make" -j ${NUMCPUS} || exit 1
&& (entry->value.functionValue == jsDOMWindowPrototypeFunctionBlur
|| entry->value.functionValue == jsDOMWindowPrototypeFunctionClose
|| entry->value.functionValue == jsDOMWindowPrototypeFunctionFocus
- || entry->value.functionValue == jsDOMWindowPrototypeFunctionPostMessage)) {
+#if ENABLE(CROSS_DOCUMENT_MESSAGING)
+ || entry->value.functionValue == jsDOMWindowPrototypeFunctionPostMessage
+#endif
+ )) {
if (!allowsAccess) {
slot.setStaticEntry(this, entry, nonCachingStaticFunctionGetter);
return true;
return false;
}
+#if ENABLE(CROSS_DOCUMENT_MESSAGING)
JSValue* JSDOMWindow::postMessage(ExecState* exec, const List& args)
{
DOMWindow* window = impl();
return jsUndefined();
}
+#endif
} // namespace WebCore
ret = new JSMutationEvent(JSMutationEventPrototype::self(exec), static_cast<MutationEvent*>(event));
else if (event->isOverflowEvent())
ret = new JSOverflowEvent(JSOverflowEventPrototype::self(exec), static_cast<OverflowEvent*>(event));
+#if ENABLE(CROSS_DOCUMENT_MESSAGING)
else if (event->isMessageEvent())
ret = new JSMessageEvent(JSMessageEventPrototype::self(exec), static_cast<MessageEvent*>(event));
+#endif
else if (event->isProgressEvent())
ret = new JSProgressEvent(JSProgressEventPrototype::self(exec), static_cast<ProgressEvent*>(event));
else
return false;
}
+#if ENABLE(CROSS_DOCUMENT_MESSAGING)
bool Event::isMessageEvent() const
{
return false;
}
+#endif
bool Event::isBeforeTextInsertedEvent() const
{
virtual bool isTextEvent() const;
virtual bool isDragEvent() const; // a subset of mouse events
virtual bool isClipboardEvent() const;
+#if ENABLE(CROSS_DOCUMENT_MESSAGING)
virtual bool isMessageEvent() const;
+#endif
virtual bool isWheelEvent() const;
virtual bool isBeforeTextInsertedEvent() const;
virtual bool isOverflowEvent() const;
#include "config.h"
+#if ENABLE(CROSS_DOCUMENT_MESSAGING)
+
#include "DOMWindow.h"
#include "EventNames.h"
#include "MessageEvent.h"
}
} // namespace WebCore
+
+#endif // ENABLE(CROSS_DOCUMENT_MESSAGING)
#ifndef MessageEvent_h
#define MessageEvent_h
+#if ENABLE(CROSS_DOCUMENT_MESSAGING)
+
#include "Event.h"
namespace WebCore {
} // namespace WebCore
+#endif // ENABLE(CROSS_DOCUMENT_MESSAGING)
+
#endif // MessageEvent_h
module events {
- interface [GenerateConstructor] MessageEvent : Event {
+ interface [Conditional=CROSS_DOCUMENT_MESSAGING,GenerateConstructor] MessageEvent : Event {
readonly attribute DOMString data;
readonly attribute DOMString domain;
return m_console.get();
}
+#if ENABLE(CROSS_DOCUMENT_MESSAGING)
void DOMWindow::postMessage(const String& message, const String& domain, const String& uri, DOMWindow* source) const
{
ExceptionCode ec;
document()->dispatchEvent(new MessageEvent(message, domain, uri, source), ec, true);
}
+#endif
DOMSelection* DOMWindow::getSelection()
{
Console* console() const;
+#if ENABLE(CROSS_DOCUMENT_MESSAGING)
void postMessage(const String& message, const String& domain, const String& uri, DOMWindow* source) const;
+#endif
void scrollBy(int x, int y) const;
void scrollTo(int x, int y) const;
attribute [Replaceable] Console console;
+#if defined(ENABLE_CROSS_DOCUMENT_MESSAGING)
// cross-document messaging
[DoNotCheckDomainSecurity, Custom] void postMessage(in DOMString message);
+#endif
#if defined(LANGUAGE_JAVASCRIPT)
// Global constructors
attribute HTMLUListElementConstructor HTMLUListElement;
attribute EventConstructor Event;
- attribute MessageEventConstructor MessageEvent;
attribute KeyboardEventConstructor KeyboardEvent;
attribute MouseEventConstructor MouseEvent;
attribute MutationEventConstructor MutationEvent;
attribute XMLHttpRequestExceptionConstructor XMLHttpRequestException;
+#if defined(ENABLE_CROSS_DOCUMENT_MESSAGING)
+ attribute MessageEventConstructor MessageEvent;
+#endif
+
#if defined(ENABLE_VIDEO)
attribute HTMLAudioElementConstructor HTMLAudioElement;
attribute HTMLMediaElementConstructor HTMLMediaElement;
+2008-02-14 Adam Roben <aroben@apple.com>
+
+ Conditionalize cross-document messaging support
+
+ The cross-document messaging parts of HTML 5 are in flux and we want
+ ports to be able to turn off the support as needed.
+
+ Note that the support is turned off by default right now. A subsequent
+ commit will turn it on by default.
+
+ Reviewed by Darin.
+
+ * Scripts/build-webkit:
+
2008-02-14 Darin Adler <darin@apple.com>
- fix Windows build
my $originalWorkingDirectory = getcwd();
+my $crossDocumentMessagingSupport = 0;
my $databaseSupport = 1;
my $iconDatabaseSupport = 1;
my $svgSupport = 1;
my $usage = <<EOF;
Usage: $programName [options] [options to pass to build system]
--help Show this help message
+ --[no-]cross-document-messaging Toggle cross-document messaging support (default: $crossDocumentMessagingSupport)
--[no-]database Toggle Database Support (default: $databaseSupport)
--[no-]icon-database Toggle Icon database support (default: $iconDatabaseSupport)
--[no-]svg Toggle SVG support (default: $svgSupport)
--[no-]coverage Toggle code coverage support (default: $coverageSupport)
EOF
-GetOptions('database!' => \$databaseSupport,
+GetOptions('cross-document-messaging!' => \$crossDocumentMessagingSupport,
+ 'database!' => \$databaseSupport,
'icon-database!' => \$iconDatabaseSupport,
'svg!' => \$svgSupport,
'svg-experimental!' => \$svgExperimentalSupport,
my $productDir = productDir();
my @overrideFeatureDefinesOption = ();
+push @overrideFeatureDefinesOption, "ENABLE_CROSS_DOCUMENT_MESSAGIN" if $crossDocumentMessagingSupport;
push @overrideFeatureDefinesOption, "ENABLE_DATABASE" if $databaseSupport;
push @overrideFeatureDefinesOption, "ENABLE_ICONDATABASE" if $iconDatabaseSupport;
push @overrideFeatureDefinesOption, "ENABLE_SVG" if $svgSupport;
# enable autotool options accordingly
if ($ENV{WEBKITAUTOTOOLS}) {
+ push @options, autotoolsFlag($crossDocumentMessagingSupport, "cross-document-messaging");
push @options, autotoolsFlag($databaseSupport, "database");
push @options, autotoolsFlag($iconDatabaseSupport, "icon-database");
push @options, autotoolsFlag($svgSupport, "svg");
[],[enable_debug="no"])
AC_MSG_RESULT([$enable_debug])
+# check whether to build with cross-document messaging support
+AC_MSG_CHECKING([whether to enable HTML5 client-side storage support])
+AC_ARG_ENABLE(cross_document_messaging,
+ AC_HELP_STRING([--enable-cross-document-messaging],
+ [enable HTML5 cross-document messaging support [default=no]]),
+ [],[enable_cross_document_messaging="no"])
+AC_MSG_RESULT([$enable_cross_document_messaging])
+
# check whether to build with database support
AC_MSG_CHECKING([whether to enable HTML5 client-side storage support])
AC_ARG_ENABLE(database,
# WebKit feature conditionals
AM_CONDITIONAL([ENABLE_DEBUG],[test "$enable_debug" = "yes"])
+AM_CONDITIONAL([ENABLE_CROSS_DOCUMENT_MESSAGING],[test "$enable_cross_document_messaging" = "yes"])
AM_CONDITIONAL([ENABLE_DATABASE],[test "$enable_database" = "yes"])
AM_CONDITIONAL([ENABLE_ICONDATABASE],[test "$enable_icon_database" = "yes"])
AM_CONDITIONAL([ENABLE_XPATH],[test "$enable_xpath" = "yes"])
Enable debug : $enable_debug
Code coverage support : $enable_coverage
Optimized memory allocator : $enable_fast_malloc
+ HTML5 cross-document messaging : $enable_cross_document_messaging
HTML5 client-side storage support : $enable_database
HTML5 video element support : $enable_video
Icon database support : $enable_icon_database