Commit Graph

412 Commits

Author SHA1 Message Date
Ting-Yu Lin
b2223c6e75 Bug 1854892 - Simplify nsVideoFrame::Reflow() and switch it to logical coordinates. r=emilio
This patch doesn't change user-perceivable behavior.

Note: before this patch, when reflowing poster frame, `kidReflowInput` was
initialized with `cbSize` of value (0,0), which is bogus since `Size` in
`aMetrics` has not been set yet. Removing the bogus code uncovers the following
assertions

```
ASSERTION: Our containing block must not have unconstrained inline-size!
```

in a 944909-1.html, which has bogus large sizes.

Differential Revision: https://phabricator.services.mozilla.com/D189084
2023-09-26 23:15:35 +00:00
Natalia Csoregi
f46d106ac4 Backed out changeset 5c3542fc6cc8 (bug 1854892) for causing failures on 944909-1.html. CLOSED TREE 2023-09-26 22:56:59 +03:00
Ting-Yu Lin
e1358c7124 Bug 1854892 - Simplify nsVideoFrame::Reflow() and switch it to logical coordinates. r=emilio
This patch doesn't change user-perceivable behavior.

Note: before this patch, when reflowing poster frame, `kidReflowInput` was
initialized with `cbSize` of value (0,0), which is bogus since `Size` in
`aMetrics` has not been set yet. Removing the bogus code uncovers the following
assertions

```
ASSERTION: Our containing block must not have unconstrained inline-size!
```

in a 944909-1.html, which has bogus large sizes.

Differential Revision: https://phabricator.services.mozilla.com/D189084
2023-09-26 18:30:27 +00:00
Emilio Cobos Álvarez
6c324c6d1b Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-07 11:46:30 +00:00
Narcis Beleuzu
33592fec5e Backed out changeset 55052ae7d067 (bug 1851868) for reftest failure on 1153695.html . CLOSED TREE 2023-09-07 02:42:25 +03:00
Emilio Cobos Álvarez
0698c96bd1 Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-06 22:34:35 +00:00
Karl Tomlinson
78009af43e Bug 1822404 don't force image state for poster anonymous img r=emilio
so that the nsImageFrame can release a previous image and trigger reflow on
BROKEN state change when src is removed.

Differential Revision: https://phabricator.services.mozilla.com/D177360
2023-05-10 00:42:47 +00:00
Emilio Cobos Álvarez
09eaf2464a Bug 1824957 - Remove a bunch of now completely dead XUL layout code. r=layout-reviewers,desktop-theme-reviewers,devtools-reviewers,dao,TYLin
And some related tests.

A bunch of -moz-box* properties are web exposed, so I'll file a
follow-up for hiding them.

Differential Revision: https://phabricator.services.mozilla.com/D173819
2023-03-29 21:23:55 +00:00
Emilio Cobos Álvarez
8a25b72558 Bug 1824489 - Remove nsBoxFrame, nsBoxLayout and related code. r=jwatt
We still have some remnants of XUL layout due to nsBox / nsLeafBoxFrame
which XUL trees / nsTextBoxFrame still use.

However all this code can go away before we get rid of those.
nsSplitterFrame was the last thing inheriting from nsBoxFrame.

Differential Revision: https://phabricator.services.mozilla.com/D173601
2023-03-27 23:25:42 +00:00
Robert Longson
099b2e87d0 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
Chris Peterson
d3ac3dae1d Bug 1794164 - Fix C++20 -Wenum-float-conversion warnings in layout-related code. r=dholbert
C++20 deprecates some operations between enums and floating point types:

https://clang.llvm.org/docs/DiagnosticsReference.html#wenum-float-conversion

dom/canvas/CanvasRenderingContext2D.cpp:4743:58 [-Wenum-float-conversion] arithmetic between enumeration type 'VideoInfo::Rotation' and floating-point type 'double'

dom/events/EventStateManager.cpp:6656:35 [-Wenum-float-conversion] comparison of floating-point type 'double' with enumeration type 'mozilla::EventStateManager::(unnamed enum at dom/events/EventStateManager.h:342:3)'
dom/events/EventStateManager.cpp:6664:35 [-Wenum-float-conversion] comparison of floating-point type 'double' with enumeration type 'mozilla::EventStateManager::(unnamed enum at dom/events/EventStateManager.h:342:3)'

gfx/thebes/gfxTextRun.cpp:2992:24 [-Wenum-float-conversion] comparison of floating-point type 'gfxFloat' (aka 'double') with enumeration type 'gfxFontGroup::(unnamed enum at gfx/thebes/gfxTextRun.h:1035:3)'

layout/generic/nsVideoFrame.cpp:59:58 [-Wenum-float-conversion] arithmetic between enumeration type 'VideoInfo::Rotation' and floating-point type 'double'

layout/painting/nsCSSRenderingBorders.cpp:2752:27 [-Wenum-float-conversion] arithmetic between enumeration type 'mozilla::Corner' and floating-point type 'double'

Differential Revision: https://phabricator.services.mozilla.com/D158867
2022-10-28 00:45:25 +00:00
Iulian Moraru
2c2fadc420 Backed out changeset d2d7ad3741c8 (bug 1792414) for causing wpt failures on video-aspect-ratio.html. CLOSED TREE 2022-10-10 23:39:01 +03:00
Emilio Cobos Álvarez
3dadd089e0 Bug 1792414 - Tweak video aspect-ratio behavior with degenerate ratio. r=Oriol
To preserve behavior on degenerate ratios like auto 0/0.

Differential Revision: https://phabricator.services.mozilla.com/D158962
2022-10-10 19:07:54 +00:00
Martin Robinson
009354aed9 Bug 1791760 - Move GetContainSizeAxes to nsIFrame r=emilio
This will allow this function to eventually return an appropriate value
depending on whether or not content is skipped via `content-visibility:
auto`. This change also starts looking directly at whether
content-visibility is skipping content or not, which should make it
compatible with a future `content-visibility: auto` implementation.

Differential Revision: https://phabricator.services.mozilla.com/D157831
2022-09-22 12:11:09 +00:00
Martin Robinson
d6b19e86ff Bug 1789255: Anonymous children of elements with content-visibility should not be skipped for layout r=emilio
Some anonymous children are important for properly sizing their parents
even when those parents hide content with `content-visibility`. This is
shown by regressions in the proper layout of some form elements with
`content-visibility`.

This change introduces a more conservative approach for avoiding layout
of hidden content. Instead of leaving all children dirty during reflow,
reflow anonymous frames (and nsComboboxDisplayFrame, a specialized kind
of anonymous frame). This change means that frames may only lay out some
of their children, so it must introduce some more changes to assumptions
during line layout.

In addition, this change renames `content-visibility` related methods in
nsIFrame in order to make it more obvious what they do.

Differential Revision: https://phabricator.services.mozilla.com/D157306
2022-09-15 20:32:27 +00:00
Norisz Fay
59f059dd2d Backed out changeset c3780baf6f24 (bug 1789255) for causing build bustages CLOSED TREE 2022-09-15 21:14:04 +03:00
Martin Robinson
a7d2990285 Bug 1789255: Anonymous children of elements with content-visibility should not be skipped for layout r=emilio
Some anonymous children are important for properly sizing their parents
even when those parents hide content with `content-visibility`. This is
shown by regressions in the proper layout of some form elements with
`content-visibility`.

This change introduces a more conservative approach for avoiding layout
of hidden content. Instead of leaving all children dirty during reflow,
reflow anonymous frames (and nsComboboxDisplayFrame, a specialized kind
of anonymous frame). This change means that frames may only lay out some
of their children, so it must introduce some more changes to assumptions
during line layout.

In addition, this change renames `content-visibility` related methods in
nsIFrame in order to make it more obvious what they do.

Differential Revision: https://phabricator.services.mozilla.com/D157306
2022-09-15 17:56:42 +00:00
Sandor Molnar
12e1fb9746 Backed out changeset 3a5759eabb42 (bug 1789255) for causing wpt failures in netwerk/protocol/http/Http2Session.cpp CLOSED TREE 2022-09-14 02:01:36 +03:00
Martin Robinson
00e3cff6d7 Bug 1789255: Anonymous children of elements with content-visibility should not be skipped for layout r=emilio
Some anonymous children are important for properly sizing their parents
even when those parents hide content with `content-visibility`. This is
shown by regressions in the proper layout of some form elements with
`content-visibility`.

This change introduces a more conservative approach for avoiding layout
of hidden content. Instead of leaving all children dirty during reflow,
reflow anonymous frames (and nsComboboxDisplayFrame, a specialized kind
of anonymous frame). This change means that frames may only lay out some
of their children, so it must introduce some more changes to assumptions
during line layout.

In addition, this change renames `content-visibility` related methods in
nsIFrame in order to make it more obvious what they do.

Differential Revision: https://phabricator.services.mozilla.com/D156473
2022-09-13 20:01:35 +00:00
Emilio Cobos Álvarez
ad42a88460 Bug 1783069 - Make aspect-ratio work on <video> properly. r=boris,Oriol,layout-reviewers
See https://github.com/w3c/csswg-drafts/issues/7524 for discussion. This
matches what we do for images.

Differential Revision: https://phabricator.services.mozilla.com/D153664
2022-08-16 12:20:15 +00:00
Oriol Brufau
93ea081a0a Bug 1783296 - Obey contain-intrinsic-size in videos. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D153816
2022-08-16 10:59:30 +00:00
Sandor Molnar
506e066f14 Backed out changeset 4a697ec6ca7c (bug 1783069) for causing wpt failures CLOSED TREE 2022-08-04 04:45:47 +03:00
Emilio Cobos Álvarez
f90bc292cd Bug 1783069 - Make aspect-ratio work on <video> properly. r=boris,layout-reviewers
See https://github.com/w3c/csswg-drafts/issues/7524 for discussion. This
matches what we do for images.

Differential Revision: https://phabricator.services.mozilla.com/D153664
2022-08-03 22:24:39 +00:00
Ting-Yu Lin
06ddbd2b65 Bug 1464761 Part 4 - Remove nsReflowStatus::mTruncated bit. r=dholbert
In the description of the mTruncated bit, its purpose is the same as calling
SetInlineLineBreakBeforeAndReset(). We've removed all its usages in previous
patches, so the bit is no longer needed.

Differential Revision: https://phabricator.services.mozilla.com/D151461
2022-07-27 21:55:18 +00:00
Oriol Brufau
58c8eea78c 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
Emilio Cobos Álvarez
2eb18a86f1 Bug 1769869 - Fix nsVideoFrame::ReflowFinished. r=jfkthame
ReflowFinished can happen with scripts allowed, so make sure not to
synchronously fire events, as they can fire content microtasks which
could destroy the frame.

Differential Revision: https://phabricator.services.mozilla.com/D146668
2022-05-18 16:33:25 +00:00
David Shin
2c0b4a9db9 Bug 1765654 - Simplify audio/video frame intrinsic sizing, and make audio elements report the correct intrinsic width during layout r=dholbert,emilio
Fix regression from returning zero intrinsic size for audio
elements, which caused the element to be positioned incorrectly
in absolutely positioned, orthogonal flow situations.

Differential Revision: https://phabricator.services.mozilla.com/D144182
2022-04-27 16:20:05 +00:00
David Shin
fa30ed0b4a 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
Boris Chiou
161886a3c9 Bug 1716612 - Don't apply aspect-ratio to audio elements with controls. r=emilio
There are two cases for the audio element:
1. audio element with "controls" - replaced element (but UA shouldn't
   show the content. Only control UI there.)
2. audio element without "controls" - UA sets display:none.

Per spec, if a replaced element’s only natural dimension is a natural width or
a natural height, giving it a preferred aspect ratio also gives it an natural
height or width, whichever was missing, by transferring the existing size
through the preferred aspect ratio.

However, the audio element (with or without "controls") doesn't have the
natural ratio and natural size. I think it's a special case and it doesn't
make sense to apply aspect-ratio to it even though we specify a width or
height.

Blink and Webkit don't apply aspect-ratio to audio element, either. So
let's follow other browsers' behavior.

Differential Revision: https://phabricator.services.mozilla.com/D118245
2022-04-14 02:10:34 +00:00
Emilio Cobos Álvarez
c796a55f39 Bug 1764224 - Don't assert primary frame on printing docs. r=dholbert
ReplicateFixedFrames can create extra frames, but we don't particularly
care about this.

Differential Revision: https://phabricator.services.mozilla.com/D143471
2022-04-12 21:25:05 +00:00
Olli Pettay
819d673464 Bug 1764212, track reflow callbacks in videoframe, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D143452
2022-04-12 09:07:16 +00:00
Emilio Cobos Álvarez
8b54bd527c Bug 1733232 - Use reflow callbacks to properly track video control / caption sizes. r=dholbert
This ensures not to fire dummy events for measuring reflows for example.

Needs a test, maybe Alwu can help with that?

Differential Revision: https://phabricator.services.mozilla.com/D142897
2022-04-07 21:46:03 +00:00
Martin Robinson
ca0375e365 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
Andrew Osmond
53bce6dc87 Bug 1728903 - Remove plumbing for CanvasLayer and ImageLayer. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D124406
2021-09-18 11:44:51 +00:00
Iulian Moraru
5ec6e27b91 Backed out changeset 089962073382 (bug 1728903) for causing Bp-hybrid bustages on ImageBitmapRenderingContext.cpp. CLOSED TREE 2021-09-03 18:49:32 +03:00
Andrew Osmond
6a5f7ab2d3 Bug 1728903 - Remove plumbing for CanvasLayer and ImageLayer. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D124406
2021-09-03 12:52:05 +00:00
Noemi Erli
6fcdaed88b Backed out changeset f12c6a6cd1a5 (bug 1728903) for causing build bustage in TestTextures.cpp CLOSED TREE 2021-09-03 05:16:59 +03:00
Andrew Osmond
a5a30fa776 Bug 1728903 - Remove plumbing for CanvasLayer and ImageLayer. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D124406
2021-09-03 01:48:17 +00:00
Matt Woodrow
b88ce7b3a4 Bug 1727423 - Remove BasicLayerManager. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D123555
2021-08-25 07:35:17 +00:00
Matt Woodrow
5f215bb867 Bug 1727172 - Use doubles instead of ints when computing video scale for fallback painting. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D123411
2021-08-25 04:18:01 +00:00
criss
715e01a62b Backed out 2 changesets (bug 1727423) for causing build bustages
Backed out changeset 9b2ca95a6527 (bug 1727423)
Backed out changeset 1f01fcbd46a8 (bug 1727423)
2021-08-25 04:41:35 +03:00
criss
daf505a908 Backed out changeset b9116770d9b1 (bug 1727172) for causing failures in layout/reftests/bugs/1727172 2021-08-25 04:38:49 +03:00
Matt Woodrow
03b11c639a Bug 1727423 - Remove BasicLayerManager. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D123555
2021-08-25 01:04:26 +00:00
Matt Woodrow
cc48ecad46 Bug 1727172 - Use doubles instead of ints when computing video scale for fallback painting. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D123411
2021-08-25 00:14:03 +00:00
Brindusan Cristian
111ea1dee9 Backed out 1 changesets (bug 1727172) for causing reftest failures in 1727172-1-ref.html.
CLOSED TREE

Backed out changeset e8046a319fbf (bug 1727172)
2021-08-24 08:49:01 +03:00
Matt Woodrow
f8f50f353e Bug 1727172 - Use doubles instead of ints when computing video scale for fallback painting. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D123411
2021-08-24 04:06:54 +00:00
Matt Woodrow
eea082d1f2 Bug 1726291 - Remove FrameLayerBuilder. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D122930
2021-08-23 03:07:31 +00:00
Cosmin Sabou
1efa0d3a4e Backed out changeset e111894317cc (bug 1726291) for causing assertion failures on WebRenderCommandBuilder.cpp. CLOSED TREE 2021-08-20 06:22:40 +03:00
Matt Woodrow
2a95268df2 Bug 1726291 - Remove FrameLayerBuilder. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D122930
2021-08-20 02:20:39 +00:00
Matt Woodrow
fbd0072a14 Bug 1724839 - Snap transforms for video/canvas painting in the same way that Layer rendering did. r=jrmuizel
This takes the logic used for Image/CanvasLayer::ComputeEffectiveTransforms and uses it to get matching rendering for the Paint path.

Depends on D122175

Differential Revision: https://phabricator.services.mozilla.com/D122176
2021-08-10 03:38:42 +00:00