diff --git a/content/html/content/src/nsHTMLAtomList.h b/content/html/content/src/nsHTMLAtomList.h
index 95cd1af7a4b6..6ba1f449afa0 100644
--- a/content/html/content/src/nsHTMLAtomList.h
+++ b/content/html/content/src/nsHTMLAtomList.h
@@ -57,6 +57,7 @@ HTML_ATOM(mozAnonymousPositionedBlock, ":-moz-anonymous-positioned-block")
HTML_ATOM(mozFirstLineFixup, ":-moz-first-line-fixup")
HTML_ATOM(mozLineFrame, ":-moz-line-frame")
HTML_ATOM(mozListBulletPseudo, ":-moz-list-bullet")
+HTML_ATOM(mozListNumberPseudo, ":-moz-list-number")
HTML_ATOM(mozSingleLineTextControlFrame, ":-moz-singleline-textcontrol-frame")
HTML_ATOM(mozFocusInnerPseudo, ":-moz-focus-inner")
HTML_ATOM(mozFocusOuterPseudo, ":-moz-focus-outer")
diff --git a/content/shared/public/nsHTMLAtomList.h b/content/shared/public/nsHTMLAtomList.h
index 95cd1af7a4b6..6ba1f449afa0 100644
--- a/content/shared/public/nsHTMLAtomList.h
+++ b/content/shared/public/nsHTMLAtomList.h
@@ -57,6 +57,7 @@ HTML_ATOM(mozAnonymousPositionedBlock, ":-moz-anonymous-positioned-block")
HTML_ATOM(mozFirstLineFixup, ":-moz-first-line-fixup")
HTML_ATOM(mozLineFrame, ":-moz-line-frame")
HTML_ATOM(mozListBulletPseudo, ":-moz-list-bullet")
+HTML_ATOM(mozListNumberPseudo, ":-moz-list-number")
HTML_ATOM(mozSingleLineTextControlFrame, ":-moz-singleline-textcontrol-frame")
HTML_ATOM(mozFocusInnerPseudo, ":-moz-focus-inner")
HTML_ATOM(mozFocusOuterPseudo, ":-moz-focus-outer")
diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp
index 25e8415ebeb7..76c324f2768f 100644
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -859,7 +859,8 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
}
}
- // XXX_perf get rid of this!
+ // XXX_perf get rid of this! This is one of the things that makes
+ // incremental reflow O(N^2).
BuildFloaterList();
}
@@ -1443,7 +1444,8 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
}
// Compute the combined area of our children
-// XXX_perf: This can be done incrementally
+ // XXX_perf: This can be done incrementally. It is currently one of
+ // the things that makes incremental reflow O(N^2).
nscoord xa = 0, ya = 0, xb = aMetrics.width, yb = aMetrics.height;
if (NS_STYLE_OVERFLOW_HIDDEN != aReflowState.mStyleDisplay->mOverflow) {
for (line_iterator line = begin_lines(), line_end = end_lines();
@@ -6123,10 +6125,23 @@ nsBlockFrame::SetInitialChildList(nsIPresContext* aPresContext,
(NS_STYLE_DISPLAY_LIST_ITEM == styleDisplay->mDisplay) &&
(nsnull == mBullet)) {
// Resolve style for the bullet frame
+ const nsStyleList* styleList;
+ GetStyleData(eStyleStruct_List, (const nsStyleStruct*&) styleList);
+ nsIAtom *pseudoElement;
+ switch (styleList->mListStyleType) {
+ case NS_STYLE_LIST_STYLE_DISC:
+ case NS_STYLE_LIST_STYLE_CIRCLE:
+ case NS_STYLE_LIST_STYLE_SQUARE:
+ pseudoElement = nsHTMLAtoms::mozListBulletPseudo;
+ break;
+ default:
+ pseudoElement = nsHTMLAtoms::mozListNumberPseudo;
+ break;
+ }
nsIStyleContext* kidSC;
- aPresContext->ResolvePseudoStyleContextFor(mContent,
- nsHTMLAtoms::mozListBulletPseudo,
- mStyleContext, PR_FALSE, &kidSC);
+ aPresContext->ResolvePseudoStyleContextFor(mContent, pseudoElement,
+ mStyleContext, PR_FALSE,
+ &kidSC);
// Create bullet frame
nsCOMPtr shell;
@@ -6142,8 +6157,6 @@ nsBlockFrame::SetInitialChildList(nsIPresContext* aPresContext,
// If the list bullet frame should be positioned inside then add
// it to the flow now.
- const nsStyleList* styleList;
- GetStyleData(eStyleStruct_List, (const nsStyleStruct*&) styleList);
if (NS_STYLE_LIST_STYLE_POSITION_INSIDE ==
styleList->mListStylePosition) {
AddFrames(aPresContext, mBullet, nsnull);
diff --git a/layout/html/base/src/nsBlockFrame.cpp b/layout/html/base/src/nsBlockFrame.cpp
index 25e8415ebeb7..76c324f2768f 100644
--- a/layout/html/base/src/nsBlockFrame.cpp
+++ b/layout/html/base/src/nsBlockFrame.cpp
@@ -859,7 +859,8 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
}
}
- // XXX_perf get rid of this!
+ // XXX_perf get rid of this! This is one of the things that makes
+ // incremental reflow O(N^2).
BuildFloaterList();
}
@@ -1443,7 +1444,8 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
}
// Compute the combined area of our children
-// XXX_perf: This can be done incrementally
+ // XXX_perf: This can be done incrementally. It is currently one of
+ // the things that makes incremental reflow O(N^2).
nscoord xa = 0, ya = 0, xb = aMetrics.width, yb = aMetrics.height;
if (NS_STYLE_OVERFLOW_HIDDEN != aReflowState.mStyleDisplay->mOverflow) {
for (line_iterator line = begin_lines(), line_end = end_lines();
@@ -6123,10 +6125,23 @@ nsBlockFrame::SetInitialChildList(nsIPresContext* aPresContext,
(NS_STYLE_DISPLAY_LIST_ITEM == styleDisplay->mDisplay) &&
(nsnull == mBullet)) {
// Resolve style for the bullet frame
+ const nsStyleList* styleList;
+ GetStyleData(eStyleStruct_List, (const nsStyleStruct*&) styleList);
+ nsIAtom *pseudoElement;
+ switch (styleList->mListStyleType) {
+ case NS_STYLE_LIST_STYLE_DISC:
+ case NS_STYLE_LIST_STYLE_CIRCLE:
+ case NS_STYLE_LIST_STYLE_SQUARE:
+ pseudoElement = nsHTMLAtoms::mozListBulletPseudo;
+ break;
+ default:
+ pseudoElement = nsHTMLAtoms::mozListNumberPseudo;
+ break;
+ }
nsIStyleContext* kidSC;
- aPresContext->ResolvePseudoStyleContextFor(mContent,
- nsHTMLAtoms::mozListBulletPseudo,
- mStyleContext, PR_FALSE, &kidSC);
+ aPresContext->ResolvePseudoStyleContextFor(mContent, pseudoElement,
+ mStyleContext, PR_FALSE,
+ &kidSC);
// Create bullet frame
nsCOMPtr shell;
@@ -6142,8 +6157,6 @@ nsBlockFrame::SetInitialChildList(nsIPresContext* aPresContext,
// If the list bullet frame should be positioned inside then add
// it to the flow now.
- const nsStyleList* styleList;
- GetStyleData(eStyleStruct_List, (const nsStyleStruct*&) styleList);
if (NS_STYLE_LIST_STYLE_POSITION_INSIDE ==
styleList->mListStylePosition) {
AddFrames(aPresContext, mBullet, nsnull);
diff --git a/layout/html/document/src/html.css b/layout/html/document/src/html.css
index 61190f734f40..ac6d7f021a83 100644
--- a/layout/html/document/src/html.css
+++ b/layout/html/document/src/html.css
@@ -339,7 +339,7 @@ abbr[title], acronym[title] {
/* lists */
-*|*:-moz-list-bullet {
+*|*:-moz-list-bullet, *|*:-moz-list-number {
display: inline;
vertical-align: baseline;
margin-right: 8px;
diff --git a/layout/style/html.css b/layout/style/html.css
index 61190f734f40..ac6d7f021a83 100644
--- a/layout/style/html.css
+++ b/layout/style/html.css
@@ -339,7 +339,7 @@ abbr[title], acronym[title] {
/* lists */
-*|*:-moz-list-bullet {
+*|*:-moz-list-bullet, *|*:-moz-list-number {
display: inline;
vertical-align: baseline;
margin-right: 8px;