Use nsTArray::StableSort in CSSOrderAwareFrameIteratorT
Categories
(Core :: Layout, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
References
Details
Attachments
(3 files)
Let's fix this
// XXX replace this with nsTArray::StableSort when bug 1147091 is fixed.
std::stable_sort(mArray->begin(), mArray->end(), comparator);
I also spot some minor improvements in CSSOrderAwareFrameIteratorT.
Assignee | ||
Comment 1•4 years ago
|
||
Both methods are implementation details specific to this iterator, not
public interfaces that can be cooperated with C++ standard library, so
move them into private section.
Assignee | ||
Comment 2•4 years ago
|
||
nsTArray::StableSort() requires the Comparator to be a class/struct with
Equals() and LessThan() members. This patch adapts the original
comparators to fulfill this contract.
Using StableSort() can also avoid the array bound checking in the array
iterator as described in bug 1147091 comment 8.
Change the include to <limits> because std::stable_sort is removed but
we still use std::numeric_limits.
Depends on D82117
Assignee | ||
Comment 3•4 years ago
|
||
Our minimum version requirements for clang is 5.0 per
https://groups.google.com/forum/#!msg/mozilla.dev.platform/ygj-1MDVB4M/CLxE_7OcBAAJ
Depends on D82118
Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/7d9b58a4da5c Part 1 - Move begin() and end() into private section in CSSOrderAwareFrameIterator. r=dholbert https://hg.mozilla.org/integration/autoland/rev/a0aef12f15c1 Part 2 - Use nsTArray::StableSort() in CSSOrderAwareFrameIteratorT. r=dholbert,sg https://hg.mozilla.org/integration/autoland/rev/193197448f03 Part 3 - Remove CLANG_CRASH_BUG define in CSSOrderAwareFrameIterator.h. r=dholbert
Comment 5•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7d9b58a4da5c
https://hg.mozilla.org/mozilla-central/rev/a0aef12f15c1
https://hg.mozilla.org/mozilla-central/rev/193197448f03
Description
•