Skip to content

Commit

Permalink
Comment out unimplemented IDL, plus minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic committed Jan 7, 2016
1 parent 36c0f4b commit 6d54df2
Show file tree
Hide file tree
Showing 51 changed files with 235 additions and 264 deletions.
3 changes: 0 additions & 3 deletions lib/jsdom/living/nodes/Document-impl.js
Expand Up @@ -440,9 +440,6 @@ class DocumentImpl extends NodeImpl {
get referrer() {
return this._referrer || "";
}
get domain() {
return "";
}
get images() {
return this.getElementsByTagName("IMG");
}
Expand Down
70 changes: 35 additions & 35 deletions lib/jsdom/living/nodes/Document.idl
Expand Up @@ -4,7 +4,7 @@ interface Document : Node {
[SameObject] readonly attribute DOMImplementation implementation;
readonly attribute DOMString URL;
readonly attribute DOMString documentURI;
readonly attribute DOMString origin;
// readonly attribute DOMString origin;
readonly attribute DOMString compatMode;
readonly attribute DOMString characterSet;
readonly attribute DOMString charset; // historical alias of .characterSet
Expand All @@ -25,63 +25,63 @@ interface Document : Node {
[NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);

[NewObject] Node importNode(Node node, optional boolean deep = false);
Node adoptNode(Node node);
// Node adoptNode(Node node);

[NewObject] Attr createAttribute(DOMString localName);
[NewObject] Attr createAttributeNS(DOMString? namespace, DOMString qualifiedName);

[NewObject] Event createEvent(DOMString interface);

[NewObject] Range createRange();
// [NewObject] Range createRange();

// NodeFilter.SHOW_ALL = 0xFFFFFFFF
[NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
[NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
// [NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); // implemented in node-iterator.js; TODO move to Document-impl.js
// [NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
};

[OverrideBuiltins]
partial /*sealed*/ interface Document {
// resource metadata management
[PutForwards=href, Unforgeable] readonly attribute Location? location;
attribute DOMString domain;
// attribute DOMString domain;
readonly attribute DOMString referrer;
attribute DOMString cookie;
readonly attribute DOMString lastModified;
// readonly attribute DOMString lastModified;
readonly attribute DocumentReadyState readyState;

// DOM tree accessors
getter object (DOMString name);
// getter object (DOMString name);
attribute DOMString title;
attribute DOMString dir;
// attribute DOMString dir;
attribute HTMLElement? body;
readonly attribute HTMLHeadElement? head;
[SameObject] readonly attribute HTMLCollection images;
[SameObject] readonly attribute HTMLCollection embeds;
[SameObject] readonly attribute HTMLCollection plugins;
// [SameObject] readonly attribute HTMLCollection embeds;
// [SameObject] readonly attribute HTMLCollection plugins;
[SameObject] readonly attribute HTMLCollection links;
[SameObject] readonly attribute HTMLCollection forms;
[SameObject] readonly attribute HTMLCollection scripts;
// [SameObject] readonly attribute HTMLCollection scripts;
NodeList getElementsByName(DOMString elementName);
readonly attribute HTMLScriptElement? currentScript;

// dynamic markup insertion
Document open(optional DOMString type = "text/html", optional DOMString replace = "");
WindowProxy open(DOMString url, DOMString name, DOMString features, optional boolean replace = false);
// WindowProxy open(DOMString url, DOMString name, DOMString features, optional boolean replace = false);
void close();
void write(DOMString... text);
void writeln(DOMString... text);

// user interaction
readonly attribute WindowProxy? defaultView;
readonly attribute Element? activeElement;
// unimplemented: boolean hasFocus();
attribute DOMString designMode;
boolean execCommand(DOMString commandId, optional boolean showUI = false, optional DOMString value = "");
boolean queryCommandEnabled(DOMString commandId);
boolean queryCommandIndeterm(DOMString commandId);
boolean queryCommandState(DOMString commandId);
boolean queryCommandSupported(DOMString commandId);
DOMString queryCommandValue(DOMString commandId);
// boolean hasFocus();
// attribute DOMString designMode;
// boolean execCommand(DOMString commandId, optional boolean showUI = false, optional DOMString value = "");
// boolean queryCommandEnabled(DOMString commandId);
// boolean queryCommandIndeterm(DOMString commandId);
// boolean queryCommandState(DOMString commandId);
// boolean queryCommandSupported(DOMString commandId);
// DOMString queryCommandValue(DOMString commandId);

// special event handler IDL attributes that only apply to Document objects
[LenientThis] attribute EventHandler onreadystatechange;
Expand All @@ -91,27 +91,27 @@ partial /*sealed*/ interface Document {
Document implements GlobalEventHandlers;

partial interface Document {
[TreatNullAs=EmptyString] attribute DOMString fgColor;
[TreatNullAs=EmptyString] attribute DOMString linkColor;
[TreatNullAs=EmptyString] attribute DOMString vlinkColor;
[TreatNullAs=EmptyString] attribute DOMString alinkColor;
[TreatNullAs=EmptyString] attribute DOMString bgColor;
// [TreatNullAs=EmptyString] attribute DOMString fgColor;
// [TreatNullAs=EmptyString] attribute DOMString linkColor;
// [TreatNullAs=EmptyString] attribute DOMString vlinkColor;
// [TreatNullAs=EmptyString] attribute DOMString alinkColor;
// [TreatNullAs=EmptyString] attribute DOMString bgColor;

[SameObject] readonly attribute HTMLCollection anchors;
[SameObject] readonly attribute HTMLCollection applets;

void clear();
void captureEvents();
void releaseEvents();
// void clear();
// void captureEvents();
// void releaseEvents();

[SameObject] readonly attribute HTMLAllCollection all;
// [SameObject] readonly attribute HTMLAllCollection all;
};

partial interface Document {
[SameObject] readonly attribute StyleSheetList styleSheets;
attribute DOMString? selectedStyleSheetSet;
readonly attribute DOMString? lastStyleSheetSet;
readonly attribute DOMString? preferredStyleSheetSet;
readonly attribute FrozenArray<DOMString> styleSheetSets;
void enableStyleSheetsForSet(DOMString? name);
// attribute DOMString? selectedStyleSheetSet;
// readonly attribute DOMString? lastStyleSheetSet;
// readonly attribute DOMString? preferredStyleSheetSet;
// readonly attribute FrozenArray<DOMString> styleSheetSets;
// void enableStyleSheetsForSet(DOMString? name);
};
8 changes: 0 additions & 8 deletions lib/jsdom/living/nodes/Element-impl.js
Expand Up @@ -86,14 +86,6 @@ class ElementImpl extends NodeImpl {
return qualifiedName;
}

get id() {
const idAttr = this.getAttribute("id");
if (idAttr === null) {
return "";
}
return idAttr;
}

get attributes() {
return this._attributes;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/jsdom/living/nodes/Element.idl
Expand Up @@ -11,7 +11,7 @@ interface Element : Node {

boolean hasAttributes();
[SameObject] readonly attribute NamedNodeMap attributes;
sequence<DOMString> getAttributeNames();
// sequence<DOMString> getAttributeNames();
DOMString? getAttribute(DOMString qualifiedName);
DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
void setAttribute(DOMString qualifiedName, DOMString value);
Expand All @@ -27,7 +27,7 @@ interface Element : Node {
Attr? setAttributeNodeNS(Attr attr);
Attr removeAttributeNode(Attr attr);

Element? closest(DOMString selectors);
// Element? closest(DOMString selectors);
boolean matches(DOMString selectors);
boolean webkitMatchesSelector(DOMString selectors); // historical alias of .matches

Expand All @@ -41,5 +41,5 @@ partial interface Element {
attribute DOMString innerHTML;
[TreatNullAs=EmptyString]
attribute DOMString outerHTML;
void insertAdjacentHTML (DOMString position, DOMString text);
// void insertAdjacentHTML (DOMString position, DOMString text);
};
2 changes: 1 addition & 1 deletion lib/jsdom/living/nodes/ElementCSSInlineStyle.idl
@@ -1,6 +1,6 @@
[NoInterfaceObject]
interface ElementCSSInlineStyle {
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style; // TODO: implement in ElementCSSInlineStyle-impl.js instead of in HTMLElement-impl.js
};

HTMLElement implements ElementCSSInlineStyle;
Expand Down
4 changes: 2 additions & 2 deletions lib/jsdom/living/nodes/ElementContentEditable.idl
@@ -1,5 +1,5 @@
[NoInterfaceObject]
interface ElementContentEditable {
attribute DOMString contentEditable;
readonly attribute boolean isContentEditable;
// attribute DOMString contentEditable;
// readonly attribute boolean isContentEditable;
};
6 changes: 3 additions & 3 deletions lib/jsdom/living/nodes/HTMLAnchorElement.idl
@@ -1,13 +1,13 @@
interface HTMLAnchorElement : HTMLElement {
[Reflect] attribute DOMString target;
[Reflect] attribute DOMString download;
[PutForwards=value] readonly attribute DOMSettableTokenList ping;
// [PutForwards=value] readonly attribute DOMSettableTokenList ping;
[Reflect] attribute DOMString rel;
readonly attribute DOMTokenList relList;
// readonly attribute DOMTokenList relList;
[Reflect] attribute DOMString hreflang;
[Reflect] attribute DOMString type;

attribute DOMString text;
// attribute DOMString text;

// also has obsolete members
};
Expand Down
6 changes: 3 additions & 3 deletions lib/jsdom/living/nodes/HTMLAreaElement.idl
Expand Up @@ -3,10 +3,10 @@ interface HTMLAreaElement : HTMLElement {
[Reflect] attribute DOMString coords;
[Reflect] attribute DOMString shape;
[Reflect] attribute DOMString target;
attribute DOMString download;
[PutForwards=value] readonly attribute DOMSettableTokenList ping;
// attribute DOMString download;
// [PutForwards=value] readonly attribute DOMSettableTokenList ping;
[Reflect] attribute DOMString rel;
readonly attribute DOMTokenList relList;
// readonly attribute DOMTokenList relList;

// also has obsolete members
};
Expand Down
22 changes: 11 additions & 11 deletions lib/jsdom/living/nodes/HTMLButtonElement.idl
Expand Up @@ -2,22 +2,22 @@ interface HTMLButtonElement : HTMLElement {
[Reflect] attribute boolean autofocus;
[Reflect] attribute boolean disabled;
readonly attribute HTMLFormElement? form;
attribute DOMString formAction;
attribute DOMString formEnctype;
attribute DOMString formMethod;
// attribute DOMString formAction;
// attribute DOMString formEnctype;
// attribute DOMString formMethod;
[Reflect] attribute boolean formNoValidate;
[Reflect] attribute DOMString formTarget;
[Reflect] attribute DOMString name;
attribute DOMString type;
[Reflect] attribute DOMString value;
attribute HTMLMenuElement? menu;
// attribute HTMLMenuElement? menu;

readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
boolean reportValidity();
void setCustomValidity(DOMString error);
// readonly attribute boolean willValidate;
// readonly attribute ValidityState validity;
// readonly attribute DOMString validationMessage;
// boolean checkValidity();
// boolean reportValidity();
// void setCustomValidity(DOMString error);

[SameObject] readonly attribute NodeList labels;
// [SameObject] readonly attribute NodeList labels;
};
4 changes: 2 additions & 2 deletions lib/jsdom/living/nodes/HTMLCanvasElement.idl
Expand Up @@ -6,8 +6,8 @@ interface HTMLCanvasElement : HTMLElement {
boolean probablySupportsContext(DOMString contextId, any... arguments);

void setContext(RenderingContext context);
CanvasProxy transferControlToProxy();
// CanvasProxy transferControlToProxy();

DOMString toDataURL(optional DOMString type, any... arguments);
void toBlob(BlobCallback _callback, optional DOMString type, any... arguments);
// void toBlob(BlobCallback _callback, optional DOMString type, any... arguments);
};
2 changes: 1 addition & 1 deletion lib/jsdom/living/nodes/HTMLDataListElement.idl
@@ -1,3 +1,3 @@
interface HTMLDataListElement : HTMLElement {
[SameObject] readonly attribute HTMLCollection options;
// [SameObject] readonly attribute HTMLCollection options;
};
8 changes: 4 additions & 4 deletions lib/jsdom/living/nodes/HTMLDialogElement.idl
@@ -1,7 +1,7 @@
interface HTMLDialogElement : HTMLElement {
[Reflect] attribute boolean open;
attribute DOMString returnValue;
void show(optional (MouseEvent or Element) anchor);
void showModal(optional (MouseEvent or Element) anchor);
void close(optional DOMString returnValue);
// attribute DOMString returnValue;
// void show(optional (MouseEvent or Element) anchor);

This comment has been minimized.

Copy link
@algoORgoal

algoORgoal Mar 29, 2024

What made you you add these changes? HTMLDialogElement is not supported.

// void showModal(optional (MouseEvent or Element) anchor);
// void close(optional DOMString returnValue);
};
2 changes: 1 addition & 1 deletion lib/jsdom/living/nodes/HTMLElement-impl.js
Expand Up @@ -81,6 +81,7 @@ class HTMLElementImpl extends ElementImpl {
super._attrModified.apply(this, arguments);
}

// TODO this should be [Reflect]able if we added default value support to webidl2js's [Reflect]
get tabIndex() {
if (!this.hasAttribute("tabindex")) {
return -1;
Expand All @@ -91,7 +92,6 @@ class HTMLElementImpl extends ElementImpl {
set tabIndex(value) {
this.setAttribute("tabIndex", String(value));
}
// TODO
}

module.exports = {
Expand Down
19 changes: 9 additions & 10 deletions lib/jsdom/living/nodes/HTMLElement.idl
Expand Up @@ -2,10 +2,9 @@ interface HTMLElement : Element {
// metadata attributes
[Reflect] attribute DOMString title;
[Reflect] attribute DOMString lang;
attribute boolean translate;
/* incorrect */ [Reflect]
attribute DOMString dir;
[SameObject] readonly attribute DOMStringMap dataset;
// attribute boolean translate;
[Reflect] attribute DOMString dir; // TODO this should be limited to known values only; [Reflect] by itself is incorrect
// [SameObject] readonly attribute DOMStringMap dataset;

// user interaction
[Reflect] attribute boolean hidden;
Expand All @@ -14,12 +13,12 @@ interface HTMLElement : Element {
void focus();
void blur();
[Reflect] attribute DOMString accessKey;
readonly attribute DOMString accessKeyLabel;
attribute boolean draggable;
[PutForwards=value] readonly attribute DOMSettableTokenList dropzone;
attribute HTMLMenuElement? contextMenu;
attribute boolean spellcheck;
void forceSpellCheck();
// readonly attribute DOMString accessKeyLabel;
// attribute boolean draggable;
// [PutForwards=value] readonly attribute DOMSettableTokenList dropzone;
// attribute HTMLMenuElement? contextMenu;
// attribute boolean spellcheck;
// void forceSpellCheck();
};
HTMLElement implements GlobalEventHandlers;
HTMLElement implements ElementContentEditable;
4 changes: 2 additions & 2 deletions lib/jsdom/living/nodes/HTMLEmbedElement.idl
Expand Up @@ -3,8 +3,8 @@ interface HTMLEmbedElement : HTMLElement {
[Reflect] attribute DOMString type;
[Reflect] attribute DOMString width;
[Reflect] attribute DOMString height;
Document? getSVGDocument();
legacycaller any (any... arguments);
// Document? getSVGDocument();
// legacycaller any (any... arguments);

// also has obsolete members
};
Expand Down
16 changes: 8 additions & 8 deletions lib/jsdom/living/nodes/HTMLFieldSetElement.idl
Expand Up @@ -3,14 +3,14 @@ interface HTMLFieldSetElement : HTMLElement {
readonly attribute HTMLFormElement? form;
[Reflect] attribute DOMString name;

readonly attribute DOMString type;
// readonly attribute DOMString type;

[SameObject] readonly attribute HTMLFormControlsCollection elements;
// [SameObject] readonly attribute HTMLFormControlsCollection elements;

readonly attribute boolean willValidate;
[SameObject] readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
boolean reportValidity();
void setCustomValidity(DOMString error);
// readonly attribute boolean willValidate;
// [SameObject] readonly attribute ValidityState validity;
// readonly attribute DOMString validationMessage;
// boolean checkValidity();
// boolean reportValidity();
// void setCustomValidity(DOMString error);
};

0 comments on commit 6d54df2

Please sign in to comment.