mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 21:05:36 +00:00
Bug 1027057, use nsLayoutUtils::HasCurrentAnimations to check for transitions when hiding the popup, r=neil
This commit is contained in:
parent
cdee38da50
commit
9fd9de6c74
@ -1407,22 +1407,30 @@ nsXULPopupManager::FirePopupHidingEvent(nsIContent* aPopup,
|
||||
// are currently disabled on Linux due to rendering issues on certain
|
||||
// configurations.
|
||||
#ifndef MOZ_WIDGET_GTK
|
||||
if (!aNextPopup && aPopup->HasAttr(kNameSpaceID_None, nsGkAtoms::animate) &&
|
||||
popupFrame->StyleDisplay()->mTransitionPropertyCount > 0) {
|
||||
nsAutoString animate;
|
||||
aPopup->GetAttr(kNameSpaceID_None, nsGkAtoms::animate, animate);
|
||||
|
||||
if (!aNextPopup && aPopup->HasAttr(kNameSpaceID_None, nsGkAtoms::animate)) {
|
||||
// If animate="false" then don't transition at all. If animate="cancel",
|
||||
// only show the transition if cancelling the popup or rolling up.
|
||||
// Otherwise, always show the transition.
|
||||
nsAutoString animate;
|
||||
aPopup->GetAttr(kNameSpaceID_None, nsGkAtoms::animate, animate);
|
||||
|
||||
if (!animate.EqualsLiteral("false") &&
|
||||
(!animate.EqualsLiteral("cancel") || aIsRollup)) {
|
||||
presShell->FlushPendingNotifications(Flush_Layout);
|
||||
|
||||
// Get the frame again in case the flush caused it to go away
|
||||
popupFrame = do_QueryFrame(aPopup->GetPrimaryFrame());
|
||||
if (!popupFrame)
|
||||
return;
|
||||
|
||||
if (nsLayoutUtils::HasCurrentAnimations(aPopup, nsGkAtoms::transitionsProperty, aPresContext)) {
|
||||
nsRefPtr<TransitionEnder> ender = new TransitionEnder(aPopup, aDeselectMenu);
|
||||
aPopup->AddSystemEventListener(NS_LITERAL_STRING("transitionend"),
|
||||
ender, false, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
HidePopupCallback(aPopup, popupFrame, aNextPopup, aLastPopup,
|
||||
|
Loading…
Reference in New Issue
Block a user