From 01c47ed1718aeb4b2892c8af188a4dd3d7cc0e50 Mon Sep 17 00:00:00 2001 From: "peterl%netscape.com" Date: Wed, 18 Nov 1998 02:11:54 +0000 Subject: [PATCH] cleaned up cursor style handling git-svn-id: svn://10.0.0.236/trunk@14845 18797224-902f-48f8-a5cc-f745e15eee43 --- .../content/html/style/src/nsCSSStyleRule.cpp | 2 +- .../layout/forms/nsHTMLButtonControlFrame.cpp | 17 ------- mozilla/layout/generic/nsContainerFrame.cpp | 7 ++- mozilla/layout/generic/nsFrame.cpp | 7 ++- .../layout/generic/nsHTMLContainerFrame.cpp | 46 ------------------- mozilla/layout/generic/nsHTMLContainerFrame.h | 5 -- mozilla/layout/generic/nsHTMLFrame.cpp | 3 -- mozilla/layout/generic/nsImageFrame.cpp | 32 ++++++------- mozilla/layout/generic/nsTextFrame.cpp | 7 ++- mozilla/layout/html/base/src/nsBodyFrame.cpp | 5 +- .../layout/html/base/src/nsContainerFrame.cpp | 7 ++- mozilla/layout/html/base/src/nsFrame.cpp | 7 ++- .../html/base/src/nsHTMLContainerFrame.cpp | 46 ------------------- .../html/base/src/nsHTMLContainerFrame.h | 5 -- mozilla/layout/html/base/src/nsHTMLFrame.cpp | 3 -- mozilla/layout/html/base/src/nsImageFrame.cpp | 32 ++++++------- mozilla/layout/html/base/src/nsTextFrame.cpp | 7 ++- .../forms/src/nsHTMLButtonControlFrame.cpp | 17 ------- .../layout/html/style/src/nsCSSStyleRule.cpp | 2 +- mozilla/layout/style/nsCSSStyleRule.cpp | 2 +- 20 files changed, 68 insertions(+), 191 deletions(-) diff --git a/mozilla/content/html/style/src/nsCSSStyleRule.cpp b/mozilla/content/html/style/src/nsCSSStyleRule.cpp index a1cea01163c..dd7eec2b653 100644 --- a/mozilla/content/html/style/src/nsCSSStyleRule.cpp +++ b/mozilla/content/html/style/src/nsCSSStyleRule.cpp @@ -1217,7 +1217,7 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration, list->mValue.GetStringValue(color->mCursorImage); } else if (eCSSUnit_Inherit == list->mValue.GetUnit()) { - color->mCursor = NS_STYLE_CURSOR_INHERIT; + color->mCursor = parentColor->mCursor; } } diff --git a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp index 4a8b715c7e1..c3742cc43a3 100644 --- a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp @@ -98,11 +98,6 @@ public: void GetDefaultLabel(nsString& aLabel); - NS_IMETHOD GetCursorAndContentAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - nsIContent** aContent, - PRInt32& aCursor); protected: virtual ~nsHTMLButtonControlFrame(); NS_IMETHOD_(nsrefcnt) AddRef(void); @@ -675,18 +670,6 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext, return NS_OK; } -NS_IMETHODIMP -nsHTMLButtonControlFrame::GetCursorAndContentAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - nsIContent** aContent, - PRInt32& aCursor) -{ - nsresult result = nsHTMLContainerFrame::GetCursorAndContentAt(aPresContext, aPoint, aFrame, aContent, aCursor); - aCursor = eCursor_standard; - return result; -} - PRIntn nsHTMLButtonControlFrame::GetSkipSides() const { diff --git a/mozilla/layout/generic/nsContainerFrame.cpp b/mozilla/layout/generic/nsContainerFrame.cpp index 66067f4da64..7ae944e514e 100644 --- a/mozilla/layout/generic/nsContainerFrame.cpp +++ b/mozilla/layout/generic/nsContainerFrame.cpp @@ -367,8 +367,13 @@ NS_METHOD nsContainerFrame::GetCursorAndContentAt(nsIPresContext& aPresContext, nsIContent** aContent, PRInt32& aCursor) { - aCursor = NS_STYLE_CURSOR_INHERIT; + const nsStyleColor* color = (const nsStyleColor*) + mStyleContext->GetStyleData(eStyleStruct_Color); + if (NS_STYLE_CURSOR_AUTO != color->mCursor) { + aCursor = color->mCursor; + } *aContent = mContent; + *aFrame = this; nsIFrame* kid; FirstChild(nsnull, kid); diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index e57c44aba21..c91e111fd07 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -1127,7 +1127,12 @@ NS_IMETHODIMP nsFrame::GetCursorAndContentAt(nsIPresContext& aPresContext, PRInt32& aCursor) { *aContent = mContent; - aCursor = NS_STYLE_CURSOR_INHERIT; + *aFrame = this; + const nsStyleColor* color = (const nsStyleColor*) + mStyleContext->GetStyleData(eStyleStruct_Color); + if (NS_STYLE_CURSOR_AUTO != color->mCursor) { + aCursor = color->mCursor; + } return NS_OK; } diff --git a/mozilla/layout/generic/nsHTMLContainerFrame.cpp b/mozilla/layout/generic/nsHTMLContainerFrame.cpp index 9a2af4414f0..b051bf4581a 100644 --- a/mozilla/layout/generic/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/generic/nsHTMLContainerFrame.cpp @@ -117,52 +117,6 @@ nsHTMLContainerFrame::HandleEvent(nsIPresContext& aPresContext, return nsContainerFrame::HandleEvent(aPresContext, aEvent, aEventStatus); } -NS_IMETHODIMP -nsHTMLContainerFrame::GetCursorAndContentAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - nsIContent** aContent, - PRInt32& aCursor) -{ - // Set content here, child will override if found. - *aContent = mContent; - - // Get my cursor - const nsStyleColor* styleColor = (const nsStyleColor*) - mStyleContext->GetStyleData(eStyleStruct_Color); - PRInt32 myCursor = styleColor->mCursor; - - if (NS_STYLE_CURSOR_INHERIT != myCursor) { - // If this container has a particular cursor, use it, otherwise - // let the child decide. - *aFrame = this; - aCursor = myCursor; - return NS_OK; - } - - // Get child's cursor, if any - nsContainerFrame::GetCursorAndContentAt(aPresContext, aPoint, aFrame, aContent, aCursor); - if (aCursor != NS_STYLE_CURSOR_INHERIT) { - if (nsnull != mContent) { - nsIAtom* tag; - mContent->GetTag(tag); - if (nsHTMLAtoms::a == tag) { - // Anchor tags override their child cursors in some cases. - if ((NS_STYLE_CURSOR_TEXT == aCursor) && - (NS_STYLE_CURSOR_INHERIT != myCursor)) { - aCursor = myCursor; - } - } - NS_RELEASE(tag); - } - return NS_OK; - } - - // No specific cursor for us - aCursor = NS_STYLE_CURSOR_INHERIT; - return NS_OK; -} - nsPlaceholderFrame* nsHTMLContainerFrame::CreatePlaceholderFrame(nsIPresContext& aPresContext, nsIFrame* aFloatedFrame) diff --git a/mozilla/layout/generic/nsHTMLContainerFrame.h b/mozilla/layout/generic/nsHTMLContainerFrame.h index 684097c5c69..ae4f1824af4 100644 --- a/mozilla/layout/generic/nsHTMLContainerFrame.h +++ b/mozilla/layout/generic/nsHTMLContainerFrame.h @@ -38,11 +38,6 @@ public: NS_IMETHOD HandleEvent(nsIPresContext& aPresContext, nsGUIEvent* aEvent, nsEventStatus& aEventStatus); - NS_IMETHOD GetCursorAndContentAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - nsIContent** aContent, - PRInt32& aCursor); nsPlaceholderFrame* CreatePlaceholderFrame(nsIPresContext& aPresContext, nsIFrame* aFloatedFrame); diff --git a/mozilla/layout/generic/nsHTMLFrame.cpp b/mozilla/layout/generic/nsHTMLFrame.cpp index b4cd3d06def..c19e61c4604 100644 --- a/mozilla/layout/generic/nsHTMLFrame.cpp +++ b/mozilla/layout/generic/nsHTMLFrame.cpp @@ -262,9 +262,6 @@ RootFrame::HandleEvent(nsIPresContext& aPresContext, PRInt32 cursor; GetCursorAndContentAt(aPresContext, aEvent->point, &target, &mContent, cursor); - if (cursor == NS_STYLE_CURSOR_INHERIT) { - cursor = NS_STYLE_CURSOR_DEFAULT; - } nsCursor c; switch (cursor) { default: diff --git a/mozilla/layout/generic/nsImageFrame.cpp b/mozilla/layout/generic/nsImageFrame.cpp index 4521b55847a..2a5a426f6f7 100644 --- a/mozilla/layout/generic/nsImageFrame.cpp +++ b/mozilla/layout/generic/nsImageFrame.cpp @@ -841,30 +841,28 @@ ImageFrame::GetCursorAndContentAt(nsIPresContext& aPresContext, nsIContent** aContent, PRInt32& aCursor) { - // The default cursor is to have no cursor - aCursor = NS_STYLE_CURSOR_INHERIT; *aContent = mContent; - const nsStyleColor* styleColor = (const nsStyleColor*) mStyleContext->GetStyleData(eStyleStruct_Color); - if (styleColor->mCursor != NS_STYLE_CURSOR_INHERIT) { - // If we have a particular cursor, use it - *aFrame = this; + *aFrame = this; + if (NS_STYLE_CURSOR_AUTO != styleColor->mCursor) { aCursor = (PRInt32) styleColor->mCursor; } - nsIImageMap* map = GetImageMap(); - if (nsnull != map) { - nsRect inner; - GetInnerArea(&aPresContext, inner); - aCursor = NS_STYLE_CURSOR_DEFAULT; - float t2p = aPresContext.GetTwipsToPixels(); - PRInt32 x = NSTwipsToIntPixels((aPoint.x - inner.x), t2p); - PRInt32 y = NSTwipsToIntPixels((aPoint.y - inner.y), t2p); - if (NS_OK == map->IsInside(x, y)) { - aCursor = NS_STYLE_CURSOR_POINTER; + if (NS_STYLE_CURSOR_AUTO == styleColor->mCursor) { // image map wins over local auto + nsIImageMap* map = GetImageMap(); + if (nsnull != map) { + nsRect inner; + GetInnerArea(&aPresContext, inner); + aCursor = NS_STYLE_CURSOR_DEFAULT; + float t2p = aPresContext.GetTwipsToPixels(); + PRInt32 x = NSTwipsToIntPixels((aPoint.x - inner.x), t2p); + PRInt32 y = NSTwipsToIntPixels((aPoint.y - inner.y), t2p); + if (NS_OK == map->IsInside(x, y)) { + aCursor = NS_STYLE_CURSOR_POINTER; + } + NS_RELEASE(map); } - NS_RELEASE(map); } return NS_OK; diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index a9b44637a3e..86c7bf29b0a 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -459,8 +459,11 @@ TextFrame::GetCursorAndContentAt(nsIPresContext& aPresContext, nsIContent** aContent, PRInt32& aCursor) { - *aContent = mContent; - aCursor = NS_STYLE_CURSOR_TEXT; + if (NS_STYLE_CURSOR_AUTO == aCursor) { + *aContent = mContent; + *aFrame = this; + aCursor = NS_STYLE_CURSOR_TEXT; + } return NS_OK; } diff --git a/mozilla/layout/html/base/src/nsBodyFrame.cpp b/mozilla/layout/html/base/src/nsBodyFrame.cpp index 3a95727601b..b7a85778caa 100644 --- a/mozilla/layout/html/base/src/nsBodyFrame.cpp +++ b/mozilla/layout/html/base/src/nsBodyFrame.cpp @@ -509,12 +509,9 @@ nsBodyFrame::HandleEvent(nsIPresContext& aPresContext, { nsIFrame* target = this; nsIContent* mTargetContent = mContent; - PRInt32 cursor; + PRInt32 cursor = NS_STYLE_CURSOR_AUTO; GetCursorAndContentAt(aPresContext, aEvent->point, &target, &mTargetContent, cursor); - if (cursor == NS_STYLE_CURSOR_INHERIT) { - cursor = NS_STYLE_CURSOR_DEFAULT; - } nsCursor c; switch (cursor) { default: diff --git a/mozilla/layout/html/base/src/nsContainerFrame.cpp b/mozilla/layout/html/base/src/nsContainerFrame.cpp index 66067f4da64..7ae944e514e 100644 --- a/mozilla/layout/html/base/src/nsContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsContainerFrame.cpp @@ -367,8 +367,13 @@ NS_METHOD nsContainerFrame::GetCursorAndContentAt(nsIPresContext& aPresContext, nsIContent** aContent, PRInt32& aCursor) { - aCursor = NS_STYLE_CURSOR_INHERIT; + const nsStyleColor* color = (const nsStyleColor*) + mStyleContext->GetStyleData(eStyleStruct_Color); + if (NS_STYLE_CURSOR_AUTO != color->mCursor) { + aCursor = color->mCursor; + } *aContent = mContent; + *aFrame = this; nsIFrame* kid; FirstChild(nsnull, kid); diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index e57c44aba21..c91e111fd07 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -1127,7 +1127,12 @@ NS_IMETHODIMP nsFrame::GetCursorAndContentAt(nsIPresContext& aPresContext, PRInt32& aCursor) { *aContent = mContent; - aCursor = NS_STYLE_CURSOR_INHERIT; + *aFrame = this; + const nsStyleColor* color = (const nsStyleColor*) + mStyleContext->GetStyleData(eStyleStruct_Color); + if (NS_STYLE_CURSOR_AUTO != color->mCursor) { + aCursor = color->mCursor; + } return NS_OK; } diff --git a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp index 9a2af4414f0..b051bf4581a 100644 --- a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp @@ -117,52 +117,6 @@ nsHTMLContainerFrame::HandleEvent(nsIPresContext& aPresContext, return nsContainerFrame::HandleEvent(aPresContext, aEvent, aEventStatus); } -NS_IMETHODIMP -nsHTMLContainerFrame::GetCursorAndContentAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - nsIContent** aContent, - PRInt32& aCursor) -{ - // Set content here, child will override if found. - *aContent = mContent; - - // Get my cursor - const nsStyleColor* styleColor = (const nsStyleColor*) - mStyleContext->GetStyleData(eStyleStruct_Color); - PRInt32 myCursor = styleColor->mCursor; - - if (NS_STYLE_CURSOR_INHERIT != myCursor) { - // If this container has a particular cursor, use it, otherwise - // let the child decide. - *aFrame = this; - aCursor = myCursor; - return NS_OK; - } - - // Get child's cursor, if any - nsContainerFrame::GetCursorAndContentAt(aPresContext, aPoint, aFrame, aContent, aCursor); - if (aCursor != NS_STYLE_CURSOR_INHERIT) { - if (nsnull != mContent) { - nsIAtom* tag; - mContent->GetTag(tag); - if (nsHTMLAtoms::a == tag) { - // Anchor tags override their child cursors in some cases. - if ((NS_STYLE_CURSOR_TEXT == aCursor) && - (NS_STYLE_CURSOR_INHERIT != myCursor)) { - aCursor = myCursor; - } - } - NS_RELEASE(tag); - } - return NS_OK; - } - - // No specific cursor for us - aCursor = NS_STYLE_CURSOR_INHERIT; - return NS_OK; -} - nsPlaceholderFrame* nsHTMLContainerFrame::CreatePlaceholderFrame(nsIPresContext& aPresContext, nsIFrame* aFloatedFrame) diff --git a/mozilla/layout/html/base/src/nsHTMLContainerFrame.h b/mozilla/layout/html/base/src/nsHTMLContainerFrame.h index 684097c5c69..ae4f1824af4 100644 --- a/mozilla/layout/html/base/src/nsHTMLContainerFrame.h +++ b/mozilla/layout/html/base/src/nsHTMLContainerFrame.h @@ -38,11 +38,6 @@ public: NS_IMETHOD HandleEvent(nsIPresContext& aPresContext, nsGUIEvent* aEvent, nsEventStatus& aEventStatus); - NS_IMETHOD GetCursorAndContentAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - nsIContent** aContent, - PRInt32& aCursor); nsPlaceholderFrame* CreatePlaceholderFrame(nsIPresContext& aPresContext, nsIFrame* aFloatedFrame); diff --git a/mozilla/layout/html/base/src/nsHTMLFrame.cpp b/mozilla/layout/html/base/src/nsHTMLFrame.cpp index b4cd3d06def..c19e61c4604 100644 --- a/mozilla/layout/html/base/src/nsHTMLFrame.cpp +++ b/mozilla/layout/html/base/src/nsHTMLFrame.cpp @@ -262,9 +262,6 @@ RootFrame::HandleEvent(nsIPresContext& aPresContext, PRInt32 cursor; GetCursorAndContentAt(aPresContext, aEvent->point, &target, &mContent, cursor); - if (cursor == NS_STYLE_CURSOR_INHERIT) { - cursor = NS_STYLE_CURSOR_DEFAULT; - } nsCursor c; switch (cursor) { default: diff --git a/mozilla/layout/html/base/src/nsImageFrame.cpp b/mozilla/layout/html/base/src/nsImageFrame.cpp index 4521b55847a..2a5a426f6f7 100644 --- a/mozilla/layout/html/base/src/nsImageFrame.cpp +++ b/mozilla/layout/html/base/src/nsImageFrame.cpp @@ -841,30 +841,28 @@ ImageFrame::GetCursorAndContentAt(nsIPresContext& aPresContext, nsIContent** aContent, PRInt32& aCursor) { - // The default cursor is to have no cursor - aCursor = NS_STYLE_CURSOR_INHERIT; *aContent = mContent; - const nsStyleColor* styleColor = (const nsStyleColor*) mStyleContext->GetStyleData(eStyleStruct_Color); - if (styleColor->mCursor != NS_STYLE_CURSOR_INHERIT) { - // If we have a particular cursor, use it - *aFrame = this; + *aFrame = this; + if (NS_STYLE_CURSOR_AUTO != styleColor->mCursor) { aCursor = (PRInt32) styleColor->mCursor; } - nsIImageMap* map = GetImageMap(); - if (nsnull != map) { - nsRect inner; - GetInnerArea(&aPresContext, inner); - aCursor = NS_STYLE_CURSOR_DEFAULT; - float t2p = aPresContext.GetTwipsToPixels(); - PRInt32 x = NSTwipsToIntPixels((aPoint.x - inner.x), t2p); - PRInt32 y = NSTwipsToIntPixels((aPoint.y - inner.y), t2p); - if (NS_OK == map->IsInside(x, y)) { - aCursor = NS_STYLE_CURSOR_POINTER; + if (NS_STYLE_CURSOR_AUTO == styleColor->mCursor) { // image map wins over local auto + nsIImageMap* map = GetImageMap(); + if (nsnull != map) { + nsRect inner; + GetInnerArea(&aPresContext, inner); + aCursor = NS_STYLE_CURSOR_DEFAULT; + float t2p = aPresContext.GetTwipsToPixels(); + PRInt32 x = NSTwipsToIntPixels((aPoint.x - inner.x), t2p); + PRInt32 y = NSTwipsToIntPixels((aPoint.y - inner.y), t2p); + if (NS_OK == map->IsInside(x, y)) { + aCursor = NS_STYLE_CURSOR_POINTER; + } + NS_RELEASE(map); } - NS_RELEASE(map); } return NS_OK; diff --git a/mozilla/layout/html/base/src/nsTextFrame.cpp b/mozilla/layout/html/base/src/nsTextFrame.cpp index a9b44637a3e..86c7bf29b0a 100644 --- a/mozilla/layout/html/base/src/nsTextFrame.cpp +++ b/mozilla/layout/html/base/src/nsTextFrame.cpp @@ -459,8 +459,11 @@ TextFrame::GetCursorAndContentAt(nsIPresContext& aPresContext, nsIContent** aContent, PRInt32& aCursor) { - *aContent = mContent; - aCursor = NS_STYLE_CURSOR_TEXT; + if (NS_STYLE_CURSOR_AUTO == aCursor) { + *aContent = mContent; + *aFrame = this; + aCursor = NS_STYLE_CURSOR_TEXT; + } return NS_OK; } diff --git a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp index 4a8b715c7e1..c3742cc43a3 100644 --- a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp @@ -98,11 +98,6 @@ public: void GetDefaultLabel(nsString& aLabel); - NS_IMETHOD GetCursorAndContentAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - nsIContent** aContent, - PRInt32& aCursor); protected: virtual ~nsHTMLButtonControlFrame(); NS_IMETHOD_(nsrefcnt) AddRef(void); @@ -675,18 +670,6 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext, return NS_OK; } -NS_IMETHODIMP -nsHTMLButtonControlFrame::GetCursorAndContentAt(nsIPresContext& aPresContext, - const nsPoint& aPoint, - nsIFrame** aFrame, - nsIContent** aContent, - PRInt32& aCursor) -{ - nsresult result = nsHTMLContainerFrame::GetCursorAndContentAt(aPresContext, aPoint, aFrame, aContent, aCursor); - aCursor = eCursor_standard; - return result; -} - PRIntn nsHTMLButtonControlFrame::GetSkipSides() const { diff --git a/mozilla/layout/html/style/src/nsCSSStyleRule.cpp b/mozilla/layout/html/style/src/nsCSSStyleRule.cpp index a1cea01163c..dd7eec2b653 100644 --- a/mozilla/layout/html/style/src/nsCSSStyleRule.cpp +++ b/mozilla/layout/html/style/src/nsCSSStyleRule.cpp @@ -1217,7 +1217,7 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration, list->mValue.GetStringValue(color->mCursorImage); } else if (eCSSUnit_Inherit == list->mValue.GetUnit()) { - color->mCursor = NS_STYLE_CURSOR_INHERIT; + color->mCursor = parentColor->mCursor; } } diff --git a/mozilla/layout/style/nsCSSStyleRule.cpp b/mozilla/layout/style/nsCSSStyleRule.cpp index a1cea01163c..dd7eec2b653 100644 --- a/mozilla/layout/style/nsCSSStyleRule.cpp +++ b/mozilla/layout/style/nsCSSStyleRule.cpp @@ -1217,7 +1217,7 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration, list->mValue.GetStringValue(color->mCursorImage); } else if (eCSSUnit_Inherit == list->mValue.GetUnit()) { - color->mCursor = NS_STYLE_CURSOR_INHERIT; + color->mCursor = parentColor->mCursor; } }