Commit graph

416 commits

Author SHA1 Message Date
Ting-Yu Lin
26c26e265f Bug 1888535 Part 4 - Remove DISPLAY_PREF_INLINE_SIZE and DISPLAY_MIN_INLINE_SIZE. r=layout-reviewers,emilio
The two macros are used in `GetPrefISize()` and `GetMinISize()` implementations.
After removing them, we could further simplify some implementations because we
don't need a `result` variable in many cases.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D206316
2024-04-02 19:03:04 +00:00
Emilio Cobos Álvarez
6ec14897b2 Bug 1876541 - Factor out the common-to-all-elements intrinsic size steps to nsIFrame::FinishIntrinsicSize. r=TYLin
No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D199989
2024-02-07 09:39:33 +00:00
Karl Tomlinson
e01e8e4950 Bug 1863846 change VideoInfo::Rotation to non-nested enum class VideoRotation so that it can be forward declared r=aosmond,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D193163
2023-11-29 01:44:45 +00:00
Emilio Cobos Álvarez
5730ee0ca5 Bug 1364813 - Remove IsFrameOfType, use non-virtual checks. r=jwatt
Extend the per-frame-class bit we have to devirtualize IsLeaf to also
devirtualize IsFrameOfType. That is, move this data to FrameClasses.py.

This was done by going through all the frame classes, trying to preserve
behavior.

The only quirky thing is that I had to add two more trivial frame
classes, `nsAudioFrame` for audio elements, and
`nsFloatingFirstLetterFrame`. That's because these frame classes were
returning different answers at runtime, but they do this only on
conditions that trigger frame reconstruction (floating, and being an
audio element, respectively).

Differential Revision: https://phabricator.services.mozilla.com/D194703
2023-11-26 22:17:28 +00:00
Ting-Yu Lin
502271d073 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
d7ae2613a4 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
dce1ef04df 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
52d097c513 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
77ba6cde90 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
59766eeba4 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
18b008f783 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
2d0e69f4a1 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
b9d1536d46 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
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
Chris Peterson
075d5c8197 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
bdb516e93f 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
3c497e61a5 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
3b0ff9fae9 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
f943c5f18d 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
fd54c095de Backed out changeset c3780baf6f24 (bug 1789255) for causing build bustages CLOSED TREE 2022-09-15 21:14:04 +03:00
Martin Robinson
631f1807ed 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
4009825526 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
f48a334b7c 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
c94712abf1 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
49dba20520 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
eb3ea6fefa Backed out changeset 4a697ec6ca7c (bug 1783069) for causing wpt failures CLOSED TREE 2022-08-04 04:45:47 +03:00
Emilio Cobos Álvarez
1c5347dff7 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
f101e2077d 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
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
Emilio Cobos Álvarez
382e03ceaf 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
834cc0ea32 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
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
Boris Chiou
993c59ddf8 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
85598ec315 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
b9a8518c6b 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
55392c2e73 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
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
Andrew Osmond
3a98545701 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
d7a06601a0 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
472ab1dfc3 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
e5f5e8d032 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
4219d92daf 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
7755c29fd8 Bug 1727423 - Remove BasicLayerManager. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D123555
2021-08-25 07:35:17 +00:00
Matt Woodrow
00be3c92c2 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
58591696b7 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
96498febad Backed out changeset b9116770d9b1 (bug 1727172) for causing failures in layout/reftests/bugs/1727172 2021-08-25 04:38:49 +03:00
Matt Woodrow
59e71b6c78 Bug 1727423 - Remove BasicLayerManager. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D123555
2021-08-25 01:04:26 +00:00
Matt Woodrow
e9dfbfe231 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
8db1d46e9f 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
f9c7e2846d 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