зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1305957 part 3 - Add IsStickyPositioned() method to nsStyleDisplay. r=emilio
This commit is used in a later commit to exclude frames that are sticky positioned from being scroll anchors. Differential Revision: https://phabricator.services.mozilla.com/D13266 --HG-- extra : rebase_source : 50cddce18bbc0164bfff70bf00ab698354ede375 extra : histedit_source : 7cad7389e6958d3107e43e5f915139f6682c168d
This commit is contained in:
Родитель
53ae64fd5e
Коммит
1041d94fae
|
@ -3848,6 +3848,7 @@ class nsIFrame : public nsQueryFrame {
|
|||
inline bool IsAbsPosContainingBlock() const;
|
||||
inline bool IsFixedPosContainingBlock() const;
|
||||
inline bool IsRelativelyPositioned() const;
|
||||
inline bool IsStickyPositioned() const;
|
||||
inline bool IsAbsolutelyPositioned(
|
||||
const nsStyleDisplay* aStyleDisplay = nullptr) const;
|
||||
|
||||
|
|
|
@ -47,6 +47,10 @@ bool nsIFrame::IsRelativelyPositioned() const {
|
|||
return StyleDisplay()->IsRelativelyPositioned(this);
|
||||
}
|
||||
|
||||
bool nsIFrame::IsStickyPositioned() const {
|
||||
return StyleDisplay()->IsStickyPositioned(this);
|
||||
}
|
||||
|
||||
bool nsIFrame::IsAbsolutelyPositioned(
|
||||
const nsStyleDisplay* aStyleDisplay) const {
|
||||
const nsStyleDisplay* disp = StyleDisplayWithOptionalParam(aStyleDisplay);
|
||||
|
|
|
@ -2109,6 +2109,9 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay {
|
|||
return NS_STYLE_POSITION_RELATIVE == mPosition ||
|
||||
NS_STYLE_POSITION_STICKY == mPosition;
|
||||
}
|
||||
bool IsStickyPositionedStyle() const {
|
||||
return NS_STYLE_POSITION_STICKY == mPosition;
|
||||
}
|
||||
bool IsPositionForcingStackingContext() const {
|
||||
return NS_STYLE_POSITION_STICKY == mPosition ||
|
||||
NS_STYLE_POSITION_FIXED == mPosition;
|
||||
|
@ -2230,6 +2233,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay {
|
|||
inline mozilla::StyleDisplay GetDisplay(const nsIFrame* aContextFrame) const;
|
||||
inline bool IsFloating(const nsIFrame* aContextFrame) const;
|
||||
inline bool IsRelativelyPositioned(const nsIFrame* aContextFrame) const;
|
||||
inline bool IsStickyPositioned(const nsIFrame* aContextFrame) const;
|
||||
inline bool IsAbsolutelyPositioned(const nsIFrame* aContextFrame) const;
|
||||
|
||||
// These methods are defined in nsStyleStructInlines.h.
|
||||
|
|
|
@ -211,6 +211,13 @@ bool nsStyleDisplay::IsRelativelyPositioned(
|
|||
!nsSVGUtils::IsInSVGTextSubtree(aContextFrame);
|
||||
}
|
||||
|
||||
bool nsStyleDisplay::IsStickyPositioned(const nsIFrame* aContextFrame) const {
|
||||
NS_ASSERTION(aContextFrame->StyleDisplay() == this,
|
||||
"unexpected aContextFrame");
|
||||
return IsStickyPositionedStyle() &&
|
||||
!nsSVGUtils::IsInSVGTextSubtree(aContextFrame);
|
||||
}
|
||||
|
||||
bool nsStyleDisplay::IsAbsolutelyPositioned(
|
||||
const nsIFrame* aContextFrame) const {
|
||||
NS_ASSERTION(aContextFrame->StyleDisplay() == this,
|
||||
|
|
Загрузка…
Ссылка в новой задаче