22789 Commits

Author SHA1 Message Date
Razvan Cojocaru
1ef41e3cef Bug 1771533 - Audit usages of MatrixScalesDouble to see if using MatrixScales would make more sense in some cases. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D148498
2022-06-08 21:28:30 +00:00
Emilio Cobos Álvarez
e37bef5dfb Bug 1772968 - nsPresContext::UpdateViewportScrollStylesOverride shouldn't look at retargeted elements. r=edgar
This is mostly an optimization since html/body can't have shadow roots
and we only care about comparing the fullscreen element against those,
but it also avoids the problematic codepath.

The issue is that we call UpdateViewportScrollStylesOverride() in the
middle of UnbindFromTree when the DOM state isn't quite stable.

Before my patch, we only did that once the top layer stack is empty, but
now we do it once for each element we pop, which means that we might hit
this codepath with a fullscreen element mid-unbind.

The following patch fixes it but this seemed worth doing anyways.

Differential Revision: https://phabricator.services.mozilla.com/D148491
2022-06-08 11:25:24 +00:00
Hiroyuki Ikezoe
20c48b14ce Bug 1771830 - Apply scroll snap in ScrollToShowRect in PresShell.cpp. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D147708
2022-06-08 02:49:56 +00:00
Emilio Cobos Álvarez
12bd84f0c5 Bug 1773070 - While at it rename ContentStateChanged to ElementStateChanged, and make it take elements. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D148553
2022-06-07 23:09:54 +00:00
Emilio Cobos Álvarez
255763ef57 Bug 1773070 - Unify Gecko and Servo EventState/ElementState bits. r=smaug
Add a dom/base/rust crate called just "dom" where we can share these.

Most of the changes are automatic:

  s/mozilla::EventStates/mozilla::dom::ElementState/
  s/EventStates/ElementState/
  s/NS_EVENT_STATE_/ElementState::/
  s/NS_DOCUMENT_STATE_/DocumentState::/

And so on. This requires a new cbindgen version to avoid ugly casts for
large shifts.

Differential Revision: https://phabricator.services.mozilla.com/D148537
2022-06-07 23:09:52 +00:00
Mats Palmgren
f13e1725b3 Bug 1694056 - Remove (XUL) nsTitleBarFrame since it's no longer used. r=emilio
Depends on D105927

Differential Revision: https://phabricator.services.mozilla.com/D105928
2022-06-07 09:30:03 +00:00
Mats Palmgren
6b2f046373 Bug 1590376 part 1 - Add a XULResizerElement and move all nsResizerFrame's event handling code there. r=ntim,smaug
I'm mostly moving the code verbatim, but I excluded a few bits
that handled resizers inside menu popup frames, e.g.
https://searchfox.org/mozilla-central/rev/7bb1cc6abf6634b2a20f71935e1e519e73402b63/layout/xul/nsResizerFrame.cpp#165-170
I don't think we need that functionallity anymore and it
simplifies the code to exclude it.

Differential Revision: https://phabricator.services.mozilla.com/D105926
2022-06-07 09:30:01 +00:00
Butkovits Atila
e3b4113a08 Backed out 4 changesets (bug 1694056, bug 1590376) for causing failures at test_resizer_ctrl_click.xhtml. CLOSED TREE
Backed out changeset 656906f99173 (bug 1590376)
Backed out changeset 15e9b4e9070c (bug 1694056)
Backed out changeset f137d6e73641 (bug 1590376)
Backed out changeset 00ed65f43cb2 (bug 1590376)
2022-06-07 02:12:40 +03:00
Mats Palmgren
cd6ad5af43 Bug 1694056 - Remove (XUL) nsTitleBarFrame since it's no longer used. r=emilio
Depends on D105927

Differential Revision: https://phabricator.services.mozilla.com/D105928
2022-06-06 20:00:46 +00:00
Mats Palmgren
17801441dd Bug 1590376 part 1 - Add a XULResizerElement and move all nsResizerFrame's event handling code there. r=ntim,smaug
I'm mostly moving the code verbatim, but I excluded a few bits
that handled resizers inside menu popup frames, e.g.
https://searchfox.org/mozilla-central/rev/7bb1cc6abf6634b2a20f71935e1e519e73402b63/layout/xul/nsResizerFrame.cpp#165-170
I don't think we need that functionallity anymore and it
simplifies the code to exclude it.

Differential Revision: https://phabricator.services.mozilla.com/D105926
2022-06-06 20:00:45 +00:00
Daniel Holbert
551202fc84 Bug 1772228: Use BehavesLikeInitialValueOnBlockAxis to broaden/optimimize a check in IntrinsicForAxis, and answer a TODO comment with an explanation in the code. r=emilio
The TODO comment (removed here) was correct that we could/should be using
BehavesLikeInitialValueOnBlockAxis instead of explicit `auto` / `none` checks
(since any value that behaves like the initial value will have the same
semantics as far as this code is concerned, in terms of not generating a
meaningful transferred constraint).

The explicit `minBSize == 0 check **is still needed** (or at least, it's still
useful), since 0 is trivially uninteresting as a transferred lower-bound, so
it's valid to exclude it from the guarded logic (and 0 is not handled by the
BehavesLikeInitialValueOnBlockAxis() check). In this patch I broaden it to
check IsDefinitelyZero(), though (to include 0%).

Hopefully the new code-comment and lambda make these checks clearer.

Differential Revision: https://phabricator.services.mozilla.com/D148079
2022-06-05 21:20:00 +00:00
Jonathan Kew
f117f58e47 Bug 1771609 - patch 3 - Remove nsAutoLineIterator, as it no longer serves any useful purpose since the iterator is owned by the target frame. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D147579
2022-06-03 22:05:36 +00:00
Botond Ballo
84fc68c001 Bug 1771822 - Do not explicitly set dom.visualviewport.enabled in tests. r=tnikkel
This pref is now enabled by default on all platforms.

Depends on D147810

Differential Revision: https://phabricator.services.mozilla.com/D147811
2022-06-02 22:57:56 +00:00
Olli Pettay
7cdb022402 Bug 1771718, let idle period be shorter when frame rate is very high, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D147643
2022-06-02 10:40:54 +00:00
Olli Pettay
1ced6a09b8 Bug 1771718, nsRefreshDriver::IsInHighRateMode(), r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D147642
2022-06-02 10:40:54 +00:00
Timothy Nikkel
4a902a6a3e Bug 1768593. Allow createImageBitmap to work on img elements whose src is an svg with no specified size of resizeWidth/Height is specified. r=lsalzman
Just need to pass the resizeWidth/Height down into SurfaceFromElement for html image elements so we can ask for a frame of the right size from the image.

We have to annotate the new test that I add as failing, just like all of the existing tests, because we don't yet support the resizeQuality option, so we fail that part of the test and pass all of the rest of it. The part that we are fixing here passes.

Differential Revision: https://phabricator.services.mozilla.com/D147739
2022-06-02 03:31:43 +00:00
Razvan Cojocaru
dab093953c Bug 1770289 - Change the return type of nsLayoutUtils::ComputeSuitableScaleForAnimation() to MatrixScales. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D147835
2022-06-01 23:19:11 +00:00
MartinH
1fd222a2a4 Bug 1475232 - When next line selection moves to a valid frame without line iterator, drill down to a first selectable child with line iterator r=emilio
Also bug 1216483

The problem was that GetNextPrevLineFromeBlockFrame correctly identified the target frame but in case it was a flex/grid container, PeekOffsetForLine didn't accept it as a valid result due to a missing line iterator.

There was an existing case which handled this similarly for a table target, drilling into a first child with line iterator, but it was also incomplete.

Extended the drill condition for flex/grid and made the drilling algorithm more robust to be able to also crawl siblings and skip non-selectable elements (e.g. :before pseudoelement, contenteditable="false")

Differential Revision: https://phabricator.services.mozilla.com/D147752
2022-06-01 09:57:46 +00:00
Emilio Cobos Álvarez
27e31ed3bf Bug 1771571 - Fix include header mess between frame constructor / restyle manager. r=layout-reviewers,AlaskanEmily
RestyleManager includes nsPresContextInlines which includes
nsCSSFrameConstructor which includes RestyleManager.

Break the cycle, since turns out the later include is not needed.

Differential Revision: https://phabricator.services.mozilla.com/D147560
2022-05-31 20:07:38 +00:00
Razvan Cojocaru
5370a472bc Bug 1767126 - Change the return type of AnimationValue::GetScaleValue() to MatrixScales. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D147575
2022-05-31 19:55:30 +00:00
Miko Mynttinen
b72bc79cff Bug 1766650 - Store modified frames in display root frame RetainedDisplayListBuilder r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D144889
2022-05-30 14:20:58 +00:00
Emilio Cobos Álvarez
f64de373aa Bug 1381071 - Cache computed styles objects display: none subtrees. r=boris
This reuses our existing undisplayed style generation, but in a
per-document rather than per-nsComputedDOMStyle object, which means that
we can avoid re-resolving styles of elements in display: none subtrees
much more often.

This brings the test-case in the bug to par with other browsers or
better, and is much simpler than the initial approach I tried back in
the day.

Differential Revision: https://phabricator.services.mozilla.com/D147547
2022-05-30 11:08:15 +00:00
Emilio Cobos Álvarez
9c190fff4b Bug 1771564 - Constify ComputedStyle usage in nsComputedDOMStyle. r=dholbert
None of the consumer need to mutate styles, and this saves some ugly
const_casting on the next patch.

Doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D147555
2022-05-28 01:04:24 +00:00
Razvan Cojocaru
331a6fea02 Bug 1767124 - Change the return type of nsLayoutUtils::GetTransformToAncestorScaleExcludingAnimated to MatrixScalesDouble. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D147100
2022-05-27 19:23:33 +00:00
Emilio Cobos Álvarez
c8ac345ec7 Bug 1769774 - Stop tracking painted PresShells. r=mstange
After bug 1730284 we don't use it for throttling iframes, so the only
remaining use the test-only nsIDOMWindowUtils.paintCount. None of the
tests using it rely on the empty transaction case, so we should be able
to just remove this.

Differential Revision: https://phabricator.services.mozilla.com/D146589
2022-05-27 11:12:19 +00:00
Martin Robinson
cac491e1fd Bug 1477524 - Update quotes and counters to work trough the flattened tree r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D146693
2022-05-26 16:12:46 +00:00
Norisz Fay
28db98ade1 Backed out changeset ce66cc2cbb95 (bug 1477524) for causing build bustages on nsCounterManager.cpp CLOSED TREE 2022-05-26 15:24:40 +03:00
Martin Robinson
786890b5c4 Bug 1477524 - Update quotes and counters to work trough the flattened tree r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D146693
2022-05-26 11:15:16 +00:00
Masayuki Nakano
77df1d2c4c Bug 1680611 - part 10: Mark nsFocusManager::Flush*() and their callers in nsFocusManager r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D147069
2022-05-26 04:37:21 +00:00
Masayuki Nakano
c8fc1057ba Bug 1680611 - part 2: Mark nsFocusManager::SetFocusedWindowWithCallerType and its callers in nsFocusManager as MOZ_CAN_RUN_SCRIPT r=smaug,media-playback-reviewers,chunmin
Differential Revision: https://phabricator.services.mozilla.com/D147061
2022-05-26 04:37:18 +00:00
Cristian Tuns
a089bcae5b Backed out changeset ad9f67e4e822 (bug 1769774) for causing build bustages after backout of Bug 1730284 CLOSED TREE 2022-05-25 16:10:08 -04:00
Emilio Cobos Álvarez
7789efcab7 Bug 1769774 - Stop tracking painted PresShells. r=mstange
After bug 1730284 we don't use it for throttling iframes, so the only
remaining use the test-only nsIDOMWindowUtils.paintCount. None of the
tests using it rely on the empty transaction case, so we should be able
to just remove this.

Differential Revision: https://phabricator.services.mozilla.com/D146589
2022-05-25 17:55:17 +00:00
Emilio Cobos Álvarez
24252a4136 Bug 1766093 - Fix a test that was relying on a selectionchange event which no longer happens.
MANUAL PUSH: Trivial fix CLOSED TREE
2022-05-25 19:10:52 +02:00
Dmitrij Feller
ba3866a5fc Bug 370035 - Remove the aWidget parameter from nsIDeviceContextSpec::Init.r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D145841
2022-05-23 19:34:40 +00:00
Razvan Cojocaru
bf44f67f77 Bug 1767123 - Change the return type of nsLayoutUtils::GetTransformToAncestorScale to MatrixScalesDouble. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D146834
2022-05-22 01:36:29 +00:00
Botond Ballo
f9a2c18bfe Bug 1743731 - Disable the 'two layers that scroll together' assertion for content being presented in a paginated way. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D146972
2022-05-21 17:52:44 +00:00
Eitan Isaacson
c42dbc8b0f Bug 1769640 - P1: Cache content AUPDP in DocAccessibleParents. r=morgan,emilio
This change allows us to remove the `FullZoom` multiplier and fixes text
bounds caclulations in a zoomed page.

Testing: The current browser scroll/bounds tests pass (with the
exception of fission iframes which were already broken).

Differential Revision: https://phabricator.services.mozilla.com/D146507
2022-05-20 16:39:50 +00:00
Emilio Cobos Álvarez
7184afff2f Bug 1738380 - Draw backgrounds of iframes with mismatched embedder color schemes. r=jwatt
In the future we might want to (also?) propagate the
prefers-color-scheme on the iframe like we do for the content/chrome
boundary / top browsing contexts, see:

 * https://github.com/w3c/csswg-drafts/issues/4772
 * https://github.com/w3c/csswg-drafts/issues/7213

Differential Revision: https://phabricator.services.mozilla.com/D146162
2022-05-20 15:20:34 +00:00
Razvan Cojocaru
ae67e4906d Bug 1767121 - Change the type of StackingContextHelper::mScale to MatrixScales. r=botond
Fix a minor typo while at it: "Inherrited" -> "Inherited".

Differential Revision: https://phabricator.services.mozilla.com/D146298
2022-05-19 01:45:52 +00:00
Mark Banner
3924c8914b Bug 1769569 - Automatically replace Components.* with C* in sjs files. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D146451
2022-05-18 08:13:19 +00:00
Emilio Cobos Álvarez
46ca6e2712 Bug 1768285 - Clean up unused -moz-window-shadow values. r=jwatt
After bug 1768278 and bug 1767815 there's no more uses of the cliprounded value
in the tree (also it causes artifacts on HiDPI screens so we probably don't
want new usages).

The "sheet" value is unused, and the other values other than "default" and
"none" are only derived from "default", so they don't need to be exposed in the
style system.

Differential Revision: https://phabricator.services.mozilla.com/D145821
2022-05-17 23:20:48 +00:00
Sebastian Hengst
c552340e0c Backed out 5 changesets (bug 1769569) for causing devtools' browser/browser_page_redirection.js to fail. CLOSED TREE
Backed out changeset 66a42eb3a366 (bug 1769569)
Backed out changeset d3cc9629cd9a (bug 1769569)
Backed out changeset edcd3dade079 (bug 1769569)
Backed out changeset 29d8dd058b7a (bug 1769569)
Backed out changeset 1aed34fdf2d3 (bug 1769569)
2022-05-17 19:49:17 +02:00
Mark Banner
4acbb4ff59 Bug 1769569 - Automatically replace Components.* with C* in sjs files. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D146451
2022-05-17 16:50:33 +00:00
Jonathan Watt
1790ea2686 Bug 1769756 - Remove nsIWebBrowserPrint.currentPrintSettings. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D146569
2022-05-17 15:04:24 +00:00
Jonathan Watt
dfbf5426b6 Bug 1769717 - Remove nsPrintJob::GetPrintPreviewPresShell(). r=emilio
Long ago we used to play switcheroo with PresShells in order to print a
document, but for over a decade we've been cloning the document that is
to be printed (bug 487667). Since then we've had no need for this method.

Differential Revision: https://phabricator.services.mozilla.com/D146545
2022-05-17 11:36:20 +00:00
Jonathan Watt
6e5bce1349 Bug 1769388 - Change nsIPrintSettingsService's 'newPrintSettings' attribute to a 'createNewPrintSettings' function. r=bobowen,webdriver-reviewers,whimboo
Having an attribute be a constructor is just...wrong.

Differential Revision: https://phabricator.services.mozilla.com/D146383
2022-05-16 11:50:34 +00:00
Jonathan Watt
41b151c8c4 Bug 1432651 p1 - Pass RemotePrintJobChild through to the places where it's needed. r=emilio
Given how nsIPrintSettings is passed around, stored and copied all over the
place, it's very hard to reason about where and when a RemotePrintJobChild is
needed or valid. This patch avoids all that by explicitly passing a
RemotePrintJobChild when it's needed.

Another reason to make this change is because RemotePrintJobChild really does
not belong on nsIPrintSettings. That interface is supposed to represent a
collection of settings for laying out the document that is to be printed.

Differential Revision: https://phabricator.services.mozilla.com/D146380
2022-05-16 08:38:01 +00:00
Glenn Watson
cebe610723 Bug 1768983 - Add prim flag for checkerboarding backgrounds r=gfx-reviewers,lsalzman
Although not needed right now (checkerboarding backgrounds get
a slice anyway due to being a different scroll root), this will
be important for the upcoming work to make backdrop filter
roots implicit. This allows WR to know when slicing up a content
slice if the prim is relevant to the backdrop root.

Differential Revision: https://phabricator.services.mozilla.com/D146145
2022-05-15 21:54:25 +00:00
Hiroyuki Ikezoe
a457a5cfbb Bug 1766805 - Introduce intended direction and intended end position concepts. r=botond
The scroll snap spec defines the concepts [1]. There are three type of scroll
operations. 1) intended end position, 2) intended direction and end position
and 3) intended direction.

Basically our existing ScrollUnits types correspond;

1) DEVICE_PIXELS, WHOLE => intended end position
2) PAGES => intended direction and end position
3) LINES => intended direction

There are two exceptions in the `intended direction and end position` case,
scrollBy() and fling gestures (on Linux). They were defined as scroll operations
with DEVICE_PIXELS unit, but the spec cleary says they are `intended direction
and end position` operations.

Note that we will also use this information for scroll-snap-stop property since
the properly will only have effects on both 2) and 3) cases.

[1] https://drafts.csswg.org/css-scroll-snap/#scroll-types

Depends on D145190

Differential Revision: https://phabricator.services.mozilla.com/D145191
2022-05-12 12:25:15 +00:00
Norisz Fay
ce587cb281 Backed out 3 changesets (bug 1766805) for causing build bustage on AsyncPanZoomController.cpp CLOSED TREE
Backed out changeset e35a130f2bce (bug 1766805)
Backed out changeset 9f9e2030fbc1 (bug 1766805)
Backed out changeset 898bd12a5da8 (bug 1766805)
2022-05-12 13:42:36 +03:00