Open Bug 1433362 Opened 8 years ago Updated 4 years ago

Avoid removing each observers for nsRefreshDriver when we destroy the root document

Categories

(Core :: Layout, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: hiro, Unassigned)

Details

As Brian noted in bug 1415780 comment 47, when we destroy a document, we call RemoveStyleFlushObserver() [1] and also other observers for nsRefreshDriver. In the case we destroy the root document, it will end up O(N^2) cost there. We should avoid it somehow. [1] https://hg.mozilla.org/mozilla-central/file/723b25eb3dd8/layout/base/nsRefreshDriver.h#l183
FWIW, I did push a try with removing all observers in descendants; https://treeherder.mozilla.org/#/jobs?repo=try&revision=50f87640b253417951deed58a699d63fb18f39eb Is seems there are some test cases that we shouldn't remove descendant observers for reflows? https://treeherder.mozilla.org/#/jobs?repo=try&revision=50f87640b253417951deed58a699d63fb18f39eb&selectedJob=158656966
[ Triage 2017/02/20: P3 ]
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.