author | Xidorn Quan <me@upsuper.org> |
Tue, 27 Mar 2018 11:05:05 +1100 | |
changeset 772880 | d135467bdde302d44805d5d06c9061a7bef106c2 |
parent 772879 | b1f996682c808c85074121d7ab19a2d59621a11d |
child 772881 | 293fd0a418511471445459be5a1e1b73487d9650 |
push id | 104075 |
push user | xquan@mozilla.com |
push date | Tue, 27 Mar 2018 03:57:37 +0000 |
reviewers | emilio |
bugs | 1449039 |
milestone | 61.0a1 |
--- a/layout/style/nsCSSPropList.h +++ b/layout/style/nsCSSPropList.h @@ -1489,18 +1489,17 @@ CSS_PROP_SHORTHAND( Columns, CSS_PROPERTY_PARSE_FUNCTION, "") CSS_PROP_DISPLAY( contain, contain, Contain, CSS_PROPERTY_PARSE_VALUE | - CSS_PROPERTY_VALUE_PARSER_FUNCTION | - CSS_PROPERTY_FIXPOS_CB, + CSS_PROPERTY_VALUE_PARSER_FUNCTION, "layout.css.contain.enabled", // Does not affect parsing, but is needed for tab completion in devtools: VARIANT_HK | VARIANT_NONE, kContainKTable, CSS_PROP_NO_OFFSET, eStyleAnimType_Discrete) CSS_PROP_CONTENT( content, @@ -1648,18 +1647,17 @@ CSS_PROP_SVG( kFillRuleKTable, CSS_PROP_NO_OFFSET, eStyleAnimType_Discrete) CSS_PROP_EFFECTS( filter, filter, Filter, CSS_PROPERTY_PARSE_FUNCTION | - CSS_PROPERTY_CREATES_STACKING_CONTEXT | - CSS_PROPERTY_FIXPOS_CB, + CSS_PROPERTY_CREATES_STACKING_CONTEXT, "", 0, nullptr, CSS_PROP_NO_OFFSET, eStyleAnimType_Custom) CSS_PROP_SHORTHAND( flex, flex, @@ -3362,18 +3360,17 @@ CSS_PROP_SVG( nullptr, CSS_PROP_NO_OFFSET, eStyleAnimType_Discrete) CSS_PROP_DISPLAY( perspective, perspective, Perspective, CSS_PROPERTY_PARSE_VALUE | - CSS_PROPERTY_CREATES_STACKING_CONTEXT | - CSS_PROPERTY_FIXPOS_CB, + CSS_PROPERTY_CREATES_STACKING_CONTEXT, "", VARIANT_NONE | VARIANT_INHERIT | VARIANT_LENGTH | VARIANT_NONNEGATIVE_DIMENSION, nullptr, offsetof(nsStyleDisplay, mChildPerspective), eStyleAnimType_Coord) CSS_PROP_DISPLAY( perspective-origin, @@ -3417,18 +3414,17 @@ CSS_PROP_USERINTERFACE( CSS_PROP_NO_OFFSET, eStyleAnimType_Discrete) CSS_PROP_DISPLAY( position, position, Position, CSS_PROPERTY_PARSE_VALUE | // For position: sticky/fixed - CSS_PROPERTY_CREATES_STACKING_CONTEXT | - CSS_PROPERTY_ABSPOS_CB, + CSS_PROPERTY_CREATES_STACKING_CONTEXT, "", VARIANT_HK, kPositionKTable, CSS_PROP_NO_OFFSET, eStyleAnimType_Discrete) CSS_PROP_LIST( quotes, quotes, @@ -3467,18 +3463,17 @@ CSS_PROP_POSITION( offsetof(nsStylePosition, mOffset), eStyleAnimType_Sides_Right) CSS_PROP_DISPLAY( rotate, rotate, Rotate, CSS_PROPERTY_PARSE_FUNCTION | CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH | - CSS_PROPERTY_CREATES_STACKING_CONTEXT | - CSS_PROPERTY_FIXPOS_CB, + CSS_PROPERTY_CREATES_STACKING_CONTEXT, "layout.css.individual-transform.enabled", 0, nullptr, offsetof(nsStyleDisplay, mSpecifiedRotate), eStyleAnimType_None) CSS_PROP_TEXT( ruby-align, ruby_align, @@ -4106,18 +4101,17 @@ CSS_PROP_TEXT( CSS_PROP_NO_OFFSET, eStyleAnimType_Discrete) CSS_PROP_DISPLAY( scale, scale, Scale, CSS_PROPERTY_PARSE_FUNCTION | CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH | - CSS_PROPERTY_CREATES_STACKING_CONTEXT | - CSS_PROPERTY_FIXPOS_CB, + CSS_PROPERTY_CREATES_STACKING_CONTEXT, "layout.css.individual-transform.enabled", 0, nullptr, offsetof(nsStyleDisplay, mSpecifiedScale), eStyleAnimType_None) CSS_PROP_TEXT( text-transform, text_transform, @@ -4185,18 +4179,17 @@ CSS_PROP_DISPLAY( eStyleAnimType_Discrete) CSS_PROP_DISPLAY( transform, transform, Transform, CSS_PROPERTY_PARSE_FUNCTION | CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH | CSS_PROPERTY_CREATES_STACKING_CONTEXT | - CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR | - CSS_PROPERTY_FIXPOS_CB, + CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR, "", 0, nullptr, offsetof(nsStyleDisplay, mSpecifiedTransform), eStyleAnimType_Custom) CSS_PROP_DISPLAY( transform-box, transform_box, @@ -4219,18 +4212,17 @@ CSS_PROP_DISPLAY( kImageLayerPositionKTable, CSS_PROP_NO_OFFSET, eStyleAnimType_Custom) CSS_PROP_DISPLAY( transform-style, transform_style, TransformStyle, CSS_PROPERTY_PARSE_VALUE | - CSS_PROPERTY_CREATES_STACKING_CONTEXT | - CSS_PROPERTY_FIXPOS_CB, + CSS_PROPERTY_CREATES_STACKING_CONTEXT, "", VARIANT_HK, kTransformStyleKTable, CSS_PROP_NO_OFFSET, eStyleAnimType_Discrete) CSS_PROP_SHORTHAND( transition, transition, @@ -4282,18 +4274,17 @@ CSS_PROP_DISPLAY( CSS_PROP_NO_OFFSET, eStyleAnimType_None) CSS_PROP_DISPLAY( translate, translate, Translate, CSS_PROPERTY_PARSE_FUNCTION | CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH | - CSS_PROPERTY_CREATES_STACKING_CONTEXT | - CSS_PROPERTY_FIXPOS_CB, + CSS_PROPERTY_CREATES_STACKING_CONTEXT, "layout.css.individual-transform.enabled", 0, nullptr, offsetof(nsStyleDisplay, mSpecifiedTranslate), eStyleAnimType_None) #ifndef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND CSS_PROP_TEXTRESET( unicode-bidi,
--- a/layout/style/nsCSSProps.h +++ b/layout/style/nsCSSProps.h @@ -254,32 +254,16 @@ static_assert((CSS_PROPERTY_PARSE_PROPER // This property can be animated on the compositor. #define CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR (1<<27) // This property is an internal property that is not represented // in the DOM. Properties with this flag must be defined in an #ifndef // 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) - -// This property has values that can establish a containing block for -// 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::IsAbsPosContainingBlock. -// It does not need to be set for properties that also have -// CSS_PROPERTY_FIXPOS_CB set. -#define CSS_PROPERTY_ABSPOS_CB (1<<30) - // This property should add Cross Origin Request headers to any loads // that it triggers. Currently this is only used for properties that // also use CSS_PROPERTY_START_IMAGE_LOADS. #define CSS_PROPERTY_LOAD_USE_CORS (1U<<31) /** * Types of animatable values. */
--- a/layout/style/nsStyleStructInlines.h +++ b/layout/style/nsStyleStructInlines.h @@ -148,17 +148,17 @@ nsStyleDisplay::HasTransform(const nsIFr } template<class ComputedStyleLike> bool nsStyleDisplay::HasFixedPosContainingBlockStyleInternal( ComputedStyleLike* aComputedStyle) const { // NOTE: Any CSS properties that influence the output of this function - // should have the CSS_PROPERTY_FIXPOS_CB set on them. + // should have the FIXPOS_CB flag set on them. NS_ASSERTION(aComputedStyle->ThreadsafeStyleDisplay() == this, "unexpected aComputedStyle"); if (IsContainPaint() || HasPerspectiveStyle()) { return true; } if (mWillChangeBitField & NS_STYLE_WILL_CHANGE_FIXPOS_CB) { @@ -169,62 +169,62 @@ nsStyleDisplay::HasFixedPosContainingBlo } template<class ComputedStyleLike> bool nsStyleDisplay::IsFixedPosContainingBlockForAppropriateFrame( ComputedStyleLike* aComputedStyle) const { // NOTE: Any CSS properties that influence the output of this function - // should have the CSS_PROPERTY_FIXPOS_CB set on them. + // should have the FIXPOS_CB flag set on them. return HasFixedPosContainingBlockStyleInternal(aComputedStyle) || HasTransformStyle(); } 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. + // should have the FIXPOS_CB flag set on them. if (!HasFixedPosContainingBlockStyleInternal(aContextFrame->Style()) && !HasTransform(aContextFrame)) { return false; } return !nsSVGUtils::IsInSVGTextSubtree(aContextFrame); } template<class ComputedStyleLike> bool nsStyleDisplay::HasAbsPosContainingBlockStyleInternal( ComputedStyleLike* aComputedStyle) const { // NOTE: Any CSS properties that influence the output of this function - // should have the CSS_PROPERTY_ABSPOS_CB set on them. + // should have the ABSPOS_CB set on them. NS_ASSERTION(aComputedStyle->ThreadsafeStyleDisplay() == this, "unexpected aComputedStyle"); return IsAbsolutelyPositionedStyle() || IsRelativelyPositionedStyle() || (mWillChangeBitField & NS_STYLE_WILL_CHANGE_ABSPOS_CB); } template<class ComputedStyleLike> bool nsStyleDisplay::IsAbsPosContainingBlockForAppropriateFrame(ComputedStyleLike* aComputedStyle) const { // NOTE: Any CSS properties that influence the output of this function - // should have the CSS_PROPERTY_ABSPOS_CB set on them. + // should have the ABSPOS_CB set on them. return HasAbsPosContainingBlockStyleInternal(aComputedStyle) || IsFixedPosContainingBlockForAppropriateFrame(aComputedStyle); } bool nsStyleDisplay::IsAbsPosContainingBlock(const nsIFrame* aContextFrame) const { // NOTE: Any CSS properties that influence the output of this function - // should have the CSS_PROPERTY_ABSPOS_CB set on them. + // should have the ABSPOS_CB set on them. mozilla::ComputedStyle* sc = aContextFrame->Style(); if (!HasAbsPosContainingBlockStyleInternal(sc) && !HasFixedPosContainingBlockStyleInternal(sc) && !HasTransform(aContextFrame)) { return false; } return !nsSVGUtils::IsInSVGTextSubtree(aContextFrame); }