Bug 1852478 - Convert CSS white-space into a shorthand that expands to white-space-collapse and text-wrap-mode longhands. r=firefox-style-system-reviewers,emilio
Note that although this builds, it would (by itself) result in some test breakage; this is resolved in the following patches that build on this. Differential Revision: https://phabricator.services.mozilla.com/D198790
This commit is contained in:
@@ -365,12 +365,14 @@ bool HTMLTextAreaElement::ParseAttribute(int32_t aNamespaceID,
|
||||
void HTMLTextAreaElement::MapAttributesIntoRule(
|
||||
MappedDeclarationsBuilder& aBuilder) {
|
||||
// wrap=off
|
||||
if (!aBuilder.PropertyIsSet(eCSSProperty_white_space)) {
|
||||
const nsAttrValue* value = aBuilder.GetAttr(nsGkAtoms::wrap);
|
||||
if (value && value->Type() == nsAttrValue::eString &&
|
||||
value->Equals(nsGkAtoms::OFF, eIgnoreCase)) {
|
||||
aBuilder.SetKeywordValue(eCSSProperty_white_space, StyleWhiteSpace::Pre);
|
||||
}
|
||||
const nsAttrValue* value = aBuilder.GetAttr(nsGkAtoms::wrap);
|
||||
if (value && value->Type() == nsAttrValue::eString &&
|
||||
value->Equals(nsGkAtoms::OFF, eIgnoreCase)) {
|
||||
// Equivalent to expanding `white-space; pre`
|
||||
aBuilder.SetKeywordValue(eCSSProperty_white_space_collapse,
|
||||
StyleWhiteSpaceCollapse::Preserve);
|
||||
aBuilder.SetKeywordValue(eCSSProperty_text_wrap_mode,
|
||||
StyleTextWrapMode::Nowrap);
|
||||
}
|
||||
|
||||
nsGenericHTMLFormControlElementWithState::MapDivAlignAttributeInto(aBuilder);
|
||||
|
||||
Reference in New Issue
Block a user