Bug 832120 cursor: auto; should be cursor: text; on editable element r=dbaron

This commit is contained in:
Masayuki Nakano 2013-01-23 23:36:48 +09:00
parent 5a451d0261
commit 12e37ff264
2 changed files with 8 additions and 1 deletions

View File

@ -3682,7 +3682,10 @@ nsFrame::GetCursor(const nsPoint& aPoint,
{
FillCursorInformationFromStyle(GetStyleUserInterface(), aCursor);
if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) {
aCursor.mCursor = NS_STYLE_CURSOR_DEFAULT;
// If this is editable, I-beam cursor is better for most elements.
aCursor.mCursor =
(mContent && mContent->IsEditable()) ? NS_STYLE_CURSOR_TEXT :
NS_STYLE_CURSOR_DEFAULT;
}

View File

@ -4270,6 +4270,10 @@ nsTextFrame::GetCursor(const nsPoint& aPoint,
FillCursorInformationFromStyle(GetStyleUserInterface(), aCursor);
if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) {
aCursor.mCursor = NS_STYLE_CURSOR_TEXT;
// If this is editable, we should ignore tabindex value.
if (mContent->IsEditable()) {
return NS_OK;
}
// If tabindex >= 0, use default cursor to indicate it's not selectable
nsIFrame *ancestorFrame = this;