mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backout bug 862693 (Stop the :-moz-focusring pseudo-class from matching if an element is themed and the theme will display a visual indication of focus for the element. r=roc)
This commit is contained in:
parent
7c1ae1ff7c
commit
c63ee27f69
@ -1018,23 +1018,6 @@ nsFocusManager::FocusPlugin(nsIContent* aContent)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ bool
|
|
||||||
nsFocusManager::ThemeDisplaysFocusForContent(nsIContent* aContent)
|
|
||||||
{
|
|
||||||
// We don't want to draw the focusring if the element is themed and
|
|
||||||
// the theme displays an indication of focus for the element.
|
|
||||||
nsIFrame* frame = aContent->GetPrimaryFrame();
|
|
||||||
if (frame) {
|
|
||||||
nsPresContext *presContext = frame->PresContext();
|
|
||||||
const nsStyleDisplay *disp = frame->StyleDisplay();
|
|
||||||
if (frame->IsThemed(disp) &&
|
|
||||||
presContext->GetTheme()->ThemeDrawsFocusForWidget(presContext, frame, disp->mAppearance)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
void
|
void
|
||||||
nsFocusManager::NotifyFocusStateChange(nsIContent* aContent,
|
nsFocusManager::NotifyFocusStateChange(nsIContent* aContent,
|
||||||
@ -1045,9 +1028,7 @@ nsFocusManager::NotifyFocusStateChange(nsIContent* aContent,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
nsEventStates eventState = NS_EVENT_STATE_FOCUS;
|
nsEventStates eventState = NS_EVENT_STATE_FOCUS;
|
||||||
if (!aGettingFocus ||
|
if (aWindowShouldShowFocusRing) {
|
||||||
(aWindowShouldShowFocusRing &&
|
|
||||||
!ThemeDisplaysFocusForContent(aContent))) {
|
|
||||||
eventState |= NS_EVENT_STATE_FOCUSRING;
|
eventState |= NS_EVENT_STATE_FOCUSRING;
|
||||||
}
|
}
|
||||||
if (aGettingFocus) {
|
if (aGettingFocus) {
|
||||||
|
@ -116,8 +116,6 @@ public:
|
|||||||
|
|
||||||
static bool sMouseFocusesFormControl;
|
static bool sMouseFocusesFormControl;
|
||||||
|
|
||||||
static bool ThemeDisplaysFocusForContent(nsIContent* aContent);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
nsFocusManager();
|
nsFocusManager();
|
||||||
|
@ -8417,8 +8417,7 @@ nsGlobalWindow::SetKeyboardIndicators(UIStateChangeType aShowAccelerators,
|
|||||||
oldShouldShowFocusRing != newShouldShowFocusRing &&
|
oldShouldShowFocusRing != newShouldShowFocusRing &&
|
||||||
mFocusedNode->IsElement()) {
|
mFocusedNode->IsElement()) {
|
||||||
// Update mFocusedNode's state.
|
// Update mFocusedNode's state.
|
||||||
if (newShouldShowFocusRing &&
|
if (newShouldShowFocusRing) {
|
||||||
!nsFocusManager::ThemeDisplaysFocusForContent(mFocusedNode.get())) {
|
|
||||||
mFocusedNode->AsElement()->AddStates(NS_EVENT_STATE_FOCUSRING);
|
mFocusedNode->AsElement()->AddStates(NS_EVENT_STATE_FOCUSRING);
|
||||||
} else {
|
} else {
|
||||||
mFocusedNode->AsElement()->RemoveStates(NS_EVENT_STATE_FOCUSRING);
|
mFocusedNode->AsElement()->RemoveStates(NS_EVENT_STATE_FOCUSRING);
|
||||||
|
@ -49,7 +49,6 @@ function runTest()
|
|||||||
|
|
||||||
var isMac = (navigator.platform.indexOf("Mac") >= 0);
|
var isMac = (navigator.platform.indexOf("Mac") >= 0);
|
||||||
var isWin = (navigator.platform.indexOf("Win") >= 0);
|
var isWin = (navigator.platform.indexOf("Win") >= 0);
|
||||||
var isLinux = (navigator.platform.indexOf("Linux") >= 0);
|
|
||||||
|
|
||||||
function checkFocus(element, visible, testid)
|
function checkFocus(element, visible, testid)
|
||||||
{
|
{
|
||||||
@ -101,7 +100,7 @@ function runTest()
|
|||||||
checkFocus($("l2"), true, "appearance on list after mouse focus with :focus");
|
checkFocus($("l2"), true, "appearance on list after mouse focus with :focus");
|
||||||
|
|
||||||
synthesizeMouse($("b1"), 4, 4, { });
|
synthesizeMouse($("b1"), 4, 4, { });
|
||||||
checkFocus($("b1"), !isMac && !isLinux && expectedVisible, "appearance on button after mouse focus with :moz-focusring");
|
checkFocus($("b1"), !isMac && expectedVisible, "appearance on button after mouse focus with :moz-focusring");
|
||||||
if (navigator.platform.indexOf("Mac") >= 0) {
|
if (navigator.platform.indexOf("Mac") >= 0) {
|
||||||
ok(compareSnapshots(snapShot($("b1")), snapShot($("b2")), false)[0], "focus after mouse shows no ring");
|
ok(compareSnapshots(snapShot($("b1")), snapShot($("b2")), false)[0], "focus after mouse shows no ring");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user