зеркало из https://github.com/mozilla/gecko-dev.git
Update focus and hover state correctly when an _ancestor_ of the current focus
or hover content is removed from the DOM. Bug 293914, r+sr=roc, a=asa
This commit is contained in:
Родитель
9d0c926cd8
Коммит
af1ea33dd6
|
@ -4216,7 +4216,8 @@ nsEventStateManager::GetFocusedFrame(nsIFrame** aFrame)
|
|||
NS_IMETHODIMP
|
||||
nsEventStateManager::ContentRemoved(nsIContent* aContent)
|
||||
{
|
||||
if (aContent == mCurrentFocus) {
|
||||
if (mCurrentFocus &&
|
||||
nsContentUtils::ContentIsDescendantOf(mCurrentFocus, aContent)) {
|
||||
// Note that we don't use SetContentState() here because
|
||||
// we don't want to fire a blur. Blurs should only be fired
|
||||
// in response to clicks or tabbing.
|
||||
|
@ -4224,7 +4225,8 @@ nsEventStateManager::ContentRemoved(nsIContent* aContent)
|
|||
SetFocusedContent(nsnull);
|
||||
}
|
||||
|
||||
if (aContent == mHoverContent) {
|
||||
if (mHoverContent &&
|
||||
nsContentUtils::ContentIsDescendantOf(mHoverContent, aContent)) {
|
||||
// Since hover is hierarchical, set the current hover to the
|
||||
// content's parent node.
|
||||
mHoverContent = aContent->GetParent();
|
||||
|
|
Загрузка…
Ссылка в новой задаче