From d3ac2bc0d63d1740a1dc655f94cb1179bea25afe Mon Sep 17 00:00:00 2001 From: "mats.palmgren@bredband.net" Date: Sat, 26 Jan 2008 18:49:47 -0800 Subject: [PATCH] Always post a restyle request if SetTextStyle() indicates it's needed. b=414123 r+sr+a=roc --- layout/mathml/base/src/nsMathMLTokenFrame.cpp | 10 ++--- layout/mathml/base/src/nsMathMLTokenFrame.h | 5 +-- layout/mathml/base/src/nsMathMLmoFrame.cpp | 4 +- layout/mathml/base/src/nsMathMLmoFrame.h | 3 +- layout/reftests/bugs/414123-ref.xhtml | 34 +++++++++++++++ layout/reftests/bugs/414123.xhtml | 42 +++++++++++++++++++ layout/reftests/bugs/reftest.list | 1 + 7 files changed, 85 insertions(+), 14 deletions(-) create mode 100644 layout/reftests/bugs/414123-ref.xhtml create mode 100644 layout/reftests/bugs/414123.xhtml diff --git a/layout/mathml/base/src/nsMathMLTokenFrame.cpp b/layout/mathml/base/src/nsMathMLTokenFrame.cpp index 2c42c604c05b..e57cf8d31f9a 100644 --- a/layout/mathml/base/src/nsMathMLTokenFrame.cpp +++ b/layout/mathml/base/src/nsMathMLTokenFrame.cpp @@ -111,7 +111,7 @@ nsMathMLTokenFrame::SetInitialChildList(nsIAtom* aListName, return rv; SetQuotes(); - ProcessTextData(PR_FALSE); + ProcessTextData(); return rv; } @@ -212,7 +212,7 @@ nsMathMLTokenFrame::MarkIntrinsicWidthsDirty() { // this could be called due to changes in the nsTextFrame beneath us // when something changed in the text content. So re-process our text - ProcessTextData(PR_TRUE); + ProcessTextData(); nsMathMLContainerFrame::MarkIntrinsicWidthsDirty(); } @@ -232,16 +232,12 @@ nsMathMLTokenFrame::AttributeChanged(PRInt32 aNameSpaceID, } void -nsMathMLTokenFrame::ProcessTextData(PRBool aComputeStyleChange) +nsMathMLTokenFrame::ProcessTextData() { // see if the style changes from normal to italic or vice-versa if (!SetTextStyle()) return; - // has changed but it doesn't have to be reflected straightaway - if (!aComputeStyleChange) - return; - // explicitly request a re-resolve to pick up the change of style PresContext()->PresShell()->FrameConstructor()-> PostRestyleEvent(mContent, eReStyle_Self, NS_STYLE_HINT_NONE); diff --git a/layout/mathml/base/src/nsMathMLTokenFrame.h b/layout/mathml/base/src/nsMathMLTokenFrame.h index c5f2809b9aab..d773d94ed73e 100644 --- a/layout/mathml/base/src/nsMathMLTokenFrame.h +++ b/layout/mathml/base/src/nsMathMLTokenFrame.h @@ -82,7 +82,7 @@ public: virtual nsresult ChildListChanged(PRInt32 aModType) { - ProcessTextData(PR_TRUE); + ProcessTextData(); return nsMathMLContainerFrame::ChildListChanged(aModType); } @@ -93,8 +93,7 @@ protected: virtual PRIntn GetSkipSides() const { return 0; } // hook to perform MathML-specific actions depending on the tag - virtual void - ProcessTextData(PRBool aComputeStyleChange); + virtual void ProcessTextData(); // helper to set the style of which has to be italic or normal // depending on its textual content diff --git a/layout/mathml/base/src/nsMathMLmoFrame.cpp b/layout/mathml/base/src/nsMathMLmoFrame.cpp index c0e043a40bb2..96939657bd3f 100644 --- a/layout/mathml/base/src/nsMathMLmoFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmoFrame.cpp @@ -153,7 +153,7 @@ nsMathMLmoFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, // get the text that we enclose and setup our nsMathMLChar void -nsMathMLmoFrame::ProcessTextData(PRBool aComputeStyleChange) +nsMathMLmoFrame::ProcessTextData() { mFlags = 0; @@ -958,7 +958,7 @@ nsMathMLmoFrame::MarkIntrinsicWidthsDirty() // from the parent of our outermost embellished container (we ensure // that we are the core, not just a sibling of the core) - ProcessTextData(PR_FALSE); + ProcessTextData(); nsIFrame* target = this; nsEmbellishData embellishData; diff --git a/layout/mathml/base/src/nsMathMLmoFrame.h b/layout/mathml/base/src/nsMathMLmoFrame.h index d2c0ad0e218e..26facd3361e5 100644 --- a/layout/mathml/base/src/nsMathMLmoFrame.h +++ b/layout/mathml/base/src/nsMathMLmoFrame.h @@ -103,8 +103,7 @@ protected: float mMaxSize; // overload the base method so that we can setup our nsMathMLChar - virtual void - ProcessTextData(PRBool aComputeStyleChange); + virtual void ProcessTextData(); // helper to get our 'form' and lookup in the Operator Dictionary to fetch // our default data that may come from there, and to complete the setup diff --git a/layout/reftests/bugs/414123-ref.xhtml b/layout/reftests/bugs/414123-ref.xhtml new file mode 100644 index 000000000000..edfbf1c91903 --- /dev/null +++ b/layout/reftests/bugs/414123-ref.xhtml @@ -0,0 +1,34 @@ + + + + + + Testcase for bug 414123 + + + + + + M + 2 + + + + + + M + 2 + + + + + + M + 2 + + + + + + diff --git a/layout/reftests/bugs/414123.xhtml b/layout/reftests/bugs/414123.xhtml new file mode 100644 index 000000000000..f41d4a716151 --- /dev/null +++ b/layout/reftests/bugs/414123.xhtml @@ -0,0 +1,42 @@ + + + + + Testcase for bug 414123 + + + + + + + + 2 + + + + + + M + 2 + + + + + + + + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index afecc0aec102..1fcbc0510668 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -665,3 +665,4 @@ random == 403134-1.html 403134-1-ref.html # bug 405377 == 411334-1.xml 411334-1-ref.xml == 413292-1.html 413292-1-ref.html == 413361-1.html 413361-1-ref.html +== 414123.xhtml 414123-ref.xhtml