[webkit-changes] [WebKit/WebKit] 128031: Support border/padding/margin on RenderMathMLRow a...

Frédéric Wang noreply at github.com
Mon Jul 8 08:18:31 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 12803196d5e76b29a63777ce78612ba4e8ec15c1
      https://github.com/WebKit/WebKit/commit/12803196d5e76b29a63777ce78612ba4e8ec15c1
  Author: Frédéric Wang <fwang at igalia.com>
  Date:   2024-07-08 (Mon, 08 Jul 2024)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/border-002-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/margin-001-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/margin-002-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/margin-003-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/padding-002-expected.txt
    M LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/border-002-expected.txt
    M LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/margin-003-expected.txt
    M LayoutTests/platform/gtk/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/padding-002-expected.txt
    M LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/padding-002-expected.txt
    M LayoutTests/platform/mac/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/padding-002-expected.txt
    M Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
    M Source/WebCore/rendering/mathml/RenderMathMLBlock.h
    M Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
    M Source/WebCore/rendering/mathml/RenderMathMLMath.cpp
    M Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp
    M Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp
    M Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
    M Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
    M Source/WebCore/rendering/mathml/RenderMathMLRow.h

  Log Message:
  -----------
  Support border/padding/margin on RenderMathMLRow and subclasses
https://bugs.webkit.org/show_bug.cgi?id=276227

Reviewed by Rob Buis.

This implements support for border/margin/padding on the mrow, math,
mpadded, mroot, msqrt, menclose, merror, mphantom, mstyle elements
according to the rules described in MathML Core:

- When handling boxes of children during math layout, we consider *margin*
  boxes. Following other renderers, `recomputeLogicalWidth()` is called
  during the layout of children to set the inline margins (this does not
  seem enough for preferred width calculations though, but will be
  considered in follow-up patches) while during the parent we call
  `computeAndSetBlockDirectionMargins()` on each child in order to set
  set the block margins. To make the latter easier, the helper method
  RenderMathMLBlock::computeAndSetBlockDirectionMarginsOfChildren() is
  introduced.

- Current math layout is modified so that padding/border are added in
  order to obtain the border box. RenderMathMLRow already does that but
  then this can become wrong for derived classes (which add extra space
  or painting). Consequently, we modify RenderMathMLRow so the helpers
  getContentBoundingBox(), layoutRowItems() and
  stretchVerticalOperatorsAndLayoutChildren() do not actually consider
  the padding/border and it is up to the callers to add it around their
  own layout. Similarly, a new helper preferredLogicalWidthOfRowItems()
  is introduced to calculate the preferred logical width of a row of
  items without adding the border/padding. Finally we add a helper
  shiftRowItems() to shift children by an offset, something that
  was already used by some subclasses and can be used to shift by the
  top-left border/padding too.

Canonical link: https://commits.webkit.org/280733@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list