mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 94424: Search/filters UI text field doesn't accept click-right paste. The underlying cause was that mousedown on a menuitem in the textbox's context menu shifted focus from the textbox into the first focusable container of the textbox. We're fixing this by not letting the focusable frame search code look outside popup frames. r=bryner, sr=hyatt
This commit is contained in:
parent
e5b94cfd7f
commit
c19fc0a9be
@ -1776,7 +1776,7 @@ nsEventStateManager::PostHandleEvent(nsIPresContext* aPresContext,
|
||||
if (mCurrentTarget) {
|
||||
mCurrentTarget->GetContentForEvent(mPresContext, aEvent, getter_AddRefs(newFocus));
|
||||
const nsStyleUserInterface* ui;
|
||||
mCurrentTarget->GetStyleData(eStyleStruct_UserInterface, ((const nsStyleStruct*&)ui));
|
||||
::GetStyleData(mCurrentTarget, &ui);
|
||||
suppressBlur = (ui->mUserFocus == NS_STYLE_USER_FOCUS_IGNORE);
|
||||
}
|
||||
|
||||
@ -1787,8 +1787,17 @@ nsEventStateManager::PostHandleEvent(nsIPresContext* aPresContext,
|
||||
|
||||
// Look for the nearest enclosing focusable frame.
|
||||
while (currFrame) {
|
||||
// If the mousedown happened inside a popup, don't
|
||||
// try to set focus on one of its containing elements
|
||||
const nsStyleDisplay* display;
|
||||
::GetStyleData(currFrame, &display);
|
||||
if (display->mDisplay == NS_STYLE_DISPLAY_POPUP) {
|
||||
newFocus = nsnull;
|
||||
break;
|
||||
}
|
||||
|
||||
const nsStyleUserInterface* ui;
|
||||
currFrame->GetStyleData(eStyleStruct_UserInterface, ((const nsStyleStruct*&)ui));
|
||||
::GetStyleData(currFrame, &ui);
|
||||
if ((ui->mUserFocus != NS_STYLE_USER_FOCUS_IGNORE) &&
|
||||
(ui->mUserFocus != NS_STYLE_USER_FOCUS_NONE)) {
|
||||
currFrame->GetContent(getter_AddRefs(newFocus));
|
||||
|
Loading…
Reference in New Issue
Block a user