Closed Bug 1124245 Opened 9 years ago Closed 9 years ago

[E10s] IsParentActivated() call in nsGlobalWindow looks wrong

Categories

(Core :: DOM: Core & HTML, defect)

36 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
e10s + ---
firefox38 --- fixed

People

(Reporter: smaug, Assigned: smaug)

References

Details

Attachments

(2 files, 1 obsolete file)

...since IsParentActivated() relies on global state in nsFocusManager, and the same
nsFocusManager can be used for several tabs in several parent process windows.
In fact we can't really keep mParentFocusType as such in nsFocusManager.
(/me kicks himself for not catching this while reviewing the patch.)
Smaug, what do you want to do here?
Flags: needinfo?(bugs)
Store the state in TabChild and nsGlobalWindow should read the state when it gets its docshell.
Flags: needinfo?(bugs)
What's the effect of this? Is there any user-visible bug here?
Flags: needinfo?(bugs)
Yes, but let me fix this.
Assignee: nobody → bugs
Flags: needinfo?(bugs)
Attached patch v1 (obsolete) — Splinter Review
nsFocusManager::WindowShown is still a bit odd, but decided to not change
the current behavior.

https://tbpl.mozilla.org/?tree=Try&rev=897aca538dba
Attachment #8555566 - Flags: review?(enndeakin)
Comment on attachment 8555566 [details] [diff] [review]
v1

>-    mRemoteBrowser->Show(size);
>+    nsPIDOMWindow* win = mOwnerContent->OwnerDoc()->GetWindow();
>+    bool parentIsActive = false;
>+    if (win) {
>+      nsCOMPtr<nsPIWindowRoot> windowRoot =
>+        static_cast<nsGlobalWindow*>(win)->GetTopWindowRoot();
>+      if (windowRoot) {
>+        nsPIDOMWindow* topWin = windowRoot->GetWindow();
>+        parentIsActive = topWin && topWin->IsActive();
>+      }
>+    }

The active state gets propagated down to child windows. Do you need to use the root window here?
Attachment #8555566 - Flags: review?(enndeakin) → review+
We don't propagate that flag. We propagate NS_DOCUMENT_STATE_WINDOW_INACTIVE state.
Boo, there is some bug in the patch. It doesn't update background tabs properly or something.
Attached patch v2Splinter Review
This passes locally.
(I'm still not quite happy how we deal with activate, especially in non-e10s case, but that is for some other bug)

https://tbpl.mozilla.org/?tree=Try&rev=a2e570a4abfd

The change to the test is needed just to be able to run it separately locally on linux.

interdiff coming
Attachment #8555566 - Attachment is obsolete: true
Attachment #8556758 - Flags: review?(enndeakin)
Attachment #8556758 - Flags: review?(enndeakin) → review+
https://hg.mozilla.org/mozilla-central/rev/647d24c9a40a
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: