Commit graph

1404 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
c20ec755c9 Bug 1782751 - Make desktop viewport mode a synced BrowsingContext field. r=twisniewski
So that it's preserved properly across replacements (bug 1781936).

Differential Revision: https://phabricator.services.mozilla.com/D155274
2022-08-22 22:12:07 +00:00
Emilio Cobos Álvarez
d23c50ffee Bug 1782082 - Avoid rounding error accumulation in nsDOMWindowUtils::ToScreenRectInCSSUnits. r=dholbert
Make sure to use the same scale the browser-chrome would actually use by
rounding to full app units.

This is especially visible with 1.5 text scale factor.

Differential Revision: https://phabricator.services.mozilla.com/D153099
2022-07-29 09:04:43 +00:00
Sean Feng
288cbe9f46 Bug 1778492 - Add an origin trial for coep: credentialless r=emilio,necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D151381
2022-07-27 20:33:19 +00:00
Marian-Vasile Laza
2ab97e789a Backed out 2 changesets (bug 1778492) for causing eslint failures.
Backed out changeset 6c3ac3569d31 (bug 1778492)
Backed out changeset 34227495753a (bug 1778492)
2022-07-26 17:43:53 +03:00
Sean Feng
38f70ee5fc Bug 1778492 - Add an origin trial for coep: credentialless r=emilio,necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D151381
2022-07-26 14:06:04 +00:00
Edgar Chen
775d68bc7e Bug 1778486 - Use Pointer event to record last user input position; r=smaug
In order to support record the last user input for touch given APZ won't
synthesize mouse event for touch in parent process. Using pointer event could
support pen input nicely, too.

Differential Revision: https://phabricator.services.mozilla.com/D151282
2022-07-22 13:51:47 +00:00
Bogdan Szekely
86a4afe3d3 Backed out changeset 5ffdcd317253 (bug 1778486) for causing mochitest failures on test_getLastOverWindowPointerLocationInCSSPixels.html CLOSED TREE 2022-07-21 16:58:07 +03:00
Edgar Chen
758aaaa824 Bug 1778486 - Use Pointer event to record last user input position; r=smaug
In order to support record the last user input for touch given APZ won't
synthesize mouse event for touch in parent process. Using pointer event could
support pen input nicely, too.

Differential Revision: https://phabricator.services.mozilla.com/D151282
2022-07-21 08:56:48 +00:00
Iulian Moraru
eefea78474 Backed out changeset 9a5d1eaadf39 (bug 1778486) for causing mochitest-crash failures on test_getLastOverWindowPointerLocationInCSSPixels.html. CLOSED TREE 2022-07-20 18:56:03 +03:00
Edgar Chen
4811778c31 Bug 1778486 - Use Pointer event to record last user input position; r=smaug
In order to support record the last user input for touch given APZ won't
synthesize mouse event for touch in parent process. Using pointer event could
support pen input nicely, too.

Differential Revision: https://phabricator.services.mozilla.com/D151282
2022-07-20 15:03:19 +00:00
Kagami Sascha Rosylight
0e82d63d54 Bug 1354500 - Part 1: Remove options parameter from nsDOMWindowUtils::GetFileReferences r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D151416
2022-07-15 01:55:26 +00:00
James Graham
b57989d24a 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-07-06 19:55:12 +00:00
Cristian Tuns
c35e657922 Backed out changeset 85d0efe7eb9b (bug 1773696) for causing mochitest failures in test_bug946632.html CLOSED TREE 2022-07-04 13:04:32 -04:00
James Graham
a60c9412c5 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-07-04 12:56:20 +00:00
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