Граф коммитов

78939 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 94699183f2 Bug 1782071 - Invalidate the undisplayed style cache on ContentRemoved. r=boris
See comment. Not sure how easy to test this is in practice since it
involves nodes getting cc'd.

I tried to repro (not too hard) with a crashtest running
SpecialPowers.gc() but that didn't cut it, looks like.

Differential Revision: https://phabricator.services.mozilla.com/D154891
2022-08-17 20:53:23 +00:00
Marian-Vasile Laza ae17d72d9f Backed out changeset cf566ee2f54b (bug 1784335) for causing mochitest failures on test_emulateMedium.html. CLOSED TREE 2022-08-17 22:00:06 +03:00
Emilio Cobos Álvarez 2abe4462f2 Bug 1780650 - Fix assert in SharedStyleSheetCache. r=boris
The document might be gone already if unlinking / cc has happened.

Differential Revision: https://phabricator.services.mozilla.com/D154918
2022-08-17 18:40:08 +00:00
Emilio Cobos Álvarez 9b7c17fcb6 Bug 1785229 - Factor out <select> longest option size computation. r=TYLin
This patch doesn't change behavior but I had it lying around in my
machine, and makes the code a bit easier to follow, so no reason not
to land it IMO.

Differential Revision: https://phabricator.services.mozilla.com/D154886
2022-08-17 18:36:40 +00:00
Emilio Cobos Álvarez d3d0814758 Bug 1777931 - Add a few diagnostic asserts to the sub-resource cache. r=dholbert,layout-reviewers
The only thing that could trigger this is a bogus key, or overriding an
already-loading stylesheet which we didn't correctly coalesce.

Either of those is a bug.

Differential Revision: https://phabricator.services.mozilla.com/D154915
2022-08-17 18:13:25 +00:00
Ting-Yu Lin 27be7e6ac4 Bug 1441048 Part 2 - Use NS_FRAME_HAS_MULTI_COLUMN_ANCESTOR to detect block-fragmented context when marking a line dirty. r=emilio
We can move a float frame into its block parent's PushedFloatsList during column
balancing when it cannot fit in the available block-size.

Later, when the column balancing algorithm reflows the last column in an
unconstrained block-size (in the very last reflow if needed [1]), we have to
reflow the line which contains the float's placeholder. The old code uses
`GetPrevInFlow() || GetNextInFlow()` to detect this scenario, which is
insufficient because the float's block parent might not have any continuation.
This patch uses `NS_FRAME_HAS_MULTI_COLUMN_ANCESTOR` bit to detect this instead.

[1] https://searchfox.org/mozilla-central/rev/5c04fc7016eb7f52cf835d482f1125c8f139c959/layout/generic/nsColumnSetFrame.cpp#1144-1154

Differential Revision: https://phabricator.services.mozilla.com/D154860
2022-08-17 17:18:00 +00:00
Ting-Yu Lin 169f235b0c Bug 1441048 Part 1 - Clarify variable naming and log when we reflow last column with unconstrained available bsize. r=emilio
The naming of `isMeasuringFeasibleContentBSize` and associated log are
misleading. We can change last column's available block-size to be unconstrained
at the end of column balancing [1].

This patch shouldn't change the behavior.

[1] https://searchfox.org/mozilla-central/rev/5c04fc7016eb7f52cf835d482f1125c8f139c959/layout/generic/nsColumnSetFrame.cpp#1144-1154

Differential Revision: https://phabricator.services.mozilla.com/D154859
2022-08-17 17:18:00 +00:00
Emilio Cobos Álvarez fcae7ec6a6 Bug 1784335 - Make print emulation also prefer light color-scheme. r=dholbert
This has the side effect of firing the media query list change event for
printing, but it also improves the print emulation on DevTools, which is
an extra win!

Differential Revision: https://phabricator.services.mozilla.com/D154906
2022-08-17 17:07:25 +00:00
Jonathan Kew 6a602a4a4b Bug 1740530 - patch 10 - Basic reftests for COLRv1 font rendering. r=gfx-reviewers,lsalzman
The font here is a copy of Ahem with a COLRv1 table added, using various of the
COLRv1 paint and transform tables. This is far from an exhaustive set of tests,
but serves to check that basic rendering functionality is working.

The reference file uses CSS blocks filled with gradients, etc, to simulate the
expected rendering of the colored Ahem glyphs. This is unlikely to be a perfect
match in any but the simplest cases, thanks to antialiasing, pixel-rounding, etc.,
but the results are visually indistinguishable, or virtually so, and the amount
of "fuzz" is far less than the differences would be in the case of the COLRv1
glyphs actually being mis-rendered.

(There's a try run *without* the fuzz annotations at
https://treeherder.mozilla.org/jobs?repo=try&revision=4a2e2f7190661614ecddd223dd7178589d0ec5f2
where the results can be viewed in reftest-analyzer.)

We may eventually want to move this or similar tests into WPT, but I'm expecting
more extensive test coverage to be a co-operative effort with the other vendors
who are also implementing support, so this is intended as an interim step just to
ensure we have the basic functionality tested in-tree.

Depends on D154585

Differential Revision: https://phabricator.services.mozilla.com/D154586
2022-08-17 10:59:36 +00:00
Emilio Cobos Álvarez 9897cb6fe5 Bug 1781096 - Fix decoding="sync" when the frame is created after the image attribute. r=tnikkel
The fix is the one line in
nsImageLoadingContent::MaybeForceSyncDecoding, but I added new asserts
that should prevent this from regressing in the future.

Differential Revision: https://phabricator.services.mozilla.com/D154815
2022-08-17 10:10:26 +00:00
Oriol Brufau d437cb23da Bug 1784575 - Let contain-intrinsic-size:auto use last remembered size. r=emilio
This has no effect for now since the last remembered size is never set
(will be implemented in bug 1784577).

Differential Revision: https://phabricator.services.mozilla.com/D154575
2022-08-16 19:55:48 +00:00
Iulian Moraru 04e55eb8e5 Backed out 10 changesets (bug 1740530) for causing reftest failures on colrv1.
Backed out changeset 6f6a55195489 (bug 1740530)
Backed out changeset adc2b1544c4c (bug 1740530)
Backed out changeset cf530e9fea50 (bug 1740530)
Backed out changeset 10b6bafbbd9a (bug 1740530)
Backed out changeset 1c9205a0193f (bug 1740530)
Backed out changeset 06f7b45d044a (bug 1740530)
Backed out changeset 02d6294b7a6d (bug 1740530)
Backed out changeset 673f9010ea75 (bug 1740530)
Backed out changeset 429601610f26 (bug 1740530)
Backed out changeset e6523049b675 (bug 1740530)
2022-08-16 21:28:46 +03:00
Andreas Farre 4b493b6a30 Bug 1595491 - Part 1: Make <embed> and <object> behave more like <iframe>. r=smaug,emilio
By making image loading in <embed> and <object> behave more like when
an <iframe> loads an image, we can make sure that the synthetic
document generated is process switched if the image is cross
origin. This is done by making image loading in nsObjectLoadingContent
follow the document loading path.

We also make sure that we pass the image size back to the embedder
element to not get stuck with the intrinsic size.

To avoid named targeting being able to target these synthetic
documents, as well as showing up in `Window.frames` and being counted
in `Window.length`, we keep a filtered list of non-synthetic browsing
contexts for that use-case.

This feature is controlled by two prefs:

* browser.opaqueResponseBlocking.syntheticBrowsingContext

  This triggers the creation of synthetic documents for images loaded
  in <object> or embed.

* browser.opaqueResponseBlocking.syntheticBrowsingContext.filter

  This turns on the filtering of synthetic browsing contexts in named
  targeting, `Window.length` and `Window.frames`.

Differential Revision: https://phabricator.services.mozilla.com/D148117
2022-08-16 16:42:58 +00:00
Noemi Erli 163b6ffe4a Backed out changeset 9b69d9a0881b (bug 1784575) for causing build bustage in nsStyleStruct.cpp CLOSED TREE 2022-08-16 18:23:50 +03:00
Oriol Brufau 8dd9f29ad0 Bug 1784575 - Let contain-intrinsic-size:auto use last remembered size. r=emilio
This has no effect for now since the last remembered size is never set
(will be implemented in bug 1784577).

Differential Revision: https://phabricator.services.mozilla.com/D154575
2022-08-16 13:07:05 +00:00
Jonathan Kew 8e8d6fbbce Bug 1740530 - patch 10 - Basic reftests for COLRv1 font rendering. r=gfx-reviewers,lsalzman
The font here is a copy of Ahem with a COLRv1 table added, using various of the
COLRv1 paint and transform tables. This is far from an exhaustive set of tests,
but serves to check that basic rendering functionality is working.

The reference file uses CSS blocks filled with gradients, etc, to simulate the
expected rendering of the colored Ahem glyphs. This is unlikely to be a perfect
match in any but the simplest cases, thanks to antialiasing, pixel-rounding, etc.,
but the results are visually indistinguishable, or virtually so, and the amount
of "fuzz" is far less than the differences would be in the case of the COLRv1
glyphs actually being mis-rendered.

(There's a try run *without* the fuzz annotations at
https://treeherder.mozilla.org/jobs?repo=try&revision=4a2e2f7190661614ecddd223dd7178589d0ec5f2
where the results can be viewed in reftest-analyzer.)

We may eventually want to move this or similar tests into WPT, but I'm expecting
more extensive test coverage to be a co-operative effort with the other vendors
who are also implementing support, so this is intended as an interim step just to
ensure we have the basic functionality tested in-tree.

Depends on D154585

Differential Revision: https://phabricator.services.mozilla.com/D154586
2022-08-16 12:48: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
Noemi Erli dd80638572 Backed out 10 changesets (bug 1740530) for causing build bustage in COLRFonts.cpp CLOSED TREE
Backed out changeset afbcf312dbaf (bug 1740530)
Backed out changeset dfcb59684ed2 (bug 1740530)
Backed out changeset cc1a41e1bf44 (bug 1740530)
Backed out changeset 4c3cb20a5203 (bug 1740530)
Backed out changeset 275eb6c4900b (bug 1740530)
Backed out changeset 768df8b3c770 (bug 1740530)
Backed out changeset 4db61d87c172 (bug 1740530)
Backed out changeset a95e62dc9288 (bug 1740530)
Backed out changeset fdc71479fcd9 (bug 1740530)
Backed out changeset 8b26219a4294 (bug 1740530)
2022-08-16 14:31:39 +03: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
Jonathan Kew 44c5fab730 Bug 1740530 - patch 10 - Basic reftests for COLRv1 font rendering. r=gfx-reviewers,lsalzman
The font here is a copy of Ahem with a COLRv1 table added, using various of the
COLRv1 paint and transform tables. This is far from an exhaustive set of tests,
but serves to check that basic rendering functionality is working.

The reference file uses CSS blocks filled with gradients, etc, to simulate the
expected rendering of the colored Ahem glyphs. This is unlikely to be a perfect
match in any but the simplest cases, thanks to antialiasing, pixel-rounding, etc.,
but the results are visually indistinguishable, or virtually so, and the amount
of "fuzz" is far less than the differences would be in the case of the COLRv1
glyphs actually being mis-rendered.

(There's a try run *without* the fuzz annotations at
https://treeherder.mozilla.org/jobs?repo=try&revision=4a2e2f7190661614ecddd223dd7178589d0ec5f2
where the results can be viewed in reftest-analyzer.)

We may eventually want to move this or similar tests into WPT, but I'm expecting
more extensive test coverage to be a co-operative effort with the other vendors
who are also implementing support, so this is intended as an interim step just to
ensure we have the basic functionality tested in-tree.

Depends on D154585

Differential Revision: https://phabricator.services.mozilla.com/D154586
2022-08-16 10:39:53 +00:00
Andi-Bogdan Postelnicu eeac3728d2 Bug 1519636 - Reformat recent changes to the Google coding style. r=glandium
Updated with clang-format version 14.0.5 (taskcluster-DydCt-ryTuKvBYw1HQOugw)
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D154661
2022-08-16 07:08:27 +00:00
Dan Robertson 7460f1a302 Bug 1772859 - Expand visible rect height if dynamic toolbar is collapsed. r=tnikkel
When the dynamic toolbar is completely collapsed and calculating the visible
rect for out of flow content, ensure that the visible rect is expanded to
include the dynamic toolbar max height.

Differential Revision: https://phabricator.services.mozilla.com/D152807
2022-08-16 01:20:05 +00:00
David Shin 05f999536d Bug 1681183: Ignore unwriteable margins user specifies `Margins: None` for printing. r=dholbert,mstriemer
This lets users e.g. print-to-scale where it matters.
Custom margins are still clamped to unwriteable margins, even when all zeroes,
to avoid impacting user-specified & persisted margins.

Differential Revision: https://phabricator.services.mozilla.com/D152900
2022-08-15 19:55:08 +00:00
Butkovits Atila ae6a677e52 Backed out changeset 7538d23ee88e (bug 1767262) for causing failures at content-visibility-081.html. CLOSED TREE 2022-08-15 20:37:49 +03:00
Martin Robinson 1cf715eb0d Bug 1767262 - Lazily layout content that is hidden via `content-visibility: hidden` r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D145949
2022-08-15 16:18:43 +00:00
André Bargull 8c3a6dad95 Bug 1784375: Call LocaleParser::TryParse() with a new, empty Locale. r=platform-i18n-reviewers,dminor
For this to work, we need to add a move-constructor to `Locale`, so that it's
possible to write `loc = {}`. (We need move instead of copy semantics, because
`Locale` has UniquePtr members.) All other `Locale` members except for
`LanguageTagSubtag` already support move semantics. Add copy-constructors to
`LanguageTagSubtag`, so defaulted move-constructor/assignment works for `Locale`.
`LanguageTagSubtag` gets copy- instead of move-constructors, because there isn't
a good reason to disallow copying when moving is allowed.

Also add extra assertions and comments to document the requirement that `TryParse`
expects a new, empty `Locale`.

Differential Revision: https://phabricator.services.mozilla.com/D154496
2022-08-15 15:37:20 +00:00
Frederic Wang 3c65c69660 Bug 1783995 - Remove MathML preference deprecated_menclose_notation_radical. r=emilio
- Remove the preference and corresponding tests.
- nsMathMLmencloseFrame continues to implement the radical notation for
  now, since it's still used by nsMathMLmsqrtFrame. Ideally, we should
  refactor our code so that msqrt/mroot share the same implementation.

Differential Revision: https://phabricator.services.mozilla.com/D154194
2022-08-15 08:55:50 +00:00
Hiroyuki Ikezoe c0d588b85a Bug 1757410 - Ensure MobileViewportManager::UpdateSizesBeforeReflow gets called with up-to-date app-units-per-dev-pixel and CV bounds in UIResolutionChangedInternal. r=emilio
Before this change, BrowserChild::RecvUIResolutionChanged calls
UIResolutionChangedSync first, then updates CV bounds. With the setup, when
UIResolutionChangedInternal gets called, the CV bounds hasn't yet been updated
so that UpdateSizesBeforeReflow doesn't get the proper metrics.

This change consists of three parts;

1) Use UIResolutionChangedSync instead of UIResolutionChanged in
   nsDocumentViewer::SetBoundsWithFlags which calls
   nsPresContext::AppUnitsPerDevPixel which needs to be actually updated by
   UIResolutionChangedSync.
2) Move the UIResolutionChangedSync call in RecvUIResolutionChanged after
   the SetPositionAndSize in the function.
3) Add a UpdateSizesBeforeReflow call in UIResolutionChangedInternal

As for 1), nsDocumentViewer::SetBoundsWithFlags  calls
nsPresContext::AppUnitsPerDevPixel so that UIResolutionChangedInternal needs to be
called synchronously rather than asynchronously.

As for 2), SetPositionAndSize gets called only if the BrowserChild size is changed,
so we need to call UIResolutionChangedSync in other cases.

Differential Revision: https://phabricator.services.mozilla.com/D153687
2022-08-15 03:39:20 +00:00
Ziran Sun e9ef6ad79c Bug 1783611 - Calculate repeat fill count with the contain intrinsic block size if available. r=emilio
When block size is initially indefinite but later was determined by the contain intrinsic
size, we calculate the repeat fill count using the contain intrinsic block size.

Differential Revision: https://phabricator.services.mozilla.com/D153933
2022-08-13 12:27:07 +00:00
Emilio Cobos Álvarez 19634f0148 Bug 1784200 - Try to make xulscroll.html more reliable.
MANUAL PUSH: Trivial test tweak CLOSED TREE
2022-08-13 11:40:29 +02:00
Emilio Cobos Álvarez e6e5d81b1c Bug 1784265 - Remove layout diagnostic code. r=dholbert
Do this separately so that Thunderbird / pine can revert this patch and
find affected elements.

Differential Revision: https://phabricator.services.mozilla.com/D154499
2022-08-12 23:13:42 +00:00
Emilio Cobos Álvarez a7401488af Bug 1784265 - Drop support for flex attribute values other than 0 and 1. r=dholbert,mconley,preferences-reviewers
This makes it easier to get parity between legacy and regular flex
without having to either have tons of arbitrary attribute selectors in
the xul sheet, nor adding attribute lookup hacks to the html flexbox
layout.

Also, reimplement the remaining supported flex attribute-values (0 and 1)
purely in terms of CSS rules in xul.css (regardless of whether
emulate-moz-box-with-flex is enabled).

In practice these are pretty uncommon and the style attribute does the
trick in every case I've tried.

Add a debug-only assertion to ensure we preserve behavior for now.

Add a new test with another behavior difference between flexbox
emulation and old xul layout because the old reftest now passes. Use
replaced elements, which in modern flex are treated differently.

Differential Revision: https://phabricator.services.mozilla.com/D154394
2022-08-12 23:13:41 +00:00
Jonathan Kew 70dfa83f89 Bug 1715546 - Add support for the @font-face src descriptor's tech() function. r=emilio
WPT tests to be added in a following patch.

Differential Revision: https://phabricator.services.mozilla.com/D154399
2022-08-12 22:17:24 +00:00
Marian-Vasile Laza 7f5e2711c6 Backed out 3 changesets (bug 1784265) for causing reftest failures on flex-emulation-1.xhtml. CLOSED TREE
Backed out changeset 415da4b53bdd (bug 1784265)
Backed out changeset e27b21c54b1f (bug 1784265)
Backed out changeset fcb1a053fbe2 (bug 1784265)
2022-08-13 01:14:13 +03:00
Emilio Cobos Álvarez 493306ff8f Bug 1784265 - Remove layout diagnostic code. r=dholbert
Do this separately so that Thunderbird / pine can revert this patch and
find affected elements.

Differential Revision: https://phabricator.services.mozilla.com/D154499
2022-08-12 19:34:35 +00:00
Emilio Cobos Álvarez a2ec6564f3 Bug 1784265 - Drop support for flex attribute values other than 0 and 1. r=dholbert,mconley,preferences-reviewers
This makes it easier to get parity between legacy and regular flex
without having to either have tons of arbitrary attribute selectors in
the xul sheet, nor adding attribute lookup hacks to the html flexbox
layout.

Also, reimplement the remaining supported flex attribute-values (0 and 1)
purely in terms of CSS rules in xul.css (regardless of whether
emulate-moz-box-with-flex is enabled).

In practice these are pretty uncommon and the style attribute does the
trick in every case I've tried.

Add a debug-only assertion to ensure we preserve behavior for now.

Add a new test with another behavior difference between flexbox
emulation and old xul layout because the old reftest now passes. Use
replaced elements, which in modern flex are treated differently.

Differential Revision: https://phabricator.services.mozilla.com/D154394
2022-08-12 19:34:34 +00:00
Ziran Sun d2ec77d012 Bug 1783006 - Calculate the track sizes with the contain intrinsic block size if available. r=emilio,Oriol
When block size is initially indefinite but later was determined by the contain intrinsic
size, we calculate the track sizes using the contain intrinsic block size.

Differential Revision: https://phabricator.services.mozilla.com/D153623
2022-08-12 19:17:17 +00:00
Emilio Cobos Álvarez 83145e5efe Bug 1764640 - Apply implicit containment with container-type. r=dholbert
As per spec. This is a progression but there's still more work to do of
course.

Differential Revision: https://phabricator.services.mozilla.com/D153950
2022-08-12 19:13:13 +00:00
Sandor Molnar 8aada8ee04 Backed out 2 changesets (bug 1595491) for causing build bustages in docshell/base/BrowsingContext.cpp CLOSED TREE
Backed out changeset 3687b7153c44 (bug 1595491)
Backed out changeset 91d87de145e3 (bug 1595491)
2022-08-12 19:50:20 +03:00
Andreas Farre ec3d91462e Bug 1595491 - Part 1: Make <embed> and <object> behave more like <iframe>. r=smaug,emilio
By making image loading in <embed> and <object> behave more like when
an <iframe> loads an image, we can make sure that the synthetic
document generated is process switched if the image is cross
origin. This is done by making image loading in nsObjectLoadingContent
follow the document loading path.

We also make sure that we pass the image size back to the embedder
element to not get stuck with the intrinsic size.

To avoid named targeting being able to target these synthetic
documents, as well as showing up in `Window.frames` and being counted
in `Window.length`, we keep a filtered list of non-synthetic browsing
contexts for that use-case.

This feature is controlled by two prefs:

* browser.opaqueResponseBlocking.syntheticBrowsingContext

  This triggers the creation of synthetic documents for images loaded
  in <object> or embed.

* browser.opaqueResponseBlocking.syntheticBrowsingContext.filter

  This turns on the filtering of synthetic browsing contexts in named
  targeting, `Window.length` and `Window.frames`.

Differential Revision: https://phabricator.services.mozilla.com/D148117
2022-08-12 15:48:26 +00:00
Emilio Cobos Álvarez 5b6ce8a6e2 Bug 1784287 - Use input margin for screen size expansion. r=tnikkel
This is a follow-up to bug 1783500. The existing expansion for the
screen area works great on Windows and so on, but on macOS it can
conceptually cause a menulist to go off-screen, because of this margin
used to move menulists to the left:

  https://searchfox.org/mozilla-central/rev/f655bdf6b4bf01b42609750ab94fc37635397260/toolkit/themes/osx/global/popup.css#85

Instead we should do the same as that bug did, and use the
input-region-margin, which is the amount of space that has no content
(that is, that contains the shadow and so on) and is zero on macOS
(because shadows on macOS are drawn by the OS unlike on Windows /
Linux).

This required extra test changes so it was worth getting it reviewed
separately.

Differential Revision: https://phabricator.services.mozilla.com/D154401
2022-08-12 12:21:59 +00:00
Jonathan Kew efddb23ccc Bug 650372 - Fix legacy tests to account for keywords now being accepted. r=emilio
Depends on D154238

Differential Revision: https://phabricator.services.mozilla.com/D154278
2022-08-12 11:26:00 +00:00
Jonathan Kew 99b0686d3d Bug 650372 - Use the style-system format hint directly in gfx, instead of mapping to a separate internal enum. r=gfx-reviewers,aosmond,lsalzman
Now that the style system has keywords for this, we don't need to define them in gfx
but can just use the enum directly. (No functional change, just code simplification.)

Depends on D154237

Differential Revision: https://phabricator.services.mozilla.com/D154238
2022-08-12 11:25:59 +00:00
Jonathan Kew dfd2d5cda8 Bug 650372 - Accept keywords in addition to strings in the @font-face format() hint function. r=emilio
The CSS Fonts 4 spec requires this, and Safari (at least) has long supported it.

Depends on D154277

Differential Revision: https://phabricator.services.mozilla.com/D154237
2022-08-12 11:25:59 +00:00
Jonathan Kew 4d9597030c Bug 1784058 - Fix up legacy @font-face tests that depended on previous behavior, no longer allowed by the spec. r=emilio
Depends on D154236

Differential Revision: https://phabricator.services.mozilla.com/D154277
2022-08-12 11:25:59 +00:00
Jonathan Kew 781bb53269 Bug 1784058 - Simplify @font-face format hint handling in gfx/thebes, now that it is explicitly only a single hint, not a set. r=gfx-reviewers,aosmond,lsalzman
No functional change, just simplifying the code a bit.

Depends on D154235

Differential Revision: https://phabricator.services.mozilla.com/D154236
2022-08-12 11:25:58 +00:00
Ting-Yu Lin 5cdc372fbb Bug 1784208 Part 3 - Remove checking mIsBalancing in FindBestBalanceBSize(). r=emilio
According to our code coverage, the `if` statement is not reachable via any
tests on our CI.
https://coverage.moz.tools/#view=file&revision=7169b8faa7e112c9c4323753434324b93270fc3d&path=layout%2Fgeneric%2FnsColumnSetFrame.cpp&line=1129

After part 1 & 2, `ReflowColumns` can no longer change
`ReflowConfig::mIsBalancing` from true to false since the `ReflowConfig`
argument is now a `const`. Thus, `mIsBalancing` can never be false in
FindBestBalanceBSize().

Differential Revision: https://phabricator.services.mozilla.com/D154429
2022-08-12 05:04:03 +00:00
Ting-Yu Lin 474a3b0b9e Bug 1784208 Part 2 - Remove nsColumnSetFrame::ReflowChildren. r=emilio
With part 1, ReflowChildren and ReflowColumns are identical except for the
constness of the ReflowConfig. I choose to remove ReflowChildren because
ReflowColumns is more meaningful and keeping it requires less change to the
existing code.

Differential Revision: https://phabricator.services.mozilla.com/D154428
2022-08-12 05:04:02 +00:00
Ting-Yu Lin 1886ac30c5 Bug 1784208 Part 1 - Remove ColumnBalanceData::mHasExcessBSize flag. r=emilio
Remove the flag because it doesn't serve its purpose for current multicolumn
frame hierarchy (i.e. after we introduce ColumnSetWrapperFrame). Nowadays, we
limit the column's block-size with the column container's block-size and
max-block-size in [1]. If the column container has content which exceeds its
max-block-size, we are going to give up column balancing and reach [2] after the
first iteration in the column balancing `while` loop in FindBestBalanceBSize().

However, the flag can still be set in cases with absurd `nscoord` values, so
this patch still changes the behavior. For example, in crashtests with bogus
sizes such as 673770.html,

```
contentBEnd > aReflowInput.mCBReflowInput->ComputedMaxBSize() && aConfig.mIsBalancing
```

can still be true when `contentBEnd` is greater than `nscoord_MAX`. In such
cases, we might spend extra iterations in column balancing. Other than that, our
rendering shouldn't have perceived behavior change.

[1] https://searchfox.org/mozilla-central/rev/6a37a2ab9328bec6a29f688d1b2fba6974d34905/layout/generic/nsBlockFrame.cpp#3834-3844
[2] https://searchfox.org/mozilla-central/rev/6a37a2ab9328bec6a29f688d1b2fba6974d34905/layout/generic/nsColumnSetFrame.cpp#1145-1162,1169-1173

Differential Revision: https://phabricator.services.mozilla.com/D154427
2022-08-12 05:04:02 +00:00
Emilio Cobos Álvarez ff538cab0e Bug 1784349 - Don't use -moz-bool-pref for flexbox -moz-box emulation. r=dholbert,perftest-reviewers,sparky
Use a bool pref media query which allows dynamic changes to get
reflected instantly.

Differential Revision: https://phabricator.services.mozilla.com/D154449
2022-08-11 23:22:52 +00:00