Experiment propagating NS_FRAME_IS_DIRTY once in PresShell::FrameNeedsReflow instead of in ReflowInput::Init
Categories
(Core :: Layout, task, P3)
Tracking
()
People
(Reporter: mozbugz, Assigned: dbaron)
References
(Regressed 1 open bug)
Details
(Whiteboard: [layout-sydney-2018])
Attachments
(3 files)
| Assignee | ||
Comment 1•7 years ago
|
||
| Reporter | ||
Comment 2•7 years ago
|
||
| Assignee | ||
Comment 3•7 years ago
|
||
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Comment 4•7 years ago
|
||
| Reporter | ||
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
| Assignee | ||
Comment 7•7 years ago
|
||
Are you planning to look into this further, or should we get somebody else assigned here?
| Reporter | ||
Comment 8•7 years ago
|
||
Sorry, I shouldn't have kept it, especially since I've now been away from layout for a couple of months. Thank you for reminding me.
NI: back to you, to pick a new assignee.
The last patch I had working is:
https://hg.mozilla.org/try/rev/e9866f8d1d76
I've just done a naive* rebase there:
https://hg.mozilla.org/try/rev/08e027f82b75
(try in progress: https://treeherder.mozilla.org/#/jobs?repo=try&revision=eb24cf596ebfab62a8016f2edd3b64dc3f061fe8 , looks like an a11y test is broken.)
- No real merge issue, but it's possible it's now broken and/or incomplete, not covering all locations where
AddStateBits(NS_FRAME_IS_DIRTY)should be turned intoMarkSubtreeDirty(). AlsoMarkFrameChildrenDirtyis new, I don't know whether it's different from myMarkSubtreeDirty, to be investigated!
Please ask me if you have further questions.
| Assignee | ||
Comment 9•6 years ago
|
||
Try run of patch merged to tip:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=249695c05ba5dc6fb0817adb02427feae240b09c&group_state=expanded
| Assignee | ||
Comment 10•6 years ago
|
||
Here's a new try push with (a) additional code changes from a code audit a few months ago and (b) a test fix for the test failure seen in the previous try push.
| Assignee | ||
Comment 11•6 years ago
|
||
| Assignee | ||
Comment 12•6 years ago
|
||
NS_FRAME_IS_DIRTY being set on a frame has always meant that that
frame and all of its descendants need to be reflowed. What the main
patch on this bug is changing is when it gets propagated to descendants;
prior to that patch it gets propagated during reflow, whereas after the
patch it gets propagated when the bit is set. This means that
NS_FRAME_IS_DIRTY is now (after the patch) a somewhat more reliable
indicator of whether a frame requires reflow than it was before.
However, this has a strange interaction with the particular sequence of
operations that test_list.html performs. In particular, test_list.html:
(1) makes a style change that requires reflow,
(2) flushes style (but not layout), and
(3) gets the name of an accessible whose layout was dirtied by the style change.
Getting this name ends up here:
nsTextFrame::GetRenderedText at layout/generic/nsTextFrame.cpp:9600
nsTextEquivUtils::AppendTextEquivFromTextContent at accessible/base/nsTextEquivUtils.cpp:127
nsTextEquivUtils::AppendFromAccessible at accessible/base/nsTextEquivUtils.cpp:174
nsTextEquivUtils::AppendFromAccessibleChildren at accessible/base/nsTextEquivUtils.cpp:162
nsTextEquivUtils::GetNameFromSubtree at accessible/base/nsTextEquivUtils.cpp:39
mozilla::a11y::Accessible::NativeName at accessible/generic/Accessible.cpp:1991
mozilla::a11y::HyperTextAccessible::NativeName at accessible/generic/HyperTextAccessible.cpp:1760
mozilla::a11y::Accessible::Name at accessible/generic/Accessible.cpp:149
mozilla::a11y::xpcAccessible::GetName at accessible/xpcom/xpcAccessible.cpp:245
NS_InvokeByIndex at xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S:106
What the main patch in the bug has changed is whether this nsTextFrame
has the NS_FRAME_IS_DIRTY bit set at this point. This means that
GetRenderedText will bail out without reporting the text, because the
frame is marked dirty.
On the assumption that this action -- getting accessible names while
frames are dirty -- is an artificial situation set up in the test and
not a real-world situation that we need to care about, I'm proposing
that we make the straightforward adjustment to the test: flush layout
in addition to flushing style at step (2) above, so that the test works
again. As long as that assumption is correct, I think this should be
fine. (I'd note that this is the only test that breaks as a result of
the patch.)
If, on the other hand, we actually do care about what accessible names
return while layout state is dirty and reflow is needed, we should
probably improve nsTextFrame::GetRenderedText so that it can somehow
report useful state even when NS_FRAME_IS_DIRTY is set, or something
else more complicated.
| Assignee | ||
Comment 13•6 years ago
|
||
This simplifies dealing with frames that are pushed/pulled between
continuations during reflow, allows us to avoid the complexity of the
fix to 1459937, and hopefully fixes some of the regressions from bug
1308876.
This disables the changes from bug 1459937 by commenting out a single
line in ReparentFrameInternal in nsBlockFrame.cpp, but all the added
code will be removed in the following patch.
Co-authored-by: Gerald Squelart <gsquelart@mozilla.com>
Co-authored-by: L. David Baron <dbaron@dbaron.org>
Depends on D36423
| Assignee | ||
Comment 14•6 years ago
|
||
(The single line that made them active was commented out in the previous patch.)
Depends on D36424
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Updated•6 years ago
|
Comment 15•6 years ago
|
||
Comment 16•6 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/61732637cead
https://hg.mozilla.org/mozilla-central/rev/ae0a517daf97
https://hg.mozilla.org/mozilla-central/rev/c70683bb3522
Updated•6 years ago
|
| Assignee | ||
Updated•6 years ago
|
Comment 17•6 years ago
|
||
== Change summary for alert #21762 (as of Sat, 06 Jul 2019 20:00:14 GMT) ==
Improvements:
2% tp5o windows10-64-shippable opt e10s stylo 120.45 -> 117.94
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=21762
| Assignee | ||
Comment 18•6 years ago
|
||
Yeah, this graph is reasonably convincing that the improvement came from this bug. I'm a little bit surprised, but not all that surprised.
| Assignee | ||
Comment 19•6 years ago
|
||
It seems like the subtest data is only available on mozilla-central and not autoland, but it seems like there were substantial improvements on a subset of the sites including 56.com and dailymail.co.uk.
| Assignee | ||
Comment 20•6 years ago
|
||
... also myspace.com. Possibly some smaller changes on a few other sites.
Description
•