Bug 1617472 - Use enums for text-align / text-align-last. r=jfkthame

This also fixes some backwards logic in nsBlockFrame::ReflowDirtyLines, and adds
some static assertions to nsGenericHTMLElement that almost cause a very subtle
bug.

Depends on D63792

Differential Revision: https://phabricator.services.mozilla.com/D63793
This commit is contained in:
Emilio Cobos Álvarez
2020-02-24 13:32:57 +00:00
parent 5f19da8f36
commit 9850f6ee73
27 changed files with 246 additions and 220 deletions

View File

@@ -863,8 +863,8 @@ void HTMLTableElement::MapAttributesIntoRule(
// illegal)
value = aAttributes->GetAttr(nsGkAtoms::align);
if (value && value->Type() == nsAttrValue::eEnum) {
if (value->GetEnumValue() == NS_STYLE_TEXT_ALIGN_CENTER ||
value->GetEnumValue() == NS_STYLE_TEXT_ALIGN_MOZ_CENTER) {
if (value->GetEnumValue() == uint8_t(StyleTextAlign::Center) ||
value->GetEnumValue() == uint8_t(StyleTextAlign::MozCenter)) {
aDecls.SetAutoValueIfUnset(eCSSProperty_margin_left);
aDecls.SetAutoValueIfUnset(eCSSProperty_margin_right);
}