зеркало из https://github.com/mozilla/gecko-dev.git
Bug 180502. Never reorder views by z-index; just keep the document order. r=kmcclusk,sr=dbaron
This commit is contained in:
Родитель
f4e000a5fa
Коммит
3147a22b92
|
@ -2952,25 +2952,21 @@ NS_IMETHODIMP nsViewManager::SetViewZIndex(nsIView *aView, PRBool aAutoZIndex, P
|
||||||
|
|
||||||
if (CompareZIndex(oldidx, oldTopMost, oldIsAuto,
|
if (CompareZIndex(oldidx, oldTopMost, oldIsAuto,
|
||||||
aZIndex, aTopMost, aAutoZIndex) != 0) {
|
aZIndex, aTopMost, aAutoZIndex) != 0) {
|
||||||
if (IsViewInserted(view)) {
|
UpdateView(view, NS_VMREFRESH_NO_SYNC);
|
||||||
nsView *parent = view->GetParent();
|
|
||||||
if (nsnull != parent) {
|
|
||||||
//we don't just call the view manager's RemoveChild()
|
|
||||||
//so that we can avoid two trips trough the UpdateView()
|
|
||||||
//code (one for removal, one for insertion). MMP
|
|
||||||
parent->RemoveChild(view);
|
|
||||||
UpdateTransCnt(view, nsnull);
|
|
||||||
rv = InsertChild(parent, view, aZIndex);
|
|
||||||
}
|
}
|
||||||
// XXX The following else block is a workaround and should be cleaned up (bug 43410)
|
|
||||||
}
|
// Native widgets ultimately just can't deal with the awesome power
|
||||||
} else {
|
// of CSS2 z-index. However, we set the z-index on the widget anyway
|
||||||
|
// because in many simple common cases the widgets do end up in the
|
||||||
|
// right order. Even if they don't, we'll still render correctly as
|
||||||
|
// long as there are no plugins around (although there may be more
|
||||||
|
// flickering and other perf issues than if the widgets were in a
|
||||||
|
// good order).
|
||||||
nsCOMPtr<nsIWidget> widget;
|
nsCOMPtr<nsIWidget> widget;
|
||||||
view->GetWidget(*getter_AddRefs(widget));
|
view->GetWidget(*getter_AddRefs(widget));
|
||||||
if (widget) {
|
if (widget) {
|
||||||
widget->SetZIndex(aZIndex);
|
widget->SetZIndex(aZIndex);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
nsZPlaceholderView* zParentView = view->GetZParent();
|
nsZPlaceholderView* zParentView = view->GetZParent();
|
||||||
if (nsnull != zParentView) {
|
if (nsnull != zParentView) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче