mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-25 19:04:21 +03:00
Support duktape and WebIDL
This commit is contained in:
parent
aadb820089
commit
061472e520
@ -58,8 +58,35 @@ S_JAVASCRIPT += content.c jsapi.c fetcher.c $(addprefix jsapi/,$(S_JSAPI))
|
||||
|
||||
$(eval $(foreach V,$(filter JSAPI_BINDING_%,$(.VARIABLES)),$(call convert_jsapi_binding,$($(V)),$(OBJROOT)/$(patsubst JSAPI_BINDING_%,%,$(V)).c,$(OBJROOT)/$(patsubst JSAPI_BINDING_%,%,$(V)).h,$(patsubst JSAPI_BINDING_%,%,$(V))_jsapi)))
|
||||
|
||||
ifeq ($(filter $(MAKECMDGOALS),clean test coverage),)
|
||||
-include $(D_JSAPI_BINDING)
|
||||
endif
|
||||
|
||||
else
|
||||
ifeq ($(NETSURF_USE_DUKTAPE),YES)
|
||||
|
||||
javascript/dukky.c: $(OBJROOT)/duktape/binding.h
|
||||
|
||||
BINDINGS := $(wildcard javascript/duktape/*.bnd)
|
||||
|
||||
$(OBJROOT)/duktape/binding.h $(OBJROOT)/duktape/Makefile: javascript/duktape/netsurf.bnd $(BINDINGS)
|
||||
$(Q)mkdir -p $(OBJROOT)/duktape
|
||||
$(VQ)echo " GENBIND: $<"
|
||||
$(Q)nsgenbind -I javascript/WebIDL $< $(OBJROOT)/duktape
|
||||
|
||||
ifeq ($(filter $(MAKECMDGOALS),clean test coverage),)
|
||||
-include $(OBJROOT)/duktape/Makefile
|
||||
endif
|
||||
|
||||
S_JSAPI_BINDING:=$(addprefix $(OBJROOT)/duktape/,$(NSGENBIND_SOURCES))
|
||||
|
||||
$(S_JSAPI_BINDING): $(BINDINGS)
|
||||
|
||||
S_JAVASCRIPT += dukky.c content.c fetcher.c duktape/duktape.c
|
||||
|
||||
else
|
||||
S_JAVASCRIPT += none.c fetcher.c
|
||||
endif
|
||||
endif
|
||||
|
||||
S_JAVASCRIPT := $(addprefix javascript/,$(S_JAVASCRIPT)) $(S_JSAPI_BINDING)
|
@ -2,10 +2,14 @@
|
||||
#
|
||||
# Create the WebIDL for core DOM and HTML spec directly from
|
||||
# downloaded specifications. The resulting IDL is pretty close but
|
||||
# carries the example text etc. and should be manually cleaned up and
|
||||
# tagged with the retrival date and source URL
|
||||
# should be manually cleaned up and tagged with the retrival date and
|
||||
# source URL
|
||||
#
|
||||
# needs debin packages: curl w3m tidy html-xml-utils
|
||||
# The dom spec has an index on the end that contains all the IDL a
|
||||
# second time! be aware htis needs removing or your IDL will have two
|
||||
# copies of all interfaces which is bad.
|
||||
#
|
||||
# needs debian packages: curl w3m tidy html-xml-utils
|
||||
#
|
||||
# Copyright 2012 Vincent Sanders
|
||||
# MIT licenced
|
||||
|
@ -1,43 +1,10 @@
|
||||
// DOM core WebIDL
|
||||
// retrived from http://dom.spec.whatwg.org/
|
||||
// 23rd October 2012
|
||||
// DOM web IDL
|
||||
// Retrived from https://dom.spec.whatwg.org/
|
||||
// Sat Jul 18 2015
|
||||
|
||||
|
||||
|
||||
exception DOMException {
|
||||
const unsigned short INDEX_SIZE_ERR = 1;
|
||||
const unsigned short DOMSTRING_SIZE_ERR = 2; // historical
|
||||
const unsigned short HIERARCHY_REQUEST_ERR = 3;
|
||||
const unsigned short WRONG_DOCUMENT_ERR = 4;
|
||||
const unsigned short INVALID_CHARACTER_ERR = 5;
|
||||
const unsigned short NO_DATA_ALLOWED_ERR = 6; // historical
|
||||
const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7;
|
||||
const unsigned short NOT_FOUND_ERR = 8;
|
||||
const unsigned short NOT_SUPPORTED_ERR = 9;
|
||||
const unsigned short INUSE_ATTRIBUTE_ERR = 10; // historical
|
||||
const unsigned short INVALID_STATE_ERR = 11;
|
||||
const unsigned short SYNTAX_ERR = 12;
|
||||
const unsigned short INVALID_MODIFICATION_ERR = 13;
|
||||
const unsigned short NAMESPACE_ERR = 14;
|
||||
const unsigned short INVALID_ACCESS_ERR = 15;
|
||||
const unsigned short VALIDATION_ERR = 16; // historical
|
||||
const unsigned short TYPE_MISMATCH_ERR = 17;
|
||||
const unsigned short SECURITY_ERR = 18;
|
||||
const unsigned short NETWORK_ERR = 19;
|
||||
const unsigned short ABORT_ERR = 20;
|
||||
const unsigned short URL_MISMATCH_ERR = 21;
|
||||
const unsigned short QUOTA_EXCEEDED_ERR = 22;
|
||||
const unsigned short TIMEOUT_ERR = 23;
|
||||
const unsigned short INVALID_NODE_TYPE_ERR = 24;
|
||||
const unsigned short DATA_CLONE_ERR = 25;
|
||||
unsigned short code;
|
||||
};
|
||||
|
||||
interface DOMError {
|
||||
readonly attribute DOMString name;
|
||||
};
|
||||
|
||||
[Constructor(DOMString type, optional EventInit eventInitDict)]
|
||||
[Constructor(DOMString type, optional EventInit eventInitDict),
|
||||
Exposed=(Window,Worker)]
|
||||
interface Event {
|
||||
readonly attribute DOMString type;
|
||||
readonly attribute EventTarget? target;
|
||||
@ -57,26 +24,30 @@ interface Event {
|
||||
void preventDefault();
|
||||
readonly attribute boolean defaultPrevented;
|
||||
|
||||
readonly attribute boolean isTrusted;
|
||||
[Unforgeable] readonly attribute boolean isTrusted;
|
||||
readonly attribute DOMTimeStamp timeStamp;
|
||||
|
||||
void initEvent(DOMString type, boolean bubbles, boolean cancelable);
|
||||
};
|
||||
|
||||
dictionary EventInit {
|
||||
boolean bubbles;
|
||||
boolean cancelable;
|
||||
boolean bubbles = false;
|
||||
boolean cancelable = false;
|
||||
};
|
||||
|
||||
[Constructor(DOMString type, optional CustomEventInit eventInitDict)]
|
||||
[Constructor(DOMString type, optional CustomEventInit eventInitDict),
|
||||
Exposed=(Window,Worker)]
|
||||
interface CustomEvent : Event {
|
||||
readonly attribute any detail;
|
||||
|
||||
void initCustomEvent(DOMString type, boolean bubbles, boolean cancelable, any detail);
|
||||
};
|
||||
|
||||
dictionary CustomEventInit : EventInit {
|
||||
any detail;
|
||||
any detail = null;
|
||||
};
|
||||
|
||||
[Exposed=(Window,Worker)]
|
||||
interface EventTarget {
|
||||
void addEventListener(DOMString type, EventListener? callback, optional boolean capture = false);
|
||||
void removeEventListener(DOMString type, EventListener? callback, optional boolean capture = false);
|
||||
@ -87,6 +58,74 @@ callback interface EventListener {
|
||||
void handleEvent(Event event);
|
||||
};
|
||||
|
||||
[NoInterfaceObject,
|
||||
Exposed=Window]
|
||||
interface NonElementParentNode {
|
||||
Element? getElementById(DOMString elementId);
|
||||
};
|
||||
Document implements NonElementParentNode;
|
||||
DocumentFragment implements NonElementParentNode;
|
||||
|
||||
[NoInterfaceObject,
|
||||
Exposed=Window]
|
||||
interface ParentNode {
|
||||
[SameObject] readonly attribute HTMLCollection children;
|
||||
readonly attribute Element? firstElementChild;
|
||||
readonly attribute Element? lastElementChild;
|
||||
readonly attribute unsigned long childElementCount;
|
||||
|
||||
[Unscopeable] void prepend((Node or DOMString)... nodes);
|
||||
[Unscopeable] void append((Node or DOMString)... nodes);
|
||||
|
||||
[Unscopeable] Element? query(DOMString relativeSelectors);
|
||||
[NewObject, Unscopeable] Elements queryAll(DOMString relativeSelectors);
|
||||
Element? querySelector(DOMString selectors);
|
||||
[NewObject] NodeList querySelectorAll(DOMString selectors);
|
||||
};
|
||||
Document implements ParentNode;
|
||||
DocumentFragment implements ParentNode;
|
||||
Element implements ParentNode;
|
||||
|
||||
[NoInterfaceObject,
|
||||
Exposed=Window]
|
||||
interface NonDocumentTypeChildNode {
|
||||
readonly attribute Element? previousElementSibling;
|
||||
readonly attribute Element? nextElementSibling;
|
||||
};
|
||||
Element implements NonDocumentTypeChildNode;
|
||||
CharacterData implements NonDocumentTypeChildNode;
|
||||
|
||||
[NoInterfaceObject,
|
||||
Exposed=Window]
|
||||
interface ChildNode {
|
||||
[Unscopeable] void before((Node or DOMString)... nodes);
|
||||
[Unscopeable] void after((Node or DOMString)... nodes);
|
||||
[Unscopeable] void replaceWith((Node or DOMString)... nodes);
|
||||
[Unscopeable] void remove();
|
||||
};
|
||||
DocumentType implements ChildNode;
|
||||
Element implements ChildNode;
|
||||
CharacterData implements ChildNode;
|
||||
|
||||
//class Elements extends Array {
|
||||
// Element? query(DOMString relativeSelectors);
|
||||
// Elements queryAll(DOMString relativeSelectors);
|
||||
//};
|
||||
|
||||
[Exposed=Window]
|
||||
interface NodeList {
|
||||
getter Node? item(unsigned long index);
|
||||
readonly attribute unsigned long length;
|
||||
iterable<Node>;
|
||||
};
|
||||
|
||||
[Exposed=Window]
|
||||
interface HTMLCollection {
|
||||
readonly attribute unsigned long length;
|
||||
getter Element? item(unsigned long index);
|
||||
getter Element? namedItem(DOMString name);
|
||||
};
|
||||
|
||||
[Constructor(MutationCallback callback)]
|
||||
interface MutationObserver {
|
||||
void observe(Node target, MutationObserverInit options);
|
||||
@ -97,20 +136,21 @@ interface MutationObserver {
|
||||
callback MutationCallback = void (sequence<MutationRecord> mutations, MutationObserver observer);
|
||||
|
||||
dictionary MutationObserverInit {
|
||||
boolean childList;
|
||||
boolean childList = false;
|
||||
boolean attributes;
|
||||
boolean characterData;
|
||||
boolean subtree;
|
||||
boolean subtree = false;
|
||||
boolean attributeOldValue;
|
||||
boolean characterDataOldValue;
|
||||
sequence<DOMString> attributeFilter;
|
||||
};
|
||||
|
||||
[Exposed=Window]
|
||||
interface MutationRecord {
|
||||
readonly attribute DOMString type;
|
||||
readonly attribute Node target;
|
||||
readonly attribute NodeList addedNodes;
|
||||
readonly attribute NodeList removedNodes;
|
||||
[SameObject] readonly attribute NodeList addedNodes;
|
||||
[SameObject] readonly attribute NodeList removedNodes;
|
||||
readonly attribute Node? previousSibling;
|
||||
readonly attribute Node? nextSibling;
|
||||
readonly attribute DOMString? attributeName;
|
||||
@ -118,6 +158,7 @@ interface MutationRecord {
|
||||
readonly attribute DOMString? oldValue;
|
||||
};
|
||||
|
||||
[Exposed=Window]
|
||||
interface Node : EventTarget {
|
||||
const unsigned short ELEMENT_NODE = 1;
|
||||
const unsigned short ATTRIBUTE_NODE = 2; // historical
|
||||
@ -140,7 +181,7 @@ interface Node : EventTarget {
|
||||
readonly attribute Node? parentNode;
|
||||
readonly attribute Element? parentElement;
|
||||
boolean hasChildNodes();
|
||||
readonly attribute NodeList childNodes;
|
||||
[SameObject] readonly attribute NodeList childNodes;
|
||||
readonly attribute Node? firstChild;
|
||||
readonly attribute Node? lastChild;
|
||||
readonly attribute Node? previousSibling;
|
||||
@ -148,37 +189,40 @@ interface Node : EventTarget {
|
||||
|
||||
attribute DOMString? nodeValue;
|
||||
attribute DOMString? textContent;
|
||||
Node insertBefore(Node node, Node? child);
|
||||
Node appendChild(Node node);
|
||||
Node replaceChild(Node node, Node child);
|
||||
Node removeChild(Node child);
|
||||
void normalize();
|
||||
|
||||
|
||||
Node cloneNode(optional boolean deep = true);
|
||||
boolean isEqualNode(Node? node);
|
||||
[NewObject] Node cloneNode(optional boolean deep = false);
|
||||
boolean isEqualNode(Node? otherNode);
|
||||
|
||||
const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
|
||||
const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
|
||||
const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
|
||||
const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
|
||||
const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
|
||||
const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; // historical
|
||||
const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
|
||||
unsigned short compareDocumentPosition(Node other);
|
||||
boolean contains(Node? other);
|
||||
|
||||
DOMString? lookupPrefix(DOMString? namespace);
|
||||
DOMString? lookupNamespaceURI(DOMString? prefix);
|
||||
boolean isDefaultNamespace(DOMString? namespace);
|
||||
|
||||
Node insertBefore(Node node, Node? child);
|
||||
Node appendChild(Node node);
|
||||
Node replaceChild(Node node, Node child);
|
||||
Node removeChild(Node child);
|
||||
};
|
||||
|
||||
[Constructor]
|
||||
[Constructor,
|
||||
Exposed=Window]
|
||||
interface Document : Node {
|
||||
readonly attribute DOMImplementation implementation;
|
||||
[SameObject] readonly attribute DOMImplementation implementation;
|
||||
readonly attribute DOMString URL;
|
||||
readonly attribute DOMString documentURI;
|
||||
readonly attribute DOMString origin;
|
||||
readonly attribute DOMString compatMode;
|
||||
readonly attribute DOMString characterSet;
|
||||
readonly attribute DOMString inputEncoding; // legacy alias of .characterSet
|
||||
readonly attribute DOMString contentType;
|
||||
|
||||
readonly attribute DocumentType? doctype;
|
||||
@ -186,59 +230,54 @@ interface Document : Node {
|
||||
HTMLCollection getElementsByTagName(DOMString localName);
|
||||
HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
|
||||
HTMLCollection getElementsByClassName(DOMString classNames);
|
||||
Element? getElementById(DOMString elementId);
|
||||
|
||||
Element createElement(DOMString localName);
|
||||
Element createElementNS(DOMString? namespace, DOMString qualifiedName);
|
||||
DocumentFragment createDocumentFragment();
|
||||
Text createTextNode(DOMString data);
|
||||
Comment createComment(DOMString data);
|
||||
ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
|
||||
[NewObject] Element createElement(DOMString localName);
|
||||
[NewObject] Element createElementNS(DOMString? namespace, DOMString qualifiedName);
|
||||
[NewObject] DocumentFragment createDocumentFragment();
|
||||
[NewObject] Text createTextNode(DOMString data);
|
||||
[NewObject] Comment createComment(DOMString data);
|
||||
[NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
|
||||
|
||||
Node importNode(Node node, optional boolean deep = true);
|
||||
[NewObject] Node importNode(Node node, optional boolean deep = false);
|
||||
Node adoptNode(Node node);
|
||||
|
||||
Event createEvent(DOMString interface);
|
||||
[NewObject] Attr createAttribute(DOMString localName);
|
||||
[NewObject] Attr createAttributeNS(DOMString? namespace, DOMString name);
|
||||
|
||||
Range createRange();
|
||||
[NewObject] Event createEvent(DOMString interface);
|
||||
|
||||
[NewObject] Range createRange();
|
||||
|
||||
// NodeFilter.SHOW_ALL = 0xFFFFFFFF
|
||||
NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
|
||||
TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
|
||||
|
||||
// NEW
|
||||
void prepend((Node or DOMString)... nodes);
|
||||
void append((Node or DOMString)... nodes);
|
||||
[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);
|
||||
};
|
||||
|
||||
[Exposed=Window]
|
||||
interface XMLDocument : Document {};
|
||||
|
||||
[Exposed=Window]
|
||||
interface DOMImplementation {
|
||||
DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId, DOMString systemId);
|
||||
XMLDocument createDocument(DOMString? namespace, [TreatNullAs=EmptyString] DOMString qualifiedName, DocumentType? doctype);
|
||||
Document createHTMLDocument(optional DOMString title);
|
||||
[NewObject] DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId, DOMString systemId);
|
||||
[NewObject] XMLDocument createDocument(DOMString? namespace, [TreatNullAs=EmptyString] DOMString qualifiedName, optional DocumentType? doctype = null);
|
||||
[NewObject] Document createHTMLDocument(optional DOMString title);
|
||||
|
||||
boolean hasFeature(DOMString feature, [TreatNullAs=EmptyString] DOMString version);
|
||||
boolean hasFeature(); // useless; always returns true
|
||||
};
|
||||
|
||||
[Constructor,
|
||||
Exposed=Window]
|
||||
interface DocumentFragment : Node {
|
||||
// NEW
|
||||
void prepend((Node or DOMString)... nodes);
|
||||
void append((Node or DOMString)... nodes);
|
||||
};
|
||||
|
||||
[Exposed=Window]
|
||||
interface DocumentType : Node {
|
||||
readonly attribute DOMString name;
|
||||
readonly attribute DOMString publicId;
|
||||
readonly attribute DOMString systemId;
|
||||
|
||||
// NEW
|
||||
void before((Node or DOMString)... nodes);
|
||||
void after((Node or DOMString)... nodes);
|
||||
void replace((Node or DOMString)... nodes);
|
||||
void remove();
|
||||
};
|
||||
|
||||
[Exposed=Window]
|
||||
interface Element : Node {
|
||||
readonly attribute DOMString? namespaceURI;
|
||||
readonly attribute DOMString? prefix;
|
||||
@ -247,9 +286,10 @@ interface Element : Node {
|
||||
|
||||
attribute DOMString id;
|
||||
attribute DOMString className;
|
||||
readonly attribute DOMTokenList classList;
|
||||
[SameObject] readonly attribute DOMTokenList classList;
|
||||
|
||||
readonly attribute Attr[] attributes;
|
||||
boolean hasAttributes();
|
||||
[SameObject] readonly attribute NamedNodeMap attributes;
|
||||
DOMString? getAttribute(DOMString name);
|
||||
DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
|
||||
void setAttribute(DOMString name, DOMString value);
|
||||
@ -259,36 +299,46 @@ interface Element : Node {
|
||||
boolean hasAttribute(DOMString name);
|
||||
boolean hasAttributeNS(DOMString? namespace, DOMString localName);
|
||||
|
||||
Attr? getAttributeNode(DOMString name);
|
||||
Attr? getAttributeNodeNS(DOMString? namespace, DOMString localName);
|
||||
Attr? setAttributeNode(Attr attr);
|
||||
Attr? setAttributeNodeNS(Attr attr);
|
||||
Attr removeAttributeNode(Attr attr);
|
||||
|
||||
Element? closest(DOMString selectors);
|
||||
boolean matches(DOMString selectors);
|
||||
|
||||
HTMLCollection getElementsByTagName(DOMString localName);
|
||||
HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
|
||||
HTMLCollection getElementsByClassName(DOMString classNames);
|
||||
|
||||
readonly attribute HTMLCollection children;
|
||||
readonly attribute Element? firstElementChild;
|
||||
readonly attribute Element? lastElementChild;
|
||||
readonly attribute Element? previousElementSibling;
|
||||
readonly attribute Element? nextElementSibling;
|
||||
readonly attribute unsigned long childElementCount;
|
||||
|
||||
|
||||
// NEW
|
||||
void prepend((Node or DOMString)... nodes);
|
||||
void append((Node or DOMString)... nodes);
|
||||
void before((Node or DOMString)... nodes);
|
||||
void after((Node or DOMString)... nodes);
|
||||
void replace((Node or DOMString)... nodes);
|
||||
void remove();
|
||||
};
|
||||
[Exposed=Window]
|
||||
interface NamedNodeMap {
|
||||
readonly attribute unsigned long length;
|
||||
getter Attr? item(unsigned long index);
|
||||
getter Attr? getNamedItem(DOMString name);
|
||||
Attr? getNamedItemNS(DOMString? namespace, DOMString localName);
|
||||
Attr? setNamedItem(Attr attr);
|
||||
Attr? setNamedItemNS(Attr attr);
|
||||
Attr removeNamedItem(DOMString name);
|
||||
Attr removeNamedItemNS(DOMString? namespace, DOMString localName);
|
||||
};
|
||||
|
||||
[Exposed=Window]
|
||||
interface Attr {
|
||||
readonly attribute DOMString name;
|
||||
attribute DOMString value;
|
||||
|
||||
readonly attribute DOMString? namespaceURI;
|
||||
readonly attribute DOMString? prefix;
|
||||
readonly attribute DOMString localName;
|
||||
};
|
||||
readonly attribute DOMString name;
|
||||
attribute DOMString value;
|
||||
[TreatNullAs=EmptyString] attribute DOMString nodeValue; // legacy alias of .value
|
||||
[TreatNullAs=EmptyString] attribute DOMString textContent; // legacy alias of .value
|
||||
|
||||
readonly attribute Element? ownerElement;
|
||||
|
||||
readonly attribute boolean specified; // useless; always returns true
|
||||
};
|
||||
[Exposed=Window]
|
||||
interface CharacterData : Node {
|
||||
[TreatNullAs=EmptyString] attribute DOMString data;
|
||||
readonly attribute unsigned long length;
|
||||
@ -297,26 +347,25 @@ interface CharacterData : Node {
|
||||
void insertData(unsigned long offset, DOMString data);
|
||||
void deleteData(unsigned long offset, unsigned long count);
|
||||
void replaceData(unsigned long offset, unsigned long count, DOMString data);
|
||||
|
||||
// NEW
|
||||
void before((Node or DOMString)... nodes);
|
||||
void after((Node or DOMString)... nodes);
|
||||
void replace((Node or DOMString)... nodes);
|
||||
void remove();
|
||||
};
|
||||
|
||||
[Constructor(optional DOMString data = ""),
|
||||
Exposed=Window]
|
||||
interface Text : CharacterData {
|
||||
Text splitText(unsigned long offset);
|
||||
[NewObject] Text splitText(unsigned long offset);
|
||||
readonly attribute DOMString wholeText;
|
||||
};
|
||||
|
||||
[Exposed=Window]
|
||||
interface ProcessingInstruction : CharacterData {
|
||||
readonly attribute DOMString target;
|
||||
};
|
||||
|
||||
[Constructor(optional DOMString data = ""),
|
||||
Exposed=Window]
|
||||
interface Comment : CharacterData {
|
||||
};
|
||||
|
||||
[Constructor,
|
||||
Exposed=Window]
|
||||
interface Range {
|
||||
readonly attribute Node startContainer;
|
||||
readonly attribute unsigned long startOffset;
|
||||
@ -325,15 +374,15 @@ interface Range {
|
||||
readonly attribute boolean collapsed;
|
||||
readonly attribute Node commonAncestorContainer;
|
||||
|
||||
void setStart(Node refNode, unsigned long offset);
|
||||
void setEnd(Node refNode, unsigned long offset);
|
||||
void setStartBefore(Node refNode);
|
||||
void setStartAfter(Node refNode);
|
||||
void setEndBefore(Node refNode);
|
||||
void setEndAfter(Node refNode);
|
||||
void collapse(boolean toStart);
|
||||
void selectNode(Node refNode);
|
||||
void selectNodeContents(Node refNode);
|
||||
void setStart(Node node, unsigned long offset);
|
||||
void setEnd(Node node, unsigned long offset);
|
||||
void setStartBefore(Node node);
|
||||
void setStartAfter(Node node);
|
||||
void setEndBefore(Node node);
|
||||
void setEndAfter(Node node);
|
||||
void collapse(optional boolean toStart = false);
|
||||
void selectNode(Node node);
|
||||
void selectNodeContents(Node node);
|
||||
|
||||
const unsigned short START_TO_START = 0;
|
||||
const unsigned short START_TO_END = 1;
|
||||
@ -342,12 +391,12 @@ interface Range {
|
||||
short compareBoundaryPoints(unsigned short how, Range sourceRange);
|
||||
|
||||
void deleteContents();
|
||||
DocumentFragment extractContents();
|
||||
DocumentFragment cloneContents();
|
||||
[NewObject] DocumentFragment extractContents();
|
||||
[NewObject] DocumentFragment cloneContents();
|
||||
void insertNode(Node node);
|
||||
void surroundContents(Node newParent);
|
||||
|
||||
Range cloneRange();
|
||||
[NewObject] Range cloneRange();
|
||||
void detach();
|
||||
|
||||
boolean isPointInRange(Node node, unsigned long offset);
|
||||
@ -358,9 +407,10 @@ interface Range {
|
||||
stringifier;
|
||||
};
|
||||
|
||||
[Exposed=Window]
|
||||
interface NodeIterator {
|
||||
readonly attribute Node root;
|
||||
readonly attribute Node? referenceNode;
|
||||
[SameObject] readonly attribute Node root;
|
||||
readonly attribute Node referenceNode;
|
||||
readonly attribute boolean pointerBeforeReferenceNode;
|
||||
readonly attribute unsigned long whatToShow;
|
||||
readonly attribute NodeFilter? filter;
|
||||
@ -371,11 +421,11 @@ interface NodeIterator {
|
||||
void detach();
|
||||
};
|
||||
|
||||
[Exposed=Window]
|
||||
interface TreeWalker {
|
||||
readonly attribute Node root;
|
||||
[SameObject] readonly attribute Node root;
|
||||
readonly attribute unsigned long whatToShow;
|
||||
readonly attribute NodeFilter? filter;
|
||||
|
||||
attribute Node currentNode;
|
||||
|
||||
Node? parentNode();
|
||||
@ -386,7 +436,7 @@ interface TreeWalker {
|
||||
Node? previousNode();
|
||||
Node? nextNode();
|
||||
};
|
||||
|
||||
[Exposed=Window]
|
||||
callback interface NodeFilter {
|
||||
// Constants for acceptNode()
|
||||
const unsigned short FILTER_ACCEPT = 1;
|
||||
@ -411,25 +461,6 @@ callback interface NodeFilter {
|
||||
unsigned short acceptNode(Node node);
|
||||
};
|
||||
|
||||
[ArrayClass]
|
||||
interface NodeList {
|
||||
getter Node? item(unsigned long index);
|
||||
readonly attribute unsigned long length;
|
||||
};
|
||||
|
||||
interface HTMLCollection {
|
||||
readonly attribute unsigned long length;
|
||||
getter Element? item(unsigned long index);
|
||||
getter object? namedItem(DOMString name); // only returns Element
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface DOMStringList {
|
||||
readonly attribute unsigned long length;
|
||||
getter DOMString? item(unsigned long index);
|
||||
boolean contains(DOMString string);
|
||||
};
|
||||
|
||||
interface DOMTokenList {
|
||||
readonly attribute unsigned long length;
|
||||
getter DOMString? item(unsigned long index);
|
||||
@ -438,9 +469,11 @@ interface DOMTokenList {
|
||||
void remove(DOMString... tokens);
|
||||
boolean toggle(DOMString token, optional boolean force);
|
||||
stringifier;
|
||||
iterable<DOMString>;
|
||||
};
|
||||
|
||||
interface DOMSettableTokenList : DOMTokenList {
|
||||
attribute DOMString value;
|
||||
};
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user