зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1009776 - part 3, [css-grid] Store the grid item's grid area on a frame property. r=dholbert
This commit is contained in:
Родитель
e6838ac9ee
Коммит
7dc47c3510
|
@ -438,6 +438,12 @@ nsGridContainerFrame::PlaceGridItems(const nsStylePosition* aStyle)
|
|||
for (nsFrameList::Enumerator e(PrincipalChildList()); !e.AtEnd(); e.Next()) {
|
||||
nsIFrame* child = e.get();
|
||||
const GridArea& area = PlaceDefinite(child, aStyle);
|
||||
GridArea* prop = GetGridAreaForChild(child);
|
||||
if (prop) {
|
||||
*prop = area;
|
||||
} else {
|
||||
child->Properties().Set(GridAreaProperty(), new GridArea(area));
|
||||
}
|
||||
if (area.IsDefinite()) {
|
||||
InflateGridFor(area);
|
||||
}
|
||||
|
|
|
@ -203,6 +203,15 @@ protected:
|
|||
return areas && areas->Contains(aName);
|
||||
}
|
||||
|
||||
NS_DECLARE_FRAME_PROPERTY(GridAreaProperty, DeleteValue<GridArea>)
|
||||
|
||||
/**
|
||||
* A convenience method to get the stored GridArea* for a frame.
|
||||
*/
|
||||
static GridArea* GetGridAreaForChild(nsIFrame* aChild) {
|
||||
return static_cast<GridArea*>(aChild->Properties().Get(GridAreaProperty()));
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void SanityCheckAnonymousGridItems() const;
|
||||
#endif // DEBUG
|
||||
|
|
Загрузка…
Ссылка в новой задаче