Fix for 5693. r=saari,a=waterson

This commit is contained in:
hyatt%netscape.com 2000-10-10 20:48:03 +00:00
parent ff08774a52
commit 032e7132f4
2 changed files with 22 additions and 8 deletions

View File

@ -1516,8 +1516,16 @@ nsEventStateManager::GenerateMouseEnterExit(nsIPresContext* aPresContext, nsGUIE
targetContent->HandleDOMEvent(aPresContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
}
if ( status != nsEventStatus_eConsumeNoDefault )
if ( status != nsEventStatus_eConsumeNoDefault ) {
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(targetContent));
if (!elt) {
// Only elements can be placed into :hover. Instead of putting
// ourselves into :hover, put our parent element into :hover instead.
nsCOMPtr<nsIContent> child = targetContent;
child->GetParent(*getter_AddRefs(targetContent));
}
SetContentState(targetContent, NS_EVENT_STATE_HOVER);
}
//Now dispatch to the frame
if (mCurrentTarget) {
@ -1571,7 +1579,6 @@ nsEventStateManager::GenerateMouseEnterExit(nsIPresContext* aPresContext, nsGUIE
SetContentState(nsnull, NS_EVENT_STATE_HOVER);
}
//Now dispatch to the frame
if (nsnull != mLastMouseOverFrame) {
//XXX Get the new frame

View File

@ -1516,8 +1516,16 @@ nsEventStateManager::GenerateMouseEnterExit(nsIPresContext* aPresContext, nsGUIE
targetContent->HandleDOMEvent(aPresContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
}
if ( status != nsEventStatus_eConsumeNoDefault )
if ( status != nsEventStatus_eConsumeNoDefault ) {
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(targetContent));
if (!elt) {
// Only elements can be placed into :hover. Instead of putting
// ourselves into :hover, put our parent element into :hover instead.
nsCOMPtr<nsIContent> child = targetContent;
child->GetParent(*getter_AddRefs(targetContent));
}
SetContentState(targetContent, NS_EVENT_STATE_HOVER);
}
//Now dispatch to the frame
if (mCurrentTarget) {
@ -1571,7 +1579,6 @@ nsEventStateManager::GenerateMouseEnterExit(nsIPresContext* aPresContext, nsGUIE
SetContentState(nsnull, NS_EVENT_STATE_HOVER);
}
//Now dispatch to the frame
if (nsnull != mLastMouseOverFrame) {
//XXX Get the new frame