Make nsIFrame::GetOrdinal accept all values that the CSS parser accepts (which currently adds no values). (Bug 644514 patch 1) r=bzbarsky
authorL. David Baron <dbaron@dbaron.org>
Tue, 19 Apr 2011 21:22:39 -0700
changeset 68343 45b20f137549b8c4bb31c95fbb3ca0e4c6ac188c
parent 68342 6e5fcc89c65ee568189c07cc926c73ecfca3158c
child 68350 9da94bb5ffc87d1a8916cd5104db7d10f1959bbe
push idunknown
push userunknown
push dateunknown
reviewersbzbarsky
bugs644514
milestone6.0a1
first release with
nightly linux32
45b20f137549 / 6.0a1 / 20110420030555 / files
nightly linux64
45b20f137549 / 6.0a1 / 20110420030555 / files
nightly mac
45b20f137549 / 6.0a1 / 20110420030555 / files
nightly win32
45b20f137549 / 6.0a1 / 20110420030555 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
Make nsIFrame::GetOrdinal accept all values that the CSS parser accepts (which currently adds no values). (Bug 644514 patch 1) r=bzbarsky
layout/xul/base/src/nsBox.cpp
--- a/layout/xul/base/src/nsBox.cpp
+++ b/layout/xul/base/src/nsBox.cpp
@@ -509,35 +509,28 @@ nsBox::GetFlex(nsBoxLayoutState& aState)
   nsIBox::AddCSSFlex(aState, this, flex);
 
   return flex;
 }
 
 PRUint32
 nsIFrame::GetOrdinal(nsBoxLayoutState& aState)
 {
-  PRUint32 ordinal = DEFAULT_ORDINAL_GROUP;
+  PRUint32 ordinal = GetStyleXUL()->mBoxOrdinal;
 
+  // When present, attribute value overrides CSS.
   nsIContent* content = GetContent();
   if (content) {
     PRInt32 error;
     nsAutoString value;
 
     content->GetAttr(kNameSpaceID_None, nsGkAtoms::ordinal, value);
     if (!value.IsEmpty()) {
       ordinal = value.ToInteger(&error);
     }
-    else {
-      // No attribute value.  Check CSS.
-      const nsStyleXUL* boxInfo = GetStyleXUL();
-      if (boxInfo->mBoxOrdinal > 1) {
-        // The ordinal group was defined in CSS.
-        ordinal = (nscoord)boxInfo->mBoxOrdinal;
-      }
-    }
   }
 
   return ordinal;
 }
 
 nscoord
 nsBox::GetBoxAscent(nsBoxLayoutState& aState)
 {