Bug 1227766 patch 1 - Add flag for CSS properties that establish a containing block for fixed positioned elements. r=dholbert

This commit is contained in:
L. David Baron 2015-11-30 15:46:44 -08:00
parent eeaa323e5d
commit e58dd9591a
3 changed files with 19 additions and 5 deletions

View File

@ -1482,7 +1482,8 @@ CSS_PROP_DISPLAY(
contain,
Contain,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_VALUE_PARSER_FUNCTION,
CSS_PROPERTY_VALUE_PARSER_FUNCTION |
CSS_PROPERTY_FIXPOS_CB,
"layout.css.contain.enabled",
// Does not affect parsing, but is needed for tab completion in devtools:
VARIANT_HK | VARIANT_NONE,
@ -3383,7 +3384,8 @@ CSS_PROP_DISPLAY(
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_CREATES_STACKING_CONTEXT |
CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR,
CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR |
CSS_PROPERTY_FIXPOS_CB,
"",
0,
nullptr,
@ -3428,7 +3430,8 @@ CSS_PROP_DISPLAY(
perspective,
Perspective,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_CREATES_STACKING_CONTEXT,
CSS_PROPERTY_CREATES_STACKING_CONTEXT |
CSS_PROPERTY_FIXPOS_CB,
"",
VARIANT_NONE | VARIANT_INHERIT | VARIANT_LENGTH | VARIANT_POSITIVE_DIMENSION,
nullptr,
@ -3439,7 +3442,8 @@ CSS_PROP_DISPLAY(
transform_style,
TransformStyle,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_CREATES_STACKING_CONTEXT,
CSS_PROPERTY_CREATES_STACKING_CONTEXT |
CSS_PROPERTY_FIXPOS_CB,
"",
VARIANT_HK,
kTransformStyleKTable,
@ -3967,7 +3971,8 @@ CSS_PROP_SVGRESET(
filter,
Filter,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_CREATES_STACKING_CONTEXT,
CSS_PROPERTY_CREATES_STACKING_CONTEXT |
CSS_PROPERTY_FIXPOS_CB,
"",
0,
nullptr,

View File

@ -255,6 +255,13 @@ static_assert((CSS_PROPERTY_PARSE_PROPERTY_MASK &
// CSS_PROP_LIST_EXCLUDE_INTERNAL section of nsCSSPropList.h.
#define CSS_PROPERTY_INTERNAL (1<<28)
// This property has values that can establish a containing block for
// fixed positioned and absolutely positioned elements.
// This should be set for any properties that can cause an element to be
// such a containing block, as implemented in
// nsStyleDisplay::IsFixedPosContainingBlock.
#define CSS_PROPERTY_FIXPOS_CB (1<<29)
/**
* Types of animatable values.
*/

View File

@ -138,6 +138,8 @@ nsStyleDisplay::HasTransform(const nsIFrame* aContextFrame) const
bool
nsStyleDisplay::IsFixedPosContainingBlock(const nsIFrame* aContextFrame) const
{
// NOTE: Any CSS properties that influence the output of this function
// should have the CSS_PROPERTY_FIXPOS_CB set on them.
NS_ASSERTION(aContextFrame->StyleDisplay() == this,
"unexpected aContextFrame");
return (IsContainPaint() || HasTransform(aContextFrame) ||