Commit f443c012 authored by Frédéric Wang's avatar Frédéric Wang Committed by Commit Bot

[mathml] Update TODO comments

Add links to existing bug entry and update the comments to better
reflect the current MathML status and plan.

Bug: 6606
Change-Id: Ia89c4ab1e576033ecafb8c7828362dc3f30894ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2390918Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Frédéric Wang <fwang@igalia.com>
Cr-Commit-Position: refs/heads/master@{#804572}
parent 8f47fe26
......@@ -31,9 +31,7 @@ FractionParameters GetFractionParameters(const ComputedStyle& style) {
bool has_display_style = HasDisplayStyle(style);
// We try and read constants to draw the fraction from the OpenType MATH and
// use fallback values otherwise.
// The MATH table specification suggests default rule thickness or (in
// displaystyle) 3 times default rule thickness for the gaps.
// use fallback values suggested in the MathML Core specification otherwise.
parameters.numerator_gap_min = LayoutUnit(
MathConstant(
style,
......@@ -52,8 +50,6 @@ FractionParameters GetFractionParameters(const ComputedStyle& style) {
: OpenTypeMathSupport::MathConstants::kFractionDenominatorGapMin)
.value_or(parameters.numerator_gap_min));
// TODO(crbug.com/1058369): The MATH table specification does not suggest
// any values for shifts, so we leave them at zero for now.
parameters.numerator_min_shift_up = LayoutUnit(
MathConstant(
style,
......
......@@ -35,11 +35,9 @@ NGConstraintSpace CreateConstraintSpaceForMathChild(
space_builder.SetIsShrinkToFit(child_style.LogicalWidth().IsAuto());
// TODO(rbuis): add target stretch sizes.
// TODO(crbug.com/1124301): add target stretch sizes.
// TODO(crbug.com/1125137): add ink metrics.
space_builder.SetTextDirection(child_style.Direction());
// TODO(rbuis): add ink baselines?
space_builder.SetNeedsBaseline(true);
return space_builder.ToConstraintSpace();
}
......
......@@ -69,6 +69,7 @@ void NGMathRowLayoutAlgorithm::LayoutRowItems(
LayoutUnit ascent = margins.block_start + fragment.BaselineOrSynthesize();
*max_row_block_baseline = std::max(*max_row_block_baseline, ascent);
// TODO(crbug.com/1125136): take into account italic correction.
// TODO(rbuis): Operators can add lspace and rspace.
children->emplace_back(
......@@ -152,6 +153,7 @@ MinMaxSizesResult NGMathRowLayoutAlgorithm::ComputeMinMaxSizes(
depends_on_percentage_block_size |=
child_result.depends_on_percentage_block_size;
// TODO(crbug.com/1125136): take into account italic correction.
// TODO(rbuis): Operators can add lspace and rspace.
}
......
......@@ -320,7 +320,7 @@ scoped_refptr<const NGLayoutResult> NGMathScriptsLayoutAlgorithm::Layout() {
content_start_offset.block_offset;
LayoutUnit descent =
std::max(base_metrics.descent, metrics.descent + metrics.sub_shift);
// TODO(rbuis): take into account italic correction.
// TODO(crbug.com/1125136): take into account italic correction.
LayoutUnit inline_offset = content_start_offset.inline_offset;
LayoutUnit space = GetSpaceAfterScript(Style());
......@@ -436,7 +436,7 @@ MinMaxSizesResult NGMathScriptsLayoutAlgorithm::ComputeMinMaxSizes(
case MathScriptType::kUnder:
case MathScriptType::kOver:
case MathScriptType::kSuper: {
// TODO(fwang): Take italic correction into account.
// TODO(crbug.com/1125136): Take italic correction into account.
NGBlockNode sub = sub_sup_pairs[0].sub;
NGBlockNode sup = sub_sup_pairs[0].sup;
auto first_post_script = sub ? sub : sup;
......@@ -454,7 +454,7 @@ MinMaxSizesResult NGMathScriptsLayoutAlgorithm::ComputeMinMaxSizes(
case MathScriptType::kSubSup:
case MathScriptType::kUnderOver:
case MathScriptType::kMultiscripts: {
// TODO(fwang): Take italic correction into account.
// TODO(crbug.com/1125136): Take italic correction into account.
MinMaxSizes sub_sup_pair_size;
unsigned index = 0;
do {
......
......@@ -95,8 +95,6 @@ UnderOverVerticalParameters GetUnderOverVerticalParameters(
return parameters;
}
// TODO(crbug.com/1124285): Handle accent/accentunder attributes.
// TODO(crbug.com/1124289): Implement AccentBaseHeight.
const float default_rule_thickness = RuleThicknessFallback(style);
parameters.under_gap_min = LayoutUnit(
MathConstant(style,
......@@ -216,6 +214,7 @@ scoped_refptr<const NGLayoutResult> NGMathUnderOverLayoutAlgorithm::Layout() {
UnderOverVerticalParameters parameters = GetUnderOverVerticalParameters(
Style(), is_base_large_operator, is_base_stretchy_in_inline_axis);
// TODO(crbug.com/1124301): handle stretchy operators.
// TODO(crbug.com/1125136): take into account italic correction.
auto base_space = CreateConstraintSpaceForMathChild(
Node(), ChildAvailableSize(), ConstraintSpace(), base);
......@@ -343,6 +342,7 @@ MinMaxSizesResult NGMathUnderOverLayoutAlgorithm::ComputeMinMaxSizes(
child = child.NextSibling()) {
if (child.IsOutOfFlowPositioned())
continue;
// TODO(crbug.com/1125136): take into account italic correction.
auto child_result = ComputeMinAndMaxContentContribution(
Style(), To<NGBlockNode>(child), child_input);
NGBoxStrut margins = ComputeMinMaxMargins(Style(), child);
......
......@@ -85,7 +85,7 @@ void MathMLPaddedElement::CollectStyleForPresentationAttribute(
LayoutObject* MathMLPaddedElement::CreateLayoutObject(
const ComputedStyle& style,
LegacyLayout legacy) {
// TODO(rbuis): legacy check should be removed.
// TODO(crbug.com/1125133): legacy check should be removed.
if (!RuntimeEnabledFeatures::MathMLCoreEnabled() ||
legacy == LegacyLayout::kForce || !style.IsDisplayMathType())
return MathMLElement::CreateLayoutObject(style, legacy);
......
......@@ -19,7 +19,7 @@ bool MathMLRadicalElement::HasIndex() const {
LayoutObject* MathMLRadicalElement::CreateLayoutObject(
const ComputedStyle& style,
LegacyLayout legacy) {
// TODO(rbuis): legacy check should be removed.
// TODO(crbug.com/1125133): legacy check should be removed.
if (!RuntimeEnabledFeatures::MathMLCoreEnabled() ||
legacy == LegacyLayout::kForce || !style.IsDisplayMathType())
return MathMLElement::CreateLayoutObject(style, legacy);
......
......@@ -15,7 +15,7 @@ MathMLRowElement::MathMLRowElement(const QualifiedName& tagName,
LayoutObject* MathMLRowElement::CreateLayoutObject(const ComputedStyle& style,
LegacyLayout legacy) {
// TODO(rbuis): legacy check should be removed.
// TODO(crbug.com/1125133): legacy check should be removed.
if (!RuntimeEnabledFeatures::MathMLCoreEnabled() ||
legacy == LegacyLayout::kForce ||
(!style.IsDisplayMathType() && !HasTagName(mathml_names::kMathTag)))
......
......@@ -141,7 +141,7 @@ void NGMathMLPainter::Paint(const PaintInfo& info,
return;
}
// TODO(rbuis): paint operator
// TODO(crbug.com/1124301): paint operator
PaintRadicalSymbol(info, paint_offset);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment