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:
Karl Tomlinson 2014-05-14 12:12:43 +12:00
Родитель ad013d9073
Коммит 1b266c52e3
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -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;