Bug 1020400. Remove empty-cells quirk, since no other UA has it. r=heycam
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 01 Dec 2014 15:15:41 -0500
changeset 218180 085ff9c53ded10a7b68021e3b510f961c7d95ad1
parent 218179 789bf02e66628f68b0070e4ce44a24a6fdb85a78
child 218181 f2791f426d6f3feaefef846f0e829c454344708d
push id52467
push userbzbarsky@mozilla.com
push dateMon, 01 Dec 2014 20:20:08 +0000
treeherdermozilla-inbound@7e81094bc8f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1020400
milestone37.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 1020400. Remove empty-cells quirk, since no other UA has it. r=heycam
layout/reftests/table-background/empty-cells-default-1-ref.html
layout/reftests/table-background/empty-cells-default-1.html
layout/reftests/table-background/empty-cells-default-2-ref.html
layout/reftests/table-background/empty-cells-default-2.html
layout/reftests/table-background/reftest.list
layout/style/nsCSSKeywordList.h
layout/style/nsCSSProps.cpp
layout/style/nsRuleNode.cpp
layout/style/nsStyleConsts.h
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
layout/style/test/property_database.js
layout/tables/nsTablePainter.cpp
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-background/empty-cells-default-1-ref.html
@@ -0,0 +1,6 @@
+<!-- Quirks mode on purpose -->
+<table style="empty-cells: show">
+  <tr>
+    <td style="border: 10px solid blue; background: yellow; height: 50px; width: 50px"></td>
+  </tr>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-background/empty-cells-default-1.html
@@ -0,0 +1,6 @@
+<!-- Quirks mode on purpose -->
+<table>
+  <tr>
+    <td style="border: 10px solid blue; background: yellow; height: 50px; width: 50px"></td>
+  </tr>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-background/empty-cells-default-2-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<table style="empty-cells: show">
+  <tr>
+    <td style="border: 10px solid blue; background: yellow; height: 50px; width: 50px"></td>
+  </tr>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-background/empty-cells-default-2.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<table>
+  <tr>
+    <td style="border: 10px solid blue; background: yellow; height: 50px; width: 50px"></td>
+  </tr>
+</table>
--- a/layout/reftests/table-background/reftest.list
+++ b/layout/reftests/table-background/reftest.list
@@ -51,8 +51,10 @@ fails == border-separate-opacity-table-c
 fails == border-separate-opacity-table-column.html border-separate-opacity-table-column-ref.html # bug 424274
 == border-separate-opacity-table-row-group.html border-separate-opacity-table-row-group-ref.html
 skip-if(B2G) == border-separate-opacity-table-row.html border-separate-opacity-table-row-ref.html # bug 773482
 skip-if(B2G) == border-separate-opacity-table.html border-separate-opacity-table-ref.html # bug 773482
 != scrollable-rowgroup-collapse-background.html scrollable-rowgroup-collapse-notref.html 
 != scrollable-rowgroup-collapse-border.html scrollable-rowgroup-collapse-notref.html     
 != scrollable-rowgroup-separate-background.html scrollable-rowgroup-separate-notref.html
 == scrollable-rowgroup-separate-border.html scrollable-rowgroup-separate-notref.html # scrolling rowgroups were removed in bug 28800
+== empty-cells-default-1.html empty-cells-default-1-ref.html
+== empty-cells-default-2.html empty-cells-default-2-ref.html
--- a/layout/style/nsCSSKeywordList.h
+++ b/layout/style/nsCSSKeywordList.h
@@ -109,17 +109,16 @@ CSS_KEY(-moz-oddtreerow, _moz_oddtreerow
 CSS_KEY(-moz-plaintext, _moz_plaintext)
 CSS_KEY(-moz-popup, _moz_popup)
 CSS_KEY(-moz-pre-space, _moz_pre_space)
 CSS_KEY(-moz-pull-down-menu, _moz_pull_down_menu)
 CSS_KEY(-moz-right, _moz_right)
 CSS_KEY(-moz-scrollbars-horizontal, _moz_scrollbars_horizontal)
 CSS_KEY(-moz-scrollbars-none, _moz_scrollbars_none)
 CSS_KEY(-moz-scrollbars-vertical, _moz_scrollbars_vertical)
-CSS_KEY(-moz-show-background, _moz_show_background)
 CSS_KEY(-moz-stack, _moz_stack)
 CSS_KEY(-moz-use-system-font, _moz_use_system_font)
 CSS_KEY(-moz-use-text-color, _moz_use_text_color)
 CSS_KEY(-moz-visitedhyperlinktext, _moz_visitedhyperlinktext)
 CSS_KEY(-moz-window, _moz_window)
 CSS_KEY(-moz-workspace, _moz_workspace)
 CSS_KEY(-moz-zoom-in, _moz_zoom_in)
 CSS_KEY(-moz-zoom-out, _moz_zoom_out)
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -1124,17 +1124,16 @@ KTableValue nsCSSProps::kDisplayKTable[]
   // pref.
   eCSSKeyword_contents,            NS_STYLE_DISPLAY_CONTENTS,
   eCSSKeyword_UNKNOWN,-1
 };
 
 const KTableValue nsCSSProps::kEmptyCellsKTable[] = {
   eCSSKeyword_show,                 NS_STYLE_TABLE_EMPTY_CELLS_SHOW,
   eCSSKeyword_hide,                 NS_STYLE_TABLE_EMPTY_CELLS_HIDE,
-  eCSSKeyword__moz_show_background, NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND,
   eCSSKeyword_UNKNOWN,-1
 };
 
 const KTableValue nsCSSProps::kAlignContentKTable[] = {
   eCSSKeyword_flex_start,    NS_STYLE_ALIGN_CONTENT_FLEX_START,
   eCSSKeyword_flex_end,      NS_STYLE_ALIGN_CONTENT_FLEX_END,
   eCSSKeyword_center,        NS_STYLE_ALIGN_CONTENT_CENTER,
   eCSSKeyword_space_between, NS_STYLE_ALIGN_CONTENT_SPACE_BETWEEN,
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -2497,17 +2497,17 @@ nsRuleNode::SetDefaultOnRoot(const nsSty
     case eStyleStruct_Table:
     {
       nsStyleTable* table = new (mPresContext) nsStyleTable();
       aContext->SetStyle(eStyleStruct_Table, table);
       return table;
     }
     case eStyleStruct_TableBorder:
     {
-      nsStyleTableBorder* table = new (mPresContext) nsStyleTableBorder(mPresContext);
+      nsStyleTableBorder* table = new (mPresContext) nsStyleTableBorder();
       aContext->SetStyle(eStyleStruct_TableBorder, table);
       return table;
     }
     case eStyleStruct_Content:
     {
       nsStyleContent* content = new (mPresContext) nsStyleContent();
       aContext->SetStyle(eStyleStruct_Content, content);
       return content;
@@ -7867,17 +7867,17 @@ nsRuleNode::ComputeTableData(void* aStar
 const void*
 nsRuleNode::ComputeTableBorderData(void* aStartStruct,
                                    const nsRuleData* aRuleData,
                                    nsStyleContext* aContext,
                                    nsRuleNode* aHighestNode,
                                    const RuleDetail aRuleDetail,
                                    const bool aCanStoreInRuleTree)
 {
-  COMPUTE_START_INHERITED(TableBorder, (mPresContext), table, parentTable)
+  COMPUTE_START_INHERITED(TableBorder, (), table, parentTable)
 
   // border-collapse: enum, inherit, initial
   SetDiscrete(*aRuleData->ValueForBorderCollapse(), table->mBorderCollapse,
               canStoreInRuleTree,
               SETDSC_ENUMERATED | SETDSC_UNSET_INHERIT,
               parentTable->mBorderCollapse,
               NS_STYLE_BORDER_SEPARATE, 0, 0, 0, 0);
 
@@ -7911,19 +7911,17 @@ nsRuleNode::ComputeTableBorderData(void*
               parentTable->mCaptionSide,
               NS_STYLE_CAPTION_SIDE_TOP, 0, 0, 0, 0);
 
   // empty-cells: enum, inherit, initial
   SetDiscrete(*aRuleData->ValueForEmptyCells(),
               table->mEmptyCells, canStoreInRuleTree,
               SETDSC_ENUMERATED | SETDSC_UNSET_INHERIT,
               parentTable->mEmptyCells,
-              (mPresContext->CompatibilityMode() == eCompatibility_NavQuirks)
-              ? NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND
-              : NS_STYLE_TABLE_EMPTY_CELLS_SHOW,
+              NS_STYLE_TABLE_EMPTY_CELLS_SHOW,
               0, 0, 0, 0);
 
   COMPUTE_END_INHERITED(TableBorder, table)
 }
 
 const void*
 nsRuleNode::ComputeContentData(void* aStartStruct,
                                const nsRuleData* aRuleData,
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -872,17 +872,16 @@ static inline mozilla::css::Side operato
 #define NS_STYLE_UNICODE_BIDI_ISOLATE_OVERRIDE  0x6
 #define NS_STYLE_UNICODE_BIDI_PLAINTEXT         0x8
 
 #define NS_STYLE_TABLE_LAYOUT_AUTO              0
 #define NS_STYLE_TABLE_LAYOUT_FIXED             1
 
 #define NS_STYLE_TABLE_EMPTY_CELLS_HIDE            0
 #define NS_STYLE_TABLE_EMPTY_CELLS_SHOW            1
-#define NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND 2
 
 #define NS_STYLE_CAPTION_SIDE_TOP               0
 #define NS_STYLE_CAPTION_SIDE_RIGHT             1
 #define NS_STYLE_CAPTION_SIDE_BOTTOM            2
 #define NS_STYLE_CAPTION_SIDE_LEFT              3
 #define NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE       4
 #define NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE    5
 
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -1658,27 +1658,22 @@ nsChangeHint nsStyleTable::CalcDifferenc
       mLayoutStrategy != aOther.mLayoutStrategy)
     return NS_STYLE_HINT_FRAMECHANGE;
   return NS_STYLE_HINT_NONE;
 }
 
 // -----------------------
 // nsStyleTableBorder
 
-nsStyleTableBorder::nsStyleTableBorder(nsPresContext* aPresContext) 
+nsStyleTableBorder::nsStyleTableBorder()
 { 
   MOZ_COUNT_CTOR(nsStyleTableBorder);
   mBorderCollapse = NS_STYLE_BORDER_SEPARATE;
 
-  nsCompatibility compatMode = eCompatibility_FullStandards;
-  if (aPresContext)
-    compatMode = aPresContext->CompatibilityMode();
-  mEmptyCells = (compatMode == eCompatibility_NavQuirks)
-                  ? NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND     
-                  : NS_STYLE_TABLE_EMPTY_CELLS_SHOW;
+  mEmptyCells = NS_STYLE_TABLE_EMPTY_CELLS_SHOW;
   mCaptionSide = NS_STYLE_CAPTION_SIDE_TOP;
   mBorderSpacingX = 0;
   mBorderSpacingY = 0;
 }
 
 nsStyleTableBorder::~nsStyleTableBorder(void) 
 {
   MOZ_COUNT_DTOR(nsStyleTableBorder);
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -2231,17 +2231,17 @@ struct nsStyleTable {
                           nsChangeHint_ClearAncestorIntrinsics);
   }
 
   uint8_t       mLayoutStrategy;// [reset] see nsStyleConsts.h NS_STYLE_TABLE_LAYOUT_*
   int32_t       mSpan;          // [reset] the number of columns spanned by a colgroup or col
 };
 
 struct nsStyleTableBorder {
-  explicit nsStyleTableBorder(nsPresContext* aContext);
+  nsStyleTableBorder();
   nsStyleTableBorder(const nsStyleTableBorder& aOther);
   ~nsStyleTableBorder(void);
 
   void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW {
     return aContext->PresShell()->
       AllocateByObjectID(nsPresArena::nsStyleTableBorder_id, sz);
   }
   void Destroy(nsPresContext* aContext) {
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -2436,17 +2436,17 @@ var gCSSProperties = {
     ],
     invalid_values: []
   },
   "empty-cells": {
     domProp: "emptyCells",
     inherited: true,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "show" ],
-    other_values: [ "hide", "-moz-show-background" ],
+    other_values: [ "hide" ],
     invalid_values: []
   },
   "float": {
     domProp: "cssFloat",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "none" ],
     other_values: [ "left", "right" ],
--- a/layout/tables/nsTablePainter.cpp
+++ b/layout/tables/nsTablePainter.cpp
@@ -580,19 +580,18 @@ TableBackgroundPainter::PaintRow(nsTable
 nsresult
 TableBackgroundPainter::PaintCell(nsTableCellFrame* aCell,
                                   bool aPassSelf)
 {
   NS_PRECONDITION(aCell, "null frame");
 
   const nsStyleTableBorder* cellTableStyle;
   cellTableStyle = aCell->StyleTableBorder();
-  if (!(NS_STYLE_TABLE_EMPTY_CELLS_SHOW == cellTableStyle->mEmptyCells ||
-        NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND == cellTableStyle->mEmptyCells)
-      && aCell->GetContentEmpty() && !mIsBorderCollapse) {
+  if (NS_STYLE_TABLE_EMPTY_CELLS_SHOW != cellTableStyle->mEmptyCells &&
+      aCell->GetContentEmpty() && !mIsBorderCollapse) {
     return NS_OK;
   }
 
   int32_t colIndex;
   aCell->GetColIndex(colIndex);
   NS_ASSERTION(colIndex < int32_t(mNumCols), "prevent array boundary violation");
   if (int32_t(mNumCols) <= colIndex)
     return NS_OK;