diff --git a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp
index a2d15747efb..1148d69d8f5 100644
--- a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp
+++ b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp
@@ -532,7 +532,14 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext,
if (this == targetFrame) {
Invalidate(nsRect(0,0,mRect.width,mRect.height), PR_FALSE);
- reflowState.reason = eReflowReason_Resize;
+ nsIReflowCommand::ReflowType reflowType;
+ aReflowState.reflowCommand->GetType(reflowType);
+ if (nsIReflowCommand::StyleChanged == reflowType) {
+ reflowState.reason = eReflowReason_StyleChange;
+ }
+ else {
+ reflowState.reason = eReflowReason_Resize;
+ }
} else {
nsIFrame* nextFrame;
diff --git a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp
index a2d15747efb..1148d69d8f5 100644
--- a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp
+++ b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp
@@ -532,7 +532,14 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext,
if (this == targetFrame) {
Invalidate(nsRect(0,0,mRect.width,mRect.height), PR_FALSE);
- reflowState.reason = eReflowReason_Resize;
+ nsIReflowCommand::ReflowType reflowType;
+ aReflowState.reflowCommand->GetType(reflowType);
+ if (nsIReflowCommand::StyleChanged == reflowType) {
+ reflowState.reason = eReflowReason_StyleChange;
+ }
+ else {
+ reflowState.reason = eReflowReason_Resize;
+ }
} else {
nsIFrame* nextFrame;