Merge backout
authorJustin Wood <Callek@gmail.com>
Sat, 20 Aug 2011 15:07:27 -0400
changeset 75604 955f83dc4372d50ab24ff685d462f036b68aae1e
parent 75603 7797172fc164f2f75bb739b47e99f1a5eaaa53a6 (current diff)
parent 75602 4d3de57cf81321d04014c64e11b0e7f2e5ab9941 (diff)
child 75605 be2eb19328c43951d371e6761dcc8b043d5bb437
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
milestone9.0a1
Merge backout
db/Makefile.in
dom/interfaces/css/nsIDOMDocumentCSS.idl
layout/reftests/svg/dynamic-filter-contents-01.svg
modules/plugin/test/unit/xpcshell.ini
--- a/content/events/src/nsDOMMessageEvent.cpp
+++ b/content/events/src/nsDOMMessageEvent.cpp
@@ -98,19 +98,21 @@ nsDOMMessageEvent::UnrootData()
 {
   NS_ASSERTION(mDataRooted, "...");
   NS_DROP_JS_OBJECTS(this, nsDOMMessageEvent);
   mDataRooted = false;
   mData = JSVAL_VOID;
 }
 
 NS_IMETHODIMP
-nsDOMMessageEvent::GetData(jsval* aData)
+nsDOMMessageEvent::GetData(JSContext* aCx, jsval* aData)
 {
   *aData = mData;
+  if (!JS_WrapValue(aCx, aData))
+    return NS_ERROR_FAILURE;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMMessageEvent::GetOrigin(nsAString& aOrigin)
 {
   aOrigin = mOrigin;
   return NS_OK;
--- a/content/events/test/Makefile.in
+++ b/content/events/test/Makefile.in
@@ -132,15 +132,17 @@ endif
 		test_bug586961.xul \
 		test_bug415498.xul \
 		bug415498-doc1.html \
 		bug415498-doc2.html \
 		bug602962.xul \
 		test_bug602962.xul \
 		test_bug617528.xul \
 		window_bug617528.xul \
+		test_bug679494.xul \
+		file_bug679494.html \
 		$(NULL)
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
 
 libs:: $(_CHROME_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
new file mode 100644
--- /dev/null
+++ b/content/events/test/file_bug679494.html
@@ -0,0 +1,8 @@
+<html>
+<head>
+  <title>Test for Bug 679494</title>
+</head>
+<body>
+  There and back again.
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/content/events/test/test_bug679494.xul
@@ -0,0 +1,37 @@
+<?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=67949
+-->
+<window title="Mozilla Bug 67949" onload="doTest();"
+  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+  <title>Test for Bug 67949</title>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
+
+<body  xmlns="http://www.w3.org/1999/xhtml">
+  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=67949">Mozilla Bug 67949</a>
+  <p id="display"></p>
+<div id="content" style="display: none">
+  <iframe id="contentframe" src="http://mochi.test:8888/tests/content/event/test/file_679494.html"></iframe>
+</div>
+</body>
+
+<script class="testbody" type="application/javascript;version=1.8"><![CDATA[
+
+/* Test for bug 679494 */
+function doTest() {
+  SimpleTest.waitForExplicitFinish();
+
+  var w = document.getElementById("contentframe").contentWindow;
+  w.addEventListener("message", function(e) {
+    is("test", e.data, "We got the data without a compartment mismatch assertion!");
+    SimpleTest.finish();
+    }, false);
+  w.postMessage("test", "*");
+}
+
+]]></script>
+
+</window>
--- a/content/html/content/src/nsHTMLTableCellElement.cpp
+++ b/content/html/content/src/nsHTMLTableCellElement.cpp
@@ -31,24 +31,26 @@
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 #include "nsIDOMHTMLTableCellElement.h"
 #include "nsIDOMHTMLTableRowElement.h"
+#include "nsHTMLTableElement.h"
 #include "nsIDOMHTMLCollection.h"
 #include "nsIDOMEventTarget.h"
 #include "nsMappedAttributes.h"
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsPresContext.h"
 #include "nsRuleData.h"
+#include "nsRuleWalker.h"
 #include "nsIDocument.h"
 #include "celldata.h"
 
 class nsHTMLTableCellElement : public nsGenericHTMLElement,
                                public nsIDOMHTMLTableCellElement
 {
 public:
   nsHTMLTableCellElement(already_AddRefed<nsINodeInfo> aNodeInfo);
@@ -198,29 +200,25 @@ nsHTMLTableCellElement::GetCellIndex(PRI
 
 
 NS_IMETHODIMP
 nsHTMLTableCellElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
 {
   nsresult rv = nsGenericHTMLElement::WalkContentStyleRules(aRuleWalker);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  // Add style information from the mapped attributes of the table
-  // element.  This depends on the strange behavior of the
-  // |MapAttributesIntoRule| in nsHTMLTableElement.cpp, which is
-  // technically incorrect since it's violating the nsIStyleRule
-  // contract.  However, things are OK (except for the incorrect
-  // dependence on display type rather than tag) since tables and cells
-  // match different, less specific, rules.
-  nsIContent* table = GetTable();
-  if (table) {
-    rv = table->WalkContentStyleRules(aRuleWalker);
+  nsIContent* node = GetTable();
+  if (node && node->IsHTML() && node->NodeInfo()->Equals(nsGkAtoms::table)) {
+    nsHTMLTableElement* table = static_cast<nsHTMLTableElement*>(node);
+    nsMappedAttributes* tableInheritedAttributes =
+      table->GetAttributesMappedForCell();
+    if (tableInheritedAttributes)
+      aRuleWalker->Forward(tableInheritedAttributes);
   }
-
-  return rv;
+  return NS_OK;
 }
 
 
 NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Abbr, abbr)
 NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Axis, axis)
 NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, BgColor, bgcolor)
 NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Ch, _char)
 NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, ChOff, charoff)
--- a/content/html/content/src/nsHTMLTableElement.cpp
+++ b/content/html/content/src/nsHTMLTableElement.cpp
@@ -29,91 +29,38 @@
  * under the terms of either the GPL or the LGPL, and not to allow others to
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
-#include "nsIDOMHTMLTableElement.h"
+#include "nsHTMLTableElement.h"
 #include "nsIDOMHTMLTableCaptionElem.h"
 #include "nsIDOMHTMLTableSectionElem.h"
 #include "nsCOMPtr.h"
 #include "nsIDOMEventTarget.h"
 #include "nsDOMError.h"
 #include "nsContentList.h"
-#include "nsMappedAttributes.h"
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsPresContext.h"
 #include "nsHTMLParts.h"
 #include "nsRuleData.h"
 #include "nsStyleContext.h"
 #include "nsIDocument.h"
 #include "nsContentUtils.h"
 /* for collections */
 #include "nsIDOMElement.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIHTMLCollection.h"
 /* end for collections */
-
-class TableRowsCollection;
-
-class nsHTMLTableElement :  public nsGenericHTMLElement,
-                            public nsIDOMHTMLTableElement
-{
-public:
-  nsHTMLTableElement(already_AddRefed<nsINodeInfo> aNodeInfo);
-  virtual ~nsHTMLTableElement();
-
-  // nsISupports
-  NS_DECL_ISUPPORTS_INHERITED
-
-  // nsIDOMNode
-  NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
-
-  // nsIDOMElement
-  NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
-
-  // nsIDOMHTMLElement
-  NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
-
-  // nsIDOMHTMLTableElement
-  NS_DECL_NSIDOMHTMLTABLEELEMENT
-
-  virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
-                                nsIAtom* aAttribute,
-                                const nsAString& aValue,
-                                nsAttrValue& aResult);
-  virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
-  NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
-
-  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
-
-  virtual nsXPCClassInfo* GetClassInfo();
-
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLTableElement,
-                                                     nsGenericHTMLElement)
-
-  already_AddRefed<nsIDOMHTMLTableSectionElement> GetTHead() {
-    return GetSection(nsGkAtoms::thead);
-  }
-  already_AddRefed<nsIDOMHTMLTableSectionElement> GetTFoot() {
-    return GetSection(nsGkAtoms::tfoot);
-  }
-  nsContentList* TBodies();
-protected:
-  already_AddRefed<nsIDOMHTMLTableSectionElement> GetSection(nsIAtom *aTag);
-
-  nsRefPtr<nsContentList> mTBodies;
-  nsRefPtr<TableRowsCollection> mRows;
-};
-
+#include "nsHTMLStyleSheet.h"
 
 /* ------------------------------ TableRowsCollection -------------------------------- */
 /**
  * This class provides a late-bound collection of rows in a table.
  * mParent is NOT ref-counted to avoid circular references
  */
 class TableRowsCollection : public nsIHTMLCollection 
 {
@@ -362,25 +309,27 @@ TableRowsCollection::ParentDestroyed()
 /* -------------------------- nsHTMLTableElement --------------------------- */
 // the class declaration is at the top of this file
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Table)
 
 
 nsHTMLTableElement::nsHTMLTableElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : nsGenericHTMLElement(aNodeInfo)
+  : nsGenericHTMLElement(aNodeInfo),
+    mTableInheritedAttributes(TABLE_ATTRS_DIRTY)
 {
 }
 
 nsHTMLTableElement::~nsHTMLTableElement()
 {
   if (mRows) {
     mRows->ParentDestroyed();
   }
+  ReleaseInheritedAttributes();
 }
 
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLTableElement)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLTableElement,
                                                   nsGenericHTMLElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mTBodies,
                                                        nsIDOMNodeList)
@@ -1025,229 +974,165 @@ MapAttributesIntoRule(const nsMappedAttr
   // testing the display type of the style context rather than checking
   // which *element* it's matching (style rules should not stop matching
   // when the display type is changed).
 
   nsPresContext* presContext = aData->mPresContext;
   nsCompatibility mode = presContext->CompatibilityMode();
 
   if (aData->mSIDs & NS_STYLE_INHERIT_BIT(TableBorder)) {
-    const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay();
-    if (readDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL) {
-      // cellspacing
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::cellspacing);
-      nsCSSValue* borderSpacing = aData->ValueForBorderSpacing();
-      if (value && value->Type() == nsAttrValue::eInteger) {
-        if (borderSpacing->GetUnit() == eCSSUnit_Null)
-          borderSpacing->
-            SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);
+    // cellspacing
+    const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::cellspacing);
+    nsCSSValue* borderSpacing = aData->ValueForBorderSpacing();
+    if (value && value->Type() == nsAttrValue::eInteger) {
+      if (borderSpacing->GetUnit() == eCSSUnit_Null) {
+        borderSpacing->
+          SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);
       }
-      else if (value && value->Type() == nsAttrValue::ePercent &&
-               eCompatibility_NavQuirks == mode) {
-        // in quirks mode, treat a % cellspacing value a pixel value.
-        if (borderSpacing->GetUnit() == eCSSUnit_Null)
-          borderSpacing->
-            SetFloatValue(100.0f * value->GetPercentValue(), eCSSUnit_Pixel);
+    }
+    else if (value && value->Type() == nsAttrValue::ePercent &&
+             eCompatibility_NavQuirks == mode) {
+      // in quirks mode, treat a % cellspacing value a pixel value.
+      if (borderSpacing->GetUnit() == eCSSUnit_Null) {
+        borderSpacing->
+         SetFloatValue(100.0f * value->GetPercentValue(), eCSSUnit_Pixel);
       }
     }
   }
   if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Table)) {
-    const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay();
-    if (readDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL) {
-      const nsAttrValue* value;
-      // layout
-      nsCSSValue* tableLayout = aData->ValueForTableLayout();
-      if (tableLayout->GetUnit() == eCSSUnit_Null) {
-        value = aAttributes->GetAttr(nsGkAtoms::layout);
-        if (value && value->Type() == nsAttrValue::eEnum)
-          tableLayout->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
-      }
-      
-      // cols
-      value = aAttributes->GetAttr(nsGkAtoms::cols);
-      if (value) {
-        nsCSSValue* cols = aData->ValueForCols();
-        if (value->Type() == nsAttrValue::eInteger) 
-          cols->SetIntValue(value->GetIntegerValue(), eCSSUnit_Integer);
-        else // COLS had no value, so it refers to all columns
-          cols->SetIntValue(NS_STYLE_TABLE_COLS_ALL, eCSSUnit_Enumerated);
-      }
+    const nsAttrValue* value;
+    // layout
+    nsCSSValue* tableLayout = aData->ValueForTableLayout();
+    if (tableLayout->GetUnit() == eCSSUnit_Null) {
+      value = aAttributes->GetAttr(nsGkAtoms::layout);
+      if (value && value->Type() == nsAttrValue::eEnum)
+        tableLayout->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
+    }
+    // cols
+    value = aAttributes->GetAttr(nsGkAtoms::cols);
+    if (value) {
+      nsCSSValue* cols = aData->ValueForCols();
+      if (value->Type() == nsAttrValue::eInteger)
+        cols->SetIntValue(value->GetIntegerValue(), eCSSUnit_Integer);
+      else // COLS had no value, so it refers to all columns
+        cols->SetIntValue(NS_STYLE_TABLE_COLS_ALL, eCSSUnit_Enumerated);
     }
   }
   if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Margin)) {
     const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay();
-  
-    if (readDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL) {
-      // align; Check for enumerated type (it may be another type if
-      // illegal)
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
+    // align; Check for enumerated type (it may be another type if
+    // illegal)
+    const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
 
-      if (value && value->Type() == nsAttrValue::eEnum) {
-        if (value->GetEnumValue() == NS_STYLE_TEXT_ALIGN_CENTER ||
-            value->GetEnumValue() == NS_STYLE_TEXT_ALIGN_MOZ_CENTER) {
-          nsCSSValue* marginLeft = aData->ValueForMarginLeftValue();
-          if (marginLeft->GetUnit() == eCSSUnit_Null)
-            marginLeft->SetAutoValue();
-          nsCSSValue* marginRight = aData->ValueForMarginRightValue();
-          if (marginRight->GetUnit() == eCSSUnit_Null)
-            marginRight->SetAutoValue();
-        }
+    if (value && value->Type() == nsAttrValue::eEnum) {
+      if (value->GetEnumValue() == NS_STYLE_TEXT_ALIGN_CENTER ||
+          value->GetEnumValue() == NS_STYLE_TEXT_ALIGN_MOZ_CENTER) {
+        nsCSSValue* marginLeft = aData->ValueForMarginLeftValue();
+        if (marginLeft->GetUnit() == eCSSUnit_Null)
+          marginLeft->SetAutoValue();
+        nsCSSValue* marginRight = aData->ValueForMarginRightValue();
+        if (marginRight->GetUnit() == eCSSUnit_Null)
+          marginRight->SetAutoValue();
+      }
+    }
+
+    // hspace is mapped into left and right margin,
+    // vspace is mapped into top and bottom margins
+    // - *** Quirks Mode only ***
+    if (eCompatibility_NavQuirks == mode) {
+      value = aAttributes->GetAttr(nsGkAtoms::hspace);
+
+      if (value && value->Type() == nsAttrValue::eInteger) {
+        nsCSSValue* marginLeft = aData->ValueForMarginLeftValue();
+        if (marginLeft->GetUnit() == eCSSUnit_Null)
+          marginLeft->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel); 
+        nsCSSValue* marginRight = aData->ValueForMarginRightValue();
+        if (marginRight->GetUnit() == eCSSUnit_Null)
+          marginRight->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);
       }
 
-      // hspace is mapped into left and right margin, 
-      // vspace is mapped into top and bottom margins
-      // - *** Quirks Mode only ***
-      if (eCompatibility_NavQuirks == mode) {
-        value = aAttributes->GetAttr(nsGkAtoms::hspace);
-
-        if (value && value->Type() == nsAttrValue::eInteger) {
-          nsCSSValue* marginLeft = aData->ValueForMarginLeftValue();
-          if (marginLeft->GetUnit() == eCSSUnit_Null)
-            marginLeft->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel); 
-          nsCSSValue* marginRight = aData->ValueForMarginRightValue();
-          if (marginRight->GetUnit() == eCSSUnit_Null)
-            marginRight->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);
-        }
-
-        value = aAttributes->GetAttr(nsGkAtoms::vspace);
+      value = aAttributes->GetAttr(nsGkAtoms::vspace);
 
-        if (value && value->Type() == nsAttrValue::eInteger) {
-          nsCSSValue* marginTop = aData->ValueForMarginTop();
-          if (marginTop->GetUnit() == eCSSUnit_Null)
-            marginTop->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel); 
-          nsCSSValue* marginBottom = aData->ValueForMarginBottom();
-          if (marginBottom->GetUnit() == eCSSUnit_Null)
-            marginBottom->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel); 
-        }
-      }
-    }
-  }
-  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Padding)) {
-    const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay();
-    if (readDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL) {
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::cellpadding);
-      if (value) {
-        nsAttrValue::ValueType valueType = value->Type();
-        if (valueType == nsAttrValue::eInteger || valueType == nsAttrValue::ePercent) {
-          // We have cellpadding.  This will override our padding values if we don't
-          // have any set.
-          nsCSSValue padVal;
-          if (valueType == nsAttrValue::eInteger)
-            padVal.SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);
-          else {
-            // when we support % cellpadding in standard mode, uncomment the following
-            float pctVal = value->GetPercentValue();
-            //if (eCompatibility_NavQuirks == mode) {
-              // in quirks mode treat a pct cellpadding value as a pixel value
-              padVal.SetFloatValue(100.0f * pctVal, eCSSUnit_Pixel);
-            //}
-            //else {
-            //  padVal.SetPercentValue(pctVal);
-            //}
-          }
-          nsCSSValue* paddingLeft = aData->ValueForPaddingLeftValue();
-          if (paddingLeft->GetUnit() == eCSSUnit_Null)
-            *paddingLeft = padVal;
-          nsCSSValue* paddingRight = aData->ValueForPaddingRightValue();
-          if (paddingRight->GetUnit() == eCSSUnit_Null)
-            *paddingRight = padVal;
-          nsCSSValue* paddingTop = aData->ValueForPaddingTop();
-          if (paddingTop->GetUnit() == eCSSUnit_Null)
-            *paddingTop = padVal;
-          nsCSSValue* paddingBottom = aData->ValueForPaddingBottom();
-          if (paddingBottom->GetUnit() == eCSSUnit_Null)
-            *paddingBottom = padVal;
-        }
+      if (value && value->Type() == nsAttrValue::eInteger) {
+        nsCSSValue* marginTop = aData->ValueForMarginTop();
+        if (marginTop->GetUnit() == eCSSUnit_Null)
+          marginTop->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel); 
+        nsCSSValue* marginBottom = aData->ValueForMarginBottom();
+        if (marginBottom->GetUnit() == eCSSUnit_Null)
+          marginBottom->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel); 
       }
     }
   }
   if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Position)) {
-    const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay();
-  
-    if (readDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL) {
-      // width: value
-      nsCSSValue* width = aData->ValueForWidth();
-      if (width->GetUnit() == eCSSUnit_Null) {
-        const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
-        if (value && value->Type() == nsAttrValue::eInteger) 
-          width->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);
-        else if (value && value->Type() == nsAttrValue::ePercent)
-          width->SetPercentValue(value->GetPercentValue());
-      }
+    // width: value
+    nsCSSValue* width = aData->ValueForWidth();
+    if (width->GetUnit() == eCSSUnit_Null) {
+      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
+      if (value && value->Type() == nsAttrValue::eInteger)
+        width->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);
+      else if (value && value->Type() == nsAttrValue::ePercent)
+        width->SetPercentValue(value->GetPercentValue());
+    }
 
-      // height: value
-      nsCSSValue* height = aData->ValueForHeight();
-      if (height->GetUnit() == eCSSUnit_Null) {
-        const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::height);
-        if (value && value->Type() == nsAttrValue::eInteger) 
-          height->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);
-        else if (value && value->Type() == nsAttrValue::ePercent)
-          height->SetPercentValue(value->GetPercentValue()); 
-      }
+    // height: value
+    nsCSSValue* height = aData->ValueForHeight();
+    if (height->GetUnit() == eCSSUnit_Null) {
+      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::height);
+      if (value && value->Type() == nsAttrValue::eInteger)
+        height->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);
+      else if (value && value->Type() == nsAttrValue::ePercent)
+        height->SetPercentValue(value->GetPercentValue());
     }
   }
-  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Visibility)) {
-    const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay();
-  
-    if (readDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL)
-      nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
-  }
   if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Border)) {
-    const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay();
-    if (readDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL) {
-      // bordercolor
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::bordercolor);
-      nscolor color;
-      if (value && presContext->UseDocumentColors() &&
-          value->GetColorValue(color)) {
-        nsCSSValue* borderLeftColor = aData->ValueForBorderLeftColorValue();
-        if (borderLeftColor->GetUnit() == eCSSUnit_Null)
-          borderLeftColor->SetColorValue(color);
-        nsCSSValue* borderRightColor = aData->ValueForBorderRightColorValue();
-        if (borderRightColor->GetUnit() == eCSSUnit_Null)
-          borderRightColor->SetColorValue(color);
-        nsCSSValue* borderTopColor = aData->ValueForBorderTopColor();
-        if (borderTopColor->GetUnit() == eCSSUnit_Null)
-          borderTopColor->SetColorValue(color);
-        nsCSSValue* borderBottomColor = aData->ValueForBorderBottomColor();
-        if (borderBottomColor->GetUnit() == eCSSUnit_Null)
-          borderBottomColor->SetColorValue(color);
-      }
+    // bordercolor
+    const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::bordercolor);
+    nscolor color;
+    if (value && presContext->UseDocumentColors() &&
+        value->GetColorValue(color)) {
+      nsCSSValue* borderLeftColor = aData->ValueForBorderLeftColorValue();
+      if (borderLeftColor->GetUnit() == eCSSUnit_Null)
+        borderLeftColor->SetColorValue(color);
+      nsCSSValue* borderRightColor = aData->ValueForBorderRightColorValue();
+      if (borderRightColor->GetUnit() == eCSSUnit_Null)
+        borderRightColor->SetColorValue(color);
+      nsCSSValue* borderTopColor = aData->ValueForBorderTopColor();
+      if (borderTopColor->GetUnit() == eCSSUnit_Null)
+        borderTopColor->SetColorValue(color);
+      nsCSSValue* borderBottomColor = aData->ValueForBorderBottomColor();
+      if (borderBottomColor->GetUnit() == eCSSUnit_Null)
+        borderBottomColor->SetColorValue(color);
+    }
 
-      // border
-      const nsAttrValue* borderValue = aAttributes->GetAttr(nsGkAtoms::border);
-      if (borderValue) {
-        // border = 1 pixel default
-        PRInt32 borderThickness = 1;
+    // border
+    const nsAttrValue* borderValue = aAttributes->GetAttr(nsGkAtoms::border);
+    if (borderValue) {
+      // border = 1 pixel default
+      PRInt32 borderThickness = 1;
 
-        if (borderValue->Type() == nsAttrValue::eInteger)
-          borderThickness = borderValue->GetIntegerValue();
+      if (borderValue->Type() == nsAttrValue::eInteger)
+        borderThickness = borderValue->GetIntegerValue();
 
-        // by default, set all border sides to the specified width
-        nsCSSValue* borderLeftWidth = aData->ValueForBorderLeftWidthValue();
-        if (borderLeftWidth->GetUnit() == eCSSUnit_Null)
-          borderLeftWidth->SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
-        nsCSSValue* borderRightWidth = aData->ValueForBorderRightWidthValue();
-        if (borderRightWidth->GetUnit() == eCSSUnit_Null)
-          borderRightWidth->SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
-        nsCSSValue* borderTopWidth = aData->ValueForBorderTopWidth();
-        if (borderTopWidth->GetUnit() == eCSSUnit_Null)
-          borderTopWidth->SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
-        nsCSSValue* borderBottomWidth = aData->ValueForBorderBottomWidth();
-        if (borderBottomWidth->GetUnit() == eCSSUnit_Null)
-          borderBottomWidth->SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
-      }
+      // by default, set all border sides to the specified width
+      nsCSSValue* borderLeftWidth = aData->ValueForBorderLeftWidthValue();
+      if (borderLeftWidth->GetUnit() == eCSSUnit_Null)
+        borderLeftWidth->SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
+      nsCSSValue* borderRightWidth = aData->ValueForBorderRightWidthValue();
+      if (borderRightWidth->GetUnit() == eCSSUnit_Null)
+        borderRightWidth->SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
+      nsCSSValue* borderTopWidth = aData->ValueForBorderTopWidth();
+      if (borderTopWidth->GetUnit() == eCSSUnit_Null)
+        borderTopWidth->SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
+      nsCSSValue* borderBottomWidth = aData->ValueForBorderBottomWidth();
+      if (borderBottomWidth->GetUnit() == eCSSUnit_Null)
+        borderBottomWidth->SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
     }
   }
-  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Background)) {
-    const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay();
-  
-    if (readDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL)
-      nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
-  }
+  nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
+  nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(PRBool)
 nsHTMLTableElement::IsAttributeMapped(const nsIAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
     { &nsGkAtoms::layout },
     { &nsGkAtoms::cellpadding },
@@ -1274,8 +1159,149 @@ nsHTMLTableElement::IsAttributeMapped(co
   return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
 }
 
 nsMapRuleToAttributesFunc
 nsHTMLTableElement::GetAttributeMappingFunction() const
 {
   return &MapAttributesIntoRule;
 }
+
+static void
+MapInheritedTableAttributesIntoRule(const nsMappedAttributes* aAttributes,
+                                    nsRuleData* aData)
+{
+  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Padding)) {
+    const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::cellpadding);
+    if (value) {
+      nsAttrValue::ValueType valueType = value->Type();
+      if (valueType == nsAttrValue::eInteger ||
+          valueType == nsAttrValue::ePercent) {
+        // We have cellpadding.  This will override our padding values if we
+        // don't have any set.
+        nsCSSValue padVal;
+        if (valueType == nsAttrValue::eInteger)
+          padVal.SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);
+        else {
+          // when we support % cellpadding in standard mode, uncomment the
+          // following
+          float pctVal = value->GetPercentValue();
+          //if (eCompatibility_NavQuirks == mode) {
+          // in quirks mode treat a pct cellpadding value as a pixel value
+          padVal.SetFloatValue(100.0f * pctVal, eCSSUnit_Pixel);
+          //}
+          //else {
+          //  padVal.SetPercentValue(pctVal);
+          //}
+        }
+        nsCSSValue* paddingLeft = aData->ValueForPaddingLeftValue();
+        if (paddingLeft->GetUnit() == eCSSUnit_Null)
+          *paddingLeft = padVal;
+        nsCSSValue* paddingRight = aData->ValueForPaddingRightValue();
+        if (paddingRight->GetUnit() == eCSSUnit_Null)
+          *paddingRight = padVal;
+        nsCSSValue* paddingTop = aData->ValueForPaddingTop();
+        if (paddingTop->GetUnit() == eCSSUnit_Null)
+          *paddingTop = padVal;
+        nsCSSValue* paddingBottom = aData->ValueForPaddingBottom();
+        if (paddingBottom->GetUnit() == eCSSUnit_Null)
+          *paddingBottom = padVal;
+      }
+    }
+  }
+}
+
+nsMappedAttributes*
+nsHTMLTableElement::GetAttributesMappedForCell()
+{
+  if (mTableInheritedAttributes) {
+    if (mTableInheritedAttributes == TABLE_ATTRS_DIRTY)
+      BuildInheritedAttributes();
+    if (mTableInheritedAttributes != TABLE_ATTRS_DIRTY)
+      return mTableInheritedAttributes;
+  }
+  return nsnull;
+}
+
+void
+nsHTMLTableElement::BuildInheritedAttributes()
+{
+  NS_ASSERTION(mTableInheritedAttributes == TABLE_ATTRS_DIRTY,
+               "potential leak, plus waste of work");
+  nsIDocument *document = GetCurrentDoc();
+  nsHTMLStyleSheet* sheet = document ?
+                              document->GetAttributeStyleSheet() : nsnull;
+  nsRefPtr<nsMappedAttributes> newAttrs;
+  if (sheet) {
+    const nsAttrValue* value = mAttrsAndChildren.GetAttr(nsGkAtoms::cellpadding);
+    if (value) {
+      nsRefPtr<nsMappedAttributes> modifiableMapped = new
+      nsMappedAttributes(sheet, MapInheritedTableAttributesIntoRule);
+
+      if (modifiableMapped) {
+        nsAttrValue val(*value);
+        modifiableMapped->SetAndTakeAttr(nsGkAtoms::cellpadding, val);
+      }
+      newAttrs = sheet->UniqueMappedAttributes(modifiableMapped);
+      NS_ASSERTION(newAttrs, "out of memory, but handling gracefully");
+
+      if (newAttrs != modifiableMapped) {
+        // Reset the stylesheet of modifiableMapped so that it doesn't
+        // spend time trying to remove itself from the hash.  There is no
+        // risk that modifiableMapped is in the hash since we created
+        // it ourselves and it didn't come from the stylesheet (in which
+        // case it would not have been modifiable).
+        modifiableMapped->DropStyleSheetReference();
+      }
+    }
+    mTableInheritedAttributes = newAttrs;
+    NS_IF_ADDREF(mTableInheritedAttributes);
+  }
+}
+
+nsresult
+nsHTMLTableElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
+                              nsIContent* aBindingParent,
+                              PRBool aCompileEventHandlers)
+{
+  ReleaseInheritedAttributes();
+  return nsGenericHTMLElement::BindToTree(aDocument, aParent,
+                                          aBindingParent,
+                                          aCompileEventHandlers);
+}
+
+void
+nsHTMLTableElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
+{
+  ReleaseInheritedAttributes();
+  nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
+}
+
+nsresult
+nsHTMLTableElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
+                            nsIAtom* aPrefix, const nsAString& aValue,
+                            PRBool aNotify)
+{
+  PRBool isCellPadding = (aAttribute == nsGkAtoms::cellpadding);
+  if (isCellPadding) {
+    ReleaseInheritedAttributes();
+  }
+
+  nsresult rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aAttribute,
+                                              aPrefix, aValue, aNotify);
+
+  if (isCellPadding) {
+    BuildInheritedAttributes();
+  }
+  return rv;
+}
+
+nsresult
+nsHTMLTableElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
+                               PRBool aNotify)
+{
+  PRBool isCellPadding = (aAttribute == nsGkAtoms::cellpadding);
+  if (isCellPadding) {
+    ReleaseInheritedAttributes();
+  }
+
+  return nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
+}
new file mode 100644
--- /dev/null
+++ b/content/html/content/src/nsHTMLTableElement.h
@@ -0,0 +1,116 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+#include "nsIDOMHTMLTableElement.h"
+#include "nsGenericHTMLElement.h"
+#include "nsMappedAttributes.h"
+
+#define TABLE_ATTRS_DIRTY ((nsMappedAttributes*)0x1)
+
+
+class TableRowsCollection;
+
+class nsHTMLTableElement :  public nsGenericHTMLElement,
+                            public nsIDOMHTMLTableElement
+{
+public:
+  nsHTMLTableElement(already_AddRefed<nsINodeInfo> aNodeInfo);
+  virtual ~nsHTMLTableElement();
+
+  // nsISupports
+  NS_DECL_ISUPPORTS_INHERITED
+
+  // nsIDOMNode
+  NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
+
+  // nsIDOMElement
+  NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
+
+  // nsIDOMHTMLElement
+  NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
+
+  // nsIDOMHTMLTableElement
+  NS_DECL_NSIDOMHTMLTABLEELEMENT
+
+  virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
+                                nsIAtom* aAttribute,
+                                const nsAString& aValue,
+                                nsAttrValue& aResult);
+  virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
+  NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
+
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
+
+  virtual nsXPCClassInfo* GetClassInfo();
+  virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
+                              nsIContent* aBindingParent,
+                              PRBool aCompileEventHandlers);
+  virtual void UnbindFromTree(PRBool aDeep = PR_TRUE,
+                              PRBool aNullParent = PR_TRUE);
+  virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom *aName,
+                           nsIAtom *aPrefix, const nsAString &aValue,
+                           PRBool aNotify);
+  virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
+                             PRBool aNotify);
+
+
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLTableElement,
+                                                     nsGenericHTMLElement)
+  nsMappedAttributes* GetAttributesMappedForCell();
+  already_AddRefed<nsIDOMHTMLTableSectionElement> GetTHead() {
+    return GetSection(nsGkAtoms::thead);
+  }
+  already_AddRefed<nsIDOMHTMLTableSectionElement> GetTFoot() {
+    return GetSection(nsGkAtoms::tfoot);
+  }
+  nsContentList* TBodies();
+protected:
+  already_AddRefed<nsIDOMHTMLTableSectionElement> GetSection(nsIAtom *aTag);
+
+  nsRefPtr<nsContentList> mTBodies;
+  nsRefPtr<TableRowsCollection> mRows;
+  // Sentinel value of TABLE_ATTRS_DIRTY indicates that this is dirty and needs
+  // to be recalculated.
+  nsMappedAttributes *mTableInheritedAttributes;
+  void BuildInheritedAttributes();
+  void ReleaseInheritedAttributes() {
+    if (mTableInheritedAttributes &&
+        mTableInheritedAttributes != TABLE_ATTRS_DIRTY)
+      NS_RELEASE(mTableInheritedAttributes);
+      mTableInheritedAttributes = TABLE_ATTRS_DIRTY;
+  }
+};
+
--- a/content/svg/content/src/nsSVGFilters.cpp
+++ b/content/svg/content/src/nsSVGFilters.cpp
@@ -283,16 +283,30 @@ NS_IMETHODIMP nsSVGFE::GetHeight(nsIDOMS
 
 /* readonly attribute nsIDOMSVGAnimatedString result; */
 NS_IMETHODIMP nsSVGFE::GetResult(nsIDOMSVGAnimatedString * *aResult)
 {
   return GetResultImageName().ToDOMAnimatedString(aResult, this);
 }
 
 //----------------------------------------------------------------------
+// nsIContent methods
+
+NS_IMETHODIMP_(PRBool)
+nsSVGFE::IsAttributeMapped(const nsIAtom* name) const
+{
+  static const MappedAttributeEntry* const map[] = {
+    sFiltersMap
+  };
+  
+  return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
+    nsSVGFEBase::IsAttributeMapped(name);
+}
+
+//----------------------------------------------------------------------
 // nsSVGElement methods
 
 nsSVGElement::LengthAttributesInfo
 nsSVGFE::GetLengthInfo()
 {
   return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
                               NS_ARRAY_LENGTH(sLengthInfo));
 }
@@ -2746,18 +2760,17 @@ nsSVGFEFloodElement::ComputeTargetBBox(c
 
 //----------------------------------------------------------------------
 // nsIContent methods
 
 NS_IMETHODIMP_(PRBool)
 nsSVGFEFloodElement::IsAttributeMapped(const nsIAtom* name) const
 {
   static const MappedAttributeEntry* const map[] = {
-    sFEFloodMap,
-    sFiltersMap
+    sFEFloodMap
   };
   
   return FindAttributeDependence(name, map, NS_ARRAY_LENGTH(map)) ||
     nsSVGFEFloodElementBase::IsAttributeMapped(name);
 }
 
 //----------------------------------------------------------------------
 // nsSVGElement methods
--- a/content/svg/content/src/nsSVGFilters.h
+++ b/content/svg/content/src/nsSVGFilters.h
@@ -142,16 +142,19 @@ public:
   virtual PRBool SubregionIsUnionOfRegions() { return PR_TRUE; }
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_SVG_FE_CID)
   
   // interfaces:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMSVGFILTERPRIMITIVESTANDARDATTRIBUTES
 
+  // nsIContent interface
+  NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
+
   virtual nsSVGString& GetResultImageName() = 0;
   // Return a list of all image names used as sources. Default is to
   // return no sources.
   virtual void GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources);
   // Compute the bounding box of the filter output. The default is just the
   // union of the source bounding boxes. The caller is
   // responsible for clipping this to the filter primitive subregion, so
   // if the filter fills its filter primitive subregion, it can just
deleted file mode 100644
--- a/db/Makefile.in
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either of the GNU General Public License Version 2 or later (the "GPL"),
-# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH     = ..
-topsrcdir = @top_srcdir@
-srcdir    = @srcdir@
-VPATH     = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMDocumentCSS.idl
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2000
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Johnny Stenback <jst@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsIDOMDocumentStyle.idl"
-
-[scriptable, uuid(39f76c23-45b2-428a-9240-a981e5abf148)]
-interface nsIDOMDocumentCSS : nsIDOMDocumentStyle
-{
-  nsIDOMCSSStyleDeclaration getOverrideStyle(in nsIDOMElement elt, 
-                                       in DOMString pseudoElt);
-};
--- a/dom/interfaces/events/nsIDOMMessageEvent.idl
+++ b/dom/interfaces/events/nsIDOMMessageEvent.idl
@@ -46,16 +46,17 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#messageevent
  */
 [scriptable, uuid(dc8ec5c6-ebf2-4f95-be99-cd13e3c0d0c6)]
 interface nsIDOMMessageEvent : nsIDOMEvent
 {
   /**
    * Custom string data associated with this event.
    */
+  [implicit_jscontext]
   readonly attribute jsval data;
   
   /**
    * The origin of the site from which this event originated, which is the
    * scheme, ":", and if the URI has a host, "//" followed by the
    * host, and if the port is not the default for the given scheme,
    * ":" followed by that port.  This value does not have a trailing slash.
    */
--- a/dom/interfaces/svg/nsIDOMSVGSVGElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGSVGElement.idl
@@ -69,17 +69,16 @@ interface nsIDOMSVGSVGElement
     nsIDOMSVGTests,
     nsIDOMSVGLangSpace,
     nsIDOMSVGExternalResourcesRequired,
     nsIDOMSVGStylable,
     nsIDOMSVGLocatable,
     nsIDOMSVGFitToViewBox,
     nsIDOMSVGZoomAndPan,
     events::nsIDOMEventTarget,
-    css::nsIDOMDocumentCSS
 */
 { 
   readonly attribute nsIDOMSVGAnimatedLength x;
   readonly attribute nsIDOMSVGAnimatedLength y;
   readonly attribute nsIDOMSVGAnimatedLength width;
   readonly attribute nsIDOMSVGAnimatedLength height;
   attribute DOMString         contentScriptType;
       // raises DOMException on setting
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/175190-1-ref.html
@@ -0,0 +1,40 @@
+<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<title>Test Page</title>
+<style type="text/css">
+<!--
+td{
+  background-color: rgb(140,140,140);
+}
+-->
+</style>
+</head>
+<body>
+<table cellpadding=0 cellspacing=0 border=0 width=150>
+<tr><td><img  width="16" height="16"
+             src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4z8AAAAMBAQD3A0FDAAAAAElFTkSuQmCC"
+             border=0></td></tr>
+<tr><td><img  width="16" height="16"
+             src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4z8AAAAMBAQD3A0FDAAAAAElFTkSuQmCC"
+             border=0></td></tr>
+</table>
+<table cellpadding=0 cellspacing=0 border=0 width=150>
+<tr><td><img  width="16" height="16"
+             src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4z8AAAAMBAQD3A0FDAAAAAElFTkSuQmCC"
+             border=0></td></tr>
+<tr><td><img  width="16" height="16"
+             src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4z8AAAAMBAQD3A0FDAAAAAElFTkSuQmCC"
+             border=0></td></tr>
+</table>
+<table cellpadding=0 cellspacing=0 border=0>
+<tr><td><img  width="16" height="16"
+             src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4z8AAAAMBAQD3A0FDAAAAAElFTkSuQmCC"
+             border=0></td></tr>
+<tr><td><img  width="16" height="16"
+             src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4z8AAAAMBAQD3A0FDAAAAAElFTkSuQmCC"
+             border=0></td></tr>
+</table>
+<hr>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/175190-1.html
@@ -0,0 +1,41 @@
+<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<title>Test Page</title>
+<style type="text/css">
+<!--
+.nav {
+  display:block;
+  background-color: rgb(140,140,140);
+}
+-->
+</style>
+</head>
+<body>
+<table cellpadding=0 cellspacing=0 border=0 width=150>
+<tr><td class="nav"><a href="a.htm"><img  width="16" height="16"
+             src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4z8AAAAMBAQD3A0FDAAAAAElFTkSuQmCC"
+             border=0></a></td></tr>
+<tr><td class="nav"><a href="a.htm"><img  width="16" height="16"
+             src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4z8AAAAMBAQD3A0FDAAAAAElFTkSuQmCC"
+             border=0></a></td></tr>
+</table>
+<table cellpadding=0 cellspacing=0 border=0 width=150>
+<tr><td><a href="a.htm" class="nav"><img  width="16" height="16"
+             src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4z8AAAAMBAQD3A0FDAAAAAElFTkSuQmCC"
+             border=0></a></td></tr>
+<tr><td><a href="a.htm" class="nav"><img  width="16" height="16"
+             src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4z8AAAAMBAQD3A0FDAAAAAElFTkSuQmCC"
+             border=0></a></td></tr>
+</table>
+<table cellpadding=0 cellspacing=0 border=0 width=150>
+<tr><td><a href="a.htm"><img class="nav" width="16" height="16"
+             src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4z8AAAAMBAQD3A0FDAAAAAElFTkSuQmCC"
+             border=0></a></td></tr>
+<tr><td><a href="a.htm"><img class="nav" width="16" height="16"
+             src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4z8AAAAMBAQD3A0FDAAAAAElFTkSuQmCC"
+             border=0></a></td></tr>
+</table>
+<hr>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/186317-1-ref.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+            "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>border crosstalk</title>
+</head>
+<style>
+table.t1 td {border: 1px solid black}
+</style>
+<body >
+
+
+<TABLE style="border-collapse:collapse" class="t1">
+<TR><TD>1</td> <TD>2</td> <TD>3</td></tr>
+</TABLE>
+
+<table border="1">
+<tr><td>1</td><td>2</td></tr>
+<tr><td >3</td><td>4</td></tr>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/186317-1.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+            "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>border crosstalk</title>
+</head>
+
+<body >
+
+
+<TABLE border="1" style="border-collapse:collapse">
+<TR><TD>1</td> <TD>2</td> <TD>3</td></tr>
+</TABLE>
+
+<table border="1">
+<tr><td>1</td><td>2</td></tr>
+<tr><td >3</td><td>4</td></tr>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/260406-1-ref.html
@@ -0,0 +1,20 @@
+<html>
+<head>
+<style type="text/css">
+ .forms {display:inline;}
+ .nn2{background-image: url("260406.gif");width:20px;height:18px;}
+</style>
+</head>
+<body>
+    <table border="0" cellpadding="0" cellspacing="0">
+        <tr>
+            <td>P</td>
+        </tr>
+    </table>
+    <table border="0" cellpadding="0" cellspacing="0">
+        <tr>
+            <td class="nn2"></td>
+        </tr>
+    </table>
+</body>
+</html>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/260406-1.html
@@ -0,0 +1,20 @@
+<html>
+<head>
+<style type="text/css">
+ .forms {display:inline;}
+ .nn2{background-image: url("260406.gif");width:20px;height:18px;}
+</style>
+</head>
+<body>
+    <table border="0" cellpadding="0" cellspacing="0">
+        <tr>
+            <td class="forms">P</td>
+        </tr>
+    </table>
+    <table border="0" cellpadding="0" cellspacing="0">
+        <tr>
+            <td class="nn2"></td>
+        </tr>
+    </table>
+</body>
+</html>
\ No newline at end of file
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..5d0a77dc555a5e9f78b27cc2f48643603883a2fe
GIT binary patch
literal 954
zc${<hbhEHb6k!lz_|Cvk-I9Io+_7`l&Rx5A?H&l-yZ8Lwz4t)${Q2{HK>Ymuz31<r
zzkmP!I|%&$55l8h6buuf!vF-JyuiRQpF!55<AXxe!Dc}j4TB968X1{+7)%6a2qdzw
zvI{AAFa#<yFmS0!wG>Q9Jl4y@Tf-8N@W`Q=Pew1}Mxm<rbOXg#AsZMLot@3cb<AYK
z#l*w&9faT6G!!ZZE#OTtyE@~+%d>3!hOfS4Y(3z_9Acig<yT=tL%Wo<oWgIz12@}w
pwrtA%9rpazPKG;nCKrVD@9yRLvrRVO!NLdowfLXgN((Sp0|2$1I%NO=
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -133,24 +133,26 @@ random == 99850-1b.html 99850-1-ref.html
 != 144004-3.html 144004-3-ref.html
 == 163504-1a.html 163504-1-ref.html
 == 163504-1b.html 163504-1-ref.html
 == 163504-2a.html 163504-2-ref.html
 == 163504-2b.html 163504-2-ref.html
 == 167496-1.html 167496-1-ref.html
 == 169749-1.html 169749-1-ref.html
 == 172073-1.html 172073-1-ref.html
+== 175190-1.html 175190-1-ref.html
 == 179596-1a.html 179596-1a-ref.html
 == 179596-1b.html 179596-1b-ref.html
 == 179596-2.html 179596-2-ref.html
 == 179596-2.html 179596-2-ref2.html
 == 179596-2.html 179596-2-ref3.html
 == 180085-1.html 180085-1-ref.html
 == 180085-2.html 180085-2-ref.html
 == 185388-1.html 185388-1-ref.html
+== 186317-1.html 186317-1-ref.html
 == 192902-1.html 192902-ref.html
 == 192767-01.xul 192767-11.xul
 == 192767-02.xul 192767-12.xul
 == 192767-03.xul 192767-13.xul
 == 192767-04.xul 192767-14.xul
 == 192767-05.xul 192767-15.xul
 == 192767-06.xul 192767-16.xul
 == 192767-07.xul 192767-17.xul
@@ -263,16 +265,17 @@ fails-if(Android) != 192767-17.xul 19276
 == 244135-2.html 244135-2-ref.html
 == 244932-1.html 244932-1-ref.html
 == 249141.xul 249141-ref.xul
 == 249982-1.html 249982-1-ref.html
 == 246669-1.html 246669-1-ref.html
 == 252920-1.html 252920-1-ref.html
 == 253701-1.html 253701-1-ref.html
 == 255820-1.html 255820-1-ref.html
+== 260406-1.html 260406-1-ref.html
 == 261826-1.xul 261826-1-ref.xul
 == 262151-1.html 262151-1-ref.html
 == 262998-1.html 262998-1-ref.html
 == 267353-1.html 267353-1-ref.html
 == 269908-1.html 269908-1-ref.html
 == 269908-2.html 269908-2-ref.html
 == 269908-3.html 269908-3-ref.html
 == 269908-4.html 269908-4-ref.html
rename from layout/reftests/svg/dynamic-filter-contents-01.svg
rename to layout/reftests/svg/dynamic-filter-contents-01a.svg
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/dynamic-filter-contents-01b.svg
@@ -0,0 +1,28 @@
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<svg class="reftest-wait" xmlns="http://www.w3.org/2000/svg" onload="startTest()">
+  <defs>
+    <filter id="f" filterUnits="objectBoundingBox" primitiveUnits="objectBoundingBox" 
+            x="0" y="0" width="1" height="1">
+      <feFlood flood-color="#ff0000" flood-opacity="0.5" result="flood"/>
+      <feComposite id="comp" width="1" height="1" in="flood" operator="over" in2="SourceGraphic"/>
+    </filter>
+  </defs>
+
+  <rect width="100" height="100" fill="lime" filter="url(#f)"/>
+
+  <script>
+  function startTest() {
+    document.addEventListener("MozReftestInvalidate", doTest, false);
+    // in case we're not gecko
+    setTimeout(doTest, 5000);
+  }
+
+  function doTest() {
+    document.getElementById("comp").setAttribute("color-interpolation-filters", "sRGB");
+    document.documentElement.removeAttribute('class');
+  }
+  </script>
+</svg>
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -59,17 +59,18 @@ fails-if(Android) == dynamic-conditions-
 == dynamic-conditions-09.svg about:blank
 == dynamic-conditions-10.svg about:blank
 == dynamic-conditions-11.svg pass.svg
 == dynamic-conditions-12.svg pass.svg
 == dynamic-conditions-13.svg about:blank
 == dynamic-clipPath-01.svg pass.svg
 == dynamic-feFlood-01.svg pass.svg
 == dynamic-feImage-01.svg pass.svg
-== dynamic-filter-contents-01.svg dynamic-filter-contents-01-ref.svg
+== dynamic-filter-contents-01a.svg dynamic-filter-contents-01-ref.svg
+== dynamic-filter-contents-01b.svg dynamic-filter-contents-01-ref.svg
 == dynamic-gradient-contents-01.svg pass.svg
 == dynamic-gradient-contents-02.svg pass.svg
 == dynamic-inner-svg-01.svg pass.svg
 == dynamic-link-style-01.svg pass.svg
 == dynamic-marker-01.svg pass.svg
 == dynamic-marker-02.svg dynamic-marker-02-ref.svg
 == dynamic-mask-contents-01.svg pass.svg
 == dynamic-pattern-01.svg pass.svg
--- a/layout/reftests/table-anonymous-boxes/reftest.list
+++ b/layout/reftests/table-anonymous-boxes/reftest.list
@@ -1,12 +1,12 @@
 == 121142-1a.html 121142-1-ref.html
 == 121142-1b.html 121142-1-ref.html
 == 121142-2.html 121142-2-ref.html
-fails == 156888-1.html 156888-1-ref.html # bug 484825
+== 156888-1.html 156888-1-ref.html
 == 156888-2.html 156888-2-ref.html
 == 162063-1.xhtml about:blank
 == 203923-1.html white-space-ref.html
 == 203923-2.html white-space-ref.html
 == 208305-1.html 208305-1-ref.html
 == 208305-2.html white-space-ref.html
 == 208305-3.html white-space-ref.html
 == 208305-4.html white-space-ref.html
deleted file mode 100644
--- a/modules/plugin/test/unit/xpcshell.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[DEFAULT]
-head = head_plugins.js
-tail = 
-
-[test_bug455213.js]
-[test_bug471245.js]
--- a/toolkit/toolkit-makefiles.sh
+++ b/toolkit/toolkit-makefiles.sh
@@ -34,17 +34,16 @@
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 # This file contains makefiles that will be generated for every XUL app.
 
 MAKEFILES_db="
-  db/Makefile
   db/sqlite3/src/Makefile
 "
 
 MAKEFILES_dom="
   ipc/Makefile
   ipc/chromium/Makefile
   ipc/glue/Makefile
   ipc/ipdl/Makefile
--- a/toolkit/toolkit-tiers.mk
+++ b/toolkit/toolkit-tiers.mk
@@ -106,17 +106,16 @@ tier_platform_dirs += \
 ifdef MOZ_ENABLE_GTK2
 ifdef MOZ_X11
 tier_platform_dirs     += widget/src/gtkxtbin
 endif
 endif
 
 tier_platform_dirs	+= \
 		modules/libjar \
-		db \
 		storage \
 		$(NULL)
 
 ifdef MOZ_PERMISSIONS
 tier_platform_dirs += \
 		extensions/cookie \
 		extensions/permissions \
 		$(NULL)
--- a/xpcom/idl-parser/typelib.py
+++ b/xpcom/idl-parser/typelib.py
@@ -86,17 +86,16 @@ def build_interface(iface, ifaces):
                   return xpt.StringWithSizeType(size_is, size_is)
             elif type.name == 'wstring' and size_is != None:
                   return xpt.WideStringWithSizeType(size_is, size_is)
             else:
                   tag = TypeMap[type.name]
                   isPtr = (tag == xpt.Type.Tags.char_ptr or tag == xpt.Type.Tags.wchar_t_ptr)
                   return xpt.SimpleType(tag,
                                         pointer=isPtr,
-                                        #XXXkhuey unique_pointer is completely unused (bug 677787.)
                                         reference=False)
 
         if isinstance(type, xpidl.Array):
             return xpt.ArrayType(get_type(type.type, calltype), size_is,
                                  #XXXkhuey length_is duplicates size_is (bug 677788),
                                  size_is)
 
         if isinstance(type, xpidl.Interface) or isinstance(type, xpidl.Forward):
@@ -113,25 +112,23 @@ def build_interface(iface, ifaces):
 
         if isinstance(type, xpidl.Native):
             if type.specialtype:
                 # XXXkhuey jsval is marked differently in the typelib and in the headers :-(
                 isPtr = (type.isPtr(calltype) or type.isRef(calltype)) and not type.specialtype == 'jsval'
                 isRef = type.isRef(calltype) and not type.specialtype == 'jsval'
                 return xpt.SimpleType(TypeMap[type.specialtype],
                                       pointer=isPtr,
-                                      #XXXkhuey unique_pointer is completely unused
                                       reference=isRef)
             elif iid_is != None:
                 return xpt.InterfaceIsType(iid_is)
             else:
                 # void ptr
                 return xpt.SimpleType(TypeMap['void'],
                                       pointer=True,
-                                      #XXXkhuey unique_pointer is completely unused
                                       reference=False)
 
         raise Exception("Unknown type!")
 
     def get_nsresult():
         return xpt.SimpleType(TypeMap['nsresult'])
 
     def build_nsresult_param():
--- a/xpcom/reflect/xptinfo/public/xptinfo.h
+++ b/xpcom/reflect/xptinfo/public/xptinfo.h
@@ -69,19 +69,16 @@ public:
         {flags = other.flags; return *this;}
 
     operator PRUint8() const
         {return flags;}
 
     PRBool IsPointer() const
         {return 0 != (XPT_TDP_IS_POINTER(flags));}
 
-    PRBool IsUniquePointer() const
-        {return 0 != (XPT_TDP_IS_UNIQUE_POINTER(flags));}
-
     PRBool IsReference() const
         {return 0 != (XPT_TDP_IS_REFERENCE(flags));}
 
     PRBool IsArithmetic() const     // terminology from Harbison/Steele
         {return flags <= T_WCHAR;}
 
     PRBool IsInterfacePointer() const
         {  switch (TagPart()) {
--- a/xpcom/typelib/xpt/public/xpt_struct.h
+++ b/xpcom/typelib/xpt/public/xpt_struct.h
@@ -332,24 +332,22 @@ XPT_NewStringZ(XPTArena *arena, char *by
 
 /* why bother with a struct?  - other code relies on this being a struct */
 struct XPTTypeDescriptorPrefix {
     PRUint8 flags;
 };
 
 /* flag bits -- fur and jband were right, I was miserably wrong */
 #define XPT_TDP_POINTER          0x80
-#define XPT_TDP_UNIQUE_POINTER   0x40
 #define XPT_TDP_REFERENCE        0x20
 #define XPT_TDP_FLAGMASK         0xe0
 #define XPT_TDP_TAGMASK          (~XPT_TDP_FLAGMASK)
 #define XPT_TDP_TAG(tdp)         ((tdp).flags & XPT_TDP_TAGMASK)
 
 #define XPT_TDP_IS_POINTER(flags)        (flags & XPT_TDP_POINTER)
-#define XPT_TDP_IS_UNIQUE_POINTER(flags) (flags & XPT_TDP_UNIQUE_POINTER)
 #define XPT_TDP_IS_REFERENCE(flags)      (flags & XPT_TDP_REFERENCE)
 
 /* 
  * The following enum maps mnemonic names to the different numeric values 
  * of XPTTypeDescriptor->tag.
  */
 enum XPTTypeDescriptorTags {
     TD_INT8              = 0,
--- a/xpcom/typelib/xpt/tools/runtests.py
+++ b/xpcom/typelib/xpt/tools/runtests.py
@@ -153,17 +153,16 @@ class TypelibCompareMixin:
         self.assertEqual(p1.optional, p2.optional)
         
     def assertEqualTypes(self, t1, t2):
         self.assert_(t1 is not None, "Should not be None")
         self.assert_(t2 is not None, "Should not be None")
         self.assertEqual(type(t1), type(t2), "type types should be equal")
         self.assertEqual(t1.pointer, t2.pointer,
                          "pointer flag should be equal for %s and %s" % (t1, t2))
-        self.assertEqual(t1.unique_pointer, t2.unique_pointer)
         self.assertEqual(t1.reference, t2.reference)
         if isinstance(t1, xpt.SimpleType):
             self.assertEqual(t1.tag, t2.tag)
         elif isinstance(t1, xpt.InterfaceType):
             self.assertEqualInterfaces(t1.iface, t2.iface)
         elif isinstance(t1, xpt.InterfaceIsType):
             self.assertEqual(t1.param_index, t2.param_index)
         elif isinstance(t1, xpt.ArrayType):
--- a/xpcom/typelib/xpt/tools/xpt.py
+++ b/xpcom/typelib/xpt/tools/xpt.py
@@ -136,48 +136,44 @@ class Type(object):
         #XXX: These are also SimpleTypes (but not in the spec)
         # http://hg.mozilla.org/mozilla-central/annotate/0e0e2516f04e/xpcom/typelib/xpt/tools/xpt_dump.c#l69
         'UTF8String',
         'CString',
         'AString',
         'jsval',
         )
 
-    def __init__(self, pointer=False, unique_pointer=False, reference=False):
+    def __init__(self, pointer=False, reference=False):
         self.pointer = pointer
-        self.unique_pointer = unique_pointer
         self.reference = reference
         if reference and not pointer:
             raise Exception("If reference is True pointer must be True too")
 
     @staticmethod
     def decodeflags(byte):
         """
         Given |byte|, an unsigned uint8 containing flag bits,
         decode the flag bits as described in
         http://www.mozilla.org/scriptable/typelib_file.html#TypeDescriptor
         and return a dict of flagname: (True|False) suitable
         for passing to Type.__init__ as **kwargs.
         
         """
         return {'pointer': bool(byte & 0x80),
-                'unique_pointer': bool(byte & 0x40),
                 'reference': bool(byte & 0x20),
                 }
 
     def encodeflags(self):
         """
         Encode the flag bits of this Type object. Returns a byte.
 
         """
         flags = 0
         if self.pointer:
             flags |= 0x80
-        if self.unique_pointer:
-            flags |= 0x40
         if self.reference:
             flags |= 0x20
         return flags
     
     @staticmethod
     def read(typelib, map, data_pool, offset):
         """
         Read a TypeDescriptor at |offset| from the mmaped file |map| with