mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-04 22:37:29 +09:00
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.
This commit is contained in:
parent
0af26afc22
commit
9532970df5
15 changed files with 68 additions and 16 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -524,6 +524,7 @@ enum class FillMode : uint32_t;
|
|||
enum class StyleDisplay : uint8_t {
|
||||
None = 0,
|
||||
Block,
|
||||
FlowRoot,
|
||||
Inline,
|
||||
InlineBlock,
|
||||
ListItem,
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue