Fix for 56167. r=joki, a=waterson

This commit is contained in:
hyatt%netscape.com 2000-10-16 21:52:22 +00:00
parent c1e10714aa
commit 379b66f6ec
4 changed files with 26 additions and 28 deletions

View File

@ -784,6 +784,11 @@ nsEventStateManager :: GenerateDragGesture ( nsIPresContext* aPresContext, nsGUI
StopTrackingDragGesture();
}
}
// Now flush all pending notifications.
nsCOMPtr<nsIPresShell> shell;
aPresContext->GetShell(getter_AddRefs(shell));
shell->FlushPendingNotifications();
} // GenerateDragGesture
nsresult
@ -1516,16 +1521,8 @@ nsEventStateManager::GenerateMouseEnterExit(nsIPresContext* aPresContext, nsGUIE
targetContent->HandleDOMEvent(aPresContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
}
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));
}
if ( status != nsEventStatus_eConsumeNoDefault )
SetContentState(targetContent, NS_EVENT_STATE_HOVER);
}
//Now dispatch to the frame
if (mCurrentTarget) {
@ -1750,6 +1747,11 @@ nsEventStateManager::GenerateDragDropEnterExit(nsIPresContext* aPresContext, nsG
//reset mCurretTargetContent to what it was
mCurrentTargetContent = targetBeforeEvent;
// Now flush all pending notifications.
nsCOMPtr<nsIPresShell> shell;
aPresContext->GetShell(getter_AddRefs(shell));
shell->FlushPendingNotifications();
}
NS_IMETHODIMP
@ -2376,6 +2378,7 @@ nsEventStateManager::GetContentState(nsIContent *aContent, PRInt32& aState)
aState |= NS_EVENT_STATE_HOVER;
}
}
if (aContent == mCurrentFocus) {
aState |= NS_EVENT_STATE_FOCUS;
}

View File

@ -1153,14 +1153,12 @@ nsGenericHTMLElement::HandleDOMEventForAnchors(nsIContent* aOuter,
case NS_MOUSE_ENTER_SYNTH:
{
#if 0
nsIEventStateManager *stateManager;
if (NS_OK == aPresContext->GetEventStateManager(&stateManager)) {
stateManager->SetContentState(mContent, NS_EVENT_STATE_HOVER);
NS_RELEASE(stateManager);
}
*aEventStatus = nsEventStatus_eConsumeNoDefault;
#endif
}
// Set the status bar the same for focus and mouseover
case NS_FOCUS_CONTENT:
@ -1180,14 +1178,12 @@ nsGenericHTMLElement::HandleDOMEventForAnchors(nsIContent* aOuter,
case NS_MOUSE_EXIT_SYNTH:
{
#if 0
nsIEventStateManager *stateManager;
if (NS_OK == aPresContext->GetEventStateManager(&stateManager)) {
stateManager->SetContentState(nsnull, NS_EVENT_STATE_HOVER);
NS_RELEASE(stateManager);
}
*aEventStatus = nsEventStatus_eConsumeNoDefault;
#endif
nsAutoString empty;
ret = TriggerLink(aPresContext, eLinkVerb_Replace, nsnull, empty, empty, PR_FALSE);

View File

@ -784,6 +784,11 @@ nsEventStateManager :: GenerateDragGesture ( nsIPresContext* aPresContext, nsGUI
StopTrackingDragGesture();
}
}
// Now flush all pending notifications.
nsCOMPtr<nsIPresShell> shell;
aPresContext->GetShell(getter_AddRefs(shell));
shell->FlushPendingNotifications();
} // GenerateDragGesture
nsresult
@ -1516,16 +1521,8 @@ nsEventStateManager::GenerateMouseEnterExit(nsIPresContext* aPresContext, nsGUIE
targetContent->HandleDOMEvent(aPresContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
}
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));
}
if ( status != nsEventStatus_eConsumeNoDefault )
SetContentState(targetContent, NS_EVENT_STATE_HOVER);
}
//Now dispatch to the frame
if (mCurrentTarget) {
@ -1750,6 +1747,11 @@ nsEventStateManager::GenerateDragDropEnterExit(nsIPresContext* aPresContext, nsG
//reset mCurretTargetContent to what it was
mCurrentTargetContent = targetBeforeEvent;
// Now flush all pending notifications.
nsCOMPtr<nsIPresShell> shell;
aPresContext->GetShell(getter_AddRefs(shell));
shell->FlushPendingNotifications();
}
NS_IMETHODIMP
@ -2376,6 +2378,7 @@ nsEventStateManager::GetContentState(nsIContent *aContent, PRInt32& aState)
aState |= NS_EVENT_STATE_HOVER;
}
}
if (aContent == mCurrentFocus) {
aState |= NS_EVENT_STATE_FOCUS;
}

View File

@ -1153,14 +1153,12 @@ nsGenericHTMLElement::HandleDOMEventForAnchors(nsIContent* aOuter,
case NS_MOUSE_ENTER_SYNTH:
{
#if 0
nsIEventStateManager *stateManager;
if (NS_OK == aPresContext->GetEventStateManager(&stateManager)) {
stateManager->SetContentState(mContent, NS_EVENT_STATE_HOVER);
NS_RELEASE(stateManager);
}
*aEventStatus = nsEventStatus_eConsumeNoDefault;
#endif
}
// Set the status bar the same for focus and mouseover
case NS_FOCUS_CONTENT:
@ -1180,14 +1178,12 @@ nsGenericHTMLElement::HandleDOMEventForAnchors(nsIContent* aOuter,
case NS_MOUSE_EXIT_SYNTH:
{
#if 0
nsIEventStateManager *stateManager;
if (NS_OK == aPresContext->GetEventStateManager(&stateManager)) {
stateManager->SetContentState(nsnull, NS_EVENT_STATE_HOVER);
NS_RELEASE(stateManager);
}
*aEventStatus = nsEventStatus_eConsumeNoDefault;
#endif
nsAutoString empty;
ret = TriggerLink(aPresContext, eLinkVerb_Replace, nsnull, empty, empty, PR_FALSE);