Bug 816425. Mark a few more things [Constant] in IDL, especially ImageData.width/height. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 25 Dec 2012 14:00:15 -0800
changeset 117027 7160435374764410b374d1046534e34965f05494
parent 117026 1d51451f6674864640bdc7b4ebf9266ec0f6f660
child 117028 e16925279ea3b533fcbcf8c2ce968ecd34aee211
push id24079
push userryanvm@gmail.com
push dateWed, 26 Dec 2012 12:59:56 +0000
treeherdermozilla-central@f5ed2691d901 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs816425
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 816425. Mark a few more things [Constant] in IDL, especially ImageData.width/height. r=peterv
dom/webidl/Element.webidl
dom/webidl/HTMLElement.webidl
dom/webidl/ImageData.webidl
dom/webidl/Node.webidl
dom/webidl/Performance.webidl
dom/webidl/Screen.webidl
dom/webidl/TextDecoder.webidl
dom/webidl/TextEncoder.webidl
--- a/dom/webidl/Element.webidl
+++ b/dom/webidl/Element.webidl
@@ -20,23 +20,25 @@ interface Element : Node {
 /*
   We haven't moved these from Node to Element like the spec wants.
 
   [Throws]
   readonly attribute DOMString? namespaceURI;
   readonly attribute DOMString? prefix;
   readonly attribute DOMString localName;
 */
+  // Not [Constant] because it depends on which document we're in
   readonly attribute DOMString tagName;
 
            attribute DOMString id;
 /*
   FIXME Bug 810677 Move className from HTMLElement to Element
            attribute DOMString className;
 */
+  [Constant]
   readonly attribute DOMTokenList? classList;
 
   //readonly attribute Attr[] attributes;
   DOMString? getAttribute(DOMString name);
   DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
   [Throws]
   void setAttribute(DOMString name, DOMString value);
   [Throws]
@@ -48,16 +50,17 @@ interface Element : Node {
   boolean hasAttribute(DOMString name);
   boolean hasAttributeNS(DOMString? namespace, DOMString localName);
 
   HTMLCollection getElementsByTagName(DOMString localName);
   [Throws]
   HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
   HTMLCollection getElementsByClassName(DOMString classNames);
 
+  [Constant]
   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
--- a/dom/webidl/HTMLElement.webidl
+++ b/dom/webidl/HTMLElement.webidl
@@ -18,26 +18,28 @@ interface HTMLMenuElement;
 [PrefControlled]
 interface HTMLElement : Element {
   // metadata attributes
            attribute DOMString title;
            attribute DOMString lang;
   //         attribute boolean translate;
   [SetterThrows]
            attribute DOMString dir;
+  [Constant]
   readonly attribute DOMStringMap dataset;
 
   // microdata 
   [SetterThrows]
            attribute boolean itemScope;
-  [PutForwards=value] readonly attribute DOMSettableTokenList itemType;
+  [PutForwards=value,Constant] readonly attribute DOMSettableTokenList itemType;
   [SetterThrows]
            attribute DOMString itemId;
-  [PutForwards=value] readonly attribute DOMSettableTokenList itemRef;
-  [PutForwards=value] readonly attribute DOMSettableTokenList itemProp;
+  [PutForwards=value,Constant] readonly attribute DOMSettableTokenList itemRef;
+  [PutForwards=value,Constant] readonly attribute DOMSettableTokenList itemProp;
+  [Constant]
   readonly attribute HTMLPropertiesCollection properties;
   [Throws]
            attribute any itemValue;
 
   // user interaction
   [SetterThrows]
            attribute boolean hidden;
   void click();
@@ -66,17 +68,17 @@ interface HTMLElement : Element {
   //readonly attribute DOMString? commandType;
   //readonly attribute DOMString? commandLabel;
   //readonly attribute DOMString? commandIcon;
   //readonly attribute boolean? commandHidden;
   //readonly attribute boolean? commandDisabled;
   //readonly attribute boolean? commandChecked;
 
   // styling
-  [Throws]
+  [Throws, Constant]
   readonly attribute CSSStyleDeclaration style;
 
   // event handler IDL attributes
   [SetterThrows]
            attribute EventHandler onabort;
   [SetterThrows]
            attribute EventHandler onblur;
   //[SetterThrows]
--- a/dom/webidl/ImageData.webidl
+++ b/dom/webidl/ImageData.webidl
@@ -6,12 +6,15 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#imagedata
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and Opera Software ASA.
  * You are granted a license to use, reproduce and create derivative works of this document.
  */
 
 interface ImageData {
+ [Constant]
  readonly attribute unsigned long width;
+ [Constant]
  readonly attribute unsigned long height;
- [Constant] readonly attribute Uint8ClampedArray data;
+ [Constant]
+ readonly attribute Uint8ClampedArray data;
 };
--- a/dom/webidl/Node.webidl
+++ b/dom/webidl/Node.webidl
@@ -23,25 +23,27 @@ interface Node : EventTarget {
   const unsigned short ENTITY_REFERENCE_NODE = 5; // historical
   const unsigned short ENTITY_NODE = 6; // historical
   const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
   const unsigned short COMMENT_NODE = 8;
   const unsigned short DOCUMENT_NODE = 9;
   const unsigned short DOCUMENT_TYPE_NODE = 10;
   const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
   const unsigned short NOTATION_NODE = 12; // historical
+  [Constant]
   readonly attribute unsigned short nodeType;
   readonly attribute DOMString nodeName;
 
   readonly attribute DOMString? baseURI;
 
   readonly attribute Document? ownerDocument;
   readonly attribute Node? parentNode;
   readonly attribute Element? parentElement;
   boolean hasChildNodes();
+  [Constant]
   readonly attribute NodeList childNodes;
   readonly attribute Node? firstChild;
   readonly attribute Node? lastChild;
   readonly attribute Node? previousSibling;
   readonly attribute Node? nextSibling;
 
   [SetterThrows]
            attribute DOMString? nodeValue;
@@ -71,22 +73,25 @@ interface Node : EventTarget {
   boolean contains(Node? other);
 
   DOMString? lookupPrefix(DOMString? namespace);
   DOMString? lookupNamespaceURI(DOMString? prefix);
   boolean isDefaultNamespace(DOMString? namespace);
 
   // Mozilla-specific stuff
   // These have been moved to Element in the spec.
+  [Constant]
   readonly attribute NamedNodeMap? attributes;
   // If we move namespaceURI, prefix and localName to Element they should return
   // a non-nullable type.
-  [Throws]
+  [Throws, Constant]
   readonly attribute DOMString? namespaceURI;
+  [Constant]
   readonly attribute DOMString? prefix;
+  [Constant]
   readonly attribute DOMString? localName;
 
   // This has been removed from the spec.
   boolean isSupported(DOMString feature, DOMString version);
 
   boolean hasAttributes();
   [Throws]
   any setUserData(DOMString key, any data, UserDataHandler? handler);
--- a/dom/webidl/Performance.webidl
+++ b/dom/webidl/Performance.webidl
@@ -10,11 +10,13 @@
  * liability, trademark and document use rules apply.
  */
 
 typedef double DOMHighResTimeStamp;
 
 interface Performance {
   DOMHighResTimeStamp now();
 
+  [Constant]
   readonly attribute PerformanceTiming timing;
+  [Constant]
   readonly attribute PerformanceNavigation navigation;
 };
--- a/dom/webidl/Screen.webidl
+++ b/dom/webidl/Screen.webidl
@@ -1,8 +1,9 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 interface Screen : EventTarget {
   // CSSOM-View
   // http://dev.w3.org/csswg/cssom-view/#the-screen-interface
   [Throws]
--- a/dom/webidl/TextDecoder.webidl
+++ b/dom/webidl/TextDecoder.webidl
@@ -1,21 +1,23 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * The origin of this IDL file is
  * http://encoding.spec.whatwg.org/#interface-textdecoder
  *
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 [Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options)]
 interface TextDecoder {
+  [Constant]
   readonly attribute DOMString encoding;
   [Throws]
   DOMString decode(optional ArrayBufferView? input = null, optional TextDecodeOptions options);
 };
 
 dictionary TextDecoderOptions {
   boolean fatal = false;
 };
--- a/dom/webidl/TextEncoder.webidl
+++ b/dom/webidl/TextEncoder.webidl
@@ -1,21 +1,23 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * The origin of this IDL file is
  * http://encoding.spec.whatwg.org/#interface-textencoder
  *
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 [Constructor(optional DOMString label = "utf-8")]
 interface TextEncoder {
+  [Constant]
   readonly attribute DOMString encoding;
   [Throws]
   Uint8Array encode(optional DOMString? input = null, optional TextEncodeOptions options);
 };
 
 dictionary TextEncodeOptions {
   boolean stream = false;
 };