summaryrefslogtreecommitdiffstats
path: root/layout/style
diff options
context:
space:
mode:
authorathenian200 <athenian200@outlook.com>2020-09-03 18:55:28 -0500
committerathenian200 <athenian200@outlook.com>2020-09-03 18:55:28 -0500
commit6b2c3b61b1c338ddec723482bd2c83427ef2e431 (patch)
treebd30f18df9a1d98b88a24c5e9482551ec84ff8ec /layout/style
parent0ac50227e22599b62ddfb1e4a889032837925178 (diff)
downloadUXP-6b2c3b61b1c338ddec723482bd2c83427ef2e431.tar
UXP-6b2c3b61b1c338ddec723482bd2c83427ef2e431.tar.gz
UXP-6b2c3b61b1c338ddec723482bd2c83427ef2e431.tar.lz
UXP-6b2c3b61b1c338ddec723482bd2c83427ef2e431.tar.xz
UXP-6b2c3b61b1c338ddec723482bd2c83427ef2e431.zip
Issue #1641 - Implement CSS flow-root keyword
This is just a clean port of 1322191 and follow-up 1325970. It really seems to add create a new way to access existing code relating to block formatting and floating elements rather than implementing new functionality, and it is mercifully straightforwards.
Diffstat (limited to 'layout/style')
-rw-r--r--layout/style/nsCSSKeywordList.h1
-rw-r--r--layout/style/nsCSSProps.cpp3
-rw-r--r--layout/style/nsRuleNode.cpp2
-rw-r--r--layout/style/nsStyleConsts.h1
-rw-r--r--layout/style/nsStyleStruct.h6
-rw-r--r--layout/style/test/property_database.js4
6 files changed, 15 insertions, 2 deletions
diff --git a/layout/style/nsCSSKeywordList.h b/layout/style/nsCSSKeywordList.h
index 34a46ffce..9045da9ff 100644
--- a/layout/style/nsCSSKeywordList.h
+++ b/layout/style/nsCSSKeywordList.h
@@ -285,6 +285,7 @@ CSS_KEY(flex, flex)
CSS_KEY(flex-end, flex_end)
CSS_KEY(flex-start, flex_start)
CSS_KEY(flip, flip)
+CSS_KEY(flow-root, flow_root)
CSS_KEY(forwards, forwards)
CSS_KEY(fraktur, fraktur)
CSS_KEY(from-image, from_image)
diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp
index ac2978c27..24c97cf33 100644
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -1345,6 +1345,9 @@ KTableEntry nsCSSProps::kDisplayKTable[] = {
// The next entry is controlled by the layout.css.display-contents.enabled
// pref.
{ eCSSKeyword_contents, StyleDisplay::Contents },
+ // The next entry is controlled by the layout.css.display-flow-root.enabled
+ // pref.
+ { eCSSKeyword_flow_root, StyleDisplay::FlowRoot },
{ eCSSKeyword_UNKNOWN, -1 }
};
diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp
index 1a451a2ef..036d97f86 100644
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -250,6 +250,7 @@ nsRuleNode::EnsureBlockDisplay(StyleDisplay& display,
case StyleDisplay::Flex:
case StyleDisplay::WebkitBox:
case StyleDisplay::Grid:
+ case StyleDisplay::FlowRoot:
// do not muck with these at all - already blocks
// This is equivalent to nsStyleDisplay::IsBlockOutside. (XXX Maybe we
// should just call that?)
@@ -293,6 +294,7 @@ nsRuleNode::EnsureInlineDisplay(StyleDisplay& display)
// see if the display value is already inline
switch (display) {
case StyleDisplay::Block:
+ case StyleDisplay::FlowRoot:
display = StyleDisplay::InlineBlock;
break;
case StyleDisplay::Table:
diff --git a/layout/style/nsStyleConsts.h b/layout/style/nsStyleConsts.h
index 6d207aec9..f54387aa8 100644
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -524,6 +524,7 @@ enum class FillMode : uint32_t;
enum class StyleDisplay : uint8_t {
None = 0,
Block,
+ FlowRoot,
Inline,
InlineBlock,
ListItem,
diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h
index 4bda817dd..f49cdc43e 100644
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -2890,7 +2890,8 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay
return mozilla::StyleDisplay::Block == mDisplay ||
mozilla::StyleDisplay::ListItem == mDisplay ||
mozilla::StyleDisplay::InlineBlock == mDisplay ||
- mozilla::StyleDisplay::TableCaption == mDisplay;
+ mozilla::StyleDisplay::TableCaption == mDisplay ||
+ mozilla::StyleDisplay::FlowRoot == mDisplay;
// Should TABLE_CELL be included here? They have
// block frames nested inside of them.
// (But please audit all callers before changing.)
@@ -2902,7 +2903,8 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay
mozilla::StyleDisplay::WebkitBox == mDisplay ||
mozilla::StyleDisplay::Grid == mDisplay ||
mozilla::StyleDisplay::ListItem == mDisplay ||
- mozilla::StyleDisplay::Table == mDisplay;
+ mozilla::StyleDisplay::Table == mDisplay ||
+ mozilla::StyleDisplay::FlowRoot == mDisplay;
}
static bool IsDisplayTypeInlineOutside(mozilla::StyleDisplay aDisplay) {
diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js
index c75f7b498..2d6352148 100644
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -7892,6 +7892,10 @@ if (IsCSSPropertyPrefEnabled("layout.css.background-clip-text.enabled")) {
);
}
+if (IsCSSPropertyPrefEnabled("layout.css.display-flow-root.enabled")) {
+ gCSSProperties["display"].other_values.push("flow-root");
+}
+
// Copy aliased properties' fields from their alias targets.
for (var prop in gCSSProperties) {
var entry = gCSSProperties[prop];