mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 1144905 - Clean up SortByZOrder code and comments since it now assumes the list is already in content document order. r=roc
This commit is contained in:
parent
c615325cb7
commit
85f77e706b
@ -2043,9 +2043,8 @@ static bool IsZOrderLEQ(nsDisplayItem* aItem1, nsDisplayItem* aItem2,
|
||||
return aItem1->ZIndex() <= aItem2->ZIndex();
|
||||
}
|
||||
|
||||
void nsDisplayList::SortByZOrder(nsDisplayListBuilder* aBuilder,
|
||||
nsIContent* aCommonAncestor) {
|
||||
Sort(aBuilder, IsZOrderLEQ, aCommonAncestor);
|
||||
void nsDisplayList::SortByZOrder(nsDisplayListBuilder* aBuilder) {
|
||||
Sort(aBuilder, IsZOrderLEQ, nullptr);
|
||||
}
|
||||
|
||||
void nsDisplayList::SortByContentOrder(nsDisplayListBuilder* aBuilder,
|
||||
|
@ -1668,14 +1668,10 @@ public:
|
||||
uint32_t Count() const;
|
||||
/**
|
||||
* Stable sort the list by the z-order of GetUnderlyingFrame() on
|
||||
* each item. 'auto' is counted as zero. Content order is used as the
|
||||
* secondary order.
|
||||
* @param aCommonAncestor a common ancestor of all the content elements
|
||||
* associated with the display items, for speeding up tree order
|
||||
* checks, or nullptr if not known; it's only a hint, if it is not an
|
||||
* ancestor of some elements, then we lose performance but not correctness
|
||||
* each item. 'auto' is counted as zero.
|
||||
* It is assumed that the list is already in content document order.
|
||||
*/
|
||||
void SortByZOrder(nsDisplayListBuilder* aBuilder, nsIContent* aCommonAncestor);
|
||||
void SortByZOrder(nsDisplayListBuilder* aBuilder);
|
||||
/**
|
||||
* Stable sort the list by the tree order of the content of
|
||||
* GetUnderlyingFrame() on each item. z-index is ignored.
|
||||
|
@ -2058,13 +2058,14 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
||||
set.Outlines()->DeleteAll();
|
||||
}
|
||||
|
||||
// This z-order sort also sorts secondarily by content order. We need to do
|
||||
// this so that boxes produced by the same element are placed together
|
||||
// Sort PositionedDescendants() in CSS 'z-order' order. The list is already
|
||||
// in content document order and SortByZOrder is a stable sort which
|
||||
// guarantees that boxes produced by the same element are placed together
|
||||
// in the sort. Consider a position:relative inline element that breaks
|
||||
// across lines and has absolutely positioned children; all the abs-pos
|
||||
// children should be z-ordered after all the boxes for the position:relative
|
||||
// element itself.
|
||||
set.PositionedDescendants()->SortByZOrder(aBuilder, GetContent());
|
||||
set.PositionedDescendants()->SortByZOrder(aBuilder);
|
||||
|
||||
nsDisplayList resultList;
|
||||
// Now follow the rules of http://www.w3.org/TR/CSS21/zindex.html
|
||||
|
Loading…
Reference in New Issue
Block a user