Fix for bug 824907 (Convert HTML table elements to WebIDL) - convert HTMLTableCaptionElement to WebIDL. r=bz.
authorPeter Van der Beken <peterv@propagandism.org>
Sat, 29 Dec 2012 15:07:46 +0100
changeset 126847 7564aeb63a36912dc58cbdad0073c4ffbacd597f
parent 126846 08e18a8008ec0df4c0160f418df5942764427b0d
child 126848 a4ef9c24dd5b55d29789cebe3a7126fb52b8cfb6
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs824907
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
Fix for bug 824907 (Convert HTML table elements to WebIDL) - convert HTMLTableCaptionElement to WebIDL. r=bz.
browser/devtools/debugger/test/browser_dbg_propertyview-filter-05.js
content/html/content/src/HTMLTableCaptionElement.cpp
content/html/content/src/HTMLTableCaptionElement.h
content/html/content/src/HTMLTableCellElement.cpp
content/html/content/src/HTMLTableCellElement.h
content/html/content/src/HTMLTableColElement.cpp
content/html/content/src/HTMLTableColElement.h
content/html/content/src/HTMLTableElement.cpp
content/html/content/src/HTMLTableElement.h
content/html/content/src/HTMLTableRowElement.cpp
content/html/content/src/HTMLTableRowElement.h
content/html/content/src/HTMLTableSectionElement.cpp
content/html/content/src/HTMLTableSectionElement.h
dom/bindings/Bindings.conf
dom/webidl/HTMLTableCaptionElement.webidl
dom/webidl/HTMLTableElement.webidl
dom/webidl/WebIDL.mk
--- a/browser/devtools/debugger/test/browser_dbg_propertyview-filter-05.js
+++ b/browser/devtools/debugger/test/browser_dbg_propertyview-filter-05.js
@@ -40,18 +40,18 @@ function testVariablesFiltering()
     is(innerScope.querySelectorAll(".variable:not([non-match])").length, 1,
       "There should be 1 variable displayed in the inner scope");
     is(mathScope.querySelectorAll(".variable:not([non-match])").length, 0,
       "There should be 0 variables displayed in the math scope");
     is(testScope.querySelectorAll(".variable:not([non-match])").length, 0,
       "There should be 0 variables displayed in the test scope");
     is(loadScope.querySelectorAll(".variable:not([non-match])").length, 1,
       "There should be 1 variable displayed in the load scope");
-    is(globalScope.querySelectorAll(".variable:not([non-match])").length, 3,
-      "There should be 3 variables displayed in the global scope");
+    is(globalScope.querySelectorAll(".variable:not([non-match])").length, 4,
+      "There should be 4 variables displayed in the global scope");
 
     is(innerScope.querySelectorAll(".property:not([non-match])").length, 0,
       "There should be 0 properties displayed in the inner scope");
     is(mathScope.querySelectorAll(".property:not([non-match])").length, 0,
       "There should be 0 properties displayed in the math scope");
     is(testScope.querySelectorAll(".property:not([non-match])").length, 0,
       "There should be 0 properties displayed in the test scope");
     is(loadScope.querySelectorAll(".property:not([non-match])").length, 0,
--- a/content/html/content/src/HTMLTableCaptionElement.cpp
+++ b/content/html/content/src/HTMLTableCaptionElement.cpp
@@ -2,31 +2,37 @@
 /* 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 "mozilla/Util.h"
 
 #include "mozilla/dom/HTMLTableCaptionElement.h"
 #include "nsAttrValueInlines.h"
-#include "nsGkAtoms.h"
-#include "nsStyleConsts.h"
 #include "nsMappedAttributes.h"
 #include "nsRuleData.h"
+#include "mozilla/dom/HTMLTableCaptionElementBinding.h"
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(TableCaption)
 DOMCI_NODE_DATA(HTMLTableCaptionElement, mozilla::dom::HTMLTableCaptionElement)
 
 namespace mozilla {
 namespace dom {
 
 HTMLTableCaptionElement::~HTMLTableCaptionElement()
 {
 }
 
+JSObject*
+HTMLTableCaptionElement::WrapNode(JSContext *aCx, JSObject *aScope,
+                                  bool *aTriedToWrap)
+{
+  return HTMLTableCaptionElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
+}
+
 NS_IMPL_ADDREF_INHERITED(HTMLTableCaptionElement, Element)
 NS_IMPL_RELEASE_INHERITED(HTMLTableCaptionElement, Element)
 
 // QueryInterface implementation for HTMLTableCaptionElement
 NS_INTERFACE_TABLE_HEAD(HTMLTableCaptionElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(HTMLTableCaptionElement,
                                    nsIDOMHTMLTableCaptionElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLTableCaptionElement,
--- a/content/html/content/src/HTMLTableCaptionElement.h
+++ b/content/html/content/src/HTMLTableCaptionElement.h
@@ -13,16 +13,17 @@ namespace dom {
 
 class HTMLTableCaptionElement : public nsGenericHTMLElement,
                                 public nsIDOMHTMLTableCaptionElement
 {
 public:
   HTMLTableCaptionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsGenericHTMLElement(aNodeInfo)
   {
+    SetIsDOMBinding();
   }
   virtual ~HTMLTableCaptionElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
@@ -31,26 +32,39 @@ public:
   NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
 
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
 
   // nsIDOMHTMLTableCaptionElement
   NS_DECL_NSIDOMHTMLTABLECAPTIONELEMENT
 
+  void GetAlign(nsString& aAlign)
+  {
+    GetHTMLAttr(nsGkAtoms::align, aAlign);
+  }
+  void SetAlign(const nsAString& aAlign, ErrorResult& aError)
+  {
+    SetHTMLAttr(nsGkAtoms::align, aAlign, aError);
+  }
+
   virtual bool ParseAttribute(int32_t aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
+
+protected:
+  virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope,
+                             bool *aTriedToWrap) MOZ_OVERRIDE;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif /* mozilla_dom_HTMLTableCaptionElement_h */
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -1112,18 +1112,16 @@ addExternalIface('ClientRect')
 addExternalIface("Counter")
 addExternalIface('CSSRule')
 addExternalIface('DOMRequest')
 addExternalIface('DOMStringList')
 addExternalIface('File')
 addExternalIface('HitRegionOptions', nativeType='nsISupports')
 addExternalIface('HTMLHeadElement', nativeType='mozilla::dom::Element')
 addExternalIface('HTMLCanvasElement', nativeType='mozilla::dom::HTMLCanvasElement')
-addExternalIface('HTMLTableCaptionElement',
-                 headerFile="nsIDOMHTMLTableCaptionElem.h")
 addExternalIface('HTMLTableSectionElement',
                  headerFile="nsIDOMHTMLTableSectionElem.h")
 addExternalIface('imgINotificationObserver', nativeType='imgINotificationObserver')
 addExternalIface('imgIRequest', nativeType='imgIRequest', notflattened=True)
 addExternalIface('LockedFile')
 addExternalIface('MediaStream')
 addExternalIface('NamedNodeMap')
 addExternalIface('NodeIterator')
new file mode 100644
--- /dev/null
+++ b/dom/webidl/HTMLTableCaptionElement.webidl
@@ -0,0 +1,20 @@
+/* -*- 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://www.whatwg.org/specs/web-apps/current-work/
+ *
+ * © 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 HTMLTableCaptionElement : HTMLElement {/*};
+
+partial interface HTMLTableCaptionElement {
+*/
+           [SetterThrows]
+           attribute DOMString align;
+};
--- a/dom/webidl/HTMLTableElement.webidl
+++ b/dom/webidl/HTMLTableElement.webidl
@@ -6,17 +6,16 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/
  *
  * © 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 HTMLTableCaptionElement;
 interface HTMLTableSectionElement;
 
 interface HTMLTableElement : HTMLElement {
            attribute HTMLTableCaptionElement? caption;
   HTMLElement createCaption();
   void deleteCaption();
            [SetterThrows]
            attribute HTMLTableSectionElement? tHead;
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -68,16 +68,17 @@ webidl_files = \
   HTMLLIElement.webidl \
   HTMLOListElement.webidl \
   HTMLOptionsCollection.webidl \
   HTMLParagraphElement.webidl \
   HTMLPreElement.webidl \
   HTMLPropertiesCollection.webidl \
   HTMLScriptElement.webidl \
   HTMLSpanElement.webidl \
+  HTMLTableCaptionElement.webidl \
   HTMLTableElement.webidl \
   HTMLTitleElement.webidl \
   HTMLUListElement.webidl \
   ImageData.webidl \
   Location.webidl \
   MutationObserver.webidl \
   Node.webidl \
   NodeFilter.webidl \