Commit 83643d37 authored by L. David Baron's avatar L. David Baron
Browse files

Fix serialization of the list-style-type part of counter values. (Bug 481591) r+sr=bzbarsky

parent 7d5c8d1d
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -106,7 +106,13 @@ nsCounterUseNode::GetText(nsString& aResult)
        for (nsCounterNode *n = mScopeStart; n->mScopePrev; n = n->mScopeStart)
            stack.AppendElement(n->mScopePrev);

    PRInt32 style = mCounterStyle->Item(mAllCounters ? 2 : 1).GetIntValue();
    const nsCSSValue& styleItem = mCounterStyle->Item(mAllCounters ? 2 : 1);
    PRInt32 style;
    if (styleItem.GetUnit() == eCSSUnit_None) {
        style = NS_STYLE_LIST_STYLE_NONE;
    } else {
        style = styleItem.GetIntValue();
    }
    const PRUnichar* separator;
    if (mAllCounters)
        separator = mCounterStyle->Item(1).GetStringBufferValue();
+5 −1
Original line number Diff line number Diff line
@@ -4548,7 +4548,11 @@ CSSParserImpl::ParseCounter(nsCSSValue& aValue)
    }
  }
  PRInt32 typeItem = eCSSUnit_Counters == unit ? 2 : 1;
  if (type == NS_STYLE_LIST_STYLE_NONE) {
    val->Item(typeItem).SetNoneValue();
  } else {
    val->Item(typeItem).SetIntValue(type, eCSSUnit_Enumerated);
  }

  if (!ExpectSymbol(')', PR_TRUE)) {
    SkipUntil(')');
+6 −6
Original line number Diff line number Diff line
@@ -751,12 +751,12 @@ nsComputedDOMStyle::GetContent(nsIDOMCSSValue** aValue)
            nsStyleUtil::AppendEscapedCSSString(
              nsDependentString(a->Item(1).GetStringBufferValue()), str);
          }
          if (a->Item(typeItem).GetUnit() == eCSSUnit_None) {
            str.AppendLiteral(", none");
          } else {
            PRInt32 type = a->Item(typeItem).GetIntValue();
            if (type != NS_STYLE_LIST_STYLE_DECIMAL) {
              str.AppendLiteral(", ");
            if (type == NS_STYLE_LIST_STYLE_NONE) {
              str.AppendLiteral("none");
            } else {
              AppendASCIItoUTF16(
                nsCSSProps::ValueToKeyword(type, nsCSSProps::kListStyleKTable),
                str);