Bug 1157569 - part 12 - Convert physical values from BCPropertyData to logical when returning from Get[Included]OuterBCBorder. r=roc
authorJonathan Kew <jkew@mozilla.com>
Wed, 17 Jun 2015 11:03:25 +0100
changeset 249329 54501a80ded17bfc4bff11b8c8be850de1595828
parent 249328 0fd2342bf28ca48196bbc5be4ebc5dca6384845d
child 249330 964d75a56702a7b552e572ba30153ca6b2038fb4
push id28923
push userryanvm@gmail.com
push dateWed, 17 Jun 2015 18:57:11 +0000
treeherdermozilla-central@099d6cd6725e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1157569
milestone41.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 1157569 - part 12 - Convert physical values from BCPropertyData to logical when returning from Get[Included]OuterBCBorder. r=roc
layout/reftests/table-bordercollapse/reftest.list
layout/tables/nsTableFrame.cpp
--- a/layout/reftests/table-bordercollapse/reftest.list
+++ b/layout/reftests/table-bordercollapse/reftest.list
@@ -90,9 +90,9 @@
 == borderhandling-rules-border-cols-strict.html borderhandling-rules-border-cols-strict-ref.html
 == borderhandling-rules-border-all-strict.html borderhandling-rules-border-all-strict-ref.html
 == bordercolor-1.html bordercolor-ref.html
 != bordercolor-2.html bordercolor-ref.html
 == bordercolor-3.html bordercolor-3-ref.html
 == bordercolor-4.html bordercolor-4-ref.html
 == empty-toprow.html empty-toprow-ref.html
 == double_borders.html double_borders_ref.html
-fails == border-collapse-rtl.html border-collapse-rtl-ref.html # see bug 1157569
+== border-collapse-rtl.html border-collapse-rtl-ref.html
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -2600,49 +2600,49 @@ DivideBCBorderSize(BCPixelSize  aPixelSi
 {
   aSmallHalf = aPixelSize / 2;
   aLargeHalf = aPixelSize - aSmallHalf;
 }
 
 LogicalMargin
 nsTableFrame::GetOuterBCBorder(const WritingMode aWM) const
 {
-  if (NeedToCalcBCBorders())
+  if (NeedToCalcBCBorders()) {
     const_cast<nsTableFrame*>(this)->CalcBCBorders();
+  }
 
   int32_t p2t = nsPresContext::AppUnitsPerCSSPixel();
   BCPropertyData* propData = GetBCProperty();
   if (propData) {
-    return LogicalMargin(
-      aWM,
-      BC_BORDER_START_HALF_COORD(p2t, propData->mTopBorderWidth),
-      BC_BORDER_END_HALF_COORD(p2t, propData->mRightBorderWidth),
-      BC_BORDER_END_HALF_COORD(p2t, propData->mBottomBorderWidth),
-      BC_BORDER_START_HALF_COORD(p2t, propData->mLeftBorderWidth));
-  }
-  return LogicalMargin(GetWritingMode());
+    nsMargin r(BC_BORDER_START_HALF_COORD(p2t, propData->mTopBorderWidth),
+               BC_BORDER_END_HALF_COORD(p2t, propData->mRightBorderWidth),
+               BC_BORDER_END_HALF_COORD(p2t, propData->mBottomBorderWidth),
+               BC_BORDER_START_HALF_COORD(p2t, propData->mLeftBorderWidth));
+    return LogicalMargin(aWM, r);
+  }
+  return LogicalMargin(aWM);
 }
 
 LogicalMargin
 nsTableFrame::GetIncludedOuterBCBorder(const WritingMode aWM) const
 {
-  if (NeedToCalcBCBorders())
+  if (NeedToCalcBCBorders()) {
     const_cast<nsTableFrame*>(this)->CalcBCBorders();
+  }
 
   int32_t p2t = nsPresContext::AppUnitsPerCSSPixel();
   BCPropertyData* propData = GetBCProperty();
   if (propData) {
-    return LogicalMargin(
-      aWM,
-      BC_BORDER_START_HALF_COORD(p2t, propData->mTopBorderWidth),
-      BC_BORDER_END_HALF_COORD(p2t, propData->mRightCellBorderWidth),
-      BC_BORDER_END_HALF_COORD(p2t, propData->mBottomBorderWidth),
-      BC_BORDER_START_HALF_COORD(p2t, propData->mLeftCellBorderWidth));
-  }
-  return LogicalMargin(GetWritingMode());
+    nsMargin r(BC_BORDER_START_HALF_COORD(p2t, propData->mTopBorderWidth),
+               BC_BORDER_END_HALF_COORD(p2t, propData->mRightCellBorderWidth),
+               BC_BORDER_END_HALF_COORD(p2t, propData->mBottomBorderWidth),
+               BC_BORDER_START_HALF_COORD(p2t, propData->mLeftCellBorderWidth));
+    return LogicalMargin(aWM, r);
+  }
+  return LogicalMargin(aWM);
 }
 
 LogicalMargin
 nsTableFrame::GetExcludedOuterBCBorder(const WritingMode aWM) const
 {
   return GetOuterBCBorder(aWM) - GetIncludedOuterBCBorder(aWM);
 }