зеркало из https://github.com/mozilla/gecko-dev.git
b=835044 handle popup windows with parents in GetWidgetOffset r=tn
level="parent" popup windows can sometimes return a non-null parent, which is their owner window, but their bounds are relative to the screen (previously assumed to be the owner window origin). --HG-- extra : transplant_source : %AEr%1F%1E%CC%08%A1%19%97%DBo%00f%5E%3EM%23R%FE%95
This commit is contained in:
Родитель
ad013d9073
Коммит
1b266c52e3
|
@ -2308,13 +2308,16 @@ nsLayoutUtils::TransformFrameRectToAncestor(nsIFrame* aFrame,
|
|||
|
||||
static nsIntPoint GetWidgetOffset(nsIWidget* aWidget, nsIWidget*& aRootWidget) {
|
||||
nsIntPoint offset(0, 0);
|
||||
nsIWidget* parent = aWidget->GetParent();
|
||||
while (parent) {
|
||||
while ((aWidget->WindowType() == eWindowType_child ||
|
||||
aWidget->WindowType() == eWindowType_plugin)) {
|
||||
nsIWidget* parent = aWidget->GetParent();
|
||||
if (!parent) {
|
||||
break;
|
||||
}
|
||||
nsIntRect bounds;
|
||||
aWidget->GetBounds(bounds);
|
||||
offset += bounds.TopLeft();
|
||||
aWidget = parent;
|
||||
parent = aWidget->GetParent();
|
||||
}
|
||||
aRootWidget = aWidget;
|
||||
return offset;
|
||||
|
|
Загрузка…
Ссылка в новой задаче