Bug 1403231 - Remove the "image" XBL binding. r=bz,bgrins draft
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Sat, 28 Oct 2017 16:54:09 +0100
changeset 689390 119c447a8991d958d9bb26e68070060783f0f5a2
parent 689389 74a53548890ef9d6bc3ae10ae62cf786c65d6ede
child 738305 294ce3791620e01ef04ddc4699b835c8da1ef1ee
push id87010
push userpaolo.mozmail@amadzone.org
push dateTue, 31 Oct 2017 14:09:55 +0000
reviewersbz, bgrins
bugs1403231
milestone58.0a1
Bug 1403231 - Remove the "image" XBL binding. r=bz,bgrins MozReview-Commit-ID: 3pI7jZovUX6
dom/interfaces/xul/moz.build
dom/interfaces/xul/nsIDOMXULImageElement.idl
dom/webidl/XULElement.webidl
dom/xul/nsXULElement.h
toolkit/content/widgets/general.xml
toolkit/content/xul.css
--- a/dom/interfaces/xul/moz.build
+++ b/dom/interfaces/xul/moz.build
@@ -12,17 +12,16 @@ XPIDL_SOURCES += [
     'nsIDOMXULCheckboxElement.idl',
     'nsIDOMXULCommandDispatcher.idl',
     'nsIDOMXULCommandEvent.idl',
     'nsIDOMXULContainerElement.idl',
     'nsIDOMXULControlElement.idl',
     'nsIDOMXULDescriptionElement.idl',
     'nsIDOMXULDocument.idl',
     'nsIDOMXULElement.idl',
-    'nsIDOMXULImageElement.idl',
     'nsIDOMXULLabeledControlEl.idl',
     'nsIDOMXULLabelElement.idl',
     'nsIDOMXULMenuListElement.idl',
     'nsIDOMXULMultSelectCntrlEl.idl',
     'nsIDOMXULPopupElement.idl',
     'nsIDOMXULRelatedElement.idl',
     'nsIDOMXULSelectCntrlEl.idl',
     'nsIDOMXULSelectCntrlItemEl.idl',
deleted file mode 100644
--- a/dom/interfaces/xul/nsIDOMXULImageElement.idl
+++ /dev/null
@@ -1,12 +0,0 @@
-/* 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/. */
-
-#include "nsIDOMElement.idl"
-#include "nsIDOMXULElement.idl"
-
-[scriptable, uuid(0a391077-c509-49d2-af73-72e2114edd65)]
-interface nsIDOMXULImageElement : nsISupports {
-  attribute DOMString src;
-};
-
--- a/dom/webidl/XULElement.webidl
+++ b/dom/webidl/XULElement.webidl
@@ -75,16 +75,20 @@ interface XULElement : Element {
   attribute DOMString ref;
 
   // Tooltip and status info
   [SetterThrows]
   attribute DOMString tooltipText;
   [SetterThrows]
   attribute DOMString statusText;
 
+  // Properties for images
+  [SetterThrows]
+  attribute DOMString src;
+
   attribute boolean allowEvents;
 
   readonly attribute MozRDFCompositeDataSource? database;
   readonly attribute XULTemplateBuilder?        builder;
   [Throws]
   readonly attribute MozRDFResource?            resource;
   [Throws, ChromeOnly]
   readonly attribute XULControllers             controllers;
--- a/dom/xul/nsXULElement.h
+++ b/dom/xul/nsXULElement.h
@@ -659,16 +659,24 @@ public:
     void GetStatusText(DOMString& aValue) const
     {
         GetXULAttr(nsGkAtoms::statustext, aValue);
     }
     void SetStatusText(const nsAString& aValue, mozilla::ErrorResult& rv)
     {
         SetXULAttr(nsGkAtoms::statustext, aValue, rv);
     }
+    void GetSrc(DOMString& aValue) const
+    {
+        GetXULAttr(nsGkAtoms::src, aValue);
+    }
+    void SetSrc(const nsAString& aValue, mozilla::ErrorResult& rv)
+    {
+        SetXULAttr(nsGkAtoms::src, aValue, rv);
+    }
     bool AllowEvents() const
     {
         return BoolAttrIsTrue(nsGkAtoms::allowevents);
     }
     void SetAllowEvents(bool aAllowEvents)
     {
         SetXULBoolAttr(nsGkAtoms::allowevents, aAllowEvents);
     }
--- a/toolkit/content/widgets/general.xml
+++ b/toolkit/content/widgets/general.xml
@@ -149,24 +149,16 @@
   <binding id="statusbarpanel-iconic-text" display="xul:button" role="xul:button"
            extends="chrome://global/content/bindings/general.xml#statusbarpanel">
     <content>
       <xul:image class="statusbarpanel-icon" xbl:inherits="src,src=image"/>
       <xul:label class="statusbarpanel-text" xbl:inherits="value=label,crop"/>
     </content>
   </binding>
 
-  <binding id="image" role="xul:image">
-    <implementation implements="nsIDOMXULImageElement">
-      <property name="src"
-                onget="return this.getAttribute('src');"
-                onset="this.setAttribute('src',val); return val;"/>
-    </implementation>
-  </binding>
-
   <binding id="deck">
     <implementation>
       <property name="selectedIndex"
                 onget="return this.getAttribute('selectedIndex') || '0'">
         <setter>
         <![CDATA[
           if (this.selectedIndex == val)
             return val;
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -208,22 +208,16 @@ notification.animated {
 popupnotification {
   -moz-binding: url("chrome://global/content/bindings/notification.xml#popup-notification");
 }
 
 .popup-notification-menubutton:not([label]) {
   display: none;
 }
 
-/********** image **********/
-
-image {
-  -moz-binding: url("chrome://global/content/bindings/general.xml#image");
-}
-
 /********** checkbox **********/
 
 checkbox {
   -moz-binding: url("chrome://global/content/bindings/checkbox.xml#checkbox");
 }
 
 /********** radio **********/