Skip to content
This repository has been archived by the owner on Jul 3, 2018. It is now read-only.

support display: -webkit-flex and -webkit-flex: 1 #75

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions layout/style/nsCSSKeywordList.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ CSS_KEY(-moz-workspace, _moz_workspace)
CSS_KEY(-moz-zoom-in, _moz_zoom_in)
CSS_KEY(-moz-zoom-out, _moz_zoom_out)
CSS_KEY(-webkit-box, _webkit_box)
CSS_KEY(-webkit-flex, _webkit_flex)
CSS_KEY(-webkit-inline-box, _webkit_inline_box)
CSS_KEY(absolute, absolute)
CSS_KEY(active, active)
Expand Down
6 changes: 6 additions & 0 deletions layout/style/nsCSSParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7047,6 +7047,12 @@ CSSParserImpl::LookupKeywordPrefixAware(nsAString& aKeywordStr,
return (keyword == eCSSKeyword__moz_box) ?
eCSSKeyword_flex : eCSSKeyword_inline_flex;
}

if (keyword == eCSSKeyword__webkit_flex) {
if (sWebkitPrefixedAliasesEnabled || ShouldUseUnprefixingService()) {
return eCSSKeyword_flex;
}
}
}

return keyword;
Expand Down
5 changes: 5 additions & 0 deletions layout/style/nsCSSPropAliasList.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ CSS_PROP_ALIAS(-webkit-box-sizing,
WebkitBoxSizing,
WEBKIT_PREFIX_PREF)

CSS_PROP_ALIAS(-webkit-flex,
flex,
WebkitFlex,
WEBKIT_PREFIX_PREF)

// Alias -webkit-box properties to their -moz-box equivalents.
// (NOTE: Even though they're aliases, in practice these -webkit properties
// will behave a bit differently from their -moz versions, if they're
Expand Down
3 changes: 2 additions & 1 deletion layout/style/nsCSSProps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1284,8 +1284,9 @@ KTableEntry nsCSSProps::kDisplayKTable[] = {
// The next two entries are controlled by the layout.css.grid.enabled pref.
{ eCSSKeyword_grid, NS_STYLE_DISPLAY_GRID },
{ eCSSKeyword_inline_grid, NS_STYLE_DISPLAY_INLINE_GRID },
// The next two entries are controlled by the layout.css.prefixes.webkit pref.
// The next three entries are controlled by the layout.css.prefixes.webkit pref.
{ eCSSKeyword__webkit_box, NS_STYLE_DISPLAY_WEBKIT_BOX },
{ eCSSKeyword__webkit_flex, NS_STYLE_DISPLAY_WEBKIT_FLEX },
{ eCSSKeyword__webkit_inline_box, NS_STYLE_DISPLAY_WEBKIT_INLINE_BOX },
// The next entry is controlled by the layout.css.display-contents.enabled
// pref.
Expand Down
1 change: 1 addition & 0 deletions layout/style/nsStyleConsts.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ enum class FillMode : uint32_t;
#define NS_STYLE_DISPLAY_CONTENTS 38
#define NS_STYLE_DISPLAY_WEBKIT_BOX 39
#define NS_STYLE_DISPLAY_WEBKIT_INLINE_BOX 40
#define NS_STYLE_DISPLAY_WEBKIT_FLEX 41

// See nsStyleDisplay
// If these are re-ordered, nsComputedDOMStyle::DoGetContain() and
Expand Down