зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1144096 part 5 - [css-grid] Create a couple of Grid container frame bits. r=dholbert
This commit is contained in:
Родитель
788aa99a4a
Коммит
485174bd17
|
@ -11,6 +11,7 @@
|
||||||
#include "nsBoxFrame.h"
|
#include "nsBoxFrame.h"
|
||||||
#include "nsBulletFrame.h"
|
#include "nsBulletFrame.h"
|
||||||
#include "nsFlexContainerFrame.h"
|
#include "nsFlexContainerFrame.h"
|
||||||
|
#include "nsGridContainerFrame.h"
|
||||||
#include "nsGfxScrollFrame.h"
|
#include "nsGfxScrollFrame.h"
|
||||||
#include "nsIFrame.h"
|
#include "nsIFrame.h"
|
||||||
#include "nsISVGChildFrame.h"
|
#include "nsISVGChildFrame.h"
|
||||||
|
|
|
@ -304,6 +304,17 @@ FRAME_STATE_GROUP(FlexContainer, nsFlexContainerFrame)
|
||||||
// (Means that we have to be more thorough about checking them for sortedness.)
|
// (Means that we have to be more thorough about checking them for sortedness.)
|
||||||
FRAME_STATE_BIT(FlexContainer, 20, NS_STATE_FLEX_CHILDREN_REORDERED)
|
FRAME_STATE_BIT(FlexContainer, 20, NS_STATE_FLEX_CHILDREN_REORDERED)
|
||||||
|
|
||||||
|
// == Frame state bits that apply to grid container frames ====================
|
||||||
|
|
||||||
|
FRAME_STATE_GROUP(GridContainer, nsGridContainerFrame)
|
||||||
|
|
||||||
|
// True iff the normal flow children are already in CSS 'order' in the
|
||||||
|
// order they occur in the child frame list.
|
||||||
|
FRAME_STATE_BIT(GridContainer, 20, NS_STATE_GRID_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER)
|
||||||
|
|
||||||
|
// True iff some first-in-flow in-flow children were pushed.
|
||||||
|
FRAME_STATE_BIT(GridContainer, 21, NS_STATE_GRID_DID_PUSH_ITEMS)
|
||||||
|
|
||||||
// == Frame state bits that apply to SVG frames ===============================
|
// == Frame state bits that apply to SVG frames ===============================
|
||||||
|
|
||||||
FRAME_STATE_GROUP(SVG, nsISVGChildFrame)
|
FRAME_STATE_GROUP(SVG, nsISVGChildFrame)
|
||||||
|
|
|
@ -3892,7 +3892,11 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
||||||
const nsStylePosition* stylePos = aReflowState.mStylePosition;
|
const nsStylePosition* stylePos = aReflowState.mStylePosition;
|
||||||
InitImplicitNamedAreas(stylePos);
|
InitImplicitNamedAreas(stylePos);
|
||||||
GridReflowState gridReflowState(this, aReflowState);
|
GridReflowState gridReflowState(this, aReflowState);
|
||||||
mIsNormalFlowInCSSOrder = gridReflowState.mIter.ItemsAreAlreadyInOrder();
|
if (gridReflowState.mIter.ItemsAreAlreadyInOrder()) {
|
||||||
|
AddStateBits(NS_STATE_GRID_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER);
|
||||||
|
} else {
|
||||||
|
RemoveStateBits(NS_STATE_GRID_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER);
|
||||||
|
}
|
||||||
const nscoord computedBSize = aReflowState.ComputedBSize();
|
const nscoord computedBSize = aReflowState.ComputedBSize();
|
||||||
const nscoord computedISize = aReflowState.ComputedISize();
|
const nscoord computedISize = aReflowState.ComputedISize();
|
||||||
const WritingMode& wm = gridReflowState.mWM;
|
const WritingMode& wm = gridReflowState.mWM;
|
||||||
|
@ -4058,8 +4062,9 @@ nsGridContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
&positionedDescendants,
|
&positionedDescendants,
|
||||||
aLists.Outlines());
|
aLists.Outlines());
|
||||||
typedef GridItemCSSOrderIterator::OrderState OrderState;
|
typedef GridItemCSSOrderIterator::OrderState OrderState;
|
||||||
OrderState order = mIsNormalFlowInCSSOrder ? OrderState::eKnownOrdered
|
OrderState order = HasAnyStateBits(NS_STATE_GRID_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER)
|
||||||
: OrderState::eKnownUnordered;
|
? OrderState::eKnownOrdered
|
||||||
|
: OrderState::eKnownUnordered;
|
||||||
GridItemCSSOrderIterator iter(this, kPrincipalList,
|
GridItemCSSOrderIterator iter(this, kPrincipalList,
|
||||||
GridItemCSSOrderIterator::eIncludeAll, order);
|
GridItemCSSOrderIterator::eIncludeAll, order);
|
||||||
for (; !iter.AtEnd(); iter.Next()) {
|
for (; !iter.AtEnd(); iter.Next()) {
|
||||||
|
|
|
@ -154,12 +154,6 @@ private:
|
||||||
*/
|
*/
|
||||||
nscoord mCachedMinISize;
|
nscoord mCachedMinISize;
|
||||||
nscoord mCachedPrefISize;
|
nscoord mCachedPrefISize;
|
||||||
|
|
||||||
/**
|
|
||||||
* True iff the normal flow children are already in CSS 'order' in the
|
|
||||||
* order they occur in the child frame list.
|
|
||||||
*/
|
|
||||||
bool mIsNormalFlowInCSSOrder : 1;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* nsGridContainerFrame_h___ */
|
#endif /* nsGridContainerFrame_h___ */
|
||||||
|
|
Загрузка…
Ссылка в новой задаче