Commit Graph
632 Commits
Author SHA1 Message Date
Daniel Holbert 10725540f6 Bug 2037754: Use 'MakeAndAddRef' instead of 'new' when allocating runnable for nsContentUtils::AddScriptRunner. r=dom-core,smaug
MakeAndAddRef ensures that the freshly-allocated object immediately gets a
refcount of 1 (before it's even passed to AddScriptRunner).  This avoids
several potential footguns that otherwise exist with a zero-refcount
freshly-allocated object.

It also makes the ownership-transfer semantics more clear
(via the already_AddRefed type that it produces) - AddScriptRunner is taking
ownership of the object, rather than using it temporarily while the caller
maintains ownership.

Differential Revision: https://phabricator.services.mozilla.com/D299039
2026-05-07 06:35:57 +00:00
Eugeniusz Lewandowski fc8097fcc3 Bug 1650944 - Remove ReflowInput.h include from nsIFrame.h r=firefox-style-system-reviewers,layout-reviewers,emilio
Removed the Reflow Input in nsIFrame. Added includes for ReflowInput as
necessary in cpp files. Also Forward Declared nsLineLayout in 3 header
files.

Differential Revision: https://phabricator.services.mozilla.com/D298203
2026-05-04 12:06:23 +00:00
Emilio Cobos Álvarez fb61e154ec Bug 2034897 - Fix aspect-ratio handling in ComputeSizeWithIntrinsicDimensions. r=boris,firefox-style-system-reviewers,layout-reviewers,firefox-svg-reviewers,longsonr
Prefer aspect-ratio to the tentative BSize if we have both tentative
ISize and BSize.

Also make auto aspect-ratio handling a bit more explicit.

To prevent some regressions, we need to:

 * Fix size-containment aspect ratio for <embed> (nsSubDocumentFrame).
 * Fix RasterImage::GetIntrinsicRatio with uneven ratios.
 * Avoid SVG root from using the aspect ratio from the viewbox, see
   bug 2035918.

Differential Revision: https://phabricator.services.mozilla.com/D296982
2026-04-29 22:03:12 +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
Emilio Cobos Álvarez ce566fccd9 Bug 2015650 - Minor subdocument frame clean-up. r=layout-reviewers,dholbert
No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D282506
2026-02-10 09:03:20 +00:00
agoloman 9dd12823e7 Revert "Bug 2015650 - Minor subdocument frame clean-up. r=layout-reviewers,dholbert" for causing build bustages @ComputedStyle.h.
This reverts commit 7b1ddeea49.
2026-02-10 02:03:06 +00:00
Emilio Cobos Álvarez 7b1ddeea49 Bug 2015650 - Minor subdocument frame clean-up. r=layout-reviewers,dholbert
No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D282506
2026-02-10 00:30:21 +00:00
Emilio Cobos Álvarez 074c24bf13 Bug 2010601 - Deal with not being the primary subdoc frame in some cases. r=layout-reviewers,dshin
It's very sketchy to propagate state from non-primary frames to the
frameloader.

Differential Revision: https://phabricator.services.mozilla.com/D279298
2026-01-16 14:10:20 +00:00
Emilio Cobos Álvarez 5308a95cb3 Bug 2010601 - Avoid losing track of primary frame in nsSubDocumentFrame::Init. r=layout-reviewers,dshin
When we're replicating a fixed-positioned frame that happens to contain a
subdocument, we were losing track of the primary frame of the element.

The regressing bug made us rely a bit more in the frame tree structure
here (of FindContainerFrame() and such), but this was a pre-existing bug.

This prevents us from clobbering it and is enough to fix the crash and restore
pre-regression behavior, so it is the minimal thing to uplift.

Further clean-ups incoming.

Differential Revision: https://phabricator.services.mozilla.com/D279297
2026-01-16 14:10:16 +00:00
Emilio Cobos Álvarez 78fe751822 Bug 2010056 - Don't return a print pres shell from GetSubDocumentForPainting(). r=layout-reviewers,dshin
Differential Revision: https://phabricator.services.mozilla.com/D278850
2026-01-14 15:35:37 +00:00
pstanciu 13b8ddf5b1 Revert "Bug 2010056 - Add a test. r=layout-reviewers,dshin" for causing bc failures @browser_print_silent_about_config.js
This reverts commit 2b04e154e8.

Revert "Bug 2010056 - Don't return a print pres shell from GetSubDocumentForPainting(). r=layout-reviewers,dshin"

This reverts commit b0bd65d835.
2026-01-14 03:54:28 +00:00
Emilio Cobos Álvarez b0bd65d835 Bug 2010056 - Don't return a print pres shell from GetSubDocumentForPainting(). r=layout-reviewers,dshin
Differential Revision: https://phabricator.services.mozilla.com/D278850
2026-01-14 02:25:16 +00:00
Jonathan Watt 23ba459f0e Bug 2004072. Pass a SizeComputationInput to nsIFrame::ComputeSize etc instead of a gfxContext. r=dshin,layout-reviewers,TYLin
Differential Revision: https://phabricator.services.mozilla.com/D275519
2025-12-09 06:59:12 +00:00
Emilio Cobos Álvarez 18be90ee9f Bug 1994942 - Don't use views for subdocs. r=tnikkel,jwatt
This allows to clean up even more view code, since views now are just a
link between layout and widget at the root and little else (so the whole
view children and so on can go), but that will be done in separate
patches since these patches are not risk-free.

Notable changes:

 * PresShell::WillPaint() now recurses into subdocuments. That was done
   previously via CallWillPaintOnObservers().
 * Embedder frame is tracked directly by nsSubDocumentFrame an
   PresShell. It might be possible to simplify this further,
   if bug 1997773 sticks.

Differential Revision: https://phabricator.services.mozilla.com/D232057
2025-11-11 07:33:01 +00:00
serge-sans-paille 7662b3abdc Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 19:36:01 +00:00
Cristina Horotan 8a1b1970b7 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing Gtest failures on AlreadyAddRefed.h
This reverts commit e98adca292.
2025-10-21 16:16:29 +00:00
serge-sans-paille e98adca292 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 15:05:17 +00:00
Cristina Horotan aab924e90d Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing build bustage at nsBrowserApp.cpp
This reverts commit fd0ffa193c.
2025-10-21 10:44:13 +00:00
serge-sans-paille fd0ffa193c Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 09:44:11 +00:00
Narcis Beleuzu e1e6bbb1c9 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing bustages on Document.cpp
This reverts commit b23c15e927.
2025-10-21 06:34:58 +00:00
serge-sans-paille b23c15e927 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 06:01:36 +00:00
Emilio Cobos Álvarez f786affdc7 Bug 1993353 - Remove view reparenting code that has been disabled forever. r=tnikkel,layout-reviewers
The subdocument frame caller is a no-op because nsSubdocumentFrame is a
leaf frame.

Differential Revision: https://phabricator.services.mozilla.com/D268104
2025-10-09 11:25:27 +00:00
Emilio Cobos Álvarez 764938320e Bug 1993353 - Remove NS_FRAME_HAS_VIEW. r=tnikkel,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D268103
2025-10-09 11:22:21 +00:00
Masayuki Nakano 784537b41e Bug 769207 - part 2: Make nsIFrame use new enum class to receive the type of attribute change r=smaug,dom-core,dshin
`MutationEvent_Bindings::MODIFICATION`,
`MutationEvent_Bindings::ADDITION` and `MutationEvent_Bindings::REMOVAL`
will be removed.  Therefore, we need alternative `enum class` for that.
This patch makes `nsIFrame` and subclasses use the new one.

Differential Revision: https://phabricator.services.mozilla.com/D263053
2025-09-08 00:27:36 +00:00
Timothy Nikkel dbe8df76fa Bug 1984898. Properly update asrs during partial display list update. r=layout-reviewers,emilio
The asr of some display items depends on the items that it contains. When we do a partial display list update and we merge display list we can change what an item contains so we might have to update the asr of the item. UpdateASR performs this work. Unfortunately it doesn't quite do it correctly.

Items whose asr depends on the items that it contains will pick the asr that is an ancestor (or equal to) of the asr of every item that it contains. Additionally we want the asr to be an ancestor (or equal to) the initial asr for the item.

aContainerASR in UpdateASR contains the asr that is an ancestor of every contained item. So UpdateASR assumes that if the item is not a wrap list item that it wants the container asr as its asr. This is not correct. Additionally it assumes that if the item is a wrap list item (or subclass) that it wants the ancestor behaviour for it's asr. This is also not correct. What each display item wants for its asr is more complicated then that.

The pernosco session https://bugzilla.mozilla.org/show_bug.cgi?id=1764863#c1 gives an example of this going wrong. In that case the item is a transform item and it only contains items whose asr is a descendant of the asr of the transform item. The transform item is not a wrap list, so we set the asr of the transform item to a descendant of the asr that it should be.

To fix this we add a function to all display items that opts them in to this ancestor behaviour for asrs if they want it. Some display item types only want the ancestor behaviour in some cases so it can't just be based on the display item type. In making this change we need to look at all display item types that can return non-null from GetChildren (if they can't have children the asr won't change dynamically based on children/the contents). There are four such classes (and then all of their subclasses): nsDisplayContainer, nsDisplayTransform, nsDisplayPerspective, nsDisplayWrapList. In practice nsDisplayContainer is always Ancestor asr (but we still pass Ancestor at all places we create one). nsDisplayPerspective and nsDisplayTransform are always Constant asr. and nsDisplayWrapList has a very large tree of subclasses with various different behaviours of asr.

This also fixes a bug in UpdateASR: if aContainerASR is nothing then we should set the asr to the frame asr rather then early exiting.

Differential Revision: https://phabricator.services.mozilla.com/D262257
2025-08-28 16:33:50 +00:00
David Shin 8090f17c2b Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256290
2025-07-14 21:28:23 +00:00
pstanciu 7a21072acf Revert "Bug 1969305: Adjust WPT expectations. r=layout-reviewers,emilio" for causing failures @ anchor-name-003.html
This reverts commit 5e12720896.

Revert "Bug 1969305: Pass anchor resolution params for maxsize. r=layout-reviewers,emilio"

This reverts commit 27a56d04a1.

Revert "Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio"

This reverts commit 69b2bd0242.

Revert "Bug 1969305: Pass anchor resolution params for margin. r=layout-reviewers,emilio"

This reverts commit 23c707d5a7.

Revert "Bug 1969305: Implement anchor size resolution. r=layout-reviewers,emilio"

This reverts commit c0d1d8808d.
2025-07-12 02:02:55 +00:00
David Shin 69b2bd0242 Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256290
2025-07-11 15:21:42 +00:00
Atila Butkovits 0b2944a3d2 Revert "Bug 1969305: Adjust WPT expectations. r=layout-reviewers,emilio" for causing bustages at GeckoBindings.cpp.
This reverts commit 49a7b8afce.

Revert "Bug 1969305: Pass anchor resolution params for maxsize. r=layout-reviewers,emilio"

This reverts commit 0b615836cf.

Revert "Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio"

This reverts commit 359badb60e.

Revert "Bug 1969305: Pass anchor resolution params for margin. r=layout-reviewers,emilio"

This reverts commit 17f7f64cd8.

Revert "Bug 1969305: Implement anchor size resolution. r=layout-reviewers,emilio"

This reverts commit 47197ef7ab.
2025-07-11 01:18:14 +00:00
David Shin 359badb60e Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256290
2025-07-10 20:58:21 +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
David Shin 8897bdc924 Bug 1971135: Use anchor resolution params in place of position property. r=TYLin
... The full resolution that makes use of additional parameters will follow
shortly.

Differential Revision: https://phabricator.services.mozilla.com/D253175
2025-06-16 20:35:30 +00:00
Emilio Cobos Álvarez 16d564edab Bug 1956128 - Clean up AddCanvasBackgroundColorItem callers. r=dshin
We don't need it for CSS pages because nsPrintedSheetFrame already has
an opaque background[1].

The nsSubDocumentFrame was very complicated, but I think the refactoring
shouldn't change behavior.

[1]: https://searchfox.org/mozilla-central/rev/391e86d9a0d82b655fc0ace236da04949970fb01/layout/style/res/ua.css#332

Differential Revision: https://phabricator.services.mozilla.com/D242841
2025-05-26 10:09:15 +00:00
David Shin 85c922b0dd Bug 1923959: Resolve anchor for (max) sizes. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D240864
2025-04-08 02:29:18 +00:00
Emilio Cobos Álvarez b621f3c6c5 Bug 1955863 - Use parent BC zoom level, not PresContext's. r=dholbert,jwatt
The PresContext zoom also includes the global system zoom, so we
shouldn't double-apply it:

https://searchfox.org/mozilla-central/rev/3a0ca3dffd7ccf74a53066a097739f24dd8b6b10/layout/base/nsPresContext.cpp#995

Also fix DidSetComputedStyle to handle zoom changes (which was caught by
the test), and add a (shared) WPT for that.

Differential Revision: https://phabricator.services.mozilla.com/D242701
2025-03-24 14:26:39 +00:00
Daniel Holbert d721f3c911 Bug 1955476: Propagate css 'zoom' to iframe subdocuments, as a modifier to full-page-zoom. r=emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D242453
2025-03-21 20:57:52 +00:00
Cristian Tuns 92fa13ff53 Backed out changeset 49bf8451f876 (bug 1955476) for causing mochitest failures in test_zoom_restore_bfcache.html CLOSED TREE 2025-03-21 12:42:33 -04:00
Daniel Holbert 9549c54294 Bug 1955476: Propagate css 'zoom' to iframe subdocuments, as a modifier to full-page-zoom. r=emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D242453
2025-03-21 14:26:37 +00:00
Emilio Cobos Álvarez c2506ce4c3 Bug 1935189 - Don't make frame initial viewport size depend on whether it's been laid out. r=dholbert
This is rather tricky / unfortunate, but this is the low-risk fix for
now. The issue is as follows:

When we construct a subdocument frame, we try to show its viewer by
using a script runner which will call ShowViewer().

If ShowViewer() gets called before the subdoc frame gets laid out
(has the NS_FRAME_FIRST_REFLOW bit set), we pick an (arbitrary) 10x10
device pixel size, and initialize the page with that viewport.

Then, eventually, the frame gets laid out to the correct size and fires
a resize event.

If we have container queries around, we need to lay out the page while
styling, which causes the layout to happen before the script blocker
checkpoint, and thus the viewport to get initialized with the right size
to begin with.

This generally shouldn't be bad, but google chat at least seems to rely
on this resize event (and the divergence being caused by container
queries is rather unfortunate).

For now, do the low risk fix of always using the "initial" subdoc frame
size to show the viewer.

We should ideally sort this out better. Even our "good" behavior is
quite bizarre (e.g, I'd expect going from display: block to none to
trigger a resize event and the viewport to go back to 0... As you noted,
chrome's inner layout sizes do change when the frame is display: none).

But it seems worth to land this at least in the interim.

Differential Revision: https://phabricator.services.mozilla.com/D233399
2025-01-07 17:20:31 +00:00
Timothy Nikkel cff3644c55 Bug 1934148. Skip some unneeded HasDocumentLevelListenersForApzAwareEvents calls. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D230630
2024-12-02 08:14:37 +00:00
Otto Länd 8a91f0e2e3 Bug 1933094: apply code formatting via Lando
# ignore-this-changeset
2024-11-25 00:12:01 +00:00
Emilio Cobos Álvarez a74d10350e Bug 1933094 - Move CreateView to nsSubDocumentFrame. r=dholbert
It's the only caller and we don't want to introduce more.

Differential Revision: https://phabricator.services.mozilla.com/D230051
2024-11-25 00:09:12 +00:00
Timothy Nikkel fe0adb47d6 Bug 1931798. Only check for apz listeners when building compositor hit test info. r=gfx-reviewers,nical
The info that we get from the check is only used for compositor hit test info and it takes a decent amount of time to check.

Differential Revision: https://phabricator.services.mozilla.com/D229290
2024-11-20 08:18:42 +00:00
Jonathan Watt 7532be254f Bug 1931736. Add missing braces around if/loop statements in layout/generic/. r=layout-reviewers,emilio
Depends on D229247

Differential Revision: https://phabricator.services.mozilla.com/D229248
2024-11-17 05:03:58 +00:00
Emilio Cobos Álvarez 30929e04af Bug 1930476 - Improve units in nsFrameLoader and related code. r=geckoview-reviewers,jwatt,ohall
Use LayoutDevice units for most these things, since it's what they are:

  ScreenIntSize(presContext->AppUnitsToDevPixels(size.width), ...

Is clearly a lie :)

Differential Revision: https://phabricator.services.mozilla.com/D228586
2024-11-12 15:16:50 +00:00
David Shin e52d21fa25 Bug 1900232: Part 5 - Add anchor-size() to sizing properties. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D222534
2024-09-23 13:58:38 +00:00
Emilio Cobos Álvarez b38e13f7b4 Bug 1917356 - Update remote frame sizes for printing reliably. r=mstange
Printing has a weird code-path which doesn't use the refresh driver.
Update frame sizes explicitly, and remove the hack in
nsDisplayRemote::Paint (which is what probably papered over this).

Differential Revision: https://phabricator.services.mozilla.com/D222372
2024-09-17 16:03:30 +00:00
Emilio Cobos Álvarez b13159498a Bug 1917458 - Only send resizes for remote browsers once per frame. r=mstange,extension-reviewers,tabbrowser-reviewers,dao,robwu
Do it at the same time as UpdateRemoteFrameEffects() (so, intersection
observer timing). Otherwise we can see flickering sometimes from the
resize with the previous patch (and this should be less work, when we
resize).

Non-remote frames need to synchronously communicate their resizes
(because JS could access the frame), but that's not an issue for
remote frames.

This should also more reliably prevent issues like bug 1910887 or like
bug 1764655, and paves the way for fixing bug 1750189 (which stalled) in
a similar fashion.

I tested this in a build with a couple hundred tabs open and it doesn't
measurably show up. I think we should consider not communicating resizes
to background tabs / hidden remote iframes, at least for top levels.

Differential Revision: https://phabricator.services.mozilla.com/D221405
2024-09-15 21:57:40 +00:00
Cristian Tuns 482d5b9f87 Backed out 5 changesets (bug 1917458) for causing wpt failures in no_window_open_when_term_nesting_level_nonzero.window.html CLOSED TREE
Backed out changeset 157eb2ada2ca (bug 1917458)
Backed out changeset 3f6d758ac9c6 (bug 1917458)
Backed out changeset 65384dcd3d9a (bug 1917458)
Backed out changeset e4cca274eb5a (bug 1917458)
Backed out changeset 2b1c3c2aef15 (bug 1917458)
2024-09-14 21:04:04 -04:00
Emilio Cobos Álvarez c35fde2a5b Bug 1917458 - Only send resizes for remote browsers once per frame. r=mstange,extension-reviewers,tabbrowser-reviewers,dao,robwu
Do it at the same time as UpdateRemoteFrameEffects() (so, intersection
observer timing). Otherwise we can see flickering sometimes from the
resize with the previous patch (and this should be less work, when we
resize).

Non-remote frames need to synchronously communicate their resizes
(because JS could access the frame), but that's not an issue for
remote frames.

This should also more reliably prevent issues like bug 1910887 or like
bug 1764655, and paves the way for fixing bug 1750189 (which stalled) in
a similar fashion.

I tested this in a build with a couple hundred tabs open and it doesn't
measurably show up. I think we should consider not communicating resizes
to background tabs / hidden remote iframes, at least for top levels.

Differential Revision: https://phabricator.services.mozilla.com/D221405
2024-09-14 23:05:27 +00:00