Commit 9a80bbf3 authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

IDL: Put [Exposed=Window] where it's not in Blink's renderer/core/dom

Though Web IDL spec removed [PrimaryGlobal] and made [Exposed] required [1],
many blink's IDL files have not followed it yet. So, this CL adds the keyword
to the IDL files which don't have the keyword yet in the renderer/dom
directory.

[1] https://github.com/heycam/webidl/issues/365

Bug: 963267
Change-Id: I63733c1a21476401370b2ec773c47f2a2c2ebe96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1640701Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#665455}
parent b331ef55
...@@ -19,8 +19,9 @@ ...@@ -19,8 +19,9 @@
*/ */
// https://dom.spec.whatwg.org/#interface-attr // https://dom.spec.whatwg.org/#interface-attr
[
interface Attr : Node { Exposed=Window
] interface Attr : Node {
readonly attribute DOMString? namespaceURI; readonly attribute DOMString? namespaceURI;
readonly attribute DOMString? prefix; readonly attribute DOMString? prefix;
readonly attribute DOMString localName; readonly attribute DOMString localName;
......
...@@ -19,5 +19,7 @@ ...@@ -19,5 +19,7 @@
// https://dom.spec.whatwg.org/#interface-cdatasection // https://dom.spec.whatwg.org/#interface-cdatasection
interface CDATASection : Text { [
Exposed=Window
] interface CDATASection : Text {
}; };
...@@ -18,8 +18,9 @@ ...@@ -18,8 +18,9 @@
*/ */
// https://dom.spec.whatwg.org/#interface-characterdata // https://dom.spec.whatwg.org/#interface-characterdata
[
interface CharacterData : Node { Exposed=Window
] interface CharacterData : Node {
attribute [TreatNullAs=EmptyString] DOMString data; attribute [TreatNullAs=EmptyString] DOMString data;
readonly attribute unsigned long length; readonly attribute unsigned long length;
[RaisesException] DOMString substringData(unsigned long offset, unsigned long count); [RaisesException] DOMString substringData(unsigned long offset, unsigned long count);
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
[ [
Constructor(optional DOMString data = ""), Constructor(optional DOMString data = ""),
ConstructorCallWith=Document ConstructorCallWith=Document,
Exposed=Window
] interface Comment : CharacterData { ] interface Comment : CharacterData {
}; };
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
[ [
Constructor, Constructor,
ConstructorCallWith=Document ConstructorCallWith=Document,
Exposed=Window
] interface DocumentFragment : Node { ] interface DocumentFragment : Node {
}; };
......
...@@ -19,7 +19,9 @@ ...@@ -19,7 +19,9 @@
// https://dom.spec.whatwg.org/#interface-documenttype // https://dom.spec.whatwg.org/#interface-documenttype
interface DocumentType : Node { [
Exposed=Window
] interface DocumentType : Node {
readonly attribute DOMString name; readonly attribute DOMString name;
readonly attribute DOMString publicId; readonly attribute DOMString publicId;
readonly attribute DOMString systemId; readonly attribute DOMString systemId;
......
...@@ -20,7 +20,9 @@ ...@@ -20,7 +20,9 @@
// https://dom.spec.whatwg.org/#interface-domimplementation // https://dom.spec.whatwg.org/#interface-domimplementation
interface DOMImplementation { [
Exposed=Window
] interface DOMImplementation {
[NewObject, RaisesException] DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId, DOMString systemId); [NewObject, RaisesException] DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId, DOMString systemId);
[NewObject, RaisesException] XMLDocument createDocument(DOMString? namespaceURI, [TreatNullAs=EmptyString] DOMString qualifiedName, optional DocumentType? doctype = null); [NewObject, RaisesException] XMLDocument createDocument(DOMString? namespaceURI, [TreatNullAs=EmptyString] DOMString qualifiedName, optional DocumentType? doctype = null);
// FIXME: createHTMLDocument should return a Document. crbug.com/238368 // FIXME: createHTMLDocument should return a Document. crbug.com/238368
......
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
// https://html.spec.whatwg.org/C/#the-domstringmap-interface // https://html.spec.whatwg.org/C/#the-domstringmap-interface
[ [
OverrideBuiltins OverrideBuiltins,
Exposed=Window
] interface DOMStringMap { ] interface DOMStringMap {
[ImplementedAs=item] getter DOMString (DOMString name); [ImplementedAs=item] getter DOMString (DOMString name);
[CEReactions, RaisesException] setter void (DOMString name, DOMString value); [CEReactions, RaisesException] setter void (DOMString name, DOMString value);
......
...@@ -26,7 +26,9 @@ callback ScrollStateCallback = void (ScrollState scrollState); ...@@ -26,7 +26,9 @@ callback ScrollStateCallback = void (ScrollState scrollState);
// https://dom.spec.whatwg.org/#interface-element // https://dom.spec.whatwg.org/#interface-element
interface Element : Node { [
Exposed=Window
] interface Element : Node {
readonly attribute DOMString? namespaceURI; readonly attribute DOMString? namespaceURI;
readonly attribute DOMString? prefix; readonly attribute DOMString? prefix;
readonly attribute DOMString localName; readonly attribute DOMString localName;
......
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
// https://w3c.github.io/requestidlecallback/#window_extensions // https://w3c.github.io/requestidlecallback/#window_extensions
interface IdleDeadline { [
Exposed=Window
] interface IdleDeadline {
double timeRemaining(); double timeRemaining();
readonly attribute boolean didTimeout; readonly attribute boolean didTimeout;
}; };
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
// https://dom.spec.whatwg.org/#interface-mutationrecord // https://dom.spec.whatwg.org/#interface-mutationrecord
interface MutationRecord { [
Exposed=Window
] interface MutationRecord {
readonly attribute DOMString type; readonly attribute DOMString type;
readonly attribute Node target; readonly attribute Node target;
[SameObject] readonly attribute NodeList addedNodes; [SameObject] readonly attribute NodeList addedNodes;
......
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
// https://dom.spec.whatwg.org/#interface-namednodemap // https://dom.spec.whatwg.org/#interface-namednodemap
[ [
LegacyUnenumerableNamedProperties LegacyUnenumerableNamedProperties,
Exposed=Window
] interface NamedNodeMap { ] interface NamedNodeMap {
[Affects=Nothing] readonly attribute unsigned long length; [Affects=Nothing] readonly attribute unsigned long length;
[Affects=Nothing, MeasureAs=NamedNodeMapItem] getter Attr? item(unsigned long index); [Affects=Nothing, MeasureAs=NamedNodeMapItem] getter Attr? item(unsigned long index);
......
...@@ -20,7 +20,9 @@ ...@@ -20,7 +20,9 @@
// https://dom.spec.whatwg.org/#interface-node // https://dom.spec.whatwg.org/#interface-node
interface Node : EventTarget { [
Exposed=Window
] interface Node : EventTarget {
const unsigned short ELEMENT_NODE = 1; const unsigned short ELEMENT_NODE = 1;
const unsigned short ATTRIBUTE_NODE = 2; const unsigned short ATTRIBUTE_NODE = 2;
const unsigned short TEXT_NODE = 3; const unsigned short TEXT_NODE = 3;
......
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
// https://dom.spec.whatwg.org/#interface-nodefilter // https://dom.spec.whatwg.org/#interface-nodefilter
[ [
DoNotCheckConstants DoNotCheckConstants,
Exposed=Window
] callback interface NodeFilter { ] callback interface NodeFilter {
// Constants for acceptNode() // Constants for acceptNode()
const unsigned short FILTER_ACCEPT = 1; const unsigned short FILTER_ACCEPT = 1;
......
...@@ -20,7 +20,9 @@ ...@@ -20,7 +20,9 @@
// https://dom.spec.whatwg.org/#interface-nodeiterator // https://dom.spec.whatwg.org/#interface-nodeiterator
interface NodeIterator { [
Exposed=Window
] interface NodeIterator {
[SameObject] readonly attribute Node root; [SameObject] readonly attribute Node root;
readonly attribute Node referenceNode; readonly attribute Node referenceNode;
readonly attribute boolean pointerBeforeReferenceNode; readonly attribute boolean pointerBeforeReferenceNode;
......
...@@ -20,7 +20,9 @@ ...@@ -20,7 +20,9 @@
// https://dom.spec.whatwg.org/#interface-nodelist // https://dom.spec.whatwg.org/#interface-nodelist
interface NodeList { [
Exposed=Window
] interface NodeList {
[Affects=Nothing] getter Node? item(unsigned long index); [Affects=Nothing] getter Node? item(unsigned long index);
[Affects=Nothing] readonly attribute unsigned long length; [Affects=Nothing] readonly attribute unsigned long length;
iterable<Node>; iterable<Node>;
......
...@@ -20,7 +20,9 @@ ...@@ -20,7 +20,9 @@
// https://dom.spec.whatwg.org/#interface-processinginstruction // https://dom.spec.whatwg.org/#interface-processinginstruction
interface ProcessingInstruction : CharacterData { [
Exposed=Window
] interface ProcessingInstruction : CharacterData {
readonly attribute DOMString target; readonly attribute DOMString target;
// ProcessingInstruction includes LinkStyle // ProcessingInstruction includes LinkStyle
......
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
// https://dom.spec.whatwg.org/#interface-range // https://dom.spec.whatwg.org/#interface-range
[ [
Constructor, Constructor,
ConstructorCallWith=Document ConstructorCallWith=Document,
Exposed=Window
] interface Range { ] interface Range {
readonly attribute Node startContainer; readonly attribute Node startContainer;
readonly attribute unsigned long startOffset; readonly attribute unsigned long startOffset;
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
callback TaskQueuePostCallback = void (); callback TaskQueuePostCallback = void ();
[RuntimeEnabled=ScriptedTaskQueue] interface ScriptedTaskQueue { [
RuntimeEnabled=ScriptedTaskQueue,
Exposed=Window
] interface ScriptedTaskQueue {
[CallWith=ScriptState] Promise<any> postTask(TaskQueuePostCallback callback, optional AbortSignal signal = null); [CallWith=ScriptState] Promise<any> postTask(TaskQueuePostCallback callback, optional AbortSignal signal = null);
}; };
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
enum MainThreadTaskQueueType { "user-interaction", "best-effort" }; enum MainThreadTaskQueueType { "user-interaction", "best-effort" };
[RuntimeEnabled=ScriptedTaskQueue] interface ScriptedTaskQueueController { [
RuntimeEnabled=ScriptedTaskQueue,
Exposed=Window
] interface ScriptedTaskQueueController {
[ImplementedAs=defaultQueue] ScriptedTaskQueue default(MainThreadTaskQueueType queue_type); [ImplementedAs=defaultQueue] ScriptedTaskQueue default(MainThreadTaskQueueType queue_type);
}; };
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
// https://w3c.github.io/staticrange/#interface-staticrange // https://w3c.github.io/staticrange/#interface-staticrange
interface StaticRange { [
Exposed=Window
] interface StaticRange {
readonly attribute Node startContainer; readonly attribute Node startContainer;
readonly attribute unsigned long startOffset; readonly attribute unsigned long startOffset;
readonly attribute Node endContainer; readonly attribute Node endContainer;
......
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
[ [
Constructor(optional DOMString data = ""), Constructor(optional DOMString data = ""),
ConstructorCallWith=Document ConstructorCallWith=Document,
Exposed=Window
] interface Text : CharacterData { ] interface Text : CharacterData {
[NewObject, DoNotTestNewObject, RaisesException] Text splitText(unsigned long offset); [NewObject, DoNotTestNewObject, RaisesException] Text splitText(unsigned long offset);
[MeasureAs=TextWholeText] readonly attribute DOMString wholeText; [MeasureAs=TextWholeText] readonly attribute DOMString wholeText;
......
...@@ -20,7 +20,9 @@ ...@@ -20,7 +20,9 @@
// https://dom.spec.whatwg.org/#interface-treewalker // https://dom.spec.whatwg.org/#interface-treewalker
interface TreeWalker { [
Exposed=Window
] interface TreeWalker {
[SameObject] readonly attribute Node root; [SameObject] readonly attribute Node root;
readonly attribute unsigned long whatToShow; readonly attribute unsigned long whatToShow;
readonly attribute NodeFilter? filter; readonly attribute NodeFilter? filter;
......
...@@ -25,5 +25,7 @@ ...@@ -25,5 +25,7 @@
// https://dom.spec.whatwg.org/#xmldocument // https://dom.spec.whatwg.org/#xmldocument
interface XMLDocument : Document { [
Exposed=Window
] interface XMLDocument : Document {
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment