mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Let style override the cursor choice when using an image map
This commit is contained in:
parent
7ce43732e5
commit
2fb0e7ca92
@ -917,7 +917,14 @@ nsImageFrame::GetCursor(nsIPresContext& aPresContext,
|
||||
PRInt32 x = NSTwipsToIntPixels((pt.x - inner.x), t2p);
|
||||
PRInt32 y = NSTwipsToIntPixels((pt.y - inner.y), t2p);
|
||||
if (NS_OK == map->IsInside(x, y)) {
|
||||
aCursor = NS_STYLE_CURSOR_POINTER;
|
||||
// Use style defined cursor if one is provided, otherwise when
|
||||
// the cursor style is "auto" we use the pointer cursor.
|
||||
const nsStyleColor* styleColor;
|
||||
GetStyleData(eStyleStruct_Color, (const nsStyleStruct*&)styleColor);
|
||||
aCursor = styleColor->mCursor;
|
||||
if (NS_STYLE_CURSOR_AUTO == aCursor) {
|
||||
aCursor = NS_STYLE_CURSOR_POINTER;
|
||||
}
|
||||
}
|
||||
NS_RELEASE(map);
|
||||
return NS_OK;
|
||||
|
@ -917,7 +917,14 @@ nsImageFrame::GetCursor(nsIPresContext& aPresContext,
|
||||
PRInt32 x = NSTwipsToIntPixels((pt.x - inner.x), t2p);
|
||||
PRInt32 y = NSTwipsToIntPixels((pt.y - inner.y), t2p);
|
||||
if (NS_OK == map->IsInside(x, y)) {
|
||||
aCursor = NS_STYLE_CURSOR_POINTER;
|
||||
// Use style defined cursor if one is provided, otherwise when
|
||||
// the cursor style is "auto" we use the pointer cursor.
|
||||
const nsStyleColor* styleColor;
|
||||
GetStyleData(eStyleStruct_Color, (const nsStyleStruct*&)styleColor);
|
||||
aCursor = styleColor->mCursor;
|
||||
if (NS_STYLE_CURSOR_AUTO == aCursor) {
|
||||
aCursor = NS_STYLE_CURSOR_POINTER;
|
||||
}
|
||||
}
|
||||
NS_RELEASE(map);
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user