Skip to content

Commit c786ec1

Browse files
Adding document and node support
1 parent b3ee71c commit c786ec1

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

crates/web-sys/webidls/available/Document.webidl renamed to crates/web-sys/webidls/enabled/Document.webidl

+33
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
* https://drafts.csswg.org/cssom-view/#extensions-to-the-document-interface
1515
*/
1616

17+
/*TODO
1718
interface WindowProxy;
1819
interface nsISupports;
1920
interface URI;
2021
interface nsIDocShell;
2122
interface nsILoadGroup;
2223

2324
enum VisibilityState { "hidden", "visible" };
25+
*/
2426

2527
/* https://dom.spec.whatwg.org/#dictdef-elementcreationoptions */
2628
dictionary ElementCreationOptions {
@@ -33,8 +35,11 @@ dictionary ElementCreationOptions {
3335
/* https://dom.spec.whatwg.org/#interface-document */
3436
[Constructor]
3537
interface Document : Node {
38+
39+
/*TODO
3640
[Throws]
3741
readonly attribute DOMImplementation implementation;
42+
*/
3843
[Pure, Throws, BinaryName="documentURIFromJS", NeedsCallerType]
3944
readonly attribute DOMString URL;
4045
[Pure, Throws, BinaryName="documentURIFromJS", NeedsCallerType]
@@ -54,6 +59,7 @@ interface Document : Node {
5459
readonly attribute DocumentType? doctype;
5560
[Pure]
5661
readonly attribute Element? documentElement;
62+
5763
[Pure]
5864
HTMLCollection getElementsByTagName(DOMString localName);
5965
[Pure, Throws]
@@ -73,8 +79,10 @@ interface Document : Node {
7379
Text createTextNode(DOMString data);
7480
[NewObject]
7581
Comment createComment(DOMString data);
82+
/*TODO
7683
[NewObject, Throws]
7784
ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
85+
*/
7886

7987
[CEReactions, Throws]
8088
Node importNode(Node node, optional boolean deep = false);
@@ -84,8 +92,10 @@ interface Document : Node {
8492
[NewObject, Throws, NeedsCallerType]
8593
Event createEvent(DOMString interface);
8694

95+
/*TODO
8796
[NewObject, Throws]
8897
Range createRange();
98+
*/
8999

90100
// NodeFilter.SHOW_ALL = 0xFFFFFFFF
91101
[NewObject, Throws]
@@ -100,22 +110,26 @@ interface Document : Node {
100110

101111
// These are not in the spec, but leave them for now for backwards compat.
102112
// So sort of like Gecko extensions
113+
/*TODO
103114
[NewObject, Throws]
104115
CDATASection createCDATASection(DOMString data);
105116
[NewObject, Throws]
106117
Attr createAttribute(DOMString name);
107118
[NewObject, Throws]
108119
Attr createAttributeNS(DOMString? namespace, DOMString name);
120+
*/
109121
};
110122

111123
// https://html.spec.whatwg.org/multipage/dom.html#the-document-object
112124
partial interface Document {
125+
/*TODO
113126
[PutForwards=href, Unforgeable] readonly attribute Location? location;
114127
//(HTML only) attribute DOMString domain;
115128
readonly attribute DOMString referrer;
116129
//(HTML only) attribute DOMString cookie;
117130
readonly attribute DOMString lastModified;
118131
readonly attribute DOMString readyState;
132+
*/
119133

120134
// DOM tree accessors
121135
//(Not proxy yet)getter object (DOMString name);
@@ -133,8 +147,10 @@ partial interface Document {
133147
[SameObject] readonly attribute HTMLCollection links;
134148
[SameObject] readonly attribute HTMLCollection forms;
135149
[SameObject] readonly attribute HTMLCollection scripts;
150+
/*TODO
136151
[Pure]
137152
NodeList getElementsByName(DOMString elementName);
153+
*/
138154
//(Not implemented)readonly attribute DOMElementMap cssElementMap;
139155

140156
// dynamic markup insertion
@@ -174,7 +190,9 @@ partial interface Document {
174190
* True if this document is synthetic : stand alone image, video, audio file,
175191
* etc.
176192
*/
193+
/*Non standard
177194
[Func="IsChromeOrXBL"] readonly attribute boolean mozSyntheticDocument;
195+
*/
178196
/**
179197
* Returns the script element whose script is currently being processed.
180198
*
@@ -257,17 +275,23 @@ partial interface Document {
257275
// versions have it uppercase.
258276
[LenientSetter, Unscopable, Func="nsDocument::IsUnprefixedFullscreenEnabled"]
259277
readonly attribute boolean fullscreen;
278+
/*Non standard
260279
[BinaryName="fullscreen"]
261280
readonly attribute boolean mozFullScreen;
281+
*/
262282
[LenientSetter, Func="nsDocument::IsUnprefixedFullscreenEnabled", NeedsCallerType]
263283
readonly attribute boolean fullscreenEnabled;
284+
/*Non standard
264285
[BinaryName="fullscreenEnabled", NeedsCallerType]
265286
readonly attribute boolean mozFullScreenEnabled;
287+
*/
266288

267289
[Func="nsDocument::IsUnprefixedFullscreenEnabled"]
268290
void exitFullscreen();
291+
/*Non standard
269292
[BinaryName="exitFullscreen"]
270293
void mozCancelFullScreen();
294+
*/
271295

272296
// Events handlers
273297
[Func="nsDocument::IsUnprefixedFullscreenEnabled"]
@@ -289,8 +313,11 @@ partial interface Document {
289313
// https://w3c.github.io/page-visibility/#extensions-to-the-document-interface
290314
partial interface Document {
291315
readonly attribute boolean hidden;
316+
317+
/*TODO
292318
readonly attribute VisibilityState visibilityState;
293319
attribute EventHandler onvisibilitychange;
320+
*/
294321
};
295322

296323
// https://drafts.csswg.org/cssom/#extensions-to-the-document-interface
@@ -314,8 +341,10 @@ partial interface Document {
314341
partial interface Document {
315342
[Throws, Pure]
316343
Element? querySelector(DOMString selectors);
344+
/*TODO
317345
[Throws, Pure]
318346
NodeList querySelectorAll(DOMString selectors);
347+
*/
319348

320349
//(Not implemented)Element? find(DOMString selectors, optional (Element or sequence<Node>)? refNodes);
321350
//(Not implemented)NodeList findAll(DOMString selectors, optional (Element or sequence<Node>)? refNodes);
@@ -339,6 +368,7 @@ partial interface Document {
339368
partial interface Document {
340369
// XBL support. Wish we could make these [ChromeOnly], but
341370
// that would likely break bindings running with the page principal.
371+
/*Non standard
342372
[Func="IsChromeOrXBL"]
343373
NodeList? getAnonymousNodes(Element elt);
344374
[Func="IsChromeOrXBL"]
@@ -348,6 +378,7 @@ partial interface Document {
348378
Element? getBindingParent(Node node);
349379
[Throws, Func="IsChromeOrXBL", NeedsSubjectPrincipal]
350380
void loadBindingDocument(DOMString documentURL);
381+
*/
351382

352383
// Touch bits
353384
// XXXbz I can't find the sane spec for this stuff, so just cribbing
@@ -478,10 +509,12 @@ partial interface Document {
478509
// Extension to give chrome and XBL JS the ability to determine whether
479510
// the document is sandboxed without permission to run scripts
480511
// and whether inline scripts are blocked by the document's CSP.
512+
/*Non standard
481513
partial interface Document {
482514
[Func="IsChromeOrXBL"] readonly attribute boolean hasScriptsBlockedBySandbox;
483515
[Func="IsChromeOrXBL"] readonly attribute boolean inlineScriptAllowedByCSP;
484516
};
517+
*/
485518

486519
// For more information on Flash classification, see
487520
// toolkit/components/url-classifier/flash-block-lists.rst

crates/web-sys/webidls/available/Node.webidl renamed to crates/web-sys/webidls/enabled/Node.webidl

+8
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
* liability, trademark and document use rules apply.
1111
*/
1212

13+
/*TODO
1314
interface Principal;
1415
interface URI;
16+
*/
1517

1618
interface Node : EventTarget {
1719
const unsigned short ELEMENT_NODE = 1;
@@ -38,8 +40,10 @@ interface Node : EventTarget {
3840
readonly attribute boolean isConnected;
3941
[Pure]
4042
readonly attribute Document? ownerDocument;
43+
/*TODO
4144
[Pure]
4245
Node getRootNode(optional GetRootNodeOptions options);
46+
*/
4347
[Pure]
4448
readonly attribute Node? parentNode;
4549
[Pure]
@@ -207,12 +211,16 @@ interface Node : EventTarget {
207211
[ChromeOnly, Throws]
208212
Promise<void> localize(L10nCallback l10nCallback);
209213

214+
/*Unsupported ifdef
210215
#ifdef ACCESSIBILITY
211216
[Func="mozilla::dom::AccessibleNode::IsAOMEnabled", SameObject]
212217
readonly attribute AccessibleNode? accessibleNode;
213218
#endif
219+
*/
214220
};
215221

222+
/*TODO
216223
dictionary GetRootNodeOptions {
217224
boolean composed = false;
218225
};
226+
*/

0 commit comments

Comments
 (0)