Commit graph

403 commits

Author SHA1 Message Date
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
Matt Woodrow
0ee96e3fa5 Bug 1726291 - Remove FrameLayerBuilder. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D122930
2021-08-23 03:07:31 +00:00
Cosmin Sabou
b53abb88e7 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
94015526e1 Bug 1726291 - Remove FrameLayerBuilder. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D122930
2021-08-20 02:20:39 +00:00
Matt Woodrow
9e61c44d5d 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
Matt Woodrow
d93a690a00 Bug 1724839 - Don't use BasicLayerManager to paint video elements. r=jrmuizel
Depends on D122172

Differential Revision: https://phabricator.services.mozilla.com/D122173
2021-08-10 03:38:41 +00:00
Miko Mynttinen
76c9644105 Bug 1720804 - Part 1: Move majority of the display list code inside mozilla namespace r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D120041
2021-07-19 11:28:20 +00:00
Alexandru Michis
fbd939b860 Backed out 2 changesets (bug 1720804) for causing bustages.
CLOSED TREE

Backed out changeset 5278e88c6d34 (bug 1720804)
Backed out changeset 1acb4ed79b6b (bug 1720804)
2021-07-16 18:10:11 +03:00
Miko Mynttinen
ffc501ddc9 Bug 1720804 - Part 1: Move majority of the display list code inside mozilla namespace r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D120041
2021-07-16 14:36:34 +00:00
Matt Woodrow
195a7e86e5 Bug 1540737 - Implement Paint() for all display items, and nsDisplayList so that we can paint without using FrameLayerBuilder. r=miko
This creates a new leaf nsDisplayWrapper item for consumers that just want an empty wrapper, with a Paint method that asserts. This lets us leaves Paint pure-virtual on nsDisplayWrapList, and lets the compiler force us to implement it for the other leaf types.

It also disables flattening of transform/opacity items. This is because they flatten the items even when used with FlattenedDisplayItemIterator, even though this doesn't add markers to replace them (only FLB does this). We could in theory fix this, but I don't think FLB performance matters much any more.

Differential Revision: https://phabricator.services.mozilla.com/D114676
2021-05-19 01:11:32 +00:00
Csoregi Natalia
1f3f5df2ce Backed out 8 changesets (bug 1540737) for causing graphics crashes in Bug 1711718. a=backout
Backed out changeset 37628894ffd5 (bug 1540737)
Backed out changeset 4b5f53d5127b (bug 1540737)
Backed out changeset a73e041f1f1d (bug 1540737)
Backed out changeset 81f1a9d1a5e1 (bug 1540737)
Backed out changeset b3d0cc460b24 (bug 1540737)
Backed out changeset f929de495b87 (bug 1540737)
Backed out changeset 2f5b8369d061 (bug 1540737)
Backed out changeset b4c93d182ef4 (bug 1540737)
2021-05-18 19:06:20 +03:00
Matt Woodrow
21836c0689 Bug 1540737 - Implement Paint() for all display items, and nsDisplayList so that we can paint without using FrameLayerBuilder. r=miko
This creates a new leaf nsDisplayWrapper item for consumers that just want an empty wrapper, with a Paint method that asserts. This lets us leaves Paint pure-virtual on nsDisplayWrapList, and lets the compiler force us to implement it for the other leaf types.

It also disables flattening of transform/opacity items. This is because they flatten the items even when used with FlattenedDisplayItemIterator, even though this doesn't add markers to replace them (only FLB does this). We could in theory fix this, but I don't think FLB performance matters much any more.

Differential Revision: https://phabricator.services.mozilla.com/D114676
2021-05-17 23:53:45 +00:00
Edgar Chen
d7b0e6c762 Bug 1709959 - Part 2: Remove nsIImageLoadingContent.forceImageState; r=emilio
Depends on D114575

Differential Revision: https://phabricator.services.mozilla.com/D114576
2021-05-07 10:36:40 +00:00
Ting-Yu Lin
a43cae175a Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-26 02:47:40 +00:00