Commit graph

3080 commits

Author SHA1 Message Date
Boris Chiou
5213031e3e Bug 1852323 - Part 1: Update the mapping of geometry box for clip-path. r=emilio
It seems mask-origin/mask-clip/clip-path use different mapping for
geometry-box. We should specialize each one. In this patch, we focus on
clip-path.

Differential Revision: https://phabricator.services.mozilla.com/D188146
2023-10-10 22:00:32 +00:00
Boris Chiou
d451ebbc07 Bug 1856471 - Ignore min-x and min-y when computing view-box (so we return origin box). r=dholbert
Per https://github.com/web-platform-tests/interop/issues/509, we update
the coordinate to match the spec, i.e. When the viewBox includes non-zero min-x
or min-y offsets, this origin box does not actually correspond to the visible
region rectangle defined by the viewBox.
https://drafts.csswg.org/css-box-3/#valdef-box-view-box

Also simplify mask-clip-2.html and mask-origin-3.html so that their
viewBox is anchored at the origin so it is the same as the origin box.

Differential Revision: https://phabricator.services.mozilla.com/D190325
2023-10-10 06:26:51 +00:00
Dan Robertson
9aaa529968 Bug 700533 - Use a fallback size for canvas drawImage if the given image has no intrinsic size (e.g. certain SVG images). r=dholbert
When computing the size of an image for CanvasRenderingContext2D.drawImage(),
use the fallback size of 300 x 150 if the image contains no width or
height. This may occur if the SVG contained no width or height attribute.

Depends on D182487

Differential Revision: https://phabricator.services.mozilla.com/D182488
2023-09-25 16:01:34 +00:00
Andrew Osmond
100e56e28e Bug 1854431 - Extract surface format from GPUVideoImage for VideoFrame. r=media-playback-reviewers,chunmin
This patch allows us to extract a VideoPixelFormat for a VideoFrame when
backed by a GPUVideoImage. This in turn is used by SurfaceFromVideoFrame
for canvas drawing. With a concrete surface format, we can avoid
readbacks with WebGL in particular and dramatically improve performance
in existing demos.

Differential Revision: https://phabricator.services.mozilla.com/D188853
2023-09-21 23:45:16 +00:00
Emilio Cobos Álvarez
6cd30b6fe1 Bug 1853392 - Simplify font-size-adjust: from-font handling. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D188355
2023-09-15 22:17:25 +00:00
Markus Stange
d89c20090c Bug 1843484 - Use EventTarget* instead of nsISupports* for the event target parameter of the EventDispatcher::Dispatch methods. r=smaug
This saves a few QueryInterface calls on the hot path.

Differential Revision: https://phabricator.services.mozilla.com/D186977
2023-08-28 23:38:43 +00:00
Robert Longson
4d21d74dc0 Bug 1849130 - clip-path on SVG content should default to using the stroke-box r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D186475
2023-08-20 07:04:23 +00:00
Andrew Osmond
c0bed56904 Bug 1645555 - Ensure we return surfaces with the proper size with canvas and ImageBitmap. r=gfx-reviewers,lsalzman
In general the canvas size and the surface size should match. However if
we are in the process of updating an OffscreenCanvas's size, it is
possible we may return a surface with a different size if an ImageBitmap
is created, or we draw using, the placeholder HTMLCanvasElement. In that
case we should ensure the surface we yield is the same size as the
current intrinsic size of the HTMLCanvasElement.

Differential Revision: https://phabricator.services.mozilla.com/D186376
2023-08-16 21:01:34 +00:00
Emilio Cobos Álvarez
9c4b9bb36d Bug 1847929 - Don't throttle zero-size in-viewport OOP iframes. r=smaug
Use edge-inclusive intersection like IntersectionObserver, to make
zero-size iframes that are in the viewport considered visible. This is
consistent with how we treat zero-sized in-process iframes.

Differential Revision: https://phabricator.services.mozilla.com/D185808
2023-08-10 09:30:02 +00:00
Jonathan Kew
8b2747cfc4 Bug 1708240 - Implement the from-font keyword for CSS font-size-adjust. r=emilio,devtools-reviewers
Depends on D182450

Differential Revision: https://phabricator.services.mozilla.com/D182451
2023-08-01 12:40:31 +00:00
Noemi Erli
1bf4a97b5d Backed out 5 changesets (bug 1708240) for causing failures in test_css-properties-db.js CLOSED TREE
Backed out changeset 695203c0ff61 (bug 1708240)
Backed out changeset e686e061b8b5 (bug 1708240)
Backed out changeset eac4b88ab28d (bug 1708240)
Backed out changeset e766d2a9180e (bug 1708240)
Backed out changeset 79c808970af5 (bug 1708240)
2023-08-01 15:12:46 +03:00
Jonathan Kew
0677b1aa55 Bug 1708240 - Implement the from-font keyword for CSS font-size-adjust. r=emilio
Depends on D182450

Differential Revision: https://phabricator.services.mozilla.com/D182451
2023-08-01 10:49:58 +00:00
Jan-Niklas Jaeschke
c84288a36d Bug 1838262, part 2: Implemented getComputedStyle() for custom highlight api. r=emilio
This patch introduces functional pseudo parameters, i.e. `::highlight(foo)`,
for `getComputedStyle()`. This required adapting the parse algorithm (`nsCSSPseudoElements::ParsePseudoElement()`) and forwarding the functional pseudo parameter into the style engine.

Differential Revision: https://phabricator.services.mozilla.com/D183773
2023-07-31 13:47:54 +00:00
Emilio Cobos Álvarez
9aa60b822a Bug 1844241 - Remove now-dead graphics glass code. r=tnikkel,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D183942
2023-07-19 12:44:34 +00:00
Razvan Cojocaru
23aa72ebf6 Bug 1841478 - Use strongly-typed coordinates in the BaseSize constructor. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D182654
2023-07-10 02:59:01 +00:00
Andrew Osmond
e8d3205ad7 Bug 1781527 - Part 3. Implement support for surfaces requiring scaling/crop rects with canvas. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D182208
2023-07-10 00:26:47 +00:00
Andrew Osmond
ad9ea73131 Bug 1781527 - Part 1. Add nsLayoutUtils::SurfaceFromVideoFrame. r=gfx-reviewers,chunmin,lsalzman
This patch adds a new method to convert from a VideoFrame to a
SurfaceFromElementResult, which is used by canvas, WebGPU and
ImageBitmap to do necessary conversions to a native surface.

Differential Revision: https://phabricator.services.mozilla.com/D181117
2023-07-10 00:26:47 +00:00
Cristian Tuns
982856d479 Backed out 4 changesets (bug 1781527) for causing Assertion failures in ImageBitmap.cpp CLOSED TREE
Backed out changeset d3ca9e70625b (bug 1781527)
Backed out changeset f6c56b5e6450 (bug 1781527)
Backed out changeset 34d140bc5b99 (bug 1781527)
Backed out changeset f7a2f2b89ba8 (bug 1781527)
2023-07-09 18:53:20 -04:00
Andrew Osmond
8d5b297ee9 Bug 1781527 - Part 3. Implement support for surfaces requiring scaling/crop rects with canvas. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D182208
2023-07-09 21:03:46 +00:00
Andrew Osmond
9774da01c8 Bug 1781527 - Part 1. Add nsLayoutUtils::SurfaceFromVideoFrame. r=gfx-reviewers,chunmin,lsalzman
This patch adds a new method to convert from a VideoFrame to a
SurfaceFromElementResult, which is used by canvas, WebGPU and
ImageBitmap to do necessary conversions to a native surface.

Differential Revision: https://phabricator.services.mozilla.com/D181117
2023-07-09 21:03:46 +00:00
Emilio Cobos Álvarez
bd1b363ff9 Bug 1824886 - Rewrite AnonymousContent to use a shadow tree. r=smaug,TYLin,sfoster,devtools-reviewers,nchevobbe
Subtle things:

 * We now have shadow trees in NAC, inception! Only a couple lines of
   code in the style system had to be changed to match :host rules and
   so properly.

 * Had to make highlighters.css contentaccessible, because otherwise we
   can't load it from the shadow tree. I don't think it's a big deal.

 * I removed some of the code from highlighters.css that claimed that
   stuff inherited from the html element. That's just no longer true.

 * Had to switch from `setAttribute("style", ...)` to `.style = ...;`.
   This is needed because CSSOM from chrome code bypasses CSP (as
   AnonymousContent did), but setAttribute() doesn't, see bug 1424474.

Differential Revision: https://phabricator.services.mozilla.com/D173998
2023-07-09 11:34:05 +00:00
Stanca Serban
15c8455338 Backed out changeset 1c835137f532 (bug 1824886) for causing multiple failures. CLOSED TREE 2023-07-06 02:11:59 +03:00
Emilio Cobos Álvarez
3338831b84 Bug 1824886 - Rewrite AnonymousContent to use a shadow tree. r=smaug,TYLin,sfoster,devtools-reviewers,nchevobbe
Subtle things:

 * We now have shadow trees in NAC, inception! Only a couple lines of
   code in the style system had to be changed to match :host rules and
   so properly.

 * Had to make highlighters.css contentaccessible, because otherwise we
   can't load it from the shadow tree. I don't think it's a big deal.

 * I removed some of the code from highlighters.css that claimed that
   stuff inherited from the html element. That's just no longer true.

 * Had to switch from `setAttribute("style", ...)` to `.style = ...;`.
   This is needed because CSSOM from chrome code bypasses CSP (as
   AnonymousContent did), but setAttribute() doesn't, see bug 1424474.

Differential Revision: https://phabricator.services.mozilla.com/D173998
2023-07-05 21:59:44 +00:00
Cosmin Sabou
fb92d5f42f Backed out 2 changesets (bug 1824886) for causing failures on browser_all_files_referenced.js. CLOSED TREE
Backed out changeset 650ef77d1c4d (bug 1824886)
Backed out changeset 1c835137f532 (bug 1824886)
2023-07-06 00:42:53 +03:00
Emilio Cobos Álvarez
454c0b932e Bug 1824886 - Rewrite AnonymousContent to use a shadow tree. r=smaug,TYLin,sfoster,devtools-reviewers,nchevobbe
Subtle things:

 * We now have shadow trees in NAC, inception! Only a couple lines of
   code in the style system had to be changed to match :host rules and
   so properly.

 * Had to make highlighters.css contentaccessible, because otherwise we
   can't load it from the shadow tree. I don't think it's a big deal.

 * I removed some of the code from highlighters.css that claimed that
   stuff inherited from the html element. That's just no longer true.

 * Had to switch from `setAttribute("style", ...)` to `.style = ...;`.
   This is needed because CSSOM from chrome code bypasses CSP (as
   AnonymousContent did), but setAttribute() doesn't, see bug 1424474.

Differential Revision: https://phabricator.services.mozilla.com/D173998
2023-07-05 18:21:31 +00:00
David Shin
ddab4168b8 Bug 1839550 - Back out increased clamping range. r=dholbert
Was introduced in bug 1831148, regresses the behaviour fixed by
bug 1419225.

Differential Revision: https://phabricator.services.mozilla.com/D182346
2023-06-28 14:59:23 +00:00
Razvan Cojocaru
ebe5d60c5d Bug 1838107 - Use strongly-typed coordinates in the BaseMargin constructor. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D180835
2023-06-23 20:24:53 +00:00
Jonathan Kew
7d0978de1e Bug 1839614 - patch 2 - Move the browser.display.auto_quality_min_font_size pref into StaticPrefs. r=gfx-reviewers,lsalzman
No change in behavior here; this is to prepare for offscreen-canvas workers
to be able to access the pref (following patch).

Depends on D181636

Differential Revision: https://phabricator.services.mozilla.com/D181637
2023-06-23 15:12:19 +00:00
Boris Chiou
97e7095dbd Bug 1581237 - Use <coord-box> as the reference box of the containing block for ray(). r=emilio
So now we use <coord-box> to decide which box we should use. Also, we
have to tweak the calculation of path length to take the top left point
into consideration, for padding-box and content-box. border-box is the
default value, so other tests should cover it.

Differential Revision: https://phabricator.services.mozilla.com/D180397
2023-06-16 22:43:34 +00:00
Boris Chiou
09a891ce2c Bug 1820070 - Part 3: Apply "at <position>" and offset-position to ray function. r=emilio
We apply offset-position and "at <position>" to ray function. However,
only use it on the main thread. For compositor animation, we will finish
it in the following patches.

No need to add tests because there are tests in the WPT upstream repo already:
css/motion/offset-path-ray-011.html
css/motion/offset-path-ray-012.html
css/motion/offset-path-ray-013.html
css/motion/offset-path-ray-014.html

Those tests should cover what we do in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D179861
2023-06-06 21:40:52 +00:00
Emilio Cobos Álvarez
67b6c8dad6 Bug 1833733 - Properly detect page sequence background from FindEffectiveBackgroundColor. r=dholbert
And specify it since we don't look at gradients.

Differential Revision: https://phabricator.services.mozilla.com/D178476
2023-05-30 11:25:36 +00:00
Dan Robertson
afa164a2c1 Bug 1832598 - Default enable smooth scrolls when resisting fingerprinting. r=tjr,botond
When resist fingerprinting is set, ensure that general.smoothScroll has
a resonable default set.

Differential Revision: https://phabricator.services.mozilla.com/D177915
2023-05-22 12:46:47 +00:00
Timothy Nikkel
890a5af8ce Bug 1804872. Handle cases where a scale animation is being run on the compositor when choosing the size to get a decoded image at. r=aosmond
The transform on the stacking context helper has the current scale, not the largest scale of the animation. The scale on the stack context helper holds this value thanks to the logic in ChooseScale.

Before webrender we would just look at the current matrix on the gfx context so it would have final size to draw at for the animation.

I have a fix that also fixes the blob recordings/image region case but it is a little more invasive so I want to land this first. The 3rd reftest will ensure that we can't turn on blob recording without fixing that case.

Differential Revision: https://phabricator.services.mozilla.com/D175627
2023-05-19 16:03:32 +00:00
Cosmin Sabou
b3f3b7cab8 Backed out changeset 12975d519459 (bug 1833733) for causing pagination reftest failures. CLOSED TREE 2023-05-19 17:19:56 +03:00
Emilio Cobos Álvarez
23020ca032 Bug 1833733 - Properly detect page sequence background from FindEffectiveBackgroundColor. r=dholbert
And specify it since we don't look at gradients.

Differential Revision: https://phabricator.services.mozilla.com/D178476
2023-05-19 12:42:22 +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
f8c9ab3ed0 Bug 1831148: Increase clamping range for TransformGfxRectToAncestor. r=emilio
The clamping is overaly pessimistic because the returned `Rect` is still
float-based, and the call site does its own clamping to `nscoord`.
Clamping to float's numeric limit causes significant floating point errors
when clipping the transformed rect, resulting in incorrect transforms.

Differential Revision: https://phabricator.services.mozilla.com/D178081
2023-05-16 14:12:10 +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
Natalia Csoregi
08390dcace Backed out changeset e65029dd25d0 (bug 1832598) for causing failures on test_stickyprefs.js CLOSED TREE 2023-05-13 20:58:34 +03:00
Dan Robertson
0f6d99f928 Bug 1832598 - Default enable smooth scrolls when resisting fingerprinting. r=tjr,botond
When resist fingerprinting is set, ensure that general.smoothScroll has
a resonable default set.

Differential Revision: https://phabricator.services.mozilla.com/D177915
2023-05-13 11:38:12 +00:00
Sam Kravitz
c3506078a8 Bug 1832402 - Use SafeElementAt(0) for the return statement of nsLayoutUtils::GetFrameForPoint. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D177832
2023-05-12 12:37:01 +00:00
Hiroyuki Ikezoe
2b70168145 Bug 1764606 - Expand nsDisplaySolidColor's bounds including the dynamic toolbar area. r=botond,tnikkel,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D168913
2023-05-11 21:17:30 +00:00
Iulian Moraru
1ae79c9eeb Backed out changeset f53842753805 (bug 1804872) for causing reftest failures on 1553571-1.html. CLOSED TREE 2023-05-11 12:12:21 +03:00
Timothy Nikkel
0f39def392 Bug 1804872. Handle cases where a scale animation is being run on the compositor when choosing the size to get a decoded image at. r=aosmond
The transform on the stacking context helper has the current scale, not the largest scale of the animation. The scale on the stack context helper holds this value thanks to the logic in ChooseScale.

Before webrender we would just look at the current matrix on the gfx context so it would have final size to draw at for the animation.

I have a fix that also fixes the blob recordings/image region case but it is a little more invasive so I want to land this first. The 3rd reftest will ensure that we can't turn on blob recording without fixing that case.

Differential Revision: https://phabricator.services.mozilla.com/D175627
2023-05-11 07:58:16 +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