Closed
Bug 1267568
Opened 10 years ago
Closed 10 years ago
[e10s] UpdateDimensions message may trigger additional ResizeReflow for fullscreen change
Categories
(Core :: DOM: Core & HTML, defect, P1)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla49
People
(Reporter: xidorn, Assigned: xidorn)
References
(Blocks 1 open bug)
Details
Attachments
(6 files)
|
58 bytes,
text/x-review-board-request
|
smaug
:
review+
|
Details |
|
58 bytes,
text/x-review-board-request
|
smaug
:
review+
|
Details |
|
58 bytes,
text/x-review-board-request
|
smaug
:
review+
|
Details |
|
58 bytes,
text/x-review-board-request
|
smaug
:
review+
|
Details |
|
58 bytes,
text/x-review-board-request
|
smaug
:
review+
|
Details |
|
58 bytes,
text/x-review-board-request
|
xidorn
:
review+
|
Details |
We only want one flush for fullscreen change in general. We ensure that in non-e10s (on systems other than Linux) via setting flag in pres shell to stop any immature resize reflow before we finish changing the document state, so that every thing would be updated together in the next tick.
This doesn't work perfectly with e10s. If UpdateDimensions message arrives before the next tick, a ResizeReflow would be triggered immediately, in which moment, the fullscreenchange event has not been dispatched, so the document could still be changing, and thus there could be another consequent flush. This would eventually make the change take too much time.
We need to find a way to either defer sending the UpdateDimensions message in the parent process, or suppress the effect of that message in the content process somehow.
| Assignee | ||
Comment 1•10 years ago
|
||
It seems for exiting fullscreen, UpdateDimensions could even be sent earlier than the CleanUp message.
Comment 2•10 years ago
|
||
Xidorn, is this something you can pick up? Also, would you consider this a blocker for e10s rollout?
Flags: needinfo?(bugzilla)
| Assignee | ||
Comment 3•10 years ago
|
||
Yes, I can pick up, but I don't have clear idea how to fix it yet. If this affects real life cases, then probably yes. It seems to me Youtube could be affected.
Assignee: nobody → bugzilla
Flags: needinfo?(bugzilla)
Updated•10 years ago
|
tracking-e10s:
--- → ?
Comment 4•10 years ago
|
||
(In reply to Xidorn Quan [:xidorn] (UTC+8) from comment #3)
> Yes, I can pick up, but I don't have clear idea how to fix it yet. If this
> affects real life cases, then probably yes. It seems to me Youtube could be
> affected.
What are the side effects, slow full screen transitions? I've been testing this this morning and aside from bug 1266799 transitioning feels pretty smooth.
| Assignee | ||
Comment 5•10 years ago
|
||
Yes, slow fullscreen transition.
I observed this while profiling, but without that, it seems most of the time everything works just fine. It is actually a race condition: if there is something happens to be slow before, this issue would make things even worse, so I guess it's worth a fix. Also it would allow me to continue profiling and see if there is anything else actionable.
I have had an idea how to fix it, and the fix shouldn't be too complicate. If everything goes fine, I should be able to submit the patchset for review tomorrow.
| Assignee | ||
Comment 6•10 years ago
|
||
This addresses the review comment from bug 1177155 comment 16 so that
the assertion and code to avoid breaking assertion in valid path are no
longer needed.
Review commit: https://reviewboard.mozilla.org/r/49395/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/49395/
Attachment #8746391 -
Flags: review?(bugs)
Attachment #8746392 -
Flags: review?(bugs)
Attachment #8746393 -
Flags: review?(bugs)
Attachment #8746394 -
Flags: review?(bugs)
Attachment #8746395 -
Flags: review?(bugs)
Attachment #8746396 -
Flags: review?(dao+bmo)
| Assignee | ||
Comment 7•10 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/49397/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/49397/
| Assignee | ||
Comment 8•10 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/49399/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/49399/
| Assignee | ||
Comment 9•10 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/49401/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/49401/
| Assignee | ||
Comment 10•10 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/49403/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/49403/
| Assignee | ||
Comment 11•10 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/49405/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/49405/
| Assignee | ||
Comment 12•10 years ago
|
||
Comment on attachment 8746396 [details]
MozReview Request: Bug 1267568 part 6 - Send fullscreen message before triggering any potential reflow. r=dao
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/49405/diff/1-2/
Attachment #8746396 -
Attachment description: MozReview Request: Bug 1267568 part 6 - Send fullscreen message before potentially triggering any reflow. r?dao → MozReview Request: Bug 1267568 part 6 - Send fullscreen message before triggering any potential reflow. r?dao
Updated•10 years ago
|
Attachment #8746396 -
Flags: review?(dao+bmo) → review+
Comment 13•10 years ago
|
||
Comment on attachment 8746391 [details]
MozReview Request: Bug 1267568 part 1 - Add a weak ptr to nsGlobalChromeWindow to remember the pres shell we set the fullscreen change flag. r=smaug
https://reviewboard.mozilla.org/r/49395/#review46229
Attachment #8746391 -
Flags: review?(bugs) → review+
Updated•10 years ago
|
Attachment #8746392 -
Flags: review?(bugs) → review+
Comment 14•10 years ago
|
||
Comment on attachment 8746392 [details]
MozReview Request: Bug 1267568 part 2 - Add helper method to nsIPresShell to get the RefreshDriver. r=smaug
https://reviewboard.mozilla.org/r/49397/#review46231
Comment 15•10 years ago
|
||
Comment on attachment 8746393 [details]
MozReview Request: Bug 1267568 part 3 - Use an individual method for check whether resize should be delayed. r=smaug
https://reviewboard.mozilla.org/r/49399/#review46233
Attachment #8746393 -
Flags: review?(bugs) → review+
Comment 16•10 years ago
|
||
Comment on attachment 8746394 [details]
MozReview Request: Bug 1267568 part 4 - Replace InFullscreenChange flag of PresShell with IsResizeSuppressed flag in RefreshDriver. r=smaug
https://reviewboard.mozilla.org/r/49401/#review46241
make sure to test both e10s and non-e10s
Attachment #8746394 -
Flags: review?(bugs) → review+
Comment 17•10 years ago
|
||
Comment on attachment 8746395 [details]
MozReview Request: Bug 1267568 part 5 - Replace the old FullscreenChangePrepare class with a single function. r=smaug
https://reviewboard.mozilla.org/r/49403/#review46247
Attachment #8746395 -
Flags: review?(bugs) → review+
Updated•10 years ago
|
Priority: -- → P1
| Assignee | ||
Comment 18•10 years ago
|
||
Comment on attachment 8746391 [details]
MozReview Request: Bug 1267568 part 1 - Add a weak ptr to nsGlobalChromeWindow to remember the pres shell we set the fullscreen change flag. r=smaug
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/49395/diff/1-2/
Attachment #8746391 -
Attachment description: MozReview Request: Bug 1267568 part 1 - Add a weak ptr to nsGlobalChromeWindow to remember the pres shell we set the fullscreen change flag. r?smaug → MozReview Request: Bug 1267568 part 1 - Add a weak ptr to nsGlobalChromeWindow to remember the pres shell we set the fullscreen change flag. r=smaug
Attachment #8746392 -
Attachment description: MozReview Request: Bug 1267568 part 2 - Add helper method to nsIPresShell to get the RefreshDriver. r?smaug → MozReview Request: Bug 1267568 part 2 - Add helper method to nsIPresShell to get the RefreshDriver. r=smaug
Attachment #8746393 -
Attachment description: MozReview Request: Bug 1267568 part 3 - Use an individual method for check whether resize should be delayed. r?smaug → MozReview Request: Bug 1267568 part 3 - Use an individual method for check whether resize should be delayed. r=smaug
Attachment #8746394 -
Attachment description: MozReview Request: Bug 1267568 part 4 - Replace InFullscreenChange flag of PresShell with IsResizeSuppressed flag in RefreshDriver. r?smaug → MozReview Request: Bug 1267568 part 4 - Replace InFullscreenChange flag of PresShell with IsResizeSuppressed flag in RefreshDriver. r=smaug
Attachment #8746395 -
Attachment description: MozReview Request: Bug 1267568 part 5 - Replace the old FullscreenChangePrepare class with a single function. r?smaug → MozReview Request: Bug 1267568 part 5 - Replace the old FullscreenChangePrepare class with a single function. r=smaug
Attachment #8746396 -
Attachment description: MozReview Request: Bug 1267568 part 6 - Send fullscreen message before triggering any potential reflow. r?dao → MozReview Request: Bug 1267568 part 6 - Send fullscreen message before triggering any potential reflow. r=dao
Attachment #8746396 -
Flags: review+ → review?(dao+bmo)
| Assignee | ||
Comment 19•10 years ago
|
||
Comment on attachment 8746392 [details]
MozReview Request: Bug 1267568 part 2 - Add helper method to nsIPresShell to get the RefreshDriver. r=smaug
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/49397/diff/1-2/
| Assignee | ||
Comment 20•10 years ago
|
||
Comment on attachment 8746393 [details]
MozReview Request: Bug 1267568 part 3 - Use an individual method for check whether resize should be delayed. r=smaug
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/49399/diff/1-2/
| Assignee | ||
Comment 21•10 years ago
|
||
Comment on attachment 8746394 [details]
MozReview Request: Bug 1267568 part 4 - Replace InFullscreenChange flag of PresShell with IsResizeSuppressed flag in RefreshDriver. r=smaug
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/49401/diff/1-2/
| Assignee | ||
Comment 22•10 years ago
|
||
Comment on attachment 8746395 [details]
MozReview Request: Bug 1267568 part 5 - Replace the old FullscreenChangePrepare class with a single function. r=smaug
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/49403/diff/1-2/
| Assignee | ||
Comment 23•10 years ago
|
||
Comment on attachment 8746396 [details]
MozReview Request: Bug 1267568 part 6 - Send fullscreen message before triggering any potential reflow. r=dao
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/49405/diff/2-3/
| Assignee | ||
Updated•10 years ago
|
Attachment #8746396 -
Flags: review?(dao+bmo) → review+
| Assignee | ||
Comment 24•10 years ago
|
||
https://reviewboard.mozilla.org/r/49395/#review46425
::: dom/base/nsGlobalWindow.cpp:6285
(Diff revisions 1 - 2)
> if (!NS_WARN_IF(!IsChromeWindow())) {
> auto chromeWin = static_cast<nsGlobalChromeWindow*>(this);
> - if (MOZ_LIKELY(!chromeWin->mFullscreenPresShell)) {
> + if (!NS_WARN_IF(chromeWin->mFullscreenPresShell)) {
> if (nsIPresShell* shell = mDocShell->GetPresShell()) {
> chromeWin->mFullscreenPresShell = do_GetWeakReference(shell);
> MOZ_ASSERT(chromeWin->mFullscreenPresShell);
> shell->SetIsInFullscreenChange(true);
> }
> - } else {
> - MOZ_ASSERT_UNREACHABLE("We should not have been in fullscreen change");
> }
> }
This is the only relevant part in the interdiff.
Since there was a crash from this assertion in try push, I changed this assertion to a warning. Olli, are you fine with this change?
I guess it could happen since the window size sometimes changes asynchronously, and thus there is a chance this function could be called before the previous fullscreen change finishes.
The test triggers this assertion is browser/components/extensions/test/browser/browser_ext_windows_update.js which changes the window state quickly synchronously, which doesn't seem to be something could happen in general.
| Assignee | ||
Updated•10 years ago
|
Attachment #8746391 -
Flags: review+ → review?(bugs)
| Assignee | ||
Comment 25•10 years ago
|
||
Looks good on try push now: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f46ba7b969e9
Updated•10 years ago
|
Attachment #8746391 -
Flags: review?(bugs) → review+
Comment 26•10 years ago
|
||
Comment on attachment 8746391 [details]
MozReview Request: Bug 1267568 part 1 - Add a weak ptr to nsGlobalChromeWindow to remember the pres shell we set the fullscreen change flag. r=smaug
https://reviewboard.mozilla.org/r/49395/#review46935
MozReview failed totally with interdiff here :/
| Assignee | ||
Comment 27•10 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #26)
> Comment on attachment 8746391 [details]
> MozReview Request: Bug 1267568 part 1 - Add a weak ptr to
> nsGlobalChromeWindow to remember the pres shell we set the fullscreen change
> flag. r=smaug
>
> https://reviewboard.mozilla.org/r/49395/#review46935
>
> MozReview failed totally with interdiff here :/
Yeah, because they turned off rebase filter completely. But I've quoted the only changed part in comment 24, which hopefully made your review easier.
| Assignee | ||
Comment 28•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/dd0fd7a876d62da427a2d4587e13f1837e1b78c7
Bug 1267568 part 1 - Add a weak ptr to nsGlobalChromeWindow to remember the pres shell we set the fullscreen change flag. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/fa640b84845393a371b96a5bc5d17147ecff9df5
Bug 1267568 part 2 - Add helper method to nsIPresShell to get the RefreshDriver. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/ffcdd861062d2400e3991964bb151ad17f270faa
Bug 1267568 part 3 - Use an individual method for check whether resize should be delayed. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/da3006dcfb7b7525ef19208d2d38d52c01f72bb3
Bug 1267568 part 4 - Replace InFullscreenChange flag of PresShell with IsResizeSuppressed flag in RefreshDriver. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/522031a5febb97d77c84e967c9ee57262c1ef7bb
Bug 1267568 part 5 - Replace the old FullscreenChangePrepare class with a single function. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/d95633a61869a008b69da8d621c0d0d127874fe5
Bug 1267568 part 6 - Send fullscreen message before triggering any potential reflow. r=dao
Comment 29•10 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/dd0fd7a876d6
https://hg.mozilla.org/mozilla-central/rev/fa640b848453
https://hg.mozilla.org/mozilla-central/rev/ffcdd861062d
https://hg.mozilla.org/mozilla-central/rev/da3006dcfb7b
https://hg.mozilla.org/mozilla-central/rev/522031a5febb
https://hg.mozilla.org/mozilla-central/rev/d95633a61869
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox49:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
| Assignee | ||
Comment 30•10 years ago
|
||
I wonder whether I should request uplifting it to aurora. The improvement could be just marginally in most cases. It's probably not worth considering this isn't a trivial change.
Comment 31•10 years ago
|
||
(In reply to Xidorn Quan [:xidorn] (UTC+10) from comment #30)
> I wonder whether I should request uplifting it to aurora. The improvement
> could be just marginally in most cases. It's probably not worth considering
> this isn't a trivial change.
It didn't alter talos test results afaict so the e10s team wont push for it. Up to you.
Updated•10 years ago
|
status-firefox47:
--- → wontfix
status-firefox48:
--- → wontfix
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•