зеркало из https://github.com/mozilla/gecko-dev.git
Bug 260399 disabled textarea/input should use DEFAULT pointer
r+sr=bzbarsky
This commit is contained in:
Родитель
51bba31171
Коммит
c4da642d54
|
@ -2304,24 +2304,6 @@ nsEventStateManager::ClearFrameRefs(nsIFrame* aFrame)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsEventStateManager::CheckDisabled(nsIContent* aContent)
|
||||
{
|
||||
nsIAtom *tag = aContent->Tag();
|
||||
|
||||
if (((tag == nsHTMLAtoms::input ||
|
||||
tag == nsHTMLAtoms::select ||
|
||||
tag == nsHTMLAtoms::textarea ||
|
||||
tag == nsHTMLAtoms::button) &&
|
||||
(aContent->IsContentOfType(nsIContent::eHTML))) ||
|
||||
(tag == nsHTMLAtoms::button &&
|
||||
aContent->IsContentOfType(nsIContent::eXUL))) {
|
||||
return aContent->HasAttr(kNameSpaceID_None, nsHTMLAtoms::disabled);
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
nsEventStateManager::UpdateCursor(nsPresContext* aPresContext,
|
||||
nsEvent* aEvent, nsIFrame* aTargetFrame,
|
||||
|
@ -2335,22 +2317,12 @@ nsEventStateManager::UpdateCursor(nsPresContext* aPresContext,
|
|||
cursor = mLockCursor;
|
||||
}
|
||||
//If not locked, look for correct cursor
|
||||
else {
|
||||
nsIContent* targetContent = nsnull;
|
||||
if (mCurrentTarget) {
|
||||
targetContent = mCurrentTarget->GetContent();
|
||||
}
|
||||
|
||||
//If not disabled, check for the right cursor.
|
||||
if (!targetContent || !CheckDisabled(targetContent)) {
|
||||
if (aTargetFrame) {
|
||||
nsIFrame::Cursor framecursor;
|
||||
if (NS_FAILED(aTargetFrame->GetCursor(aEvent->point, framecursor)))
|
||||
return; // don't update the cursor if we failed to get it from the frame see bug 118877
|
||||
cursor = framecursor.mCursor;
|
||||
container = framecursor.mContainer;
|
||||
}
|
||||
}
|
||||
else if (aTargetFrame) {
|
||||
nsIFrame::Cursor framecursor;
|
||||
if (NS_FAILED(aTargetFrame->GetCursor(aEvent->point, framecursor)))
|
||||
return; // don't update the cursor if we failed to get it from the frame see bug 118877
|
||||
cursor = framecursor.mCursor;
|
||||
container = framecursor.mContainer;
|
||||
}
|
||||
|
||||
// Check whether or not to show the busy cursor
|
||||
|
|
|
@ -195,7 +195,6 @@ protected:
|
|||
|
||||
PRInt32 GetNextTabIndex(nsIContent* aParent, PRBool foward);
|
||||
nsresult SendFocusBlur(nsPresContext* aPresContext, nsIContent *aContent, PRBool aEnsureWindowHasFocus);
|
||||
PRBool CheckDisabled(nsIContent* aContent);
|
||||
void EnsureDocument(nsIPresShell* aPresShell);
|
||||
void EnsureDocument(nsPresContext* aPresContext);
|
||||
void FlushPendingEvents(nsPresContext* aPresContext);
|
||||
|
|
|
@ -248,7 +248,7 @@ optgroup[disabled],
|
|||
select[disabled],
|
||||
select[disabled]::-moz-display-comboboxcontrol-frame {
|
||||
color: GrayText;
|
||||
cursor: default;
|
||||
cursor: inherit;
|
||||
}
|
||||
|
||||
/* hidden inputs */
|
||||
|
@ -270,7 +270,7 @@ input[type="image"] {
|
|||
}
|
||||
|
||||
input[type="image"][disabled] {
|
||||
cursor: default;
|
||||
cursor: inherit;
|
||||
}
|
||||
|
||||
input[type="image"]:focus {
|
||||
|
|
|
@ -258,7 +258,7 @@ select[disabled] {
|
|||
-moz-user-focus: ignore;
|
||||
color: GrayText;
|
||||
background-color: ThreeDFace;
|
||||
cursor: default;
|
||||
cursor: inherit;
|
||||
}
|
||||
|
||||
option[disabled],
|
||||
|
@ -291,7 +291,7 @@ input[type="image"] {
|
|||
}
|
||||
|
||||
input[type="image"][disabled] {
|
||||
cursor: default;
|
||||
cursor: inherit;
|
||||
}
|
||||
|
||||
input[type="image"]:focus {
|
||||
|
@ -376,6 +376,7 @@ input[type="checkbox"][disabled]:hover:active {
|
|||
/* same as above, but !important */
|
||||
color: GrayText ! important;
|
||||
background-color: ThreeDFace ! important;
|
||||
cursor: inherit;
|
||||
}
|
||||
|
||||
input[type="checkbox"]:focus,
|
||||
|
@ -472,6 +473,7 @@ input[type="submit"][disabled] {
|
|||
padding: 1px 7px 1px 7px;
|
||||
border: 1px outset ButtonShadow;
|
||||
color: GrayText;
|
||||
cursor: inherit;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче