Commit Graph
150 Commits
Author SHA1 Message Date
Seva Alipov 4f6218c8fe Bug 1927186: Alternative approach, fixing matrix zoom upsteam. r=firefox-style-system-reviewers,layout-reviewers,emilio,dshin
Differential Revision: https://phabricator.services.mozilla.com/D304905
2026-06-08 19:15:45 +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
Daniel Holbert 0dd8cd9cc0 Bug 1977696: Remove about:config pref layout.css.transform-box-content-stroke.enabled. r=layout-reviewers,emilio
This pref has been enabled-by-default since Firefox 125 in 2024.

Differential Revision: https://phabricator.services.mozilla.com/D257594
2025-07-17 14:28:12 +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
longsonr 843d861ed7 Bug 1929338 - convert more mozilla:clamped to std:clamp r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D228069
2024-11-05 18:52:41 +00:00
Emilio Cobos Álvarez ef48a336e6 Bug 1921049 - Remove some bindgen includes. r=firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D223615
2024-09-25 17:43:28 +00:00
Boris Chiou 2058fd2c6b Bug 1870200 - Break the cyclic dependency if any of the desendants uses non-scaling-stroke. r=emilio
While we are computing the transform-box:stroke-box, for CSS Transforms or
Motion path Transforms, we have to avoid the cyclic dependency not only
for the SVG geometry frame itself, but also for the desendants of
the SVG container frame. Therefore, we just compute its fill-box (i.e.
make |getStroke| be false).

https://github.com/w3c/csswg-drafts/issues/9640

Differential Revision: https://phabricator.services.mozilla.com/D203184
2024-03-04 20:46:05 +00:00
Jonathan Watt 333d99220e Bug 1864396. Prevent transform-box:stroke-box crash. r=emilio,layout-reviewers,longsonr
Differential Revision: https://phabricator.services.mozilla.com/D194712
2023-11-29 00:42:17 +00:00
Boris Chiou 148393c7ad Bug 1852323 - Part 2: Fix the mapping of StyleGeometryBox for mask-clip. r=emilio
Also, drop `nsLayoutUtils::ComputeGeometryBox()` and avoid doing mapping
in `ComputeHTMLReferenceRect()` and `ComputeSVGReferenceRect()`. The
caller should handle it properly because each property uses its own mapping
between CSS box and SVG box.

Note:
1. mask-clip-3.html is copied from mask-clip-1.html but just replace
   css boxes with svg boxes.
2. mask-clip-4.html is copied from mask-clip-2.html but just replace
   svg boxed with css boxes.

Differential Revision: https://phabricator.services.mozilla.com/D188316
2023-10-10 22:00:32 +00:00
Emilio Cobos Álvarez 597328a0ea Bug 1855763 - Use another alias other than moz-transform to test use counters, and other manual fix-ups. r=layout-reviewers,jfkthame
Depends on D189760

Differential Revision: https://phabricator.services.mozilla.com/D189769
2023-10-02 12:36:17 +00:00
Boris Chiou 02fdc23cce Bug 1737209 - Remove unused functions of decomposing 2d and 3d matrix. r=zrhoffman
We keep these functions because we used them for compositor animations before
merging stylo. Now we always use the equivalent rust version for all the
transform interpolation, on both the main thread and the compositor thread.

Differential Revision: https://phabricator.services.mozilla.com/D187072
2023-09-01 20:15:51 +00:00
Boris Chiou dfed422f66 Bug 1819464 - Part 5: Support stroke-box (for SVG layout). r=emilio
We should avoid using the SVG shape elements, e.g. path, polygon, which may not
have simple bounds, and its stroke bbox contribution may depends on the
platform and the drawing backend if using Moz2D. So for now it'd be better to
tweak the tests to use the regular shapes, e.g. rect, circle.

Differential Revision: https://phabricator.services.mozilla.com/D185366
2023-08-22 19:49:04 +00:00
Boris Chiou 8d08f4bb04 Bug 1819464 - Part 4: Support content-box (for CSS layout). r=emilio
Use a valid content-box for CSS layout. For SVG layout, just map it to
fill-box.

Differential Revision: https://phabricator.services.mozilla.com/D185365
2023-08-22 19:49:04 +00:00
Boris Chiou a99db191ab Bug 1819464 - Part 3: Refactor TransformReferenceBox. r=emilio
Refactor this structure to match spec and make us easier to support
content-box and stroke-box.

Basically, the transform-box mapping is:
1. For SVG elements without associated CSS layout box, the used value for
   content-box is fill-box and for border-box is stroke-box.
2. For elements with associated CSS layout box, the used value for fill-box
   is content-box and for stroke-box and view-box is border-box.

So we use the switch-case for each layout, to map the box correctly.

Differential Revision: https://phabricator.services.mozilla.com/D185364
2023-08-22 19:49:03 +00:00
Boris Chiou c691d750aa Bug 1819464 - Part 2: Add content-box and stroke-box into transform-box in style. r=emilio
Also, add a prefernce for content-box and stroke-box. So we have to
define a new type, TransformBox, and let content-box and stroke-box
behind the preference.

Differential Revision: https://phabricator.services.mozilla.com/D185363
2023-08-22 19:49:03 +00:00
Boris Chiou 171a85a858 Bug 1598156 - Part 3: Remove RayReferenceData. r=emilio
I'd like to reuse the data in RayReferenceData for all basic shapes,
so unpack RayReferenceData and drop this struct.

Also, use `nsPoint` for the current position and use `nsRect` for coord-box
because we use these types (i.e. app units) in ShapeUtils.

Besides, remove the usage of Maybe from nsStyleTransformMatrix.h and
just accept the pointer of ResolvedMotionPathData to avoid including
the entire header.

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D181008
2023-06-26 23:23:54 +00:00
Andi-Bogdan Postelnicu d016916382 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
Daniel Holbert 613a6d9698 Bug 1727604: clang-format the layout directory. r=layout-reviewers,TYLin
This patch's changes were automatically generated by this command:
./mach clang-format -p layout/

Differential Revision: https://phabricator.services.mozilla.com/D123662
2021-08-25 19:46:48 +00:00
Emilio Cobos Álvarez 0aa4464b29 Bug 1725207 - Implement transform: perspective(none). r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D123350
2021-08-24 00:32:24 +00:00
longsonr 7b443df78a Bug 1687136 - remove svg.transform-box.enabled pref r=emilio
It's been default true since Firefox 55 via bug 1208550

Differential Revision: https://phabricator.services.mozilla.com/D102093
2021-01-18 08:11:05 +00:00
longsonr ba1943ecf8 Bug 1259861 - Move everything else into the mozilla namespace in layout/svg r=dholbert
Also: adjust include paths to be consistent for usages of various SVG headers,
and remove unused SVG includes (mostly for "utils" classes),
and drop stray "ns" from already-renamed SVG classes in various code comments.

Differential Revision: https://phabricator.services.mozilla.com/D83140
2020-07-11 02:20:20 +00:00
Kagami Sascha Rosylight 0a3a447bbb Bug 1647525 - Use HasAnyStateBits() in remaining layout files r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81230
2020-06-28 01:00:19 +00:00
Hiroyuki Ikezoe aaed0fecf1 Bug 1615194 - Drop the reference box size argument from ProcessRotate and ProcessScale. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D62698
2020-02-13 10:37:12 +00:00
Emilio Cobos Álvarez 7e256153ad Bug 1613490 - Cleanup usage of ReferenceBox. r=miko
To avoid computing transform bounds over and over. It is generally just better.

Replace the various "overridebounds" thingies by using the "fallback" of the
transform-reference-box code which we need anyway.

Differential Revision: https://phabricator.services.mozilla.com/D61890
2020-02-07 13:34:42 +00:00
Boris Chiou 8ce5f48338 Bug 1591629 - Rename mozilla::MotionPathData as mozilla::ResolvedMotionPathData. r=hiro
To avoid the ambiguous name because we also have layers::MotionPathData.

Differential Revision: https://phabricator.services.mozilla.com/D59074
2020-01-08 09:02:38 +00:00
Boris Chiou aecba78933 Bug 1594946 - Treat 3d translate/scale as 2d if the value can be expressed as 2d. r=emilio
For the individual transform properties if they spec a value that can be
expressed as 2d we treat as 2d and serialize accordingly.

We drop Translate::Translate and Scale::Scale, and then rename
Translate::Translate3D as Translate::Translate, Scale::Scale3D as
Scale::Scale. So now we use Translate::Translate to represent 2d and 3d
translation, and Scale::Scale to represent 2d and 3d scale. There is no
difference between 2d and 3d translate/scale in Gecko because we always
convert them into 3d format to layers (on the compositor thread), so this
change makes things simpler.

Differential Revision: https://phabricator.services.mozilla.com/D52931
2019-11-15 19:38:24 +00:00
Boris Chiou 96e211ea69 Bug 1429305 - Refactor for ResolveMotionPath. r=hiro
The current implementation uses nsIFrame to get everything. However, we
want to reuse ResolveMotionPath() on the compositor thread (in the parent
process), so we need to refactor this function to avoid using nsIframe
everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D50009
2019-10-31 20:07:30 +00:00
Boris Chiou 5eed5bf1a8 Bug 1429305 - Move motion path utils into a separate file. r=hiro
I'd like to add some new data type for motion path, so it'd be great to
put all of them in an independent file.

Differential Revision: https://phabricator.services.mozilla.com/D50008
2019-10-31 20:07:28 +00:00
Kristen Wright 94d9650269 Bug 1573268 - remove the varcache definition for svg.transform-box.enabled. r=njn
svg.transform-box.enabled is already a static pref, so I removed the varcache definition of it in nsLayoutUtils.

Differential Revision: https://phabricator.services.mozilla.com/D41850
2019-08-14 00:17:04 +00:00
Boris Chiou a487829816 Bug 1559231 - Support offset-anchor. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39432
2019-08-02 20:12:38 +00:00
Brindusan Cristian 96f88a20df Backed out 2 changesets (bug 1559231) for rusttests build bustages. CLOSED TREE
Backed out changeset d47d9f4bf9a9 (bug 1559231)
Backed out changeset 50f92d01c47a (bug 1559231)
2019-08-02 21:55:37 +03:00
Boris Chiou 7d61452e50 Bug 1559231 - Support offset-anchor. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D39432
2019-08-02 00:43:11 +00:00
Emilio Cobos Álvarez 5b25d03eab Bug 1551991 - Remove legacy transform interpolation code and related dead code. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D31314
2019-05-16 23:25:10 +00:00
Emilio Cobos Álvarez 70bf324c7f Bug 1529002 - Use cbindgen to back CSS transforms. r=boris
This avoids the expensive conversion, and cleans up a bunch.

Further cleanup is possible, just not done yet to avoid growing the patch even
more.

Differential Revision: https://phabricator.services.mozilla.com/D30748
2019-05-16 23:25:10 +00:00
Ciure Andrei 0cdc899d9a Backed out 17 changesets (bug 1550554, bug 1549593, bug 1551991, bug 1529002) for failing multiple Android tests and Windows 2012 bustages CLOSED TREE
Backed out changeset 3bb3fafa62e2 (bug 1551991)
Backed out changeset e12a979de502 (bug 1551991)
Backed out changeset d81e4aa6bf0c (bug 1551991)
Backed out changeset c354e61f2a34 (bug 1551991)
Backed out changeset 37fd602bebc2 (bug 1551991)
Backed out changeset 6c1f00cc30ca (bug 1551991)
Backed out changeset 8a7a0329bdc3 (bug 1551991)
Backed out changeset 86159475ddd3 (bug 1551991)
Backed out changeset 35f91a9ea82a (bug 1529002)
Backed out changeset 6798155e71dc (bug 1529002)
Backed out changeset b90c2cf5b8c5 (bug 1550554)
Backed out changeset 882ab9868c95 (bug 1550554)
Backed out changeset b28a48e2ed21 (bug 1550554)
Backed out changeset 2c31fe18eefd (bug 1550554)
Backed out changeset 57f2362aa538 (bug 1550554)
Backed out changeset 45f171b26e95 (bug 1550554)
Backed out changeset 2e4b263c9410 (bug 1549593)
2019-05-16 13:17:10 +03:00
Emilio Cobos Álvarez e84fe31b98 Bug 1551991 - Remove legacy transform interpolation code and related dead code. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D31314
2019-05-16 03:13:26 +00:00
Emilio Cobos Álvarez 298a40cbea Bug 1529002 - Use cbindgen to back CSS transforms. r=boris
This avoids the expensive conversion, and cleans up a bunch.

Further cleanup is possible, just not done yet to avoid growing the patch even
more.

Differential Revision: https://phabricator.services.mozilla.com/D30748
2019-05-16 16:24:38 +02:00
Emilio Cobos Álvarez 8ba05939c2 Bug 1546697 - Use a consistent style for enum classes in layout. r=dholbert
Per the discussion in:

  https://groups.google.com/d/msg/mozilla.dev.platform/P79pwa9z5m8/iPYPAWPHCAAJ

They should be CamelCase, and that's what most of them already do. This converts
the rest, which are a few.

For the ones that already used `e` or `k` prefixes, I've mostly done:

 for file in $(rg Type::e layout | cut -d : -f 1 | sort | uniq); do sed -i 's#Type::e#Type::#g' $file; done

For the ones that used uppercase, I've removed the prefix if it was already in
the type name, and turn them into CamelCase.

Depends on D28680

Differential Revision: https://phabricator.services.mozilla.com/D28681
2019-04-25 23:03:04 +00:00
Emilio Cobos Álvarez c4cd8ffdb0 Bug 1529058 - Use Rust types from transform-origin / perspective-origin. r=mattwoodrow
Depends on D20381

Differential Revision: https://phabricator.services.mozilla.com/D20382
2019-02-19 20:28:47 +00:00
Sylvestre Ledru e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Emilio Cobos Álvarez 3bbbc43b9b Bug 1505645 - Remove unused outparam from nsStyleTransformMatrix. r=boris
dummy bool is dummy.

Differential Revision: https://phabricator.services.mozilla.com/D11275
2018-11-08 02:25:28 +00:00
Cameron McCormack 8dcdbfc698 Bug 1489529 - Update comments to no longer point to nsRuleNode. r=emilio
There are a few mentions of nsRuleNode left but they are mostly
historical references so it makes sense to keep them.

Differential Revision: https://phabricator.services.mozilla.com/D5505
2018-09-12 17:37:37 +10:00
Boris Chiou 79a500f278 Bug 1429298 - Part 6: Apply motion path transform matrix. r=nical
We implement the layout part of offset-path. Now we don't have
offset-distance, so use the default value, 0%, for it.

Note: rename mCombinedTransform as mIndividualTransform, which only
stores the combined individual transforms. We apply the individual
transforms, motion path transform, and specified transform in
ReadTransforms. (We have to follow the order, so we don't combine the
specified transform in FinishStyle.)

Differential Revision: https://phabricator.services.mozilla.com/D2968
2018-08-21 22:41:44 -07:00
Ting-Yu Lin 46d6c38f7b Bug 1482665 Part 2 - Remove nsPresContext::AppUnitsPerCSSPixel() and replace it with mozilla::AppUnitsPerCSSPixel(). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D3155
2018-08-13 14:29:28 -07:00
Chris Peterson f7ceeaf5cf Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr
2018-06-17 22:43:11 -07:00
Chris Peterson 5d6b16ea3b Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L
2018-04-28 12:50:58 -07:00
Jonathan Watt baf9ffb02b Bug 1448714 - Fix up comments referring to 'style context' after the rename of nsStyleContext. r=emilio 2018-03-23 13:49:21 +00:00
Jonathan Watt a30a336781 Bug 1448337 - Remove RuleNodeCacheConditions.h. r=emilio 2018-03-25 20:43:47 +02:00
Narcis Beleuzu 2764b805dc Backed out 2 changesets (bug 1448294, bug 1448337) for wpt and reftest failures on /mathml
Backed out changeset 180051cfe357 (bug 1448294)
Backed out changeset c188176f3289 (bug 1448337)
2018-03-25 21:31:08 +03:00
Jonathan Watt 0b904e9bb7 Bug 1448337 - Remove RuleNodeCacheConditions.h. r=emilio 2018-03-22 08:44:07 +00:00