Commit graph

3091 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
7bf3b0e527 Bug 1844195 - Avoid duplicating rust and C++ display definitions. r=layout-reviewers,jfkthame
We need to inline Self::new() so cbindgen generates the constants, which
is kinda lame, but seems better than duplicating the values and type
definitions.

Differential Revision: https://phabricator.services.mozilla.com/D183921
2023-07-26 06:46:32 +00:00
Iulian Moraru
0c0945174b Backed out changeset f3394bd0f554 (bug 1844195) for causing conflicts with another backout. 2023-07-26 04:00:57 +03:00
Emilio Cobos Álvarez
e56bda6fd8 Bug 1844195 - Avoid duplicating rust and C++ display definitions. r=layout-reviewers,jfkthame
We need to inline Self::new() so cbindgen generates the constants, which
is kinda lame, but seems better than duplicating the values and type
definitions.

Differential Revision: https://phabricator.services.mozilla.com/D183921
2023-07-25 21:14:39 +00:00
Iulian Moraru
da43d00caa Backed out changeset 3a3f2d5937c4 (bug 1844195) for causing mass failures. CLOSED TREE 2023-07-25 23:07:30 +03:00
Emilio Cobos Álvarez
c70814ab25 Bug 1844195 - Avoid duplicating rust and C++ display definitions. r=layout-reviewers,jfkthame
We need to inline Self::new() so cbindgen generates the constants, which
is kinda lame, but seems better than duplicating the values and type
definitions.

Differential Revision: https://phabricator.services.mozilla.com/D183921
2023-07-25 18:40:30 +00:00
Emilio Cobos Álvarez
4cc6758558 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Emilio Cobos Álvarez
b1fe05281f Bug 1834487 - Simplify border snapping. r=Oriol
Make the computed value of border-like properties app units (which is
effectively what happens in Gecko already), and clamp at computed value
time.

Differential Revision: https://phabricator.services.mozilla.com/D179481
2023-05-31 08:49:14 +00:00
David Shin
267a479339 Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-17 12:56:54 +00:00
Sandor Molnar
71c2b3db49 Backed out 3 changesets (bug 1809568) for causing build bustages in layout/generic/nsLineLayout.cpp CLOSED TREE
Backed out changeset 6c5bbcbafce9 (bug 1809568)
Backed out changeset b518133a5c34 (bug 1809568)
Backed out changeset 2407088e9b49 (bug 1809568)
2023-05-17 01:34:42 +03:00
David Shin
1eefa9a516 Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-16 20:48:18 +00:00
Sandor Molnar
a50a2052fe Backed out 3 changesets (bug 1809568) for causing node devtools failures in devtools/client/debugger/src/components/test/QuickOpenModal.spec.js CLOSED TREE
Backed out changeset 56ce741da8f5 (bug 1809568)
Backed out changeset 5a91ce4870e4 (bug 1809568)
Backed out changeset cc00422f050a (bug 1809568)
2023-05-16 22:22:31 +03:00
David Shin
30a10fdbc6 Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-16 19:02:11 +00:00
David Shin
72338e1209 Bug 1832110: Fix and simplify handling of empty rows when drawing border-collapsed tables. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D178048
2023-05-15 20:12:48 +00:00
Cristian Tuns
4d57ea669d Backed out 3 changesets (bug 1809568) for causing build bustages on nsLineLayout.cpp CLOSED TREE
Backed out changeset e862b1560caa (bug 1809568)
Backed out changeset 0a20b91de67b (bug 1809568)
Backed out changeset 6060fc7d49d4 (bug 1809568)
2023-05-15 13:03:03 -04:00
David Shin
c4f2c2237b Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-15 14:34:26 +00:00
Ting-Yu Lin
67f66f89ee Bug 1832452 - Remove rowGroupFrame local variable in nsTableFrame::ReflowChildren(). r=layout-reviewers,tnikkel
`kidFrame` and `rowGroupFrame` are the same. This patch doesn't change the
behavior.

Differential Revision: https://phabricator.services.mozilla.com/D177714
2023-05-11 16:54:32 +00:00
David Shin
d9e74a40b1 Bug 1821177: Ensure nsTableRowGroupFrame's CreateContinuingRowFrame and UndoContinuedRow push and pull from overflow lists. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D177631
2023-05-11 15:05:19 +00:00
Cosmin Sabou
543905e105 Backed out 3 changesets (bug 1809568) for causing build bustages on nsBlockFrame.cpp. CLOSED TREE
Backed out changeset eaa7fe280317 (bug 1809568)
Backed out changeset ab0f2bcb2d9b (bug 1809568)
Backed out changeset a481bf06452b (bug 1809568)
2023-05-01 21:42:14 +03:00
David Shin
d2ebe93a83 Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-01 17:04:27 +00:00
Iulian Moraru
c9ffb3ffa8 Backed out 3 changesets (bug 1809568) for causing build bustages on nsLineLayout.cpp. CLOSED TREE
Backed out changeset 573dc0bd9554 (bug 1809568)
Backed out changeset b8401947aea0 (bug 1809568)
Backed out changeset 7ecabe895121 (bug 1809568)
2023-05-01 17:59:21 +03:00
David Shin
8ff73f5fcc Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-01 13:44:43 +00:00
Timothy Nikkel
835b48d090 Bug 1828829. Fix unused warning when enabling DEBUG_FRAME_DUMP in opt builds. r=emilio
This becomes a fatal compile error in automation (ie try).

Differential Revision: https://phabricator.services.mozilla.com/D175844
2023-04-19 08:29:26 +00:00
Ting-Yu Lin
dbc0cd5615 Bug 1055894 - Add GetLogicalNormalRect() and adapt some callers of GetNormalRect(). r=emilio
This patch makes the API nicer, and shouldn't change the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D174344
2023-04-01 04:17:05 +00:00
David Shin
52c0a5e6c9 Bug 1819266: Ensure block-direction collapsed border does not extend beyond its row. r=dholbert
If `border-collapse` is set and `border` is set for `td` but there's an empty
`tr`, the collapsed border was pushed out wrongly by the empty `tr`.
Columns borders cannot collapse like row borders as you can't define an empty
column without defining a cell.

Differential Revision: https://phabricator.services.mozilla.com/D173031
2023-03-30 18:11:40 +00:00
David Shin
a47e766d75 Bug 1812679 - Handle central baseline calculation in GetNaturalBaselineBOffset. r=layout-reviewers,emilio
Previously, for writing-mode using central baseline alignment (i.e. `vertical-(lr|rl)`,
we simply used the center of content-box in `nsLineLayout::VerticalAlignFrames`.
However, this is incorrect for e.g. a `div` with two lines of text - just like how
its alphabetical baseline is the baseline of the second line of text, the central
baseline should be the centerline of the second line.

Differential Revision: https://phabricator.services.mozilla.com/D172165
2023-03-24 16:23:16 +00:00
Norisz Fay
97050950be Backed out changeset 11ba57726279 (bug 1812679) for causing Wr failures on text-combine-upright-value-all-002.html 2023-03-24 01:51:06 +02:00
David Shin
6cb3b01af3 Bug 1812679 - Handle central baseline calculation in GetNaturalBaselineBOffset. r=layout-reviewers,emilio
Previously, for writing-mode using central baseline alignment (i.e. `vertical-(lr|rl)`,
we simply used the center of content-box in `nsLineLayout::VerticalAlignFrames`.
However, this is incorrect for e.g. a `div` with two lines of text - just like how
its alphabetical baseline is the baseline of the second line of text, the central
baseline should be the centerline of the second line.

Differential Revision: https://phabricator.services.mozilla.com/D172165
2023-03-23 17:36:49 +00:00
Stanca Serban
7c4f609327 Backed out changeset 49646b0d59aa (bug 1812679) for causing mochitests failures in layout/style/test/test_revert.html. CLOSED TREE 2023-03-23 17:39:13 +02:00
David Shin
2f94be9968 Bug 1812679 - Handle central baseline calculation in GetNaturalBaselineBOffset. r=layout-reviewers,emilio
Previously, for writing-mode using central baseline alignment (i.e. `vertical-(lr|rl)`,
we simply used the center of content-box in `nsLineLayout::VerticalAlignFrames`.
However, this is incorrect for e.g. a `div` with two lines of text - just like how
its alphabetical baseline is the baseline of the second line of text, the central
baseline should be the centerline of the second line.

Differential Revision: https://phabricator.services.mozilla.com/D172165
2023-03-23 14:35:12 +00:00
Emilio Cobos Álvarez
5dfcee19a5 Bug 1600542 - Remove a few other no longer reachable XUL box special-cases. r=TYLin
The only XUL frames that remain are either scrollbars, or leafs. These are uses
that I'm pretty sure are no longer needed. There are a few others that will go
in the future.

Depends on D172874

Differential Revision: https://phabricator.services.mozilla.com/D172875
2023-03-20 23:56:03 +00:00
Emilio Cobos Álvarez
e18c9b7ad6 Bug 1815552 - Make positioned table parts deal correctly with switching position without being reframed. r=TYLin,layout-reviewers
While looking at the backout, I noticed table parts relied on reframing
on abspos-container-ness changes in a subtle way, see the test, which
fails with the first patch of this bug applied without these changes.

Make the NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN mean the same for table parts
as for everything else. Instead, keep the registration status on each
relevant frame class individually.

Depends on D169127

Differential Revision: https://phabricator.services.mozilla.com/D170969
2023-03-01 19:04:17 +00:00
Emilio Cobos Álvarez
b953328172 Bug 1815552 - Deal with table cells in the abspos cb change optimization code-path. r=dholbert
Remove an assertion that doesn't hold if we don't reframe when switching
positions.

Differential Revision: https://phabricator.services.mozilla.com/D169127
2023-03-01 19:04:16 +00:00
Cristina Horotan
e15f3e3295 Backed out 2 changesets (bug 1815552) for causing Bp-hybrid bustages at ComputedStyle.h on a CLOSED TREE
Backed out changeset da0f9295df91 (bug 1815552)
Backed out changeset cda1ee891058 (bug 1815552)
2023-03-01 16:05:19 +02:00
Emilio Cobos Álvarez
029e62f738 Bug 1815552 - Make positioned table parts deal correctly with switching position without being reframed. r=TYLin,layout-reviewers
While looking at the backout, I noticed table parts relied on reframing
on abspos-container-ness changes in a subtle way, see the test, which
fails with the first patch of this bug applied without these changes.

Make the NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN mean the same for table parts
as for everything else. Instead, keep the registration status on each
relevant frame class individually.

Depends on D169127

Differential Revision: https://phabricator.services.mozilla.com/D170969
2023-03-01 10:36:54 +00:00
Emilio Cobos Álvarez
f8fdfae384 Bug 1815552 - Deal with table cells in the abspos cb change optimization code-path. r=dholbert
Remove an assertion that doesn't hold if we don't reframe when switching
positions.

Differential Revision: https://phabricator.services.mozilla.com/D169127
2023-03-01 10:36:54 +00:00
Ting-Yu Lin
19a0c5fb59 Bug 1819211 - Export Baseline.h under mozilla. r=emilio
It is because `Baseline` is a utility class under `namespace mozilla`.

Also change the include guard to match the coding style.
https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html#header-files

Differential Revision: https://phabricator.services.mozilla.com/D171162
2023-03-01 03:50:03 +00:00
Emilio Cobos Álvarez
c8200e7d27 Bug 1818851 - Minor cleanups to table classes. r=TYLin
Remove redundant virtual keywords, and initialize stuff in the declaration
when possible.

Differential Revision: https://phabricator.services.mozilla.com/D170968
2023-02-25 00:42:48 +00:00
David Shin
f5a42005e2 Bug 1811311 - Part 3: Refactor GetNaturalBaselineBOffset to return Maybe<nscoord>. r=layout-reviewers,emilio
Changed from returning `bool` & taking an out parameter.

Differential Revision: https://phabricator.services.mozilla.com/D168998
2023-02-23 14:53:27 +00:00
David Shin
e02d078c12 Bug 1811311 - Part 2: Extract SynthesizeBaselineBOffsetFrom* out of nsIFrame. r=emilio
These functions work fine as static functions, and `nsIFrame` is pretty overloaded.

Differential Revision: https://phabricator.services.mozilla.com/D167991
2023-02-23 14:53:27 +00:00
David Shin
5c7c22165f Bug 1811311 - Part 1: Unite baseline-related functions in nsIFrame into one. r=emilio
Before, there existed 3 virtual functions that calculated baselines:

- `GetLogicalBaseline`
- `GetVerticalAlignBaseline`
- `GetNaturalBaselineBOffset`

Each of them had slightly different behaviours:

- `GetLogicalBaseline` would synthesize a baseline if there is no baseline.
  Others would simply return `false`.
- `GetNaturalBaselineBOffset` requires the caller to pick which of first/last
  baseline to calculate. Others pick on on their own.
- `GetNaturalBaselineBOffset`'s result can be either offset from border box
   start/end edge, depending on the caller-supplied baseline. Others always
   return offset from border box start edge.

Now:

- `GetNaturalBaselineBOffset` is the sole virtual function.
- `GetLogicalBaseline` exists to support its use, with 2 virtual helper functions:
  - `SynthesizeFallbackBaseline` to generate a baseline for elements that
    doesn't have one.
  - `GetBaselineSharingGroup` to preserve the default baseline picking behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D167990
2023-02-23 14:53:26 +00:00
Robert Longson
2ec308723b Bug 1651129 - Convert uses of mState to various StateBits methods and make mState private r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D169943
2023-02-15 21:35:46 +00:00
Andi-Bogdan Postelnicu
d7e8a09c21 Bug 1519636 - Reformat recent changes to the Google coding style. r=glandium
Updated with clang-format version 15.0.5 (taskcluster-MKK8dHUpQkGfPLA793lizg)
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D168658
2023-02-13 15:02:07 +00:00
Emilio Cobos Álvarez
673df6949e Bug 1809061 - Simplify background painting. r=tnikkel,layout-reviewers
The issue here is that DealWithWindowsAppearanceHacks doesn't run unless
we're actually painting a background because we look at
`mDefaultAppearance` and nsIFrame only checks `HasAppearance`.

However this code can be simplified a bit, now that we cleaned up
background propagation in bug 1665476.

Enter in AppendBackgroundItemsToTop unconditionally, and clean up a bit
while at it.

Differential Revision: https://phabricator.services.mozilla.com/D166352
2023-01-21 18:05:39 +00:00
Emilio Cobos Álvarez
3ad7017163 Bug 1807963 - Remove non-standard values of caption-side for good. r=TYLin,layout-reviewers
They have been disabled since bug 1688695. There's a variety of
table-caption bugs that would be easier to fix if we didn't have to
account for side-captions.

Differential Revision: https://phabricator.services.mozilla.com/D165690
2023-01-09 18:02:23 +00:00
Cosmin Sabou
4ab6fc29e0 Backed out changeset c34c31220275 (bug 1807963) for causing reftest unexpected passes on 446100-1c.html. 2023-01-09 15:01:55 +02:00
Emilio Cobos Álvarez
7b821c0133 Bug 1807963 - Remove non-standard values of caption-side for good. r=TYLin,layout-reviewers
They have been disabled since bug 1688695. There's a variety of
table-caption bugs that would be easier to fix if we didn't have to
account for side-captions.

Differential Revision: https://phabricator.services.mozilla.com/D165690
2023-01-09 10:39:44 +00:00
Stanca Serban
81bfc93257 Backed out changeset e018ba23c07d (bug 1807963) for causing wpt failures in caption.html. CLOSED TREE 2023-01-09 10:42:21 +02:00
Emilio Cobos Álvarez
5b925c72c8 Bug 1807963 - Remove non-standard values of caption-side for good. r=TYLin,layout-reviewers
They have been disabled since bug 1688695. There's a variety of
table-caption bugs that would be easier to fix if we didn't have to
account for side-captions.

Differential Revision: https://phabricator.services.mozilla.com/D165690
2023-01-09 07:05:14 +00:00
Dan Robertson
8b358b41b7 Bug 1379458 - The ScrollParentId should match the ASR tree. r=botond,tnikkel,mstange
Make the ScrollMetadata's mScrollParentId match what is found in the active
scroll root tree.

Depends on D148662

Differential Revision: https://phabricator.services.mozilla.com/D149925
2022-12-27 14:08:51 +00:00
Ting-Yu Lin
8f8ddadd2f Bug 1803863 Part 3 - Simplify the usages for ReflowOutput. r=emilio
- Remove unnecessary calls to ClearSize() after declaring a fresh ReflowOutput.
- Use ReflowOutput::SetSize() in nsTableFrame::FixupPositionedTableParts().

Differential Revision: https://phabricator.services.mozilla.com/D163763
2022-12-03 18:35:43 +00:00