bug 830396 - add back nsIDOMCSSValueList r=bz
authorTrevor Saunders <trev.saunders@gmail.com>
Mon, 14 Jan 2013 12:29:27 -0500 (2013-01-14)
changeset 118902 c525391efd0d0141a488ff690b8fc49b00736c13
parent 118901 0d33af2a2a7592e7b4ce3584c9d9160b2d61c222
child 118903 9a7f61363efeb7623f7c5e19c9d1f319503bc1d4
push id24180
push useremorley@mozilla.com
push dateTue, 15 Jan 2013 22:58:27 +0000 (2013-01-15)
treeherdermozilla-central@72e34ce7fd92 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs830396
milestone21.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 830396 - add back nsIDOMCSSValueList r=bz
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfoClasses.h
dom/bindings/Bindings.conf
dom/interfaces/css/Makefile.in
dom/interfaces/css/nsIDOMCSSValueList.idl
dom/tests/mochitest/chrome/Makefile.in
dom/tests/mochitest/chrome/test_bug830396.xul
layout/style/nsDOMCSSValueList.cpp
layout/style/nsDOMCSSValueList.h
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -134,16 +134,17 @@
 
 // CSS related includes
 #include "nsCSSRules.h"
 #include "nsIDOMStyleSheet.h"
 #include "nsIDOMStyleSheetList.h"
 #include "nsIDOMCSSRule.h"
 #include "nsICSSRuleList.h"
 #include "nsIDOMRect.h"
+#include "nsIDOMCSSValueList.h"
 #include "nsDOMCSSAttrDeclaration.h"
 
 // XBL related includes.
 #include "nsXBLService.h"
 #include "nsXBLBinding.h"
 #include "nsBindingManager.h"
 #include "nsIFrame.h"
 #include "nsIPresShell.h"
@@ -979,16 +980,18 @@ static nsDOMClassInfoData sClassInfoData
   NS_DEFINE_CLASSINFO_DATA(CSSGroupRuleRuleList, nsCSSRuleListSH,
                            ARRAY_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(MediaList, nsMediaListSH,
                            ARRAY_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(StyleSheetList, nsStyleSheetListSH,
                            ARRAY_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(CSSStyleSheet, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
+  NS_DEFINE_CLASSINFO_DATA(CSSValueList, nsDOMGenericSH,
+                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   // Range classes
   NS_DEFINE_CLASSINFO_DATA(Range, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(Selection, nsDOMGenericSH,
                            DEFAULT_SCRIPTABLE_FLAGS)
 
   // XUL classes
@@ -2846,16 +2849,19 @@ nsDOMClassInfo::Init()
   DOM_CLASSINFO_MAP_BEGIN(StyleSheetList, nsIDOMStyleSheetList)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMStyleSheetList)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(CSSStyleSheet, nsIDOMCSSStyleSheet)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleSheet)
   DOM_CLASSINFO_MAP_END
 
+  DOM_CLASSINFO_MAP_BEGIN(CSSValueList, nsIDOMCSSValueList)
+    DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSValueList)
+  DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(CSSRect, nsIDOMRect)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMRect)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(Range, nsIDOMRange)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMRange)
   DOM_CLASSINFO_MAP_END
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -122,16 +122,20 @@ DOMCI_CLASS(CSSImportRule)
 DOMCI_CLASS(CSSMediaRule)
 DOMCI_CLASS(CSSNameSpaceRule)
 DOMCI_CLASS(CSSRuleList)
 DOMCI_CLASS(CSSGroupRuleRuleList)
 DOMCI_CLASS(MediaList)
 DOMCI_CLASS(StyleSheetList)
 DOMCI_CLASS(CSSStyleSheet)
 
+// CSSValueList object that represents an nsIDOMCSSValueList, used
+// by DOM CSS
+DOMCI_CLASS(CSSValueList)
+
 // Range classes
 DOMCI_CLASS(Range)
 DOMCI_CLASS(Selection)
 
 // XUL classes
 #ifdef MOZ_XUL
 DOMCI_CLASS(XULDocument)
 DOMCI_CLASS(XULElement)
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -180,16 +180,17 @@ DOMInterfaces = {
 },
 
 "CSSValue": {
   "concrete": False
 },
 
 "CSSValueList": {
   "nativeType": "nsDOMCSSValueList",
+  "hasInstanceInterface": "nsIDOMCSSValueList"
 },
 
 'DelayNode': [
 {
     'resultNotAddRefed': [ 'delayTime' ],
 }],
 
 'Document': [
--- a/dom/interfaces/css/Makefile.in
+++ b/dom/interfaces/css/Makefile.in
@@ -16,16 +16,17 @@ GRE_MODULE	= 1
 
 SDK_XPIDLSRCS = 				\
 	nsIDOMCSSPrimitiveValue.idl		\
 	nsIDOMCSSRule.idl			\
 	nsIDOMCSSRuleList.idl			\
 	nsIDOMCSSStyleDeclaration.idl		\
 	nsIDOMCSSStyleSheet.idl			\
 	nsIDOMCSSValue.idl			\
+	nsIDOMCSSValueList.idl			\
 	nsIDOMElementCSSInlineStyle.idl		\
 	$(NULL)
 
 XPIDLSRCS =					\
 	nsIDOMCSSCharsetRule.idl		\
 	nsIDOMCSSConditionRule.idl		\
 	nsIDOMCSSFontFaceRule.idl		\
 	nsIDOMCSSGroupingRule.idl		\
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/css/nsIDOMCSSValueList.idl
@@ -0,0 +1,12 @@
+/* -*- 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/. */
+
+#include "domstubs.idl"
+#include "nsIDOMCSSValue.idl"
+
+[scriptable, uuid(92364ed1-e364-4175-bc52-c2fe9671cbc7)]
+interface nsIDOMCSSValueList : nsIDOMCSSValue
+{
+};
--- a/dom/tests/mochitest/chrome/Makefile.in
+++ b/dom/tests/mochitest/chrome/Makefile.in
@@ -46,16 +46,17 @@ MOCHITEST_CHROME_FILES = \
 		test_sandbox_postMessage.html \
 		test_sandbox_bindings.xul \
 		test_selectAtPoint.html \
 		selectAtPoint.html \
 		test_bug799299.xul \
 		file_bug799299.xul \
 		test_bug800817.xul \
 		file_bug800817.xul \
+		test_bug830396.xul \
 		test_subscript_bindings.xul \
 		file_subscript_bindings.js \
 		test_sandbox_eventhandler.xul \
 		test_DOM_element_instanceof.xul \
 		file_DOM_element_instanceof.xul \
 		$(NULL)
 
 ifeq (WINNT,$(OS_ARCH))
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/chrome/test_bug830396.xul
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
+                 type="text/css"?>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=830396
+-->
+<window title="Mozilla Bug 830396"
+  xmlns:html="http://www.w3.org/1999/xhtml"
+  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+  <title>Test for Bug 830396</title>
+  <script type="application/javascript"
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
+<script class="testbody" type="application/javascript">
+<![CDATA[
+
+function runTests()
+{
+  var doc = frames[0].document;
+  var cs = doc.defaultView.getComputedStyle(doc.body);
+  var nsIDOMCSSValueList = Components.interfaces.nsIDOMCSSValueList;
+  ok(cs.getPropertyCSSValue("cursor") instanceof nsIDOMCSSValueList,
+     "CSSValueList should be a nsIDOMCSSValueList");
+  SimpleTest.finish();
+}
+]]>
+</script>
+<body onload="runTests();"  xmlns="http://www.w3.org/1999/xhtml">
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=830396">Mozilla Bug 830396</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+  
+</div>
+<pre id="test">
+</pre>
+<iframe type="content"></iframe>
+</body>
+
+
+</window>
--- a/layout/style/nsDOMCSSValueList.cpp
+++ b/layout/style/nsDOMCSSValueList.cpp
@@ -4,37 +4,42 @@
 
 /* DOM object representing lists of values in DOM computed style */
 
 #include "nsDOMCSSValueList.h"
 #include "nsCOMPtr.h"
 #include "mozilla/dom/CSSValueListBinding.h"
 #include "nsError.h"
 #include "nsContentUtils.h"
+#include "nsDOMClassInfoID.h"
 
 using namespace mozilla;
 
 nsDOMCSSValueList::nsDOMCSSValueList(bool aCommaDelimited, bool aReadonly)
   : CSSValue(), mCommaDelimited(aCommaDelimited), mReadonly(aReadonly)
 {
   SetIsDOMBinding();
 }
 
 nsDOMCSSValueList::~nsDOMCSSValueList()
 {
 }
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMCSSValueList)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMCSSValueList)
 
+  DOMCI_DATA(CSSValueList, nsDOMCSSValueList)
+
 // QueryInterface implementation for nsDOMCSSValueList
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMCSSValueList)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsIDOMCSSValue)
+  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSValueList)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, CSSValue)
+  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CSSValueList)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(nsDOMCSSValueList, mCSSValues)
 
 JSObject*
 nsDOMCSSValueList::WrapObject(JSContext *cx, JSObject *scope, bool *tried)
 {
   return dom::CSSValueListBinding::Wrap(cx, scope, this, tried);
--- a/layout/style/nsDOMCSSValueList.h
+++ b/layout/style/nsDOMCSSValueList.h
@@ -2,25 +2,25 @@
  * 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/. */
 
 /* DOM object representing lists of values in DOM computed style */
 
 #ifndef nsDOMCSSValueList_h___
 #define nsDOMCSSValueList_h___
 
-#include "nsIDOMCSSValue.h"
+#include "nsIDOMCSSValueList.h"
 #include "CSSValue.h"
 #include "nsAutoPtr.h"
 #include "nsTArray.h"
 
 class nsComputedDOMStyle;
 
 class nsDOMCSSValueList MOZ_FINAL : public mozilla::dom::CSSValue,
-  public nsIDOMCSSValue
+  public nsIDOMCSSValueList
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsDOMCSSValueList, mozilla::dom::CSSValue)
 
   // nsIDOMCSSValue
   NS_DECL_NSIDOMCSSVALUE