Bug 1554499 - Part 2: Add nsDisplayList::AppendNewToBottomWithIndex() and nsDisplayList::AppendNewToTopWithIndex() r=mattwoodrow

Differential Revision: https://phabricator.services.mozilla.com/D74081
This commit is contained in:
Miko Mynttinen 2020-05-11 16:56:14 +00:00
Родитель c7fd97e5f4
Коммит bf96ae7a27
1 изменённых файлов: 20 добавлений и 4 удалений

Просмотреть файл

@ -3377,8 +3377,16 @@ class nsDisplayList {
template <typename T, typename F, typename... Args>
void AppendNewToTop(nsDisplayListBuilder* aBuilder, F* aFrame,
Args&&... aArgs) {
nsDisplayItem* item =
MakeDisplayItem<T>(aBuilder, aFrame, std::forward<Args>(aArgs)...);
AppendNewToTopWithIndex<T>(aBuilder, aFrame, 0,
std::forward<Args>(aArgs)...);
}
template <typename T, typename F, typename... Args>
void AppendNewToTopWithIndex(nsDisplayListBuilder* aBuilder, F* aFrame,
const uint16_t aIndex, Args&&... aArgs) {
nsDisplayItem* item = MakeDisplayItemWithIndex<T>(
aBuilder, aFrame, aIndex, std::forward<Args>(aArgs)...);
if (item) {
AppendToTop(item);
}
@ -3404,8 +3412,16 @@ class nsDisplayList {
template <typename T, typename F, typename... Args>
void AppendNewToBottom(nsDisplayListBuilder* aBuilder, F* aFrame,
Args&&... aArgs) {
nsDisplayItem* item =
MakeDisplayItem<T>(aBuilder, aFrame, std::forward<Args>(aArgs)...);
AppendNewToBottomWithIndex<T>(aBuilder, aFrame, 0,
std::forward<Args>(aArgs)...);
}
template <typename T, typename F, typename... Args>
void AppendNewToBottomWithIndex(nsDisplayListBuilder* aBuilder, F* aFrame,
const uint16_t aIndex, Args&&... aArgs) {
nsDisplayItem* item = MakeDisplayItemWithIndex<T>(
aBuilder, aFrame, aIndex, std::forward<Args>(aArgs)...);
if (item) {
AppendToBottom(item);
}