Diff
Modified: trunk/Source/WebCore/ChangeLog (199586 => 199587)
--- trunk/Source/WebCore/ChangeLog 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/ChangeLog 2016-04-15 14:12:50 UTC (rev 199587)
@@ -1,3 +1,55 @@
+2016-04-15 Chris Dumez <[email protected]>
+
+ Rename [GlobalContext] extended attribute to [Exposed] and align with WebIDL
+ https://bugs.webkit.org/show_bug.cgi?id=156615
+
+ Reviewed by Youenn Fablet.
+
+ Rename [GlobalContext] extended attribute to [Exposed] and align with WebIDL:
+ - http://heycam.github.io/webidl/#Exposed
+
+ * bindings/scripts/IDLAttributes.txt:
+ Stop recognizing [GlobalContext] and start recognizing [Exposed].
+
+ * bindings/scripts/IDLParser.pm:
+ (parseIdentifierList):
+ (parseExtendedAttributeRest2):
+ Add IDL parser support for having a list of identifiers as value
+ for an IDL extended attribute, e.g. Exposed=(Window, Worker).
+
+ * bindings/scripts/preprocess-idls.pl:
+ Tweak existing support for [GlobalContext] to use [Exposed] instead
+ and support the new syntax.
+
+ (getInterfaceExtendedAttributesFromIDL):
+ Do not split on commas that are within brackets.
+
+ * Modules/fetch/FetchBody.idl:
+ * Modules/fetch/FetchHeaders.idl:
+ * Modules/fetch/FetchRequest.idl:
+ * Modules/fetch/FetchResponse.idl:
+ * Modules/streams/ByteLengthQueuingStrategy.idl:
+ * Modules/streams/CountQueuingStrategy.idl:
+ * Modules/streams/ReadableStream.idl:
+ * Modules/streams/ReadableStreamController.idl:
+ * Modules/streams/ReadableStreamReader.idl:
+ * Modules/websockets/WebSocket.idl:
+ * dom/MessageChannel.idl:
+ * dom/MessageEvent.idl:
+ * fileapi/Blob.idl:
+ * fileapi/FileReader.idl:
+ * fileapi/FileReaderSync.idl:
+ * html/DOMURL.idl:
+ * html/ImageData.idl:
+ * page/EventSource.idl:
+ * workers/DedicatedWorkerGlobalScope.idl:
+ * workers/WorkerGlobalScope.idl:
+ * workers/WorkerLocation.idl:
+ * xml/XMLHttpRequest.idl:
+ * xml/XMLHttpRequestEventTarget.idl:
+ Use [Exposed] instead of [GlobalContext] to match their respective
+ specifications.
+
2016-04-15 Carlos Garcia Campos <[email protected]>
Selection.deleteFromDocument should not leave a selection character
Modified: trunk/Source/WebCore/Modules/fetch/FetchBody.idl (199586 => 199587)
--- trunk/Source/WebCore/Modules/fetch/FetchBody.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/Modules/fetch/FetchBody.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -29,7 +29,7 @@
[
Conditional=FETCH_API,
EnabledAtRuntime=FetchAPI,
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
InterfaceName=Body,
NoInterfaceObject
]
Modified: trunk/Source/WebCore/Modules/fetch/FetchHeaders.idl (199586 => 199587)
--- trunk/Source/WebCore/Modules/fetch/FetchHeaders.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/Modules/fetch/FetchHeaders.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -29,7 +29,7 @@
[
Conditional=FETCH_API,
EnabledAtRuntime=FetchAPI,
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
ImplementationLacksVTable,
InterfaceName=Headers,
JSBuiltinConstructor
Modified: trunk/Source/WebCore/Modules/fetch/FetchRequest.idl (199586 => 199587)
--- trunk/Source/WebCore/Modules/fetch/FetchRequest.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/Modules/fetch/FetchRequest.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -42,7 +42,7 @@
ConstructorRaisesException,
Constructor(FetchRequest input, [Default=Undefined] optional Dictionary init),
Constructor(DOMString input, [Default=Undefined] optional Dictionary init),
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
InterfaceName=Request
]
interface FetchRequest {
Modified: trunk/Source/WebCore/Modules/fetch/FetchResponse.idl (199586 => 199587)
--- trunk/Source/WebCore/Modules/fetch/FetchResponse.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/Modules/fetch/FetchResponse.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -32,7 +32,7 @@
Conditional=FETCH_API,
EnabledAtRuntime=FetchAPI,
ConstructorCallWith=ScriptExecutionContext,
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
InterfaceName=Response,
JSBuiltinConstructor
]
Modified: trunk/Source/WebCore/Modules/streams/ByteLengthQueuingStrategy.idl (199586 => 199587)
--- trunk/Source/WebCore/Modules/streams/ByteLengthQueuingStrategy.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/Modules/streams/ByteLengthQueuingStrategy.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -31,7 +31,7 @@
JSBuiltin,
Constructor,
Conditional=STREAMS_API,
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
] interface ByteLengthQueuingStrategy {
double size();
};
Modified: trunk/Source/WebCore/Modules/streams/CountQueuingStrategy.idl (199586 => 199587)
--- trunk/Source/WebCore/Modules/streams/CountQueuingStrategy.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/Modules/streams/CountQueuingStrategy.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -31,7 +31,7 @@
JSBuiltin,
Constructor,
Conditional=STREAMS_API,
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
] interface CountQueuingStrategy {
double size();
};
Modified: trunk/Source/WebCore/Modules/streams/ReadableStream.idl (199586 => 199587)
--- trunk/Source/WebCore/Modules/streams/ReadableStream.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/Modules/streams/ReadableStream.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -30,7 +30,7 @@
[
Conditional=STREAMS_API,
Constructor,
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
JSBuiltin
] interface ReadableStream {
Promise cancel(optional any reason);
Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamController.idl (199586 => 199587)
--- trunk/Source/WebCore/Modules/streams/ReadableStreamController.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamController.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -30,7 +30,7 @@
[
Conditional=STREAMS_API,
CustomConstructor,
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
JSBuiltin,
NoInterfaceObject
] interface ReadableStreamController {
Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamReader.idl (199586 => 199587)
--- trunk/Source/WebCore/Modules/streams/ReadableStreamReader.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamReader.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -30,7 +30,7 @@
[
Conditional=STREAMS_API,
CustomConstructor,
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
JSBuiltin,
NoInterfaceObject
] interface ReadableStreamReader {
Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.idl (199586 => 199587)
--- trunk/Source/WebCore/Modules/websockets/WebSocket.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -30,7 +30,7 @@
*/
[
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
EnabledAtRuntime,
Conditional=WEB_SOCKETS,
ActiveDOMObject,
Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (199586 => 199587)
--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt 2016-04-15 14:12:50 UTC (rev 199587)
@@ -61,11 +61,11 @@
EnabledBySetting=*
EnforceRange
ExportMacro=WEBCORE_EXPORT|WEBCORE_TESTSUPPORT_EXPORT
+Exposed=*
ForwardDeclareInHeader
GenerateIsReachable=|Impl|ImplWebGLRenderingContext|ImplDocument|ImplElementRoot|ImplFrame|ImplOwnerNodeRoot
GetterRaisesException
GetterRaisesExceptionWithMessage
-GlobalContext=DOMWindow|WorkerGlobalScope|DedicatedWorkerGlobalScope
Immutable
ImplementationLacksVTable
ImplementationNamespace=*
Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (199586 => 199587)
--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm 2016-04-15 14:12:50 UTC (rev 199587)
@@ -1073,6 +1073,19 @@
}
}
+sub parseIdentifierList
+{
+ my $self = shift;
+ my $next = $self->nextToken();
+
+ my @identifiers = ();
+ if ($next->type == IdentifierToken) {
+ push(@identifiers, $self->getToken()->value());
+ push(@identifiers, @{$self->parseIdentifiers()});
+ }
+ return @identifiers;
+}
+
sub parseIdentifiers
{
my $self = shift;
@@ -1690,6 +1703,12 @@
{
my $self = shift;
my $next = $self->nextToken();
+ if ($next->value() eq "(") {
+ $self->assertTokenValue($self->getToken(), "(", __LINE__);
+ my @arguments = $self->parseIdentifierList();
+ $self->assertTokenValue($self->getToken(), ")", __LINE__);
+ return @arguments;
+ }
if ($next->type() == IdentifierToken || $next->value() eq "::") {
my $scopedName = $self->parseScopedName();
return $self->parseExtendedAttributeRest3($scopedName);
Modified: trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl (199586 => 199587)
--- trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -115,11 +115,21 @@
my $extendedAttributes = getInterfaceExtendedAttributesFromIDL($idlFileContents);
unless ($extendedAttributes->{"NoInterfaceObject"}) {
if (!isCallbackInterfaceFromIDL($idlFileContents) || interfaceHasConstantAttribute($idlFileContents)) {
- my @globalContexts = split("&", $extendedAttributes->{"GlobalContext"} || "DOMWindow");
+ my $exposedAttribute = $extendedAttributes->{"Exposed"} || "Window";
+ $exposedAttribute = substr($exposedAttribute, 1, -1) if substr($exposedAttribute, 0, 1) eq "(";
+ my @globalContexts = split(",", $exposedAttribute);
my $attributeCode = GenerateConstructorAttribute($interfaceName, $extendedAttributes);
- $windowConstructorsCode .= $attributeCode if grep(/^DOMWindow$/, @globalContexts);
- $workerGlobalScopeConstructorsCode .= $attributeCode if grep(/^WorkerGlobalScope$/, @globalContexts);
- $dedicatedWorkerGlobalScopeConstructorsCode .= $attributeCode if grep(/^DedicatedWorkerGlobalScope$/, @globalContexts);
+ foreach my $globalContext (@globalContexts) {
+ if ($globalContext eq "Window") {
+ $windowConstructorsCode .= $attributeCode;
+ } elsif ($globalContext eq "Worker") {
+ $workerGlobalScopeConstructorsCode .= $attributeCode;
+ } elsif ($globalContext eq "DedicatedWorker") {
+ $dedicatedWorkerGlobalScopeConstructorsCode .= $attributeCode;
+ } else {
+ die "Unsupported global context '$globalContext' used in [Exposed] at $idlFile";
+ }
+ }
}
}
$supplementals{$fullPath} = [];
@@ -309,7 +319,7 @@
my $extendedAttributes = {};
if ($fileContents =~ /\[(.*)\]\s+(callback interface|interface|exception)\s+(\w+)/gs) {
- my @parts = split(',', $1);
+ my @parts = split(m/,(?![^()]*\))/, $1);
foreach my $part (@parts) {
my @keyValue = split('=', $part);
my $key = trim($keyValue[0]);
Modified: trunk/Source/WebCore/dom/MessageChannel.idl (199586 => 199587)
--- trunk/Source/WebCore/dom/MessageChannel.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/dom/MessageChannel.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -25,7 +25,7 @@
*/
[
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
Conditional=CHANNEL_MESSAGING,
Constructor,
ConstructorCallWith=ScriptExecutionContext,
Modified: trunk/Source/WebCore/dom/MessageEvent.idl (199586 => 199587)
--- trunk/Source/WebCore/dom/MessageEvent.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/dom/MessageEvent.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -26,7 +26,7 @@
*/
[
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
ConstructorTemplate=Event,
] interface MessageEvent : Event {
[InitializedByEventConstructor] readonly attribute DOMString origin;
Modified: trunk/Source/WebCore/fileapi/Blob.idl (199586 => 199587)
--- trunk/Source/WebCore/fileapi/Blob.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/fileapi/Blob.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -29,7 +29,7 @@
*/
[
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
GenerateIsReachable=Impl,
CustomToJSObject,
CustomConstructor,
Modified: trunk/Source/WebCore/fileapi/FileReader.idl (199586 => 199587)
--- trunk/Source/WebCore/fileapi/FileReader.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/fileapi/FileReader.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -30,7 +30,7 @@
*/
[
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
ActiveDOMObject,
Constructor,
ConstructorCallWith=ScriptExecutionContext,
Modified: trunk/Source/WebCore/fileapi/FileReaderSync.idl (199586 => 199587)
--- trunk/Source/WebCore/fileapi/FileReaderSync.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/fileapi/FileReaderSync.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -31,7 +31,7 @@
[
Constructor,
UsePointersEvenForNonNullableObjectArguments,
- GlobalContext=WorkerGlobalScope,
+ Exposed=Worker,
] interface FileReaderSync {
[CallWith=ScriptExecutionContext, RaisesException] ArrayBuffer readAsArrayBuffer(Blob blob);
[CallWith=ScriptExecutionContext, RaisesException] DOMString readAsBinaryString(Blob blob);
Modified: trunk/Source/WebCore/html/DOMURL.idl (199586 => 199587)
--- trunk/Source/WebCore/html/DOMURL.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/html/DOMURL.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -25,7 +25,7 @@
*/
[
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
Constructor(DOMString url),
Constructor(DOMString url, DOMString base),
Constructor(DOMString url, DOMURL base),
Modified: trunk/Source/WebCore/html/ImageData.idl (199586 => 199587)
--- trunk/Source/WebCore/html/ImageData.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/html/ImageData.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -27,7 +27,7 @@
*/
[
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
CustomToJSObject,
// FIXME: Without [Default=Undefined] CodeGeneratorJS can't generate JSImageData. But with
// the extended attribute we accept a value of 0 for sh and don't throw.
Modified: trunk/Source/WebCore/page/EventSource.idl (199586 => 199587)
--- trunk/Source/WebCore/page/EventSource.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/page/EventSource.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -30,7 +30,7 @@
*/
[
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
ActiveDOMObject,
Constructor(DOMString url, optional Dictionary eventSourceInit),
ConstructorCallWith=ScriptExecutionContext,
Modified: trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.idl (199586 => 199587)
--- trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -29,7 +29,7 @@
*/
[
- GlobalContext=DedicatedWorkerGlobalScope,
+ Exposed=DedicatedWorker,
CustomProxyToJSObject,
JSGenerateToNativeObject,
] interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.idl (199586 => 199587)
--- trunk/Source/WebCore/workers/WorkerGlobalScope.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -25,7 +25,7 @@
*/
[
- GlobalContext=WorkerGlobalScope,
+ Exposed=Worker,
CustomProxyToJSObject,
JSCustomMarkFunction,
JSCustomGetOwnPropertySlotAndDescriptor,
Modified: trunk/Source/WebCore/workers/WorkerLocation.idl (199586 => 199587)
--- trunk/Source/WebCore/workers/WorkerLocation.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/workers/WorkerLocation.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -27,7 +27,7 @@
*/
[
- GlobalContext=WorkerGlobalScope,
+ Exposed=Worker,
GenerateIsReachable=Impl,
ImplementationLacksVTable,
] interface WorkerLocation {
Modified: trunk/Source/WebCore/xml/XMLHttpRequest.idl (199586 => 199587)
--- trunk/Source/WebCore/xml/XMLHttpRequest.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -36,7 +36,7 @@
};
[
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
ActiveDOMObject,
Constructor,
ConstructorCallWith=ScriptExecutionContext,
Modified: trunk/Source/WebCore/xml/XMLHttpRequestEventTarget.idl (199586 => 199587)
--- trunk/Source/WebCore/xml/XMLHttpRequestEventTarget.idl 2016-04-15 09:07:36 UTC (rev 199586)
+++ trunk/Source/WebCore/xml/XMLHttpRequestEventTarget.idl 2016-04-15 14:12:50 UTC (rev 199587)
@@ -27,7 +27,7 @@
*/
[
- GlobalContext=DOMWindow&WorkerGlobalScope,
+ Exposed=(Window,Worker),
SuppressToJSObject,
] interface XMLHttpRequestEventTarget : EventTarget {
attribute EventHandler onloadstart;