diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index b2d7b8a686b..045c393e966 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -10099,7 +10099,13 @@ nsCSSFrameConstructor::ProcessRestyledFrames(nsStyleChangeList& aChangeList, if (hint & (nsChangeHint_RepaintFrame | nsChangeHint_SyncFrameView)) { ApplyRenderingChangeToTree(aPresContext, frame, nsnull, hint); } + if (hint & nsChangeHint_UpdateCursor) { + nsIViewManager* viewMgr = aPresContext->GetViewManager(); + if (viewMgr) + viewMgr->SynthesizeMouseMove(PR_FALSE); + } } + #ifdef DEBUG // reget from content since it may have been regenerated... if (content) { diff --git a/mozilla/layout/base/nsChangeHint.h b/mozilla/layout/base/nsChangeHint.h index 97333af62f3..ebd71f04559 100644 --- a/mozilla/layout/base/nsChangeHint.h +++ b/mozilla/layout/base/nsChangeHint.h @@ -45,6 +45,7 @@ enum nsChangeHint { nsChangeHint_RepaintFrame = 0x01, // change was visual only (e.g., COLOR=) nsChangeHint_ReflowFrame = 0x02, // change requires reflow (e.g., WIDTH=) nsChangeHint_SyncFrameView = 0x04, // change requires view to be updated, if there is one (e.g., clip:) + nsChangeHint_UpdateCursor = 0x10, // The currently shown mouse cursor needs to be updated nsChangeHint_ReconstructFrame = 0x08 // change requires frame change (e.g., display:) // This subsumes all the above // TBD: add nsChangeHint_ForceFrameView to force frame reconstruction if the frame doesn't yet diff --git a/mozilla/layout/style/nsStyleContext.cpp b/mozilla/layout/style/nsStyleContext.cpp index cc501c38794..2ff0149842a 100644 --- a/mozilla/layout/style/nsStyleContext.cpp +++ b/mozilla/layout/style/nsStyleContext.cpp @@ -431,7 +431,8 @@ nsStyleContext::CalcStyleDifference(nsStyleContext* aOther) // our position in the rule node tree is also the same. PRBool compare = mRuleNode != aOther->mRuleNode; - nsChangeHint maxHint = NS_STYLE_HINT_FRAMECHANGE; + nsChangeHint maxHint = nsChangeHint(NS_STYLE_HINT_FRAMECHANGE | + nsChangeHint_UpdateCursor); #define DO_STRUCT_DIFFERENCE(struct_) \ PR_BEGIN_MACRO \ diff --git a/mozilla/layout/style/nsStyleStruct.cpp b/mozilla/layout/style/nsStyleStruct.cpp index ef81f65cdfb..4b76c430bc7 100644 --- a/mozilla/layout/style/nsStyleStruct.cpp +++ b/mozilla/layout/style/nsStyleStruct.cpp @@ -1693,13 +1693,12 @@ nsStyleUserInterface::nsStyleUserInterface(void) mCursor = NS_STYLE_CURSOR_AUTO; // fix for bugzilla bug 51113 } -nsStyleUserInterface::nsStyleUserInterface(const nsStyleUserInterface& aSource) +nsStyleUserInterface::nsStyleUserInterface(const nsStyleUserInterface& aSource) : + mUserInput(aSource.mUserInput), + mUserModify(aSource.mUserModify), + mUserFocus(aSource.mUserFocus), + mCursor(aSource.mCursor) { - mUserInput = aSource.mUserInput; - mUserModify = aSource.mUserModify; - mUserFocus = aSource.mUserFocus; - - mCursor = aSource.mCursor; } nsStyleUserInterface::~nsStyleUserInterface(void) @@ -1708,31 +1707,29 @@ nsStyleUserInterface::~nsStyleUserInterface(void) nsChangeHint nsStyleUserInterface::CalcDifference(const nsStyleUserInterface& aOther) const { + nsChangeHint hint = nsChangeHint(0); if (mCursor != aOther.mCursor) - return NS_STYLE_HINT_VISUAL; + NS_UpdateHint(hint, nsChangeHint_UpdateCursor); - if (mUserInput == aOther.mUserInput) { - if (mUserModify == aOther.mUserModify) { - // ignore mUserFocus - return NS_STYLE_HINT_NONE; - } - return NS_STYLE_HINT_VISUAL; - } + if (mUserModify != aOther.mUserModify) + NS_UpdateHint(hint, NS_STYLE_HINT_VISUAL); if ((mUserInput != aOther.mUserInput) && ((NS_STYLE_USER_INPUT_NONE == mUserInput) || (NS_STYLE_USER_INPUT_NONE == aOther.mUserInput))) { - return NS_STYLE_HINT_FRAMECHANGE; + NS_UpdateHint(hint, NS_STYLE_HINT_FRAMECHANGE); } - return NS_STYLE_HINT_VISUAL; + // ignore mUserFocus + + return hint; } #ifdef DEBUG /* static */ nsChangeHint nsStyleUserInterface::MaxDifference() { - return NS_STYLE_HINT_FRAMECHANGE; + return nsChangeHint(nsChangeHint_UpdateCursor | NS_STYLE_HINT_FRAMECHANGE); } #endif