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

@@ -1263,12 +1263,14 @@ void nsTreeBodyFrame::AdjustForCellText(nsAutoString& aText, int32_t aRowIndex,
aRenderingContext);
switch (aColumn->GetTextAlignment()) {
case NS_STYLE_TEXT_ALIGN_RIGHT: {
case mozilla::StyleTextAlign::Right:
aTextRect.x += aTextRect.width - width;
} break;
case NS_STYLE_TEXT_ALIGN_CENTER: {
break;
case mozilla::StyleTextAlign::Center:
aTextRect.x += (aTextRect.width - width) / 2;
} break;
break;
default:
break;
}
aTextRect.width = width;