From 4a60cbef9c1609efe4196c7c7df486372c05ec09 Mon Sep 17 00:00:00 2001 From: Miko Mynttinen Date: Mon, 13 May 2019 21:13:01 +0000 Subject: [PATCH] Bug 1551053 - Check both list end and non-container items separately during display item merging r=mattwoodrow Differential Revision: https://phabricator.services.mozilla.com/D30941 --HG-- extra : moz-landing-system : lando --- layout/painting/nsDisplayList.h | 17 +++--------- .../reftests/display-list/1551053-1-ref.html | 16 +++++++++++ layout/reftests/display-list/1551053-1.html | 27 +++++++++++++++++++ layout/reftests/display-list/reftest.list | 1 + 4 files changed, 48 insertions(+), 13 deletions(-) create mode 100644 layout/reftests/display-list/1551053-1-ref.html create mode 100644 layout/reftests/display-list/1551053-1.html diff --git a/layout/painting/nsDisplayList.h b/layout/painting/nsDisplayList.h index ac7292f260ef..7bf131b852a5 100644 --- a/layout/painting/nsDisplayList.h +++ b/layout/painting/nsDisplayList.h @@ -7359,16 +7359,6 @@ class FlattenedDisplayListIterator { } } - /** - * Returns the the display item above |aCurrent| casted to nsDisplayWrapList, - * if possible. - */ - nsDisplayWrapList* GetNextAsWrapList(nsDisplayItem* aCurrent) const { - MOZ_ASSERT(aCurrent); - nsDisplayItem* next = aCurrent->GetAbove(); - return next ? next->AsDisplayWrapList() : nullptr; - } - /** * Tries to merge display items starting from |aCurrent|. * Updates the internal pointer to the next display item. @@ -7392,14 +7382,15 @@ class FlattenedDisplayListIterator { do { willMerge.AppendElement(next); - } while ((next = GetNextAsWrapList(next)) && current->CanMerge(next)); + mNext = next->GetAbove(); + next = mNext ? mNext->AsDisplayWrapList() : nullptr; + } while (next && current->CanMerge(next)); current = mBuilder->MergeItems(willMerge); } - // |mNext| will be either the first item that could not be merged with + // Here |mNext| will be either the first item that could not be merged with // |current|, or nullptr. - mNext = next; return current; } diff --git a/layout/reftests/display-list/1551053-1-ref.html b/layout/reftests/display-list/1551053-1-ref.html new file mode 100644 index 000000000000..3e9f12e81efb --- /dev/null +++ b/layout/reftests/display-list/1551053-1-ref.html @@ -0,0 +1,16 @@ + + + + + + + + +bar
baz
+qux + + diff --git a/layout/reftests/display-list/1551053-1.html b/layout/reftests/display-list/1551053-1.html new file mode 100644 index 000000000000..700d5ba1d750 --- /dev/null +++ b/layout/reftests/display-list/1551053-1.html @@ -0,0 +1,27 @@ + + + + + + + + +foo +bar
baz
+qux + + + diff --git a/layout/reftests/display-list/reftest.list b/layout/reftests/display-list/reftest.list index 9936aa73de54..3ce01d781172 100644 --- a/layout/reftests/display-list/reftest.list +++ b/layout/reftests/display-list/reftest.list @@ -41,3 +41,4 @@ fuzzy(0-2,0-40000) skip-if(!asyncPan) == 1464288-1.html 1464288-ref.html == 1504233-1.html 1504233-1-ref.html == 1533317-1.html 1533317-1-ref.html == 1544948-1.html 1544948-1-ref.html +skip-if(retainedDisplayList) == 1551053-1.html 1551053-1-ref.html