Commit graph

1556 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
0dde45fde7 Bug 1786521 - Fix AppearanceValueAffectsFrames. r=TYLin
We had zero tests for this, and when I implemented the optimization to
avoid reframing in most cases I apparently swapped the arguments ;_;

Fix <input type=search> which suffered from the same issue, but we don't
ship by default.

Differential Revision: https://phabricator.services.mozilla.com/D155394
2022-09-12 17:30:16 +00:00
Emilio Cobos Álvarez
3c206e563a Bug 1786147 - Make -webkit-line-clamp create a block container in the appropriate situations. r=dholbert
This is a hack, sorta, similar to Chromium's:

  https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/layout/layout_object.cc;l=356;drc=312b74e385e6aba98ab31fd911238c0dc16b396c

except at computed-value rather than used-value time, because it's both
simpler to reason about and prevents lying in the computed style.

This fixes the relevant test-case, and matches closer what Chromium does,
by not creating anonymous flex items for all elements inside the
line-clamp context.

The behavior change is covered by the test changes. I had to also fix a
couple pre-existing bugs that were caught by tests, now that the
line-clamped block is the -webkit-box-styled element rather than an anonymous
flex item (and thus now had padding).

Depends on D155180

Differential Revision: https://phabricator.services.mozilla.com/D155181
2022-09-07 23:57:18 +00:00
Oriol Brufau
89e5fd03fa Bug 1788128 - Replace CanUseLastRememberedSize with IsContentHidden. r=emilio
nsIFrame::IsContentHidden() is the proper way to check if an element
skips its contents (but just like CanUseLastRememberedSize, it doesn't
support 'content-visibility: auto' yet).

The only difference is that nsIFrame::IsContentHidden() checks that
'content-visibility' applies, but that should always be the case when
there is size containment, so this patch has no effect in practice.

Differential Revision: https://phabricator.services.mozilla.com/D156186
2022-09-01 16:49:14 +00:00
Emilio Cobos Álvarez
83c7733c7c Bug 1786147 - Move line-clamp out of mako and do some adjacent clean-up. r=boris
No behavior change, but simplifies the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D155180
2022-08-31 12:39:19 +00:00
Oriol Brufau
3680dbf555 Bug 1784575 - Let contain-intrinsic-size:auto use last remembered size. r=emilio
This has no effect for now since the last remembered size is never set
(will be implemented in bug 1784577).

Differential Revision: https://phabricator.services.mozilla.com/D154575
2022-08-16 19:55:48 +00:00
Cosmin Sabou
eef1e137ae Backed out 6 changesets (bug 1781046, bug 1784575) for pressumably causing Bug 1784591 and Bug 1784625. a=backout
Backed out changeset 84e0f04d939c (bug 1781046)
Backed out changeset 84228a1b82da (bug 1781046)
Backed out changeset a0574f6e88e1 (bug 1781046)
Backed out changeset 6dc8a407aa1f (bug 1781046)
Backed out changeset a3724891b9c9 (bug 1781046)
Backed out changeset 617f9a8b7512 (bug 1784575)
2022-08-19 23:37:15 +03:00
Emilio Cobos Álvarez
534f39ed75 Bug 1785310 - Remove mozilla/StaticPrefs_layout.h includes from other headers. r=dholbert
Adding layout prefs cause massive rebuilds because of this.

Differential Revision: https://phabricator.services.mozilla.com/D154928
2022-08-17 21:26:36 +00:00
Oriol Brufau
d437cb23da Bug 1784575 - Let contain-intrinsic-size:auto use last remembered size. r=emilio
This has no effect for now since the last remembered size is never set
(will be implemented in bug 1784577).

Differential Revision: https://phabricator.services.mozilla.com/D154575
2022-08-16 19:55:48 +00:00
Noemi Erli
163b6ffe4a Backed out changeset 9b69d9a0881b (bug 1784575) for causing build bustage in nsStyleStruct.cpp CLOSED TREE 2022-08-16 18:23:50 +03:00
Oriol Brufau
8dd9f29ad0 Bug 1784575 - Let contain-intrinsic-size:auto use last remembered size. r=emilio
This has no effect for now since the last remembered size is never set
(will be implemented in bug 1784577).

Differential Revision: https://phabricator.services.mozilla.com/D154575
2022-08-16 13:07:05 +00:00
Emilio Cobos Álvarez
e23e2a0212 Bug 1783934 - Add a chrome-only -moz-box-layout: legacy | flex, and use that to implement flexbox emulation. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D154153
2022-08-10 19:46:37 +00:00
Marian-Vasile Laza
8274331cda Backed out changeset 449fe2d946ea (bug 1783934) for causing mochitest failures on test_animation-type-longhand.html. CLOSED TREE 2022-08-10 19:48:38 +03:00
Emilio Cobos Álvarez
f4206bdde5 Bug 1783934 - Add a chrome-only -moz-box-layout: legacy | flex, and use that to implement flexbox emulation. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D154153
2022-08-10 15:47:41 +00:00
Oriol Brufau
2d0502bbd3 Bug 1783953 - Obey contain-intrinsic-size in multicol containers. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D154169
2022-08-10 14:53:30 +00:00
Emilio Cobos Álvarez
b1a338428d Bug 1778989 - Add some basic container query interleaving. r=dholbert
This is far from fully perfect (specially when dealing with nested
containers, we need to be smarter when updating there), but it's
incremental progress.

Differential Revision: https://phabricator.services.mozilla.com/D151496
2022-08-10 11:28:08 +00:00
Cosmin Sabou
e5288325d4 Backed out 2 changesets (bug 1764640, bug 1778989) for causing container-queries wpt related failures. CLOSED TREE
Backed out changeset e76569e0c380 (bug 1764640)
Backed out changeset ba5c1d50ce72 (bug 1778989)
2022-08-10 02:00:51 +03:00
Emilio Cobos Álvarez
f5cb2931f9 Bug 1778989 - Add some basic container query interleaving. r=dholbert
This is far from fully perfect (specially when dealing with nested
containers, we need to be smarter when updating there), but it's
incremental progress.

Differential Revision: https://phabricator.services.mozilla.com/D151496
2022-08-09 11:44:39 +00:00
Emilio Cobos Álvarez
d98aff87e0 Bug 1781140 - Remove nsTimingFunction and ComputedTimingFunction. r=dshin
They're simple wrappers of StyleComputedTimingFunction so we can remove
them.

Differential Revision: https://phabricator.services.mozilla.com/D152700
2022-07-26 14:49:02 +00:00
Oriol Brufau
90681da9ee Bug 1781097 - Obey contain-intrinsic-size in block containers. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D152666
2022-07-25 16:40:07 +00:00
Oriol Brufau
6ae79ec065 Bug 1780475 - Obey contain-intrinsic-size in ContainSizeAxes. r=emilio
ContainSizeAxes::ContainSize and ContainSizeAxes::ContainIntrinsicSize
were just using 0 for the axes with size containment, now they will take
contain-intrinsic-width and contain-intrinsic-height into account.

The WritingMode parameter is replaced with a nsIFrame from which the
properties are retrieved.

There are various places that aren't currently using these functions, so
the effect of this patch is rather minimal, but some cases of the new
test are now passing.

Differential Revision: https://phabricator.services.mozilla.com/D152355
2022-07-22 14:35:10 +00:00
Boris Chiou
41a30d913e Bug 1293490 - Part 1: Implement CSS animation-composition longhand in style system. r=emilio
This patch introduces animation-composition longhand but we don't
accept it in @keyframe rule for now. I will support this for @keyframe
in the patch series.

Besides, the shorthand of animation doesn't include animation-composition.
The spec issue is: https://github.com/w3c/csswg-drafts/issues/6946.
We could fix the shorthand once this spec issue gets updated.

Differential Revision: https://phabricator.services.mozilla.com/D150299
2022-07-12 19:02:03 +00:00
Ziran Sun
435c380565 Bug 1778062 - Add support for parsing the contain-intrinsic-size property from the CSS-sizing specification. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D151001
2022-07-06 11:47:51 +00:00
Hiroyuki Ikezoe
5e0384e16d Bug 1530253 - Trigger resnap on scroll-snap-type or scroll-snap-align changes. r=emilio
Depends on D148863

Differential Revision: https://phabricator.services.mozilla.com/D148864
2022-07-01 01:35:33 +00:00
Daniel Holbert
96bee9a8c3 Bug 1774879 part 1: Use const ComputedStyle* arg in nsCSSRendering::DetermineBackgroundColor (and in two APIs it depends on). r=emilio
This patch does not change behavior; it's just a const-correctness fix.

This patch was prompted by the desire to add "const" to a ComputedStyle*
variable in a place where we happen to call DetermineBackgroundColor.  To do
that, I have to adjust DetermineBackgroundColor to accept a const arg; and that
in turn requires GetBackgroundColor to accept a const arg, which in turn
requires IsTransparent to require a const arg. Hence, fixing all three APIs
here.

I'll opportunistically add 'const' labels at callsites for these APIs in the
next patch in this series.

Differential Revision: https://phabricator.services.mozilla.com/D149674
2022-06-18 00:45:19 +00:00
Boris Chiou
e9d0888406 Bug 1754897 - Part 2: Support scroll-timeline-axis longhand in style system. r=emilio
Implement "scroll-timeline-axis: block | inline | vertical | horizontal".

Differential Revision: https://phabricator.services.mozilla.com/D146019
2022-06-13 20:26:45 +00:00
Boris Chiou
cd0ef479a6 Bug 1754897 - Part 1: Support scroll-timeline-name longhand in style system. r=emilio
Implement "scroll-timeline-name: none | <custom-ident>".

Differential Revision: https://phabricator.services.mozilla.com/D146018
2022-06-13 20:26:44 +00:00
Emilio Cobos Álvarez
b24faeba30 Bug 1750102 - Add an input-region-margin to widgets, and implement it on Linux. r=stransky
Recompute the input region when resizing the widget and so on, and use
it to check for rollups.

Depends on D148211

Differential Revision: https://phabricator.services.mozilla.com/D148222
2022-06-04 12:41:06 +00:00
Marian-Vasile Laza
30722837c1 Backed out changeset d2838baf9655 (bug 1750102) for causing bustages on nsStyleStruct.cpp by partially backing out 1750102. CLOSED TREE 2022-06-03 20:38:13 +03:00
Emilio Cobos Álvarez
20e06ba3ee Bug 1750102 - Two minor style system fixups.
MANUAL PUSH: Trivial fixup CLOSED TREE
2022-06-03 12:58:31 +02:00
Hiroyuki Ikezoe
43bb9dc340 Bug 1312165 - Parse scroll-snap-stop style and propagate it to APZ side. r=emilio,botond
Depends on D146147

Differential Revision: https://phabricator.services.mozilla.com/D145850
2022-05-31 00:45:11 +00:00
Emilio Cobos Álvarez
99908fb968 Bug 1769512 - Implement overflow-clip-margin: <length>. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D146432
2022-05-23 07:21:43 +00:00
Emilio Cobos Álvarez
d4a37bb799 Bug 1768155 - Allow nsComboboxControlFrame to be laid out without a <button>. r=jwatt
Don't generate the button if the combobox doesn't need it anyways (if the
appearance is not menulist).

While at it improve the code that reframes on appearance: textfield changes so
that it only applies to number inputs as it should.

This shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D145712
2022-05-06 14:45:49 +00:00
Martin Robinson
80da1a7c48 Bug 1765515 - Changes to content-visibility should rebuild the frame r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D144180
2022-04-22 13:06:45 +00:00
Emilio Cobos Álvarez
ee2dcf8fe6 Bug 1765550 - Move transitions and animations to nsStyleUIReset. r=dshin
This mostly just moves code around, to minimize potential behavior
changes. There are some cleanups that we should try to do long term
(this "have an array with n different counts" is pretty weird).

But for now this should unblock people.

The destination struct (nsStyleUIReset) was chosen mainly because it's
small and non-inherited, and it doesn't seem like a worse place than
nsStyleDisplay.

Differential Revision: https://phabricator.services.mozilla.com/D144183
2022-04-20 15:13:54 +00:00
David Shin
ec93876623 Bug 1755565 - Implement contain: inline-size. r=emilio,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D143501
2022-04-19 17:44:16 +00:00
Timothy Nikkel
bf499c693a Bug 1128102. Don't reconstruct the frame for scroll-snap-type or scroll-behavior style changes. r=emilio
The reason these used to have to reconstruct the frame was so that we called nsPresContext::UpdateViewportScrollStylesOverride to update nsPresContext::mViewportScrollStyles. That field used to store scroll behavior and scroll snap data, it no longer does.

In the current code mScrollBehavior is only checked here https://searchfox.org/mozilla-central/rev/d34f9713ae128a3138c2b70d8041a535f1049d19/layout/generic/nsGfxScrollFrame.cpp#8111 before we perform a new scroll, so no change is needed, any future scroll operation will look in the correct place.

scroll-snap-type is similar except we also store it on the FrameMetrics we send to the compositor so we need to repaint.

Note that even currently where we reconstruct the frame on scroll-snap-type changes we do not perform snapping if we move from none to mandatory or proximity, this is bug 1530253. So by removing the frame reconstruct we are not regressing that since we currently fail to do it.

Differential Revision: https://phabricator.services.mozilla.com/D143690
2022-04-14 11:17:50 +00:00
Martin Robinson
b24fd95192 Bug 1761995 - Skip content-visibility: hidden content in display lists r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D142341
2022-04-05 09:10:42 +00:00
Emilio Cobos Álvarez
b9e7c7653c Bug 1762088 - Implement parsing / serialization for container{,-type,-name} CSS properties. r=firefox-style-system-reviewers,layout-reviewers,boris
Two noteworthy details that may seem random otherwise:

 * Moving values around in nsStyleDisplay is needed so that the struct
   remains under the size limit that we have to avoid jumping allocator
   buckets.

 * All the test expectation churn is because tests depend on
   `container-type: size` parsing to run, and now they run. Tests for
   the relevant bits I implemented are passing, with the only exception
   of some `container-name-computed.html` failures which are
   https://github.com/w3c/csswg-drafts/issues/7181. Safari agrees with
   us there.

Other notes when looking at the spec and seeing how it matches the
implementation:

 * `container` syntax doesn't match spec, but matches tests and sanity:
   https://github.com/w3c/csswg-drafts/issues/7180

 * `container-type` syntax doesn't _quite_ match spec, but matches tests
   and I think it's a spec bug since the definition for the missing
   keyword is gone:
   https://github.com/w3c/csswg-drafts/issues/7179

Differential Revision: https://phabricator.services.mozilla.com/D142419
2022-03-31 22:56:20 +00:00
Emilio Cobos Álvarez
9389eefd95 Bug 1759749 - Fix nsStyleOutline::CalcDifference to account for 'outline-style: auto' properly. r=dholbert
Before this patch we might not update the ink overflow areas when
'outline-style' changes without changing outline-width, if
'outline-width' was zero.

This was triggered by TopLevelVideoDocument which had 'outline-width: 0'
which before bug 1759602 disabled the default outline.

The test reliably triggers the assertion (though I think we should try
to avoid the frame property in the common case the inner rect and frame
rects just match, which would remove the assertion...).

Differential Revision: https://phabricator.services.mozilla.com/D141320
2022-03-17 12:16:15 +00:00
Martin Robinson
c7ed0eb07c Bug 1759130 - Add support for parsing the content-visibility property from the CSS Contain specification r=emilio
Add initial parsing support for the CSS `content-visibility` attribute.
Currently these parsed values have no effect.

Differential Revision: https://phabricator.services.mozilla.com/D140834
2022-03-14 12:33:55 +00:00
Ting-Yu Lin
7e0c39f9b1 Bug 1758018 Part 1 - Rename the helpers testing "position:relative" or "position:sticky". r=emilio
`nsIFrame::IsRelativelyPositioned()` tests "position:relative" or
"position:sticky", but its naming is misleading until you've dug into the
underlying helper `nsStyleDisplay::IsRelativelyPositionedStyle()`.

Differential Revision: https://phabricator.services.mozilla.com/D140273
2022-03-04 03:02:00 +00:00
Morgan Reschenberg
618acab981 Bug 1744573: Cache the transform matrix r=eeejay,Jamie
Differential Revision: https://phabricator.services.mozilla.com/D133134
2022-02-25 22:23:13 +00:00
Emilio Cobos Álvarez
b975e781a1 Bug 1747922 - Rename StyleMathMLMathVariant -> StyleMathVariant.
MANUAL PUSH: Trivial rename.
2021-12-30 02:35:54 +01:00
Neia Finch
b205467245 Bug 1747922 - Replace MathML font constants with enum r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D134802
2021-12-30 00:34:27 +00:00
Emilio Cobos Álvarez
6b5a53d800 Bug 1747595 - Make color-adjust an alias of print-color-adjust as per spec. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D134779
2021-12-29 21:52:25 +00:00
Jonathan Kew
828754d158 Bug 1746187 - Implement rendering support for hyphenate-character. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D133890
2021-12-16 13:47:56 +00:00
Marian-Vasile Laza
e3ec8630b1 Backed out 4 changesets (bug 1746187) for causing xpcshell failures on test_css-properties-db.js.
Backed out changeset fa4f889dd0d3 (bug 1746187)
Backed out changeset e3fce2273109 (bug 1746187)
Backed out changeset 6733677ad35d (bug 1746187)
Backed out changeset a4375ff93414 (bug 1746187)
2021-12-16 04:51:13 +02:00
Jonathan Kew
36031468e9 Bug 1746187 - Implement rendering support for hyphenate-character. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D133890
2021-12-15 23:16:49 +00:00
Emily McDonough
c4d55a9374 Bug 1741973 - Implement parsing of the page property r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D131531
2021-12-07 22:11:53 +00:00
Alexandru Michis
40430b0cce Backed out changeset 66eb52e5da74 (bug 1741973) for causing mochitest failures in test_animation-type-longhand.html
CLOSED TREE
2021-12-07 00:01:55 +02:00