Commit Graph
865 Commits
Author SHA1 Message Date
Sajid Anwar 194f92ebae Bug 2043603 - Remove unnecessary RefPtr in font baseline retrieval. r=layout-reviewers,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D306066
2026-06-11 05:46:38 +00:00
Sajid Anwar a3e1d680bb Bug 2010717 - Implement alignment-baseline: alphabetic/ideographic/central/mathematical/hanging. r=layout-reviewers,firefox-style-system-reviewers,dshin
Also adds WPT reftests to validate alignment behavior in horizontal and vertical
writing modes with the different `alignment-baseline` values. Additionally:

- The `alignment-baseline: middle` tests have failing expectations. This is
  because the existing implementation does not match the css-inline-3 definition
  (which the new WPTs follow). See Bug 2030203.

- The WidthTest-Regular.otf support font was updated to remove its unusual
  ideographic-under baseline value, which affected its synthesized central
  baseline. With the new support for `alignment-baseline: central`, this broke a
  number of `text-combine-upright-compression-*` WPT reftests. The non-centered
  baseline values were removed from this test using FontForge, so that the
  synthesized central baseline matched the expectation of the test references.

Differential Revision: https://phabricator.services.mozilla.com/D292136
2026-05-19 13:49:52 +00:00
Silaghi e2f7575a37 Revert "Bug 2010717, Bug 2029869 - Implement alignment-baseline: alphabetic/ideographic/central/mathematical/hanging. r=layout-reviewers,firefox-style-system-reviewers,dshin" for causing wr and reftest failures
This reverts commit 482c9f881b.

Revert "Bug 2029869 - Synthesize vertical font metrics/baselines from horizontal metrics/baselines. r=layout-reviewers,jfkthame"

This reverts commit 8699ee2727.
2026-05-11 17:37:06 +00:00
Sajid Anwar 482c9f881b Bug 2010717 - Implement alignment-baseline: alphabetic/ideographic/central/mathematical/hanging. r=layout-reviewers,firefox-style-system-reviewers,dshin
Also adds WPT reftests to validate alignment behavior in horizontal and vertical
writing modes with the different `alignment-baseline` values. Additionally:

- The `alignment-baseline: middle` tests have failing expectations. This is
  because the existing implementation does not match the css-inline-3 definition
  (which the new WPTs follow). See Bug 2030203.

- The WidthTest-Regular.otf support font was updated to remove its unusual
  ideographic-under baseline value, which affected its synthesized central
  baseline. With the new support for `alignment-baseline: central`, this broke a
  number of `text-combine-upright-compression-*` WPT reftests. The non-centered
  baseline values were removed from this test using FontForge, so that the
  synthesized central baseline matched the expectation of the test references.

Differential Revision: https://phabricator.services.mozilla.com/D292136
2026-05-11 15:44:58 +00:00
Emilio Cobos Álvarez e562ea4a57 Bug 2034573 - Fix text input rendering with text-indent. r=layout-reviewers,dholbert
Don't apply text-indent to the outer input frame, since all the inner
frames also apply it. This gets the behavior from before my patch and is
consistent with other browsers as well.

Differential Revision: https://phabricator.services.mozilla.com/D296252
2026-04-24 20:32:21 +00:00
Silaghi 6b89bca67c Revert "Bug 2034573 - Fix text input rendering with text-indent. r=layout-reviewers,dholbert" for causinf wr failures at input-text-indent.html
This reverts commit 91b23e5896.
2026-04-24 18:33:57 +00:00
Emilio Cobos Álvarez 91b23e5896 Bug 2034573 - Fix text input rendering with text-indent. r=layout-reviewers,dholbert
Don't apply text-indent to the outer input frame, since all the inner
frames also apply it. This gets the behavior from before my patch and is
consistent with other browsers as well.

Differential Revision: https://phabricator.services.mozilla.com/D296252
2026-04-24 14:21:41 +00:00
Sylvestre Ledru 55481ac4b5 Bug 2023419 - Remove Emacs/Vim modelines from layout/ r=emilio,firefox-style-system-reviewers,layout-reviewers
replaced by .editorconfig

Differential Revision: https://phabricator.services.mozilla.com/D287852
2026-03-17 12:05:43 +00:00
Sajid Anwar e2ff27b940 Bug 2015279 - Implement dominant-baseline for vertical alignment. r=layout-reviewers,firefox-style-system-reviewers,jfkthame,emilio
Moves the existing dominant-baseline CSS property out from SVG-specific
struct and into the general inherited box struct. Also adds new WPTs for
testing dominant-baseline against the alignment-baseline property.

Differential Revision: https://phabricator.services.mozilla.com/D282788
2026-02-19 23:31:58 +00:00
Sajid Anwar 3f078d2e1d Bug 2010713 - Add SVG support for baseline-shift. r=firefox-svg-reviewers,longsonr
Differential Revision: https://phabricator.services.mozilla.com/D281143
2026-01-30 19:41:34 +00:00
Atila Butkovits 8226a29315 Revert "Bug 2010713 - Add SVG support for baseline-shift. r=firefox-svg-reviewers,longsonr" for causing failures at ignore-vertical-align.svg. DONTBUILD
This reverts commit 3c61fdec18.
2026-01-30 15:33:13 +00:00
Sajid Anwar 3c61fdec18 Bug 2010713 - Add SVG support for baseline-shift. r=firefox-svg-reviewers,longsonr
Differential Revision: https://phabricator.services.mozilla.com/D281143
2026-01-30 14:08:51 +00:00
Sajid Anwar d198797615 Bug 2010715 - Implement baseline-shift: center. r=layout-reviewers,firefox-style-system-reviewers,emilio
Also added new WPTs for various values of `baseline-shift`.

Differential Revision: https://phabricator.services.mozilla.com/D279466
2026-01-30 03:35:49 +00:00
Sajid Anwar fd791116ad Bug 1830771 - Convert vertical-align into a shorthand property. r=layout-reviewers,firefox-style-system-reviewers,emilio
Replaces the `vertical-align` longhand with the shorthand version and the corresponding `alignment-baseline` and `baseline-shift` longhands (the `baseline-source` property was already implemented). Some notes about this change:

- The CSS Inline Layout Module Level 3 specification introduced new
  values to `alignment-baseline` and `baseline-shift` that were not
  available in the original `vertical-align` longhand. This change
  only implements the original keywords; the new values will be used
  in a future patch.

- The SVG layout still ignores the `vertical-align` (and now the
  corresponding longhands) in favor of the `dominant-baseline`. This
  will also be addressed in a future patch.

Differential Revision: https://phabricator.services.mozilla.com/D277725
2026-01-16 08:50:29 +00:00
Emilio Cobos Álvarez 4bbf8598d1 Bug 1998125 - Remove a lot of now unused view code. r=layout-reviewers,firefox-style-system-reviewers,dshin
No need to reposition views during layout and so on, now that we don't
use views for either popups nor subdocuments.

No need for nsView to have parent / sibling / children either.

Differential Revision: https://phabricator.services.mozilla.com/D271205
2025-11-12 01:53:45 +00:00
Emilio Cobos Álvarez 764938320e Bug 1993353 - Remove NS_FRAME_HAS_VIEW. r=tnikkel,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D268103
2025-10-09 11:22:21 +00:00
Jonathan Kew cc070973fb Bug 1980100 - Convert the layout.css.ruby.normalize-metrics pref into normalize-metrics-factor, a percentage adjustment to apply to the trimmed ascent/descent metrics. r=layout-reviewers,TYLin
This allows us to fine-tune the positioning of ruby annotations. To my eye,
a setting of around 110 (so "padding" the normalized ascent/descent of the base
characters by an extra 10%) looks better, but we should get feedback from the
Japanese community to determine a good default.

(Setting the pref to zero restores our old line-box-based ruby rendering.
Non-zero values are clamped to the range [100..200] to avoid sending the
annotations really far away or making them overprint the base text.)

This shouldn't change behavior _unless_ the pref value is adjusted.

Differential Revision: https://phabricator.services.mozilla.com/D259842
2025-08-21 13:29:12 +00:00
Jonathan Kew f70d5dd721 Bug 1980095 - patch 2 - Account for em-normalized ruby metrics in nsLineLayout, to avoid adding excessive line height when annotations are kept closer to the base text. r=layout-reviewers,TYLin
Differential Revision: https://phabricator.services.mozilla.com/D259833
2025-08-21 11:28:02 +00:00
Emilio Cobos Álvarez fd1f57b58d Bug 1873301 - Remove nsHTMLButtonControlFrame. r=dholbert,layout-reviewers,dshin
This removes the implementation of nsHTMLButtonControlFrame, instead
reusing nsBlockFrame + align-content (or the relevant display type for
flex / grid / columns / etc).

This matches what Blink does and, for the most part, it is trivial.
It requires moving some special cases around, and override inline flow
display, tho so that buttons don't suddenly start fragmenting in the
inline axis.

It adds a tiny fix for a writing-mode mismatch in
nsBlockFrame::AlignContent(), covered by
layout/reftests/writing-mode/1138356-1-button-contents-alignment.html

containing-block-change-button tests are tweaked to avoid overflowing
the 600px viewport from WPT reftests causing scrollbar fuzziness.

contain-layout-baseline-005.html removes the <select> element just like
https://chromium-review.googlesource.com/c/chromium/src/+/5479489
removed the <button>s, since they align the same now, added a test for
that.

Differential Revision: https://phabricator.services.mozilla.com/D257149
2025-07-15 11:05:54 +00:00
David Shin ad5f8e7fd0 Bug 1969305: Pass anchor resolution params for maxsize. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256291
2025-07-14 21:28:26 +00:00
David Shin 8090f17c2b Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256290
2025-07-14 21:28:23 +00:00
David Shin e68ac5eb03 Bug 1969305: Pass anchor resolution params for margin. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256289
2025-07-14 21:28:20 +00:00
pstanciu 7a21072acf Revert "Bug 1969305: Adjust WPT expectations. r=layout-reviewers,emilio" for causing failures @ anchor-name-003.html
This reverts commit 5e12720896.

Revert "Bug 1969305: Pass anchor resolution params for maxsize. r=layout-reviewers,emilio"

This reverts commit 27a56d04a1.

Revert "Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio"

This reverts commit 69b2bd0242.

Revert "Bug 1969305: Pass anchor resolution params for margin. r=layout-reviewers,emilio"

This reverts commit 23c707d5a7.

Revert "Bug 1969305: Implement anchor size resolution. r=layout-reviewers,emilio"

This reverts commit c0d1d8808d.
2025-07-12 02:02:55 +00:00
David Shin 27a56d04a1 Bug 1969305: Pass anchor resolution params for maxsize. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256291
2025-07-11 15:21:45 +00:00
David Shin 69b2bd0242 Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256290
2025-07-11 15:21:42 +00:00
David Shin 23c707d5a7 Bug 1969305: Pass anchor resolution params for margin. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256289
2025-07-11 15:21:39 +00:00
Atila Butkovits 0b2944a3d2 Revert "Bug 1969305: Adjust WPT expectations. r=layout-reviewers,emilio" for causing bustages at GeckoBindings.cpp.
This reverts commit 49a7b8afce.

Revert "Bug 1969305: Pass anchor resolution params for maxsize. r=layout-reviewers,emilio"

This reverts commit 0b615836cf.

Revert "Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio"

This reverts commit 359badb60e.

Revert "Bug 1969305: Pass anchor resolution params for margin. r=layout-reviewers,emilio"

This reverts commit 17f7f64cd8.

Revert "Bug 1969305: Implement anchor size resolution. r=layout-reviewers,emilio"

This reverts commit 47197ef7ab.
2025-07-11 01:18:14 +00:00
David Shin 0b615836cf Bug 1969305: Pass anchor resolution params for maxsize. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256291
2025-07-10 20:58:24 +00:00
David Shin 359badb60e Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256290
2025-07-10 20:58:21 +00:00
David Shin 17f7f64cd8 Bug 1969305: Pass anchor resolution params for margin. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256289
2025-07-10 20:58:18 +00:00
Emilio Cobos Álvarez a8a2311474 Bug 1976457 - Sort includes in layout/. r=janv,dshin
Interesting bit is layout/.clang-format, the rest is all automated.

Differential Revision: https://phabricator.services.mozilla.com/D256616
2025-07-09 13:24:00 +00:00
David Shin 8897bdc924 Bug 1971135: Use anchor resolution params in place of position property. r=TYLin
... The full resolution that makes use of additional parameters will follow
shortly.

Differential Revision: https://phabricator.services.mozilla.com/D253175
2025-06-16 20:35:30 +00:00
David Shin 6f62c65eda Bug 1971135: Implement and use anchor positioning parameter helpers. r=layout-reviewers,TYLin
These helpers for anchor resolution parameters from `nsIFrame` and
`ReflowInput` cover many use cases.

Differential Revision: https://phabricator.services.mozilla.com/D253174
2025-06-16 20:35:27 +00:00
David Shin 90c7608ba6 Bug 1971135: Rename anchor params to be specific for offset resolution. r=TYLin
... Also, consistently use `anchorResolutionParams` as the variable name.

Differential Revision: https://phabricator.services.mozilla.com/D253173
2025-06-16 20:35:24 +00:00
David Shin c5abad242d Bug 1923961: Unify anchor resolution parameters and use it for inset resolution. r=layout-reviewers,emilio
... In addition to previous parameters, we need access to the positioned
frame, as well as the containing block's size (If we're in reflow).

Differential Revision: https://phabricator.services.mozilla.com/D249625
2025-05-29 22:03:13 +00:00
Sandor Molnar 354a4799e0 Revert "Bug 1923961: apply code formatting via Lando" for causing build bustages @ GeckoBindings.cpp
This reverts commit ec57e25d89.

Revert "Bug 1923961: Adjust WPT expectations. r=firefox-style-system-reviewers,emilio"

This reverts commit f2612695a7.

Revert "Bug 1923961: Resolve anchor() in calc(). r=firefox-style-system-reviewers,emilio"

This reverts commit b206c5264b.

Revert "Bug 1923961: Initial implementation of anchor lookup for anchor(). r=firefox-style-system-reviewers,emilio"

This reverts commit 56c17701c5.

Revert "Bug 1923961: Make `nsLayoutUtils::GetRectRelativeToFrame` take in const ptrs. r=firefox-style-system-reviewers,emilio"

This reverts commit 34fb773837.

Revert "Bug 1923961: Pass the new AnchorPosResolutionParams to servo side. r=firefox-style-system-reviewers,emilio"

This reverts commit 73477e3296.

Revert "Bug 1923961: Unify anchor resolution parameters and use it for inset resolution. r=layout-reviewers,emilio"

This reverts commit 8461579472.

Revert "Bug 1923961: Expose `AnchorSide` to C++. r=firefox-style-system-reviewers,boris"

This reverts commit 7ecbb38056.
2025-05-29 20:46:30 +00:00
David Shin 8461579472 Bug 1923961: Unify anchor resolution parameters and use it for inset resolution. r=layout-reviewers,emilio
... In addition to previous parameters, we need access to the positioned
frame, as well as the containing block's size (If we're in reflow).

Differential Revision: https://phabricator.services.mozilla.com/D249625
2025-05-29 19:00:08 +00:00
Sandor Molnar cb9703fe12 Revert "Bug 1923961: apply code formatting via Lando" for causing build bustages & wpt failures.
This reverts commit f94a0ccf5a.

Revert "Bug 1923961: Adjust WPT expectations. r=firefox-style-system-reviewers,emilio"

This reverts commit e3e24626a3.

Revert "Bug 1923961: Resolve anchor() in calc(). r=firefox-style-system-reviewers,emilio"

This reverts commit a21f60c569.

Revert "Bug 1923961: Initial implementation of anchor lookup for anchor(). r=firefox-style-system-reviewers,emilio"

This reverts commit daaa53a9ce.

Revert "Bug 1923961: Make `nsLayoutUtils::GetRectRelativeToFrame` take in const ptrs. r=firefox-style-system-reviewers,emilio"

This reverts commit c1db75e7fc.

Revert "Bug 1923961: Pass the new AnchorPosResolutionParams to servo side. r=firefox-style-system-reviewers,emilio"

This reverts commit e0f8f99c69.

Revert "Bug 1923961: Unify anchor resolution parameters and use it for inset resolution. r=layout-reviewers,emilio"

This reverts commit adc70f8493.

Revert "Bug 1923961: Expose `AnchorSide` to C++. r=firefox-style-system-reviewers,boris"

This reverts commit b917ffcec6.
2025-05-29 18:09:52 +00:00
David Shin adc70f8493 Bug 1923961: Unify anchor resolution parameters and use it for inset resolution. r=layout-reviewers,emilio
... In addition to previous parameters, we need access to the positioned
frame, as well as the containing block's size (If we're in reflow).

Differential Revision: https://phabricator.services.mozilla.com/D249625
2025-05-29 16:35:34 +00:00
David Shin 85c922b0dd Bug 1923959: Resolve anchor for (max) sizes. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D240864
2025-04-08 02:29:18 +00:00
David Shin 40e6a5c66e Bug 1923959: Resolve anchor for margins. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D240863
2025-04-08 02:29:18 +00:00
David Shin d138dbfb8c Bug 1942715: Part 5 - Remove Maybe* optimizations for insets, always working with anchor-resolved insets. r=firefox-style-system-reviewers,emilio
Reasoning with these functions gets confusing, because anchor
functions can become percentage as well as auto.
Defer optimization for now.

Differential Revision: https://phabricator.services.mozilla.com/D237098
2025-02-12 01:31:30 +00:00
Butkovits Atila e51ff081c6 Backed out 6 changesets (bug 1942715) for causing build bustages. CLOSED TREE
Backed out changeset 1433202bd2f3 (bug 1942715)
Backed out changeset d9ce2be09cd0 (bug 1942715)
Backed out changeset 9789581a42a3 (bug 1942715)
Backed out changeset 9a18f1aca5d5 (bug 1942715)
Backed out changeset 46bd0cb031f4 (bug 1942715)
Backed out changeset 73fec8bae045 (bug 1942715)
2025-02-12 01:45:46 +02:00
David Shin d2c459be6d Bug 1942715: Part 5 - Remove Maybe* optimizations for insets, always working with anchor-resolved insets. r=firefox-style-system-reviewers,emilio
Reasoning with these functions gets confusing, because anchor
functions can become percentage as well as auto.
Defer optimization for now.

Differential Revision: https://phabricator.services.mozilla.com/D237098
2025-02-11 21:06:24 +00:00
Butkovits Atila fd3125f8e5 Backed out 6 changesets (bug 1942715) for causing build bustages. CLOSED TREE
Backed out changeset 7c5cfe6bbaeb (bug 1942715)
Backed out changeset cc5530b02046 (bug 1942715)
Backed out changeset 5a534f455cc3 (bug 1942715)
Backed out changeset ecdd7307c9f1 (bug 1942715)
Backed out changeset 05a62c484807 (bug 1942715)
Backed out changeset a9825ee69550 (bug 1942715)
2025-02-11 22:17:26 +02:00
David Shin a3d93f384a Bug 1942715: Part 5 - Remove Maybe* optimizations for insets, always working with anchor-resolved insets. r=firefox-style-system-reviewers,emilio
Reasoning with these functions gets confusing, because anchor
functions can become percentage as well as auto.
Defer optimization for now.

Differential Revision: https://phabricator.services.mozilla.com/D237098
2025-02-11 18:19:56 +00:00
David Shin b2eef4a311 Bug 1946899: Clarify in comment which block edge (i.e. block-start edge) is being zeroed out. DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D237758
2025-02-11 16:25:03 +00:00
David Shin 583a087418 Bug 1946899: Ensure child spans of an empty span receive a zero block start edge. r=layout-reviewers,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D237632
2025-02-10 23:07:57 +00:00
David Shin 3d615cb7f6 Bug 1923763: Part 5 - Replace inset evaluations with anchor-resolved inset evaluations. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D231259
2025-01-21 15:11:25 +00:00
Stanca Serban 4a35296e0c Backed out 7 changesets (bug 1923763) for causing build bustages in nsStyleStruct.cpp. CLOSED TREE
Backed out changeset d55070e64ced (bug 1923763)
Backed out changeset a92a0bc6047f (bug 1923763)
Backed out changeset 2203e2c5268e (bug 1923763)
Backed out changeset 0cc5e744c01a (bug 1923763)
Backed out changeset d2139afa933b (bug 1923763)
Backed out changeset 93e59980eac1 (bug 1923763)
Backed out changeset 8018734b5491 (bug 1923763)
2025-01-21 11:10:22 +02:00