Commit graph

1390 commits

Author SHA1 Message Date
Bogdan Szekely
ff9c07ed1b Backed out changeset 83c2ba6648ac (bug 1773696) for causing mochitest failures on TimeStamp.h CLOSED TREE 2022-06-30 13:17:39 +03:00
James Graham
926ae49c33 Bug 1773696 - Make wheel event IPC depend on test_events_async_enabled, r=smaug
The `widget->DispatchInputEvent` codepath only works in gecko CI
configurations, so to allow this to be used for e.g. WebDriver
implement a path that doesn't go via the parent process.

Differential Revision: https://phabricator.services.mozilla.com/D150632
2022-06-30 08:34:10 +00:00
Mirko Brodesser
8d922ea417 Bug 1744524: part 1) Add JS code for the "Paste" menupopup to handle ClipboardReadTextPaste events created from the C++ side. r=edgar,Gijs
Implements showing a "Paste" popup at the last mouse position (which
overlapped the browser window) when a certain custom event is received.
Creating and dispatchting that event is implemented in one of the
following parts.

Differential Revision: https://phabricator.services.mozilla.com/D135333
2022-06-16 14:43:40 +00:00
Emilio Cobos Álvarez
10e96ff14e Bug 1773633 - Allow configuring OS zoom behavior. r=tnikkel
This is reasonably straight-forward and should allow us change the
desired behavior on platforms if / when we need.

Also, this adds tests for the feature by using the relevant float pref
(though we can't easily assert the full-zoom behavior because it changes
the size of the reftest window itself).

Differential Revision: https://phabricator.services.mozilla.com/D148902
2022-06-13 11:38:43 +00:00
Csoregi Natalia
b5e25cb54f Backed out 2 changesets (bug 1773633) for causing failures on 1773633.html . CLOSED TREE
Backed out changeset a3f117c8f671 (bug 1773633)
Backed out changeset 5df8a7315ddb (bug 1773633)
2022-06-13 06:05:36 +03:00
Emilio Cobos Álvarez
3514929e87 Bug 1773633 - Allow configuring OS zoom behavior. r=tnikkel
This is reasonably straight-forward and should allow us change the
desired behavior on platforms if / when we need.

Also, this adds tests for the feature by using the relevant float pref
(though we can't easily assert the full-zoom behavior because it changes
the size of the reftest window itself).

Differential Revision: https://phabricator.services.mozilla.com/D148902
2022-06-13 00:05:00 +00:00
Emilio Cobos Álvarez
40b88fe3ed Bug 1773342 - Treat text scale factor as an additional zoom factor, on both GTK and Windows. r=stransky,handyman
GTK already did this, sorta, in a platform-specific way: by hacking in the
scale factor in the CSS screen code. I think this is cleaner, since we have a
centralized place to compute the full zoom in nsPresContext, and that code path
is fairly well tested.

This also would make it trivial to make this text zoom rather than full zoom in
the future, if we wanted (which is probably _technically_ more correct, even
though less pretty less pretty).

This also allows us to remove some hacks where we were undoing the text scale
factor on Linux (since stuff like scrollbars already ignore full zoom).

Depends on D148675

Differential Revision: https://phabricator.services.mozilla.com/D148676
2022-06-09 23:02:11 +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
Masayuki Nakano
0e50e38f5d Bug 1772634 - part 2: Make BrowserParent::RecvSynthesizeNativeTouchPoint relax in the responsive design mode r=smaug
It's used by the DevTools to emulate touch events from mouse events in the
responsive design mode.  Therefore, we should make it accept IPC messages
even if it's not in the automation mode, but it's in the responsive design mode.

Differential Revision: https://phabricator.services.mozilla.com/D148365
2022-06-06 14:30:42 +00:00
Kagami Sascha Rosylight
1991e6336d Bug 1769290 - Part 7: Apply mozilla-js-handle-rooted-typedef against dom/base r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D148280
2022-06-05 20:54:59 +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
Masayuki Nakano
6440fbddc3 Bug 1770133 - part 4: Make IMEContentObserver use dom::Element instead of nsIContent for root r=m_kato
The root is always an element node.  So, it should take and store the root node
as `dom::Element` rather than `nsIContent`.

Differential Revision: https://phabricator.services.mozilla.com/D147135
2022-05-26 07:03:20 +00:00
Makoto Kato
34944ac4bd Bug 1757031 - Don't restore previous viewport when window size isn't same. r=emilio
Fenix's Picture-In-Picture uses full screen mode. So it isn't same as Firefox
Desktop. When exiting full screen, Fenix's window may not same as before
entering full screen.

When this occurs,

1. When device is portrait orientation, user changes to full screen by content
   script.
2. Fenix enters to full screen then orientation is changed to landscape.
3. User changes that device is changed to landscape by hand.
4. Fenix enters PiP mode. Android (Home screen) change to portrait orientation.
   Then PiP window keeps landscape orientation.
5. When exiting PiP, full screen will be exited.
6. Device is landscape (by Step 3.), so Fenix window is landscape. But Gecko
   restores 1.'s viewport by `nsIDOMWindowUtils.exitFullScreen`. So viewport
   becomes portrait orientation size even if window is landscape orientation.

For PiP mode, although nsIDOMWindowUtils.exitFullScreen is used, it doesn't
consider this situation. So I would like to add non-restore option for it.

Differential Revision: https://phabricator.services.mozilla.com/D143992
2022-05-02 13:00:39 +00:00
Lee Salzman
67757dbcb6 Bug 1765912 - Allow different strides in nsDOMWindowUtils::CompareCanvases. r=aosmond
Currently nsDOMWindowUtils::CompareCanvases assumes that if the data from two different
canvases is the same, then the strides of the snapshots should be the same. However, this
is not the case for DrawTargetWebgl, and this can cause various reftests to fail when
accelerated Canvas2D is enabled. All we actually care about is that the size and data
contents is the same, whereas the stride has no consequence other than that we need to
note it for proper traversal of the data for both snapshots.

Depends on D144381

Differential Revision: https://phabricator.services.mozilla.com/D144382
2022-04-26 17:55:33 +00:00
ganguin
f01acfd647 Bug 1661450 - 2/8 Add wayland required code getting opt-out by disabling MOZ_X11 r=stransky,rmader
Ensure shared code with MOZ_X11 and MOZ_WAYLAND remains when MOZ_X11 is
undefined

Depends on D139526

Differential Revision: https://phabricator.services.mozilla.com/D139528
2022-04-20 09:32:07 +00:00
criss
8d62d22b30 Backed out 10 changesets (bug 1661450) for causing build bustages on nsWindow.cpp. CLOSED TREE
Backed out changeset 2c41d82de0c5 (bug 1661450)
Backed out changeset 5f58fcd7ac0b (bug 1661450)
Backed out changeset 62e56a6dcd22 (bug 1661450)
Backed out changeset 4b422ffa729f (bug 1661450)
Backed out changeset 6ca4705772da (bug 1661450)
Backed out changeset 031a6313459f (bug 1661450)
Backed out changeset 06ddf05e97d6 (bug 1661450)
Backed out changeset 4388b1b9aafd (bug 1661450)
Backed out changeset 600f9fd09fa6 (bug 1661450)
Backed out changeset cc5e8efe3ebf (bug 1661450)
2022-04-19 12:25:14 +03:00
ganguin
255b4632d9 Bug 1661450 - 2/8 Add wayland required code getting opt-out by disabling MOZ_X11 r=stransky,rmader
Ensure shared code with MOZ_X11 and MOZ_WAYLAND remains when MOZ_X11 is
undefined

Depends on D139526

Differential Revision: https://phabricator.services.mozilla.com/D139528
2022-04-19 08:35:26 +00:00
Makoto Kato
cf9e71c1d9 Bug 1757431 - Update orientation lock information in browsing context when exiting full screen. r=smaug
Orientation lock allows on full screen state only now. Then if exiting full
screen, orientation lock is unlocked without `screen.orientation.unlock` call.

Although we store orientation lock state in browsing context, we don't clear
when exiting full screen. So when current content is re-activated by switching
tab etc, we try to apply orientation lock state from browsing context
unfortunately.

So we should clear this state when exiting full screen even if `unlock` isn't
called.

Differential Revision: https://phabricator.services.mozilla.com/D142938
2022-04-11 04:11:22 +00:00
Timothy Nikkel
4cac1c7814 Bug 1763121. nsIDOMWindowUtils::sendNativeTouchpadPan should use an observer to notify when the event has been sent to the destination widget. r=hiro
Otherwise we can return without the widget even seeing the event. This is how other test functions are implemented.

We need this to make the test in bug 1757928 pass.

Differential Revision: https://phabricator.services.mozilla.com/D142943
2022-04-05 22:53:35 +00:00
Mike Conley
dd9df31950 Bug 1762653 - Expose EventStateManager::IsKeyboardEventUserActivity on nsIDOMWindowUtils. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D142728
2022-04-04 13:33:35 +00:00
Hiroyuki Ikezoe
1bbdcb99db Bug 1760222 - Add an API for JS to tell whether the document has scroll-linked effects or not. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D141456
2022-03-27 23:40:23 +00:00
Cristian Tuns
f0ccbd470c Backed out 4 changesets (bug 1760222) for causing reftest failures on disable-apz-for-sle-pages.html CLOSED TREE
Backed out changeset 1bf5e1ca3746 (bug 1760222)
Backed out changeset aff6bf37365d (bug 1760222)
Backed out changeset e9b3e3f52aec (bug 1760222)
Backed out changeset f65d2d719277 (bug 1760222)
2022-03-24 02:36:42 -04:00
Hiroyuki Ikezoe
cb22bc42da Bug 1760222 - Add an API for JS to tell whether the document has scroll-linked effects or not. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D141456
2022-03-24 02:20:46 +00:00
Emilio Cobos Álvarez
79f3fe026d Bug 1759962 - Don't return the DPI override in devicePixelRatio to privileged code. r=nchevobbe,webdriver-reviewers
Chrome code should be able to rely on CSS pixel * devicePixelRatio =
device pixel.

Chrome code that cares about the override should use
BrowsingContext.overrideDPPX. We were exposing the no-override value in
WindowUtils but that's unneeded now.

Differential Revision: https://phabricator.services.mozilla.com/D141323
2022-03-23 17:03:04 +00:00
Suhaib Mujahid
1e9dd0d95f Bug 1585439 - Replace assertion of window with innerWindow. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D140700
2022-03-10 03:30:17 +00:00
Daniel Holbert
64d51aae31 Bug 1756269: Add nsIDOMWindowUtils.refreshDriverHasPendingTick API, for use in regression tests. r=smaug
This API essentially reports whether the refresh driver is actively consuming
CPU.  This is intended for use in regression tests for bugs about the refresh
driver needlessly cycling.

Differential Revision: https://phabricator.services.mozilla.com/D139218
2022-02-24 00:30:51 +00:00
Marian-Vasile Laza
74fa81af19 Backed out 2 changesets (bug 1756118, bug 1756269) for causing linting failures.
Backed out changeset a2dbff9da48a (bug 1756118)
Backed out changeset c247f77150c2 (bug 1756269)
2022-02-23 14:55:06 -08:00
Daniel Holbert
946ecff756 Bug 1756269: Add nsIDOMWindowUtils.refreshDriverHasPendingTick API, for use in regression tests. r=smaug
This API essentially reports whether the refresh driver is actively consuming
CPU.  This is intended for use in regression tests for bugs about the refresh
driver needlessly cycling.

Differential Revision: https://phabricator.services.mozilla.com/D139218
2022-02-23 22:19:42 +00:00
Marian-Vasile Laza
e190b0cbf1 Backed out changeset 996c13e87e7c (bug 1756269) for causing mochitest failures on mochitest.ini. CLOSED TREE 2022-02-23 12:12:48 -08:00
Daniel Holbert
552bed68ab Bug 1756269: Add nsIDOMWindowUtils.refreshDriverHasPendingTick API, for use in regression tests. r=smaug
This API essentially reports whether the refresh driver is actively consuming
CPU.  This is intended for use in regression tests for bugs about the refresh
driver needlessly cycling.

Differential Revision: https://phabricator.services.mozilla.com/D139218
2022-02-23 17:56:10 +00:00
Molly Howell
469e3fea9d Bug 1598312 - Support setting a custom resize margin, and apply that to Picture-in-Picture windows. r=cmartin,emilio
Differential Revision: https://phabricator.services.mozilla.com/D138725
2022-02-17 23:18:45 +00:00
Timothy Nikkel
6917164039 Bug 1754662. Refactor nsLayoutUtils::GetPopupFrameForEventCoordinates. r=emilio
This lets us re-use code for bug 1754436.

Differential Revision: https://phabricator.services.mozilla.com/D138392
2022-02-12 09:41:50 +00:00
Cristian Tuns
3c1e2e8eb4 Backed out changeset 3b7f350adae9 (bug 1754662) for causing build bustages on nsLayoutUtils.cpp CLOSED TREE 2022-02-12 04:04:52 -05:00
Timothy Nikkel
a9685a14d8 Bug 1754662. Refactor nsLayoutUtils::GetPopupFrameForEventCoordinates. r=emilio
This lets us re-use code for bug 1754436.

Differential Revision: https://phabricator.services.mozilla.com/D138392
2022-02-12 08:46:47 +00:00
Sylvestre Ledru
98949ee751 Bug 1754767 - Remove duplicate includes r=media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D138441
2022-02-11 10:01:15 +00:00
Emilio Cobos Álvarez
b699e8cdc8 Bug 1753995 - Remove nsDOMWindowUtils.screenPixelsPerCSSPixel. r=smaug,dholbert
For all purposes, this is the same as devicePixelRatio. It was meant to
skip the resistFingerprinting check the devicePixelRatio getter does,
but we do that now using CallerType in WebIDL, so if we cared about that
for these tests (which we don't) we could just do
SpecialPowers.wrap(window).devicePixelRatio.

As a follow-up we could move the NoOverride to window for symmetry. But
it's only used by devtools touch simulation so not sure if worth it.

Differential Revision: https://phabricator.services.mozilla.com/D138021
2022-02-07 18:23:36 +00:00
Emilio Cobos Álvarez
03ade0a619 Bug 1753995 - Move devicePixelRatio getter from outer to inner window. r=smaug
It only pokes at the document's pres context, there's no need to
roundtrip through the outer window. No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D138019
2022-02-07 18:23:35 +00:00
Mike Conley
038eb21cc2 Bug 1749825 - Make it possible for privileged script to opt elements into mousewheel autodir/honour root behaviour. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D135914
2022-01-21 16:12:48 +00:00
Karl Tomlinson
90e86b275d Bug 1719578 use RefCountable for AudioDeviceInfo sets r=padenot
This reduces some copying and fixes a race where AppendElements() could add
the set of devices to the end of mInputDevices and/or mOutputDevices multiple
times if multiple threads were in EnumerateAudioDevices() concurrently.

It will also facilitate passing a thread-safe reference to mInputDevices
and/or mOutputDevices for use within CubebDeviceEnumerator without the need to
hold the Mutex.

Differential Revision: https://phabricator.services.mozilla.com/D134808
2022-01-03 22:38:01 +00:00
Emilio Cobos Álvarez
a6fb6742a0 Bug 1744749 - Add an API to get the real canvas background color. r=jwatt
Extensions are using getComputedStyle(body).backgroundColor, which is
wrong at multiple levels.

The one that matters for this bug is that it is not color-scheme aware.

Depends on D133770

Differential Revision: https://phabricator.services.mozilla.com/D133771
2021-12-16 14:56:32 +00:00
Emilio Cobos Álvarez
c9d4405306 Bug 1743310 - Remove paint flashing. r=gfx-reviewers,lsalzman
It's only meaningfully read in two places:

 * WebRender fallback code.
 * Some widget DEBUG-only code, which on Linux is ifdef'd and on Windows does
   some rather sketchy things like sleeping for 30ms

So I think it should be ok to remove, since WR fallback has its own flashing
pref as well, IIUC.

Differential Revision: https://phabricator.services.mozilla.com/D132313
2021-11-30 11:46:08 +00:00
sotaro
bf1f700f2b Bug 1739621 - Remove remaining UseAdvancedLayers() r=jrmuizel,gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D130467
2021-11-07 12:44:53 +00:00
Emilio Cobos Álvarez
7c1b2c19fd Bug 1738658 - Serialize text-decoration using Servo. r=layout-reviewers,mats
The code introduced in the preceding patch deals with currentColor correctly,
so we should be able to do this now.

This uncovers a bug in the existing serialization code when a non-auto
text-decoration-thickness was used, caught by
css/css-text-decor/parsing/text-decoration-computed.html.

Differential Revision: https://phabricator.services.mozilla.com/D130018
2021-11-02 14:21:38 +00:00
Masayuki Nakano
4341d6fb0c Bug 1455514 - part 1: Add accessors and static helper methods to retrieve nsINode or its concrete classes from EventTarget r=smaug
Currently, checking whether an `EventTarget` is `nsINode` (or its concrete
classes) or not requires a QI, but it's expensive and used a lot while we
handle each event.  Therefore, it'd be nicer for creating a virtual method,
`EventTarget::IsNode()` and use it for the check.

If trying to convert `EventTarget` to a concrete class, it may require two
virtual method calls.  I'm not sure whether it's cheaper than a QI, but at
least, it won't depend on the UUID check order of `QueryInterface()` when
multiple interfaces are implemented.

Differential Revision: https://phabricator.services.mozilla.com/D129781
2021-11-02 13:03:43 +00:00
Steve Fink
436b3f12a2 Bug 1732161 - Track CCReason for all cycle collections (replacing ccType) r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D126395
2021-10-14 18:15:40 +00:00
criss
0ecd4a450b Backed out 6 changesets (bug 1732161) for causing linux base toolchains bustages. CLOSED TREE
Backed out changeset 766a1bc74001 (bug 1732161)
Backed out changeset aed63de28354 (bug 1732161)
Backed out changeset 98eaff0d5124 (bug 1732161)
Backed out changeset 76c21ec8ffb6 (bug 1732161)
Backed out changeset 49dcac272f05 (bug 1732161)
Backed out changeset 67d81f8f413e (bug 1732161)
2021-10-14 05:38:08 +03:00
Steve Fink
0457cf4744 Bug 1732161 - Track CCReason for all cycle collections (replacing ccType) r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D126395
2021-10-13 22:32:59 +00:00
Emilio Cobos Álvarez
4f8856c545 Bug 1730503 - Make RDM force Android-style scrollbars better. r=mstange,devtools-backward-compat-reviewers,nchevobbe
There are a few bits that still don't work with this patch but will with the
following patches.

Differential Revision: https://phabricator.services.mozilla.com/D128083
2021-10-12 09:21:17 +00:00
Masayuki Nakano
36e01178c8 Bug 1729115 - part 1: Make it possible tests to retrieve a node being observed by IMEContentObserver for the following changes r=smaug
For making it possible to check whether an expected node is observed by
`IMEContentObserver` or not in mochitest, the following patches need this API.

Differential Revision: https://phabricator.services.mozilla.com/D127610
2021-10-12 04:41:13 +00:00
Narcis Beleuzu
a92083a114 Backed out 6 changesets (bug 1732161) for build bustages on nsCycleCollectionParticipant.h CLOSED TREE
Backed out changeset 7271b938e71a (bug 1732161)
Backed out changeset d24b8450b7ed (bug 1732161)
Backed out changeset fb1838a152f2 (bug 1732161)
Backed out changeset 84787a58a428 (bug 1732161)
Backed out changeset 6acb82c0ac3c (bug 1732161)
Backed out changeset 50d17b172185 (bug 1732161)
2021-10-12 07:13:13 +03:00