From 62fbc658379a8f7769a31038963c534167fd74d4 Mon Sep 17 00:00:00 2001 From: "mats.palmgren%bredband.net" Date: Sun, 27 Jan 2008 02:49:48 +0000 Subject: [PATCH] Always post a restyle request if SetTextStyle() indicates it's needed. b=414123 r+sr+a=roc git-svn-id: svn://10.0.0.236/trunk@244088 18797224-902f-48f8-a5cc-f745e15eee43 --- .../mathml/base/src/nsMathMLTokenFrame.cpp | 10 ++--- .../mathml/base/src/nsMathMLTokenFrame.h | 5 +-- .../mathml/base/src/nsMathMLmoFrame.cpp | 4 +- .../layout/mathml/base/src/nsMathMLmoFrame.h | 3 +- mozilla/layout/reftests/bugs/414123-ref.xhtml | 34 +++++++++++++++ mozilla/layout/reftests/bugs/414123.xhtml | 42 +++++++++++++++++++ mozilla/layout/reftests/bugs/reftest.list | 1 + 7 files changed, 85 insertions(+), 14 deletions(-) create mode 100644 mozilla/layout/reftests/bugs/414123-ref.xhtml create mode 100644 mozilla/layout/reftests/bugs/414123.xhtml diff --git a/mozilla/layout/mathml/base/src/nsMathMLTokenFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLTokenFrame.cpp index 2c42c604c05..e57cf8d31f9 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLTokenFrame.cpp +++ b/mozilla/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/mozilla/layout/mathml/base/src/nsMathMLTokenFrame.h b/mozilla/layout/mathml/base/src/nsMathMLTokenFrame.h index c5f2809b9aa..d773d94ed73 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLTokenFrame.h +++ b/mozilla/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/mozilla/layout/mathml/base/src/nsMathMLmoFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmoFrame.cpp index c0e043a40bb..96939657bd3 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmoFrame.cpp +++ b/mozilla/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/mozilla/layout/mathml/base/src/nsMathMLmoFrame.h b/mozilla/layout/mathml/base/src/nsMathMLmoFrame.h index d2c0ad0e218..26facd3361e 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmoFrame.h +++ b/mozilla/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/mozilla/layout/reftests/bugs/414123-ref.xhtml b/mozilla/layout/reftests/bugs/414123-ref.xhtml new file mode 100644 index 00000000000..edfbf1c9190 --- /dev/null +++ b/mozilla/layout/reftests/bugs/414123-ref.xhtml @@ -0,0 +1,34 @@ + + + + + + Testcase for bug 414123 + + + + + + M + 2 + + + + + + M + 2 + + + + + + M + 2 + + + + + + diff --git a/mozilla/layout/reftests/bugs/414123.xhtml b/mozilla/layout/reftests/bugs/414123.xhtml new file mode 100644 index 00000000000..f41d4a71615 --- /dev/null +++ b/mozilla/layout/reftests/bugs/414123.xhtml @@ -0,0 +1,42 @@ + + + + + Testcase for bug 414123 + + + + + + + + 2 + + + + + + M + 2 + + + + + + + + diff --git a/mozilla/layout/reftests/bugs/reftest.list b/mozilla/layout/reftests/bugs/reftest.list index afecc0aec10..1fcbc051066 100644 --- a/mozilla/layout/reftests/bugs/reftest.list +++ b/mozilla/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