Index: core/dom/Document.idl |
diff --git a/core/dom/Document.idl b/core/dom/Document.idl |
index 5b4d664ef087c0b66ec9732b1ae8e55c8f6f363c..aafcdaf198774f3978c3bb59d14dda1808c46a90 100644 |
--- a/core/dom/Document.idl |
+++ b/core/dom/Document.idl |
@@ -35,10 +35,12 @@ interface Document : Node { |
// FIXME: documentURI should not be nullable. |
[ImplementedAs=url] readonly attribute DOMString? documentURI; |
readonly attribute DOMString origin; |
+ [RuntimeEnabled=suborigins] readonly attribute DOMString suborigin; |
readonly attribute DOMString compatMode; |
readonly attribute DOMString characterSet; |
- [MeasureAs=DocumentInputEncoding, ImplementedAs=characterSet] readonly attribute DOMString inputEncoding; // legacy alias of .characterSet |
+ [ImplementedAs=characterSet] readonly attribute DOMString charset; // legacy alias of .characterSet |
+ [ImplementedAs=characterSet] readonly attribute DOMString inputEncoding; // legacy alias of .characterSet |
readonly attribute DOMString contentType; |
readonly attribute DocumentType? doctype; |
@@ -54,19 +56,19 @@ interface Document : Node { |
[NewObject] Comment createComment(DOMString data); |
[NewObject, RaisesException] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data); |
- [NewObject, CustomElementCallbacks, RaisesException, TypeChecking=Interface] Node importNode(Node node, optional boolean deep = false); |
- [RaisesException, CustomElementCallbacks, TypeChecking=Interface] Node adoptNode(Node node); |
+ [NewObject, CustomElementCallbacks, RaisesException] Node importNode(Node node, optional boolean deep = false); |
+ [RaisesException, CustomElementCallbacks] Node adoptNode(Node node); |
[NewObject, RaisesException, MeasureAs=DocumentCreateAttribute] Attr createAttribute(DOMString localName); |
[NewObject, RaisesException, MeasureAs=DocumentCreateAttributeNS] Attr createAttributeNS(DOMString? namespaceURI, DOMString qualifiedName); |
- [NewObject, RaisesException] Event createEvent(DOMString eventType); |
+ [NewObject, RaisesException, CallWith=ExecutionContext] Event createEvent(DOMString eventType); |
[NewObject] Range createRange(); |
// NodeFilter.SHOW_ALL = 0xFFFFFFFF |
- [NewObject, RaisesException, TypeChecking=Interface] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); |
- [NewObject, RaisesException, TypeChecking=Interface] 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); |
+ [NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); |
// FIXME: CDATASection has been removed from the spec. crbug.com/437205 |
[RaisesException, MeasureAs=DocumentCreateCDATASection] CDATASection createCDATASection(DOMString data); |
@@ -80,19 +82,23 @@ interface Document : Node { |
// https://html.spec.whatwg.org/#the-document-object |
// resource metadata management |
+ |
+ // Inheritance of [Unforgeable] attributes is not supported. So we have to |
+ // define the same unforgeable attributes in derived interfaces as well. |
+ // See that HTMLDocument and XMLDocument redefine 'location' attribute. |
+ // Keep all the definitions consistent. |
+ // TODO(yukishiino): Support inheritance of attributes defined on instance. |
[PutForwards=href, Unforgeable] readonly attribute Location? location; |
[RaisesException=Setter] attribute DOMString domain; |
readonly attribute DOMString referrer; |
- // FIXME: cookie should not have [TreatNullAs=NullString]. |
- [TreatNullAs=NullString, RaisesException] attribute DOMString cookie; |
+ [RaisesException] attribute DOMString cookie; |
readonly attribute DOMString lastModified; |
readonly attribute DocumentReadyState readyState; |
// DOM tree accessors |
- // FIXME: title and dir should not have [TreatNullAs=NullString]. |
- [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString title; |
- [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString dir; |
- [RaisesException=Setter, CustomElementCallbacks, PerWorldBindings, TypeChecking=Interface] attribute HTMLElement? body; |
+ [CustomElementCallbacks] attribute DOMString title; |
+ [CustomElementCallbacks] attribute DOMString dir; |
+ [RaisesException=Setter, CustomElementCallbacks, PerWorldBindings] attribute HTMLElement? body; |
readonly attribute HTMLHeadElement? head; |
[SameObject] readonly attribute HTMLCollection images; |
[SameObject] readonly attribute HTMLCollection embeds; |
@@ -107,15 +113,14 @@ interface Document : Node { |
// FIXME: There are two open() methods in the spec. |
[Custom, CustomElementCallbacks, RaisesException] void open(); |
[RaisesException] void close(); |
- [CallWith=ActiveWindow, CustomElementCallbacks, RaisesException] void write(DOMString... text); |
- [CallWith=ActiveWindow, CustomElementCallbacks, RaisesException] void writeln(DOMString... text); |
+ [CallWith=FirstWindow, CustomElementCallbacks, RaisesException] void write(DOMString... text); |
+ [CallWith=FirstWindow, CustomElementCallbacks, RaisesException] void writeln(DOMString... text); |
// user interaction |
[ImplementedAs=domWindow] readonly attribute Window? defaultView; |
readonly attribute Element? activeElement; |
boolean hasFocus(); |
- // FIXME: designMode should not have [TreatNullAs=NullString]. |
- [TreatNullAs=NullString, CustomElementCallbacks, MeasureAs=DocumentDesignMode] attribute DOMString designMode; |
+ [CustomElementCallbacks, MeasureAs=DocumentDesignMode] attribute DOMString designMode; |
[CustomElementCallbacks, RaisesException] boolean execCommand(DOMString commandId, optional boolean showUI = false, optional DOMString value = ""); |
[RaisesException] boolean queryCommandEnabled(DOMString commandId); |
[RaisesException] boolean queryCommandIndeterm(DOMString commandId); |
@@ -162,25 +167,19 @@ interface Document : Node { |
// Touch Events |
// http://rawgit.com/w3c/touch-events/v1-errata/touchevents.html#extensions-to-the-document-interface |
// FIXME: The arguments should not be optional. |
- [RuntimeEnabled=Touch, Measure] Touch createTouch([Default=Undefined] optional Window window, |
- [Default=Undefined] optional EventTarget target, |
- [Default=Undefined] optional long identifier, |
- [Default=Undefined] optional unrestricted double pageX, |
- [Default=Undefined] optional unrestricted double pageY, |
- [Default=Undefined] optional unrestricted double screenX, |
- [Default=Undefined] optional unrestricted double screenY, |
- [Default=Undefined] optional unrestricted double radiusX, |
- [Default=Undefined] optional unrestricted double radiusY, |
- [Default=Undefined] optional unrestricted float rotationAngle, |
- [Default=Undefined] optional unrestricted float force); |
+ [RuntimeEnabled=Touch, Measure, LegacyInterfaceTypeChecking] Touch createTouch([Default=Undefined] optional Window window, |
+ [Default=Undefined] optional EventTarget target, |
+ [Default=Undefined] optional long identifier, |
+ [Default=Undefined] optional unrestricted double pageX, |
+ [Default=Undefined] optional unrestricted double pageY, |
+ [Default=Undefined] optional unrestricted double screenX, |
+ [Default=Undefined] optional unrestricted double screenY, |
+ [Default=Undefined] optional unrestricted double radiusX, |
+ [Default=Undefined] optional unrestricted double radiusY, |
+ [Default=Undefined] optional unrestricted float rotationAngle, |
+ [Default=Undefined] optional unrestricted float force); |
[RuntimeEnabled=Touch] TouchList createTouchList(Touch... touches); |
- // FIXME: The spec doesn't define these event handler attributes. |
- [RuntimeEnabled=Touch] attribute EventHandler ontouchstart; |
- [RuntimeEnabled=Touch] attribute EventHandler ontouchend; |
- [RuntimeEnabled=Touch] attribute EventHandler ontouchmove; |
- [RuntimeEnabled=Touch] attribute EventHandler ontouchcancel; |
- |
// Custom Elements |
// http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-register |
// FIXME: The registerElement return type should be Function. |
@@ -196,10 +195,7 @@ interface Document : Node { |
readonly attribute VisibilityState visibilityState; |
// Non-standard APIs |
- [MeasureAs=DocumentCharset] readonly attribute DOMString charset; |
- [MeasureAs=DocumentDefaultCharset, TreatReturnedNullStringAs=Undefined] readonly attribute DOMString defaultCharset; |
[MeasureAs=DocumentCaretRangeFromPoint] Range caretRangeFromPoint([Default=Undefined] optional long x, [Default=Undefined] optional long y); |
- [CallWith=ScriptState, DeprecateAs=DocumentGetCSSCanvasContext] any getCSSCanvasContext(DOMString contextId, DOMString name, long width, long height); |
// Deprecated prefixed page visibility API. |
// TODO(davidben): This is a property so attaching a deprecation warning results in false positives when outputting |