Bug 1013160 - Remove padding suppressing mechanism of bullet. r=jfkthame,surkov
authorXidorn Quan <quanxunzhen@gmail.com>
Fri, 30 May 2014 09:00:26 +0100
changeset 185807 1f7ccdfe2c6ec00c4ed7d43548cb9d95dc6f309c
parent 185806 b39cbf840af9d971dcc7e56b4c141a28eb3a87f6
child 185808 76432b693fc49d11c7549d82e9cd5df3087458ee
child 185896 163a0c70a67d495aa20b7788131df0a37a85c712
push id26863
push userMs2ger@gmail.com
push dateFri, 30 May 2014 12:08:33 +0000
treeherdermozilla-central@76432b693fc4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame, surkov
bugs1013160
milestone32.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 1013160 - Remove padding suppressing mechanism of bullet. r=jfkthame,surkov
accessible/src/html/HTMLListAccessible.cpp
accessible/tests/mochitest/text/test_hypertext.html
accessible/tests/mochitest/text/test_lineboundary.html
accessible/tests/mochitest/textattrs/test_general.html
layout/generic/nsBlockFrame.cpp
layout/generic/nsBulletFrame.cpp
layout/generic/nsBulletFrame.h
layout/reftests/counters/counter-suffix-ref.html
layout/reftests/counters/counter-suffix.html
layout/reftests/counters/reftest.list
layout/reftests/list-item/numbering-2-ref.html
layout/reftests/list-item/numbering-2.html
layout/style/ua.css
--- a/accessible/src/html/HTMLListAccessible.cpp
+++ b/accessible/src/html/HTMLListAccessible.cpp
@@ -161,19 +161,16 @@ ENameValueFlag
 HTMLListBulletAccessible::Name(nsString &aName)
 {
   aName.Truncate();
 
   // Native anonymous content, ARIA can't be used. Get list bullet text.
   nsBlockFrame* blockFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   if (blockFrame) {
     blockFrame->GetBulletText(aName);
-
-    // Append space otherwise bullets are jammed up against list text.
-    aName.Append(' ');
   }
 
   return eNameOK;
 }
 
 role
 HTMLListBulletAccessible::NativeRole()
 {
--- a/accessible/tests/mochitest/text/test_hypertext.html
+++ b/accessible/tests/mochitest/text/test_hypertext.html
@@ -66,18 +66,18 @@
       // list
       //////////////////////////////////////////////////////////////////////////
 
       IDs = [ "list" ];
       testCharacterCount(IDs, 1);
       testText(IDs, 0, 1, kEmbedChar);
 
       IDs = [ "listitem" ];
-      testCharacterCount(IDs, 5);
-      testText(IDs, 0, 5, "1.foo");
+      testCharacterCount(IDs, 6);
+      testText(IDs, 0, 6, "1. foo");
 
       testText(["testbr"], 0, 3, "foo");
 
       testTextAtOffset(2, nsIAccessibleText.BOUNDARY_CHAR, "o", 2, 3, "testbr",
                        kOk, kOk, kOk);
       testTextAtOffset(2, nsIAccessibleText.BOUNDARY_WORD_START, "foo\n", 0, 4,
                        "testbr", kTodo, kOk, kTodo);
       testTextBeforeOffset(2, nsIAccessibleText.BOUNDARY_LINE_START, "foo\n",
--- a/accessible/tests/mochitest/text/test_lineboundary.html
+++ b/accessible/tests/mochitest/text/test_lineboundary.html
@@ -113,46 +113,46 @@
 
       testTextAtOffset([ "ht_4" ], BOUNDARY_LINE_START,
                        [ [ 0, 12, "Hello world ", 0, 12 ] ]);
 
       //////////////////////////////////////////////////////////////////////////
       // list items
 
       testTextAtOffset([ "li1" ], BOUNDARY_LINE_START,
-                       [ [ 0, 5, kDiscBulletChar + "Item", 0, 5 ] ]);
+                       [ [ 0, 6, kDiscBulletText + "Item", 0, 6 ] ]);
       testTextAtOffset([ "li2" ], BOUNDARY_LINE_START,
-                       [ [ 0, 1, kDiscBulletChar, 0, 1 ] ]);
+                       [ [ 0, 2, kDiscBulletText, 0, 2 ] ]);
       testTextAtOffset([ "li3" ], BOUNDARY_LINE_START,
-                       [ [ 0, 7, kDiscBulletChar + "a long ", 0, 8 ],
-                         [ 8, 11, "and ", 8, 12 ] ]);
+                       [ [ 0, 8, kDiscBulletText + "a long ", 0, 9 ],
+                         [ 9, 12, "and ", 9, 13 ] ]);
       testTextAtOffset([ "li4" ], BOUNDARY_LINE_START,
-                       [ [ 0, 6, kDiscBulletChar + "a " + kEmbedChar + " c", 0, 6 ] ]);
+                       [ [ 0, 7, kDiscBulletText + "a " + kEmbedChar + " c", 0, 7 ] ]);
       testTextAtOffset([ "li5" ], BOUNDARY_LINE_START,
-                       [ [ 0, 1, kDiscBulletChar + "\n", 0, 2 ],
-                         [ 2, 6, "hello", 2, 7 ] ]);
+                       [ [ 0, 2, kDiscBulletText + "\n", 0, 3 ],
+                         [ 3, 7, "hello", 3, 8 ] ]);
       testTextAtOffset([ "ul1" ], BOUNDARY_LINE_START,
                        [ [ 0, 0, kEmbedChar, 0, 1 ],
                          [ 1, 1, kEmbedChar, 1, 2 ],
                          [ 2, 2, kEmbedChar, 2, 3 ],
                          [ 3, 3, kEmbedChar, 3, 4 ],
                          [ 4, 5, kEmbedChar, 4, 5 ] ]);
 
       testTextAtOffset([ "li6" ], BOUNDARY_LINE_START,
-                       [ [ 0, 6, "1.Item", 0, 6 ] ]);
+                       [ [ 0, 7, "1. Item", 0, 7 ] ]);
       testTextAtOffset([ "li7" ], BOUNDARY_LINE_START,
-                       [ [ 0, 2, "2.", 0, 2 ] ]);
+                       [ [ 0, 3, "2. ", 0, 3 ] ]);
       testTextAtOffset([ "li8" ], BOUNDARY_LINE_START,
-                       [ [ 0, 8, "3.a long ", 0, 9 ],
-                         [ 9, 12, "and ", 9, 13 ] ]);
+                       [ [ 0, 9, "3. a long ", 0, 10 ],
+                         [ 10, 13, "and ", 10, 14 ] ]);
       testTextAtOffset([ "li9" ], BOUNDARY_LINE_START,
-                       [ [ 0, 7, "4.a " + kEmbedChar + " c", 0, 7 ] ]);
+                       [ [ 0, 8, "4. a " + kEmbedChar + " c", 0, 8 ] ]);
       testTextAtOffset([ "li10" ], BOUNDARY_LINE_START,
-                       [ [ 0, 2, "5.\n", 0, 3 ],
-                         [ 3, 7, "hello", 3, 8 ] ]);
+                       [ [ 0, 3, "5. \n", 0, 4 ],
+                         [ 4, 8, "hello", 4, 9 ] ]);
       testTextAtOffset([ "ol1" ], BOUNDARY_LINE_START,
                        [ [ 0, 0, kEmbedChar, 0, 1 ],
                          [ 1, 1, kEmbedChar, 1, 2 ],
                          [ 2, 2, kEmbedChar, 2, 3 ],
                          [ 3, 3, kEmbedChar, 3, 4 ],
                          [ 4, 5, kEmbedChar, 4, 5 ] ]);
 
       //////////////////////////////////////////////////////////////////////////
--- a/accessible/tests/mochitest/textattrs/test_general.html
+++ b/accessible/tests/mochitest/textattrs/test_general.html
@@ -533,19 +533,19 @@
       // area18, "auto-generation text" tests
       ID = "area18";
       defAttrs = buildDefaultTextAttrs(ID, "12pt");
       testDefaultTextAttrs(ID, defAttrs);
 
       var attrs = {
         "auto-generated": "true"
       };
-      testTextAttrs(ID, 0, attrs, defAttrs, 0, 2);
-      testTextAttrs(ID, 2, { }, defAttrs, 2, 6);
-      testTextAttrs(ID, 6, attrs, defAttrs, 6, 7);
+      testTextAttrs(ID, 0, attrs, defAttrs, 0, 3);
+      testTextAttrs(ID, 3, { }, defAttrs, 3, 7);
+      testTextAttrs(ID, 7, attrs, defAttrs, 7, 8);
 
        //////////////////////////////////////////////////////////////////////////
       // area19, "HTML5 mark tag" test
       // text enclosed in mark tag will have a different background color
       ID = "area19";
       defAttrs = buildDefaultTextAttrs(ID, "12pt");
 
       attrs = {};
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -6540,22 +6540,25 @@ void
 nsBlockFrame::GetBulletText(nsAString& aText) const
 {
   aText.Truncate();
 
   const nsStyleList* myList = StyleList();
   if (myList->GetListStyleImage() ||
       myList->mListStyleType == NS_STYLE_LIST_STYLE_DISC) {
     aText.Assign(kDiscCharacter);
+    aText.Append(' ');
   }
   else if (myList->mListStyleType == NS_STYLE_LIST_STYLE_CIRCLE) {
     aText.Assign(kCircleCharacter);
+    aText.Append(' ');
   }
   else if (myList->mListStyleType == NS_STYLE_LIST_STYLE_SQUARE) {
     aText.Assign(kSquareCharacter);
+    aText.Append(' ');
   }
   else if (myList->mListStyleType != NS_STYLE_LIST_STYLE_NONE) {
     nsBulletFrame* bullet = GetBullet();
     if (bullet) {
       nsAutoString text;
       bullet->GetListItemText(*myList, text);
       aText = text;
     }
--- a/layout/generic/nsBulletFrame.cpp
+++ b/layout/generic/nsBulletFrame.cpp
@@ -14,16 +14,17 @@
 #include "nsAttrValueInlines.h"
 #include "nsPresContext.h"
 #include "nsIPresShell.h"
 #include "nsIDocument.h"
 #include "nsRenderingContext.h"
 #include "prprf.h"
 #include "nsDisplayList.h"
 #include "nsCounterManager.h"
+#include "nsBidiUtils.h"
 
 #include "imgIContainer.h"
 #include "imgRequestProxy.h"
 #include "nsIURI.h"
 
 #include <algorithm>
 
 #ifdef ACCESSIBILITY
@@ -307,18 +308,16 @@ nsBulletFrame::PaintBullet(nsRenderingCo
         return;
       }
     }
   }
 
   nsRefPtr<nsFontMetrics> fm;
   aRenderingContext.SetColor(nsLayoutUtils::GetColor(this, eCSSProperty_color));
 
-  mTextIsRTL = false;
-
   nsAutoString text;
   switch (listStyleType) {
   case NS_STYLE_LIST_STYLE_NONE:
     break;
 
   default:
   case NS_STYLE_LIST_STYLE_DISC:
     aRenderingContext.FillEllipse(mPadding.left + aPt.x, mPadding.top + aPt.y,
@@ -410,22 +409,25 @@ nsBulletFrame::PaintBullet(nsRenderingCo
   case NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_AM:
   case NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ER:
   case NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ET:
     nsLayoutUtils::GetFontMetricsForFrame(this, getter_AddRefs(fm),
                                           GetFontSizeInflation());
     GetListItemText(*myList, text);
     aRenderingContext.SetFont(fm);
     nscoord ascent = fm->MaxAscent();
-    aRenderingContext.SetTextRunRTL(mTextIsRTL);
-    aRenderingContext.DrawString(
-        text, mPadding.left + aPt.x,
-        NSToCoordRound(nsLayoutUtils::GetSnappedBaselineY(
-                this, aRenderingContext.ThebesContext(),
-                mPadding.top + aPt.y, ascent)));
+    aPt.MoveBy(mPadding.left, mPadding.top);
+    aPt.y = NSToCoordRound(nsLayoutUtils::GetSnappedBaselineY(
+            this, aRenderingContext.ThebesContext(), aPt.y, ascent));
+    nsPresContext* presContext = PresContext();
+    if (!presContext->BidiEnabled() && HasRTLChars(text)) {
+      presContext->SetBidiEnabled();
+    }
+    nsLayoutUtils::DrawString(this, &aRenderingContext,
+                              text.get(), text.Length(), aPt);
     break;
   }
 }
 
 int32_t
 nsBulletFrame::SetListItemOrdinal(int32_t aNextOrdinal,
                                   bool* aChanged,
                                   int32_t aIncrement)
@@ -1449,28 +1451,26 @@ nsBulletFrame::AppendCounterText(int32_t
   }
   if (!success) {
     AppendCounterText(fallback, aOrdinal, result, isRTL);
   }
 }
 
 /* static */ void
 nsBulletFrame::GetListItemSuffix(int32_t aListStyleType,
-                                 nsString& aResult,
-                                 bool& aSuppressPadding)
+                                 nsString& aResult)
 {
-  aResult = '.';
-  aSuppressPadding = false;
+  aResult.AssignLiteral(MOZ_UTF16(". "));
 
   switch (aListStyleType) {
     case NS_STYLE_LIST_STYLE_NONE: // used by counters code only
     case NS_STYLE_LIST_STYLE_DISC: // used by counters code only
     case NS_STYLE_LIST_STYLE_CIRCLE: // used by counters code only
     case NS_STYLE_LIST_STYLE_SQUARE: // used by counters code only
-      aResult.Truncate();
+      aResult = ' ';
       break;
 
     case NS_STYLE_LIST_STYLE_CJK_DECIMAL:
     case NS_STYLE_LIST_STYLE_CJK_IDEOGRAPHIC:
     case NS_STYLE_LIST_STYLE_TRAD_CHINESE_INFORMAL:
     case NS_STYLE_LIST_STYLE_TRAD_CHINESE_FORMAL:
     case NS_STYLE_LIST_STYLE_SIMP_CHINESE_INFORMAL:
     case NS_STYLE_LIST_STYLE_SIMP_CHINESE_FORMAL:
@@ -1480,54 +1480,56 @@ nsBulletFrame::GetListItemSuffix(int32_t
     case NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_FORMAL:
     case NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_INFORMAL:
     case NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_FORMAL:
     case NS_STYLE_LIST_STYLE_MOZ_JAPANESE_INFORMAL:
     case NS_STYLE_LIST_STYLE_MOZ_JAPANESE_FORMAL:
     case NS_STYLE_LIST_STYLE_MOZ_CJK_HEAVENLY_STEM:
     case NS_STYLE_LIST_STYLE_MOZ_CJK_EARTHLY_BRANCH:
       aResult = 0x3001;
-      aSuppressPadding = true;
       break;
 
     case NS_STYLE_LIST_STYLE_KOREAN_HANGUL_FORMAL:
     case NS_STYLE_LIST_STYLE_KOREAN_HANJA_INFORMAL:
     case NS_STYLE_LIST_STYLE_KOREAN_HANJA_FORMAL:
     case NS_STYLE_LIST_STYLE_MOZ_HANGUL:
     case NS_STYLE_LIST_STYLE_MOZ_HANGUL_CONSONANT:
-      aResult = ',';
+      aResult.AssignLiteral(MOZ_UTF16(", "));
       break;
   }
 }
 
 void
 nsBulletFrame::GetListItemText(const nsStyleList& aListStyle,
                                nsString& result)
 {
-  const nsStyleVisibility* vis = StyleVisibility();
-
   NS_ASSERTION(aListStyle.mListStyleType != NS_STYLE_LIST_STYLE_NONE &&
                aListStyle.mListStyleType != NS_STYLE_LIST_STYLE_DISC &&
                aListStyle.mListStyleType != NS_STYLE_LIST_STYLE_CIRCLE &&
                aListStyle.mListStyleType != NS_STYLE_LIST_STYLE_SQUARE,
                "we should be using specialized code for these types");
 
-  result.Truncate();
-  AppendCounterText(aListStyle.mListStyleType, mOrdinal, result, mTextIsRTL);
+  bool isRTL;
+  nsAutoString number;
+  AppendCounterText(aListStyle.mListStyleType, mOrdinal, number, isRTL);
 
   nsAutoString suffix;
-  GetListItemSuffix(aListStyle.mListStyleType, suffix, mSuppressPadding);
+  GetListItemSuffix(aListStyle.mListStyleType, suffix);
 
-  // We're not going to do proper Bidi reordering on the list item marker, but
-  // just display the whole thing as RTL or LTR, so we fake reordering by
-  // appending the suffix to the end of the list item marker if the
-  // directionality of the characters is the same as the style direction or
-  // prepending it to the beginning if they are different.
-  result = (mTextIsRTL == (vis->mDirection == NS_STYLE_DIRECTION_RTL)) ?
-          result + suffix : suffix + result;
+  result.Truncate();
+  if (GetWritingMode().IsBidiLTR() != isRTL) {
+    result.Append(number);
+  } else {
+    // RLM = 0x200f, LRM = 0x200e
+    char16_t mark = isRTL ? 0x200f : 0x200e;
+    result.Append(mark);
+    result.Append(number);
+    result.Append(mark);
+  }
+  result.Append(suffix);
 }
 
 #define MIN_BULLET_SIZE 1
 
 
 void
 nsBulletFrame::GetDesiredSize(nsPresContext*  aCX,
                               nsRenderingContext *aRenderingContext,
@@ -1574,24 +1576,36 @@ nsBulletFrame::GetDesiredSize(nsPresCont
   switch (myList->mListStyleType) {
     case NS_STYLE_LIST_STYLE_NONE:
       aMetrics.Width() = aMetrics.Height() = 0;
       aMetrics.SetTopAscent(0);
       break;
 
     case NS_STYLE_LIST_STYLE_DISC:
     case NS_STYLE_LIST_STYLE_CIRCLE:
-    case NS_STYLE_LIST_STYLE_SQUARE:
+    case NS_STYLE_LIST_STYLE_SQUARE: {
       ascent = fm->MaxAscent();
       bulletSize = std::max(nsPresContext::CSSPixelsToAppUnits(MIN_BULLET_SIZE),
                           NSToCoordRound(0.8f * (float(ascent) / 2.0f)));
       mPadding.bottom = NSToCoordRound(float(ascent) / 8.0f);
       aMetrics.Width() = aMetrics.Height() = bulletSize;
       aMetrics.SetTopAscent(bulletSize + mPadding.bottom);
+
+      // Add spacing to the padding
+      nscoord halfEm = fm->EmHeight() / 2;
+      WritingMode wm = GetWritingMode();
+      if (wm.IsVertical()) {
+        mPadding.bottom += halfEm;
+      } else if (wm.IsBidiLTR()) {
+        mPadding.right += halfEm;
+      } else {
+        mPadding.left += halfEm;
+      }
       break;
+    }
 
     default:
     case NS_STYLE_LIST_STYLE_DECIMAL_LEADING_ZERO:
     case NS_STYLE_LIST_STYLE_DECIMAL:
     case NS_STYLE_LIST_STYLE_CJK_DECIMAL:
     case NS_STYLE_LIST_STYLE_LOWER_ROMAN:
     case NS_STYLE_LIST_STYLE_UPPER_ROMAN:
     case NS_STYLE_LIST_STYLE_LOWER_ALPHA:
@@ -1664,32 +1678,25 @@ nsBulletFrame::Reflow(nsPresContext* aPr
 {
   DO_GLOBAL_REFLOW_COUNT("nsBulletFrame");
   DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
 
   float inflation = nsLayoutUtils::FontSizeInflationFor(this);
   SetFontSizeInflation(inflation);
 
   // Get the base size
-  // This will also set mSuppressPadding appropriately (via GetListItemText())
-  // for the builtin counter styles with ideographic comma as suffix where the
-  // default padding from ua.css is not desired.
   GetDesiredSize(aPresContext, aReflowState.rendContext, aMetrics, inflation);
 
   // Add in the border and padding; split the top/bottom between the
   // ascent and descent to make things look nice
   const nsMargin& borderPadding = aReflowState.ComputedPhysicalBorderPadding();
-  if (!mSuppressPadding ||
-      aPresContext->HasAuthorSpecifiedRules(this,
-                                            NS_AUTHOR_SPECIFIED_PADDING)) {
-    mPadding.top += NSToCoordRound(borderPadding.top * inflation);
-    mPadding.right += NSToCoordRound(borderPadding.right * inflation);
-    mPadding.bottom += NSToCoordRound(borderPadding.bottom * inflation);
-    mPadding.left += NSToCoordRound(borderPadding.left * inflation);
-  }
+  mPadding.top += NSToCoordRound(borderPadding.top * inflation);
+  mPadding.right += NSToCoordRound(borderPadding.right * inflation);
+  mPadding.bottom += NSToCoordRound(borderPadding.bottom * inflation);
+  mPadding.left += NSToCoordRound(borderPadding.left * inflation);
   aMetrics.Width() += mPadding.left + mPadding.right;
   aMetrics.Height() += mPadding.top + mPadding.bottom;
   aMetrics.SetTopAscent(aMetrics.TopAscent() + mPadding.top);
 
   // XXX this is a bit of a hack, we're assuming that no glyphs used for bullets
   // overflow their font-boxes. It'll do for now; to fix it for real, we really
   // should rewrite all the text-handling code here to use gfxTextRun (bug
   // 397294).
--- a/layout/generic/nsBulletFrame.h
+++ b/layout/generic/nsBulletFrame.h
@@ -80,18 +80,17 @@ public:
   /* get list item text, without '.' */
   static void AppendCounterText(int32_t aListStyleType,
                                 int32_t aOrdinal,
                                 nsString& aResult,
                                 bool& aIsRTL);
 
   /* get suffix of list item */
   static void GetListItemSuffix(int32_t aListStyleType,
-                                nsString& aResult,
-                                bool& aSuppressPadding);
+                                nsString& aResult);
 
   /* get list item text, with '.' */
   void GetListItemText(const nsStyleList& aStyleList, nsString& aResult);
                          
   void PaintBullet(nsRenderingContext& aRenderingContext, nsPoint aPt,
                    const nsRect& aDirtyRect, uint32_t aFlags);
   
   virtual bool IsEmpty() MOZ_OVERRIDE;
@@ -119,23 +118,16 @@ protected:
   void GetLoadGroup(nsPresContext *aPresContext, nsILoadGroup **aLoadGroup);
 
   nsMargin mPadding;
   nsRefPtr<imgRequestProxy> mImageRequest;
   nsRefPtr<nsBulletListener> mListener;
 
   nsSize mIntrinsicSize;
   int32_t mOrdinal;
-  bool mTextIsRTL;
-
-  // If set to true, any padding of bullet defined in the UA style sheet will
-  // be suppressed.  This is used for some CJK numbering styles where extra
-  // space after the suffix is not desired.  Note that, any author-specified
-  // padding overriding the default style will NOT be suppressed.
-  bool mSuppressPadding;
 
 private:
 
   // This is a boolean flag indicating whether or not the current image request
   // has been registered with the refresh driver.
   bool mRequestRegistered;
 };
 
--- a/layout/reftests/counters/counter-suffix-ref.html
+++ b/layout/reftests/counters/counter-suffix-ref.html
@@ -3,61 +3,35 @@
   p, span { margin: 0; padding: 0; line-height: 150%; }
   #wrapper { width: 10em; }
   span {
     display: inline-block;
     width: 3em;
     text-align: end;
     box-sizing: border-box;
   }
-  .def span { -moz-padding-end: 0.5em; }
-  .fix span { -moz-padding-end: 1em; }
 </style>
 <div id="wrapper">
-  <p class="def">
-    <span>1.</span>foo<br>
-    <span>2.</span>bar
+  <p>
+    <span>1.&nbsp;</span>foo<br>
+    <span>2.&nbsp;</span>bar
   </p>
-  <p class="def">
-    <span>&#x5d0;.</span>foo<br>
-    <span>&#x5d1;.</span>bar
+  <p>
+    <span>&#x5d0;.&nbsp;</span>foo<br>
+    <span>&#x5d1;.&nbsp;</span>bar
   </p>
   <p>
     <span>&#x4e00;&#x3001;</span>foo<br>
     <span>&#x4e8c;&#x3001;</span>bar
   </p>
-  <p class="def">
-    <span>&#xc77c;,</span>foo<br>
-    <span>&#xc774;,</span>bar
-  </p>
-  <p class="fix">
-    <span>1.</span>foo<br>
-    <span>2.</span>bar
-  </p>
-  <p class="fix">
-    <span>&#x5d0;.</span>foo<br>
-    <span>&#x5d1;.</span>bar
-  </p>
-  <p class="fix">
-    <span>&#x4e00;&#x3001;</span>foo<br>
-    <span>&#x4e8c;&#x3001;</span>bar
+  <p>
+    <span>&#xc77c;,&nbsp;</span>foo<br>
+    <span>&#xc774;,&nbsp;</span>bar
   </p>
-  <p class="fix">
-    <span>&#xc77c;,</span>foo<br>
-    <span>&#xc774;,</span>bar
-  </p>
-  <p class="def" dir="rtl">
-    <span>1.</span>foo<br>
-    <span>2.</span>bar
+  <p dir="rtl">
+    <span>1.&nbsp;</span>foo<br>
+    <span>2.&nbsp;</span>bar
   </p>
-  <p class="def" dir="rtl">
-    <span>&#x5d0;.</span>foo<br>
-    <span>&#x5d1;.</span>bar
-  </p>
-  <p class="fix" dir="rtl">
-    <span>1.</span>foo<br>
-    <span>2.</span>bar
-  </p>
-  <p class="fix" dir="rtl">
-    <span>&#x5d0;.</span>foo<br>
-    <span>&#x5d1;.</span>bar
+  <p dir="rtl">
+    <span>&#x5d0;.&nbsp;</span>foo<br>
+    <span>&#x5d1;.&nbsp;</span>bar
   </p>
 </div>
--- a/layout/reftests/counters/counter-suffix.html
+++ b/layout/reftests/counters/counter-suffix.html
@@ -2,26 +2,17 @@
 <style>
   ol, li { margin: 0; padding: 0; line-height: 150%; }
   #wrapper { width: 10em; }
   ol { padding: 0 3em; }
   .dec { list-style-type: decimal; }
   .heb { list-style-type: hebrew; }
   .cjk { list-style-type: cjk-decimal; }
   .kor { list-style-type: korean-hangul-formal; }
-  .spec li::-moz-list-number {
-    -moz-padding-end: 1em;
-  }
 </style>
 <div id="wrapper">
   <ol class="dec"><li>foo<li>bar</ol>
   <ol class="heb"><li>foo<li>bar</ol>
   <ol class="cjk"><li>foo<li>bar</ol>
   <ol class="kor"><li>foo<li>bar</ol>
-  <ol class="dec spec"><li>foo<li>bar</ol>
-  <ol class="heb spec"><li>foo<li>bar</ol>
-  <ol class="cjk spec"><li>foo<li>bar</ol>
-  <ol class="kor spec"><li>foo<li>bar</ol>
   <ol class="dec" dir="rtl"><li>foo<li>bar</ol>
   <ol class="heb" dir="rtl"><li>foo<li>bar</ol>
-  <ol class="dec spec" dir="rtl"><li>foo<li>bar</ol>
-  <ol class="heb spec" dir="rtl"><li>foo<li>bar</ol>
 </div>
--- a/layout/reftests/counters/reftest.list
+++ b/layout/reftests/counters/reftest.list
@@ -63,17 +63,17 @@ fails-if(B2G&&browserIsRemote) == t1204-
 == counter-reset-integer-range.html counter-reset-integer-range-ref.html
 == counter-ua-limits-00.html counter-ua-limits-00-ref.html
 == counter-ua-limits-01.html counter-ua-limits-01-ref.html
 == counter-ua-limits-02.html counter-ua-limits-02-ref.html
 == counter-ua-limits-03.html counter-ua-limits-03-ref.html
 == counter-ua-limits-list-00.html counter-ua-limits-list-00-ref.html
 == counter-ua-limits-list-01.html counter-ua-limits-list-01-ref.html
 == multiple-thai-counters.html multiple-thai-counters-ref.html
-fails-if(B2G) == counter-suffix.html counter-suffix-ref.html # B2G kerning
+== counter-suffix.html counter-suffix-ref.html
 == counter-cjk-decimal.html counter-cjk-decimal-ref.html
 == counter-japanese-informal.html counter-japanese-informal-ref.html
 == counter-japanese-formal.html counter-japanese-formal-ref.html
 == counter-korean-hangul-formal.html counter-korean-hangul-formal-ref.html
 == counter-korean-hanja-informal.html counter-korean-hanja-informal-ref.html
 == counter-korean-hanja-formal.html counter-korean-hanja-formal-ref.html
 == counter-simp-chinese-informal.html counter-simp-chinese-informal-ref.html
 == counter-simp-chinese-formal.html counter-simp-chinese-formal-ref.html
--- a/layout/reftests/list-item/numbering-2-ref.html
+++ b/layout/reftests/list-item/numbering-2-ref.html
@@ -1,17 +1,17 @@
 <html><head>
     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
     <title>Testcase #2 for bug 614969</title>
 <style>
 html,body {
     color:black; background-color:white; font-size:12px; padding:0; margin:0;
 }
 
-li {margin-left:0; padding-left:0px; }
+li {margin-left:0; padding-left:0px; width:200px; }
 ol {margin-left:0; padding-left:40px; }
 </style>
 </head>
 <body>
 
 <div style="position:absolute;left:0;top:0"><ol style="list-style: decimal inside"><li style="height:0;">ABS</li><li style="padding-top:1em">List item</li></ol></div>
 <div style="position:absolute;left:0;top:3em"><div style="position:relative"><ol style="list-style: decimal inside"><li>REL BLOCK</li><li style="padding-top:1em">List item</li></ol></div></div>
 <div style="position:absolute;left:0;top:7em"><div style="float:left"><ol style="list-style: decimal inside"><li style="height:2em;">FLOAT</li><li style="">List item</li></ol></div></div>
--- a/layout/reftests/list-item/numbering-2.html
+++ b/layout/reftests/list-item/numbering-2.html
@@ -1,17 +1,17 @@
 <html><head>
     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
     <title>Testcase #2 for bug 614969</title>
 <style>
 html,body {
     color:black; background-color:white; font-size:12px; padding:0; margin:0;
 }
 
-li {margin-left:0; padding-left:0px; }
+li {margin-left:0; padding-left:0px; width:200px; }
 ol {margin-left:0; padding-left:40px; }
 </style>
 </head>
 <body>
 
 <div style="position:absolute;left:0;top:0"><ol style="list-style: decimal inside"><div style="position:absolute"><li>ABS</li></div><li style="padding-top:1em">List item</li></ol></div>
 <div style="position:absolute;left:0;top:3em"><ol style="list-style: decimal inside"><div style="position:relative"><li>REL BLOCK</li></div><li style="padding-top:1em">List item</li></ol></div>
 <div style="position:absolute;left:0;top:7em"><ol style="list-style: decimal inside"><div style="float:left;height:2em"><li>FLOAT</li></div><li style="padding-top:1em">List item</li></ol></div>
--- a/layout/style/ua.css
+++ b/layout/style/ua.css
@@ -72,19 +72,16 @@
   white-space: inherit;
 }
 
 /* Lists */
 
 *|*::-moz-list-bullet, *|*::-moz-list-number {
   display: inline;
   vertical-align: baseline;
-  /* Note that this padding is suppressed for some CJK numbering styles;
-   * see bug 934072 */
-  -moz-padding-end: 0.5em;
 }
 
 /* Links */
 
 *|*:-moz-any-link {
   cursor: pointer;
 }