Bug 924682 - [Pure] getters for some often used attributes, r=bz
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 09 Oct 2013 21:58:15 +0300
changeset 150278 7a7b028f0a023198f94ac8aaf42b3edbc0e2e636
parent 150277 257a97e05777f06c52e68b1cdd381fc50003d497
child 150279 bb73bada10dead35c89e01c7d34a5be9ecc4940a
push id25429
push usercbook@mozilla.com
push dateThu, 10 Oct 2013 11:35:36 +0000
treeherdermozilla-central@977afa826c5e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs924682
milestone27.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 924682 - [Pure] getters for some often used attributes, r=bz
dom/webidl/CharacterData.webidl
dom/webidl/Event.webidl
dom/webidl/HTMLDocument.webidl
--- a/dom/webidl/CharacterData.webidl
+++ b/dom/webidl/CharacterData.webidl
@@ -6,17 +6,19 @@
  * The origin of this IDL file is
  * http://dom.spec.whatwg.org/#characterdata
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 interface CharacterData : Node {
-  [TreatNullAs=EmptyString,SetterThrows] attribute DOMString data;
+  [TreatNullAs=EmptyString, Pure, SetterThrows]
+  attribute DOMString data;
+  [Pure]
   readonly attribute unsigned long length;
   [Throws]
   DOMString substringData(unsigned long offset, unsigned long count);
   [Throws]
   void appendData(DOMString data);
   [Throws]
   void insertData(unsigned long offset, DOMString data);
   [Throws]
--- a/dom/webidl/Event.webidl
+++ b/dom/webidl/Event.webidl
@@ -7,36 +7,44 @@
  * http://www.w3.org/TR/2012/WD-dom-20120105/
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 [Constructor(DOMString type, optional EventInit eventInitDict)]
 interface Event {
+  [Pure]
   readonly attribute DOMString type;
+  [Pure]
   readonly attribute EventTarget? target;
+  [Pure]
   readonly attribute EventTarget? currentTarget;
 
   const unsigned short NONE = 0;
   const unsigned short CAPTURING_PHASE = 1;
   const unsigned short AT_TARGET = 2;
   const unsigned short BUBBLING_PHASE = 3;
+  [Pure]
   readonly attribute unsigned short eventPhase;
 
   void stopPropagation();
   void stopImmediatePropagation();
 
+  [Pure]
   readonly attribute boolean bubbles;
+  [Pure]
   readonly attribute boolean cancelable;
   void preventDefault();
+  [Pure]
   readonly attribute boolean defaultPrevented;
 
-  [Unforgeable]
+  [Unforgeable, Pure]
   readonly attribute boolean isTrusted;
+  [Pure]
   readonly attribute DOMTimeStamp timeStamp;
 
   [Throws]
   void initEvent(DOMString type, boolean bubbles, boolean cancelable);
 };
 
 // Mozilla specific legacy stuff.
 partial interface Event {
--- a/dom/webidl/HTMLDocument.webidl
+++ b/dom/webidl/HTMLDocument.webidl
@@ -10,24 +10,31 @@ interface Selection;
 interface HTMLDocument : Document {
            [Throws]
            attribute DOMString? domain;
            [Throws]
            attribute DOMString cookie;
   // DOM tree accessors
   [Throws]
   getter object (DOMString name);
-           [SetterThrows]
+  [Pure, SetterThrows]
            attribute HTMLElement? body;
+  [Pure]
   readonly attribute HTMLHeadElement? head;
+  [Pure]
   readonly attribute HTMLCollection images;
+  [Pure]
   readonly attribute HTMLCollection embeds;
+  [Pure]
   readonly attribute HTMLCollection plugins;
+  [Pure]
   readonly attribute HTMLCollection links;
+  [Pure]
   readonly attribute HTMLCollection forms;
+  [Pure]
   readonly attribute HTMLCollection scripts;
   NodeList getElementsByName(DOMString elementName);
   NodeList getItems(optional DOMString typeNames = ""); // microdata
 
   // dynamic markup insertion
   [Throws]
   Document open(optional DOMString type = "text/html", optional DOMString replace = "");
   [Throws]
@@ -55,17 +62,19 @@ interface HTMLDocument : Document {
   DOMString queryCommandValue(DOMString commandId);
 
   [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;
 
+  [Pure]
   readonly attribute HTMLCollection anchors;
+  [Pure]
   readonly attribute HTMLCollection applets;
 
   void clear();
 
   [Throws]
   readonly attribute object all;
 
   // https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#selections