Disable 461917-1.xhtml under dom/xul/crashtests/ because I cannot reproduce
it locally.
Annotate assert-if on some crashtests (bug 1370830). Other modifications are
all removal of fails-if.
MozReview-Commit-ID: 6Q2A5M5rOry
--HG--
extra : rebase_source : b282a919fcda6287fe2eaa6b139a11f2663ad578
If a frame doesn't have that bit then skip mCounterManager.DestroyNodesFor()
when the frame is destroyed because it's definitely not known by
the CounterManager.
MozReview-Commit-ID: Ky3575QvZME
The first node of |iter| in Selection::SelectFrames() may be different from the start parent of given range. Therefore, if they are different, it shouldn't skip first item of |iter|.
MozReview-Commit-ID: DgE2dSziaxo
--HG--
extra : rebase_source : b35f52d194bf437cc79d1917ad497ebb1a8c27f0
Chromium doesn't make focused editing host blurred when a Selection API method call moves selection to a non-editable node. Let's follow same behavior for compatibility with both Chromium and Gecko 54.
MozReview-Commit-ID: HXmYX18HVA5
--HG--
extra : rebase_source : 61a380b9f08abc1049d72cc3dd0c4d262f9eaff9
Selection::Collapse() removes all ranges first, then, adds a collapsed range which is a new instance of nsRange.
However, new nsRange's initialize cost isn't cheap. It needs to add itself to mutation observer and computes common ancestor. However, Selection::Collapse() doesn't move the range to different document. If old range is reusable, we can avoid to remove old range from mutation observer and add new range to mutation observer, and also we can avoid to recompute common ancestor if the node is not changed, e.g., only offset is changed in selected node.
MozReview-Commit-ID: BoCBod7WVr5
--HG--
extra : rebase_source : 9ccee28aebba355ebb1137ebc1d02e7d8a30aedf
nsRange::DoSetRange() adds/remove its root to/from mutation observer, initializes common ancestor, registers itself to the common ancestor, unregisters itself from old common ancestor, and notifies selection listeners of selection change.
However, those runtime cost is expensive but on the other hand, a lot of callers set both start and end of the range and that causes calling DoSetRange() twice.
This patch renames Set() to SetStartAndEnd() for easier to understand the meaning and make it call DoSetRange() only once.
MozReview-Commit-ID: FRV55tuBAgg
--HG--
extra : rebase_source : 67adf929cf119e2425f7d3741651217522094590
Selection::SelectFrames() is an internal method of Selection, it always handles positioned range. So, neither aRange->GetStartParent() nor aRange->GetEndParent() never returns nullptr.
Additionally, nsIContentIterator::GetCurrentNode() shouldn't return nullptr until IsDone() returns true.
MozReview-Commit-ID: 1IS4nMLukt
--HG--
extra : rebase_source : a4eee06580519adf2233f535abfdf50ac8730a19
Selection::selectFrames() always creates two content iterators. However, if the range is in a node and it doesn't have children, we don't need walk the DOM tree. So, it should create content iterators only when they are necessary.
Additionally, both Selection::selectFrames() and Selection::SelectAllFramesForContent() handle first content twice, but it's not necessary.
Finally, they query interface to retrieve nsIContent* from nsINode* a lot.
This patch fixes those issues too.
MozReview-Commit-ID: 5bfYz6Zuqkg
--HG--
extra : rebase_source : cb65a313f1a9af0e0520e3fece7c065d11018aa0
Profiling indicates a significant amount of time is spent during displaylist building accessing style information in order to detect border radii. This is a cost that for frames with no border radii only needs to be paid when the style changes.
Since nsIFrame still has 16 bits available for storing data without growing it in size, this patch recomputes whether there are border radii upon DidGetStyleContext and stores that information in one of these unused bits.
MozReview-Commit-ID: 4Jm29qUwXq3
In the nsWindowMemoryReporter.cpp / nsArenaMemoryStats.h I'm only
including the concrete frame classes now - we obviously never have
instances of the other IDs so there's no need to collect stats for them.
MozReview-Commit-ID: 48uFCZ3xKBC
nsIFrame::mClass is of type enum class nsQueryFrame::ClassID which is
a strict subset of the nsQueryFrame::FrameIID values. For a concrete
frame class, its FrameIID is the same numeric value as its ClassID.
MozReview-Commit-ID: 1N0AkCGo1ol