Synchronous layout flush coming from PluginChild.jsm during page load
Categories
(Core Graveyard :: Plug-ins, enhancement, P1)
Tracking
(Performance Impact:high, firefox67 fixed)
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: smaug, Assigned: timdream)
References
()
Details
(Keywords: perf:pageload)
Attachments
(1 file, 3 obsolete files)
Reporter | ||
Comment 1•6 years ago
|
||
Reporter | ||
Comment 2•6 years ago
|
||
Assignee | ||
Comment 3•6 years ago
|
||
Assignee | ||
Comment 4•6 years ago
|
||
Assignee | ||
Comment 5•6 years ago
|
||
Assignee | ||
Comment 6•6 years ago
|
||
Assignee | ||
Comment 7•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 8•6 years ago
|
||
Assignee | ||
Comment 9•6 years ago
|
||
Assignee | ||
Comment 10•6 years ago
|
||
Assignee | ||
Comment 11•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment hidden (obsolete) |
Updated•6 years ago
|
Assignee | ||
Comment 13•6 years ago
|
||
Updated•6 years ago
|
Assignee | ||
Comment 14•6 years ago
|
||
This bug might appear as stalled here but there was a discussion here.
https://phabricator.services.mozilla.com/D13731#inline-80422
I am exploring other routes to see if it's possible to find a right timing for UA Widget.
Assignee | ||
Comment 15•6 years ago
|
||
So I've spent some time figuring out what I can do to make this work.
I looked at two fronts: (1) if we could get a tick after layout flush, (2) see if we can forgo the requirement of reading dimensions from the layout.
For (1) I tried to (a) abuse the overflow & underflow event — I did that by always set the full UI when there isn't a layout (which will overflow), and only try to resize the UI again upon hearing the overflow event.
(a) helped me a lot in terms of deciding the "sizing" and the "notext" attributes; i.e. the visibility if the icons and texts (Part I.)
However, for other test cases, particularly around the feature that detects other elements overlaying the plug-in (Part II), we do need a "layout flushed" callback in order to make a correct measurement. So far I've failed to find one for that -- suggestions in the thread on the previous patch are not available, neither does (b) ReflowObserver. I am not sure if I am using the reflow observer correctly, though.
For (2), I investigated at the commit history. bug 1405655 comment 17 is very useful. I don't think we will be able to implement hit area detection ("Part II") otherwise though.
Part I is essentially trying to implement CSS element query/container query. We could get rid of that by actually "upgrade" the UI to an iframe and use media query (lol) but that feels like an overkill.
Perhaps I should double down (a) by setting the content to be really really wide when the size is indeterminate -- that way I will always get a callback for Part II, not just Part I.
I will upload my currently failing patch here.
Assignee | ||
Comment 16•6 years ago
|
||
Assignee | ||
Comment 17•6 years ago
|
||
I've just updated the patch; these profiles confirm the fix is valid.
I tested this on https://get.adobe.com/flashplayer/about/ which comes with two CTP UIs.
After the patch, no call into PresShell::DoFlushPendingNotifications
from computeAndAdjustOverlayDisplay
: http://bit.ly/2Rs48HQ
Before the patch: http://bit.ly/2RnHuAs
I am not sure which tests will break with the patch. All the test scripts wait for the page to load so we shouldn't need changes on every test:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=cf267e99809a7d2479bf956c95d86f10b90bee80
Assignee | ||
Comment 18•6 years ago
|
||
Updated•6 years ago
|
Assignee | ||
Comment 19•6 years ago
|
||
Comment 20•6 years ago
|
||
Comment 21•6 years ago
|
||
bugherder |
Updated•3 years ago
|
Updated•3 years ago
|
Description
•