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

419 Коммитов

Автор SHA1 Сообщение Дата
Sandor Molnar 9c360d52a8 Backed out changeset 2b33eb976812 (bug 1843261) for causing assertion failures in widget/PuppetWidget.cpp CLOSED TREE 2023-07-13 19:00:50 +03:00
Gregory Pappas 1ab9739ee0 Bug 1843261 - Remove browser.tabs.remote.desktopbehavior pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D183490
2023-07-13 15:19:23 +00:00
Sandor Molnar 22d943e999 Backed out changeset 732937ff77f9 (bug 1843261) for causing assertion failures in widget/PuppetWidget.cpp CLOSED TREE 2023-07-13 15:35:23 +03:00
Gregory Pappas 6ca892ce83 Bug 1843261 - Remove browser.tabs.remote.desktopbehavior pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D183490
2023-07-13 11:34:04 +00:00
Masayuki Nakano cb321ed332 Bug 1690827 - part 1: Number each composition for native IME or synthesized in the parent process r=smaug
For handling (ignoring) "too late" composition commit request from content
process, we need to distinguish a request is for which composition.  Therefore,
we need to number each composition originated in the parent process.

This patch makes `TextComposition` instance which is created at first
composition event for a composition consider a composition ID in the parent
process and set it to composition events which are dispatched into the DOM
tree in the parent or sent to a remote process.

And also this patch adds the composition ID param to the request method of
committing composition and reply methods to notify the parent process of ending
a composition event handling.

The last patch handle them in `ContentCacheInParent` to consider
whether a request/reply should be ignored or handled.

Differential Revision: https://phabricator.services.mozilla.com/D179310
2023-06-14 01:57:33 +00:00
Cosmin Sabou b91f473221 Backed out 6 changesets (bug 1690827, bug 1835577, bug 1835578) for causing build bustages on widget/ContentCache.cpp. CLOSED TREE
Backed out changeset 8f96604b79a6 (bug 1835578)
Backed out changeset 3afcf20d7fb6 (bug 1835577)
Backed out changeset 41105bb6e199 (bug 1690827)
Backed out changeset feedd62f908d (bug 1690827)
Backed out changeset bc45f9483150 (bug 1690827)
Backed out changeset d2c874809470 (bug 1690827)
2023-06-13 09:31:03 +03:00
Masayuki Nakano b2e57090e9 Bug 1690827 - part 1: Number each composition for native IME or synthesized in the parent process r=smaug
For handling (ignoring) "too late" composition commit request from content
process, we need to distinguish a request is for which composition.  Therefore,
we need to number each composition originated in the parent process.

This patch makes `TextComposition` instance which is created at first
composition event for a composition consider a composition ID in the parent
process and set it to composition events which are dispatched into the DOM
tree in the parent or sent to a remote process.

And also this patch adds the composition ID param to the request method of
committing composition and reply methods to notify the parent process of ending
a composition event handling.

The last patch handle them in `ContentCacheInParent` to consider
whether a request/reply should be ignored or handled.

Differential Revision: https://phabricator.services.mozilla.com/D179310
2023-06-13 04:07:45 +00:00
Masayuki Nakano 5f53d66d00 Bug 1825693 - Make `PuppetWidget` stop trying to cache `Selection` directly r=m_kato
Currently, `PuppetWidget` calls `ContentCacheInChild::CacheSelection` directly.
However, `mText` can be `Nothing` or `mText` can be outdated, but `mSelection`
becomes the latest one.  Therefore, we may notify the parent process with
invalid data combination.

The callers in `PuppetWidget` are:
1. `NotifyIMEOfCompositionUpdate`
2. `NotifyIMEOfPositionChange`

I think that the former does not need to cache anything here because
`IMEContentObserver` should've updated the text/selection changes.  However,
stopping caching everything at this point is risky.  In the most cases, outdated
data appears as odd IME UI position.  Therefore, let's keep updating only caret
and text rectangles.

The latter is reported with new crash reports which is crashed by a
`MOZ_DIAGNOSTIC_ASSERT` failure added by the previous patch.  In the case,
if `mText` and `mSelection` has not been cached, we don't need to notify
the parent process with them because they will be sent later.  And also even
if they are not available, it may be useful that the character rectangles not
related to `Selection` (e.g., the first character rect).  Therefore, let's
keep caching same things as the former case.

Therefore, this patch makes `CacheSelection` a private method and add
`CacheCaretAndTextRects` for them.

Differential Revision: https://phabricator.services.mozilla.com/D178145
2023-05-26 01:24:36 +00:00
Masayuki Nakano 4c5f7cf636 Bug 1825693 - Make `ContentCache` stop assigning invalid data r=m_kato,nika
There are some crash reports crashed in TSF module which may be caused by
passing invalid selection range (e.g., out of bounds of text).  However,
the cache is created in the child process and that causes the invalid cache
creation does not appear in the crash reports.  Therefore, let's try to
crash as soon as possible if `ContentCache` has invalid data.

Note that this does not detect all of the invalid cases because it's hard to
(re-)understand the edge cases.  Therefore, this tries to detect the cases
checked in `ContentCacheInParent::HandleQueryContentEvent` (*1) and some other
obvious odd cases.

1. https://searchfox.org/mozilla-central/rev/0ffaecaa075887ab07bf4c607c61ea2faa81b172/widget/ContentCache.cpp#776-778

Differential Revision: https://phabricator.services.mozilla.com/D176747
2023-05-26 01:24:35 +00:00
Emilio Cobos Álvarez 1937b308ec Bug 1834042 - Make nsWindow::ConstrainPosition account for decorations. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D178545
2023-05-23 10:30:05 +00:00
Butkovits Atila 2fc1fdfb88 Backed out changeset ff1720f8fc34 (bug 1834042) for causing Android bustages at nsWindow.h. CLOSED TREE 2023-05-23 00:54:10 +03:00
Emilio Cobos Álvarez 56a0e2aa64 Bug 1834042 - Make nsWindow::ConstrainPosition account for decorations. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D178545
2023-05-22 20:36:27 +00:00
Iulian Moraru 645bd13854 Backed out 2 changesets (bug 1825693) for causing reftest failures related to ContentCache::Selection. CLOSED TREE
Backed out changeset 6a854fc8f509 (bug 1825693)
Backed out changeset f0646a32d694 (bug 1825693)
2023-05-19 04:15:46 +03:00
Masayuki Nakano 718cc92528 Bug 1825693 - Make `PuppetWidget` stop trying to cache `Selection` directly r=m_kato
Currently, `PuppetWidget` calls `ContentCacheInChild::CacheSelection` directly.
However, `mText` can be `Nothing` or `mText` can be outdated, but `mSelection`
becomes the latest one.  Therefore, we may notify the parent process with
invalid data combination.

The callers in `PuppetWidget` are:
1. `NotifyIMEOfCompositionUpdate`
2. `NotifyIMEOfPositionChange`

I think that the former does not need to cache anything here because
`IMEContentObserver` should've updated the text/selection changes.  However,
stopping caching everything at this point is risky.  In the most cases, outdated
data appears as odd IME UI position.  Therefore, let's keep updating only caret
and text rectangles.

The latter is reported with new crash reports which is crashed by a
`MOZ_DIAGNOSTIC_ASSERT` failure added by the previous patch.  In the case,
if `mText` and `mSelection` has not been cached, we don't need to notify
the parent process with them because they will be sent later.  And also even
if they are not available, it may be useful that the character rectangles not
related to `Selection` (e.g., the first character rect).  Therefore, let's
keep caching same things as the former case.

Therefore, this patch makes `CacheSelection` a private method and add
`CacheCaretAndTextRects` for them.

Depends on D176747

Differential Revision: https://phabricator.services.mozilla.com/D178145
2023-05-18 23:56:07 +00:00
Masayuki Nakano a6448bb218 Bug 1825693 - Make `ContentCache` stop assigning invalid data r=m_kato,nika
There are some crash reports crashed in TSF module which may be caused by
passing invalid selection range (e.g., out of bounds of text).  However,
the cache is created in the child process and that causes the invalid cache
creation does not appear in the crash reports.  Therefore, let's try to
crash as soon as possible if `ContentCache` has invalid data.

Note that this does not detect all of the invalid cases because it's hard to
(re-)understand the edge cases.  Therefore, this tries to detect the cases
checked in `ContentCacheInParent::HandleQueryContentEvent` (*1) and some other
obvious odd cases.

1. https://searchfox.org/mozilla-central/rev/0ffaecaa075887ab07bf4c607c61ea2faa81b172/widget/ContentCache.cpp#776-778

Differential Revision: https://phabricator.services.mozilla.com/D176747
2023-05-18 23:56:06 +00:00
Noemi Erli 71d235742a Backed out changeset 4f6d49b8d207 (bug 1825693) for ContentCache crashes 2023-05-16 00:29:31 +03:00
Masayuki Nakano f9157293e3 Bug 1825693 - Make `ContentCache` stop assigning invalid data r=m_kato,nika
There are some crash reports crashed in TSF module which may be caused by
passing invalid selection range (e.g., out of bounds of text).  However,
the cache is created in the child process and that causes the invalid cache
creation does not appear in the crash reports.  Therefore, let's try to
crash as soon as possible if `ContentCache` has invalid data.

Note that this does not detect all of the invalid cases because it's hard to
(re-)understand the edge cases.  Therefore, this tries to detect the cases
checked in `ContentCacheInParent::HandleQueryContentEvent` (*1) and some other
obvious odd cases.

1. https://searchfox.org/mozilla-central/rev/0ffaecaa075887ab07bf4c607c61ea2faa81b172/widget/ContentCache.cpp#776-778

Differential Revision: https://phabricator.services.mozilla.com/D176747
2023-05-15 02:01:06 +00:00
serge-sans-paille 13e51277df Bug 1825324 - Make widget/* buildable outside of a unified build environment r=andi,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D173969
2023-04-01 08:31:12 +00:00
Cristian Tuns 8e06a7a853 Backed out 12 changesets (bug 1825325, bug 1825336, bug 1825333, bug 1825332, bug 1825324, bug 1824557, bug 1825328, bug 1825335, bug 1825330, bug 1825329, bug 1825327, bug 1825331) for causing build bustages in nsClipboard.cpp CLOSED TREE
Backed out changeset 9de3ed24d3a0 (bug 1825336)
Backed out changeset aef787728f19 (bug 1825335)
Backed out changeset a04c341244c1 (bug 1825333)
Backed out changeset e3ad15f762ba (bug 1825332)
Backed out changeset eed23da92a27 (bug 1825331)
Backed out changeset 8213bb54376e (bug 1825330)
Backed out changeset 747ec5ac4994 (bug 1825329)
Backed out changeset e91ff431f92d (bug 1825328)
Backed out changeset 59c18d13768b (bug 1825327)
Backed out changeset 538096d99e49 (bug 1825325)
Backed out changeset c76eb9d9b095 (bug 1825324)
Backed out changeset 8b81410eb686 (bug 1824557)
2023-03-31 12:58:53 -04:00
serge-sans-paille 0702cdc836 Bug 1825324 - Make widget/* buildable outside of a unified build environment r=andi,geckoview-reviewers,m_kato
Depends on D173637

Differential Revision: https://phabricator.services.mozilla.com/D173969
2023-03-31 13:29:44 +00:00
Emilio Cobos Álvarez 9e530f224a Bug 1811834 - Clean up nsWidgetInitData. r=cmartin,geckoview-reviewers,calu
Move it to the mozilla::widget namespace.

Use enum classes for transparency, popup type, popup level, etc.

Mostly automated with sed, but there were a few manual changes required
as well in windows code because they relied on Atomic<TransparencyMode>
working (which now doesn't because TransparencyMode is 1 byte instead of
4 bytes).

Differential Revision: https://phabricator.services.mozilla.com/D167537
2023-01-23 23:58:41 +00:00
Olli Pettay 5d21de32ac Bug 1807812 - Remove WidgetEventTime::mTime, r=masayuki,geckoview-reviewers,m_kato
HTMLSelectEventListener changes are needed, since currently that code works somewhat by accident given that
mTime often contains totally bogus values, like PR_IntervalNow(). Those changes then reveal issues also in
browser_editAddressDialog.js.

Differential Revision: https://phabricator.services.mozilla.com/D165618
2023-01-02 12:31:40 +00:00
Matthias Camenzind c9300fab1e Bug 1786048 - Part 3: Merge nsIEmbeddingSiteWindow into nsIBaseWindow. r=emilio
Implementations of nsIEmbeddingSiteWindow and nsIBaseWindow largely
overlap, and where they don't, the nsIEmbeddingSiteWindow implementation
of the otherwise shared interface is primarily stubbed out with the
exception of Get/SetDimensions().

This patch moves a reimplementation of Get/SetDimensions() from
nsIEmbeddingSiteWindow to nsIBaseWindow. The other methods of
nsIEmbeddingSiteWindow remain covered by nsIBaseWindow.
Get/SetDimensions() can be implemented as part of nsIWebBrowserChrome
where nsIBaseWindow is not necessary. This removes the need for
nsIEmbeddingSiteWindow.

Blur() has also been moved to nsIWebBrowserChrome, as only
nsContentTreeOwner has an actual implementation which we in theory also
want to call from BrowserChild/Parent, but the spec suggests to
"selectively or uniformly ignore calls".

GetVisibility() had an implementation in BrowserChild that pretended to
always be visible. Instead of providing an interface for that,
nsDocShell now handles the not implemented case for tree owners.

nsIEmbeddingSiteWindow::GetSiteWindow() used to call through to
nsIBaseWindow::GetParentNativeWindow().

The Get/SetDimensions() implementation has been replaced with a strongly
typed setter, which is now also used directly from nsGlobalWindowOuter
to avoid problems that come with autodetecting unchanged dimensions,
when the current dimensions are outdated (e.g. immediately reverting a
change can be ignored).

Differential Revision: https://phabricator.services.mozilla.com/D160260
2022-12-15 23:13:00 +00:00
Cosmin Sabou 7089ec234d Backed out changeset 3b9e2c9256f8 (bug 1803966) for causing regressions on bugs 1786514, 1792516 and 1789145. 2022-12-08 01:52:10 +02:00
Olli Pettay 02dc105128 Bug 1803966 - Consider to not trigger the paint of the initial about:blank so eagerly when doing a process switch, r=emilio
This is a micro-optimization to process switching.  Often the paint delayes child process to send back information that it is ready to receive data from the parent process.
There are be other tiny issues like this too.

Differential Revision: https://phabricator.services.mozilla.com/D163789
2022-12-07 00:34:34 +00:00
Sandor Molnar a1e9c1d43b Backed out 4 changesets (bug 1786048) for causing multiple failures. CLOSED TREE
Backed out changeset ae94135e68ef (bug 1786048)
Backed out changeset f505df8a481a (bug 1786048)
Backed out changeset 999a18d6f33e (bug 1786048)
Backed out changeset e71e8644b8a9 (bug 1786048)
2022-12-02 20:30:07 +02:00
Matthias Camenzind 562af0a9b4 Bug 1786048 - Part 3: Merge nsIEmbeddingSiteWindow into nsIBaseWindow. r=emilio
Implementations of nsIEmbeddingSiteWindow and nsIBaseWindow largely
overlap, and where they don't, the nsIEmbeddingSiteWindow implementation
of the otherwise shared interface is primarily stubbed out with the
exception of Get/SetDimensions().

This patch moves a reimplementation of Get/SetDimensions() from
nsIEmbeddingSiteWindow to nsIBaseWindow. The other methods of
nsIEmbeddingSiteWindow remain covered by nsIBaseWindow.
Get/SetDimensions() can be implemented as part of nsIWebBrowserChrome
where nsIBaseWindow is not necessary. This removes the need for
nsIEmbeddingSiteWindow.

Blur() has also been moved to nsIWebBrowserChrome, as only
nsContentTreeOwner has an actual implementation which we in theory also
want to call from BrowserChild/Parent, but the spec suggests to
"selectively or uniformly ignore calls".

GetVisibility() had an implementation in BrowserChild that pretended to
always be visible. Instead of providing an interface for that,
nsDocShell now handles the not implemented case for tree owners.

nsIEmbeddingSiteWindow::GetSiteWindow() used to call through to
nsIBaseWindow::GetParentNativeWindow().

The Get/SetDimensions() implementation has been replaced with a strongly
typed setter, which is now also used directly from nsGlobalWindowOuter
to avoid problems that come with autodetecting unchanged dimensions,
when the current dimensions are outdated (e.g. immediately reverting a
change can be ignored).

Differential Revision: https://phabricator.services.mozilla.com/D160260
2022-12-02 16:47:46 +00:00
Marian-Vasile Laza bec56391bf Backed out 4 changesets (bug 1786048) for causing bc failures on browser_modal_resize.js. CLOSED TREE
Backed out changeset 318a2d2e6e39 (bug 1786048)
Backed out changeset 17a9990d6d19 (bug 1786048)
Backed out changeset 205f129c648a (bug 1786048)
Backed out changeset 0750c885a688 (bug 1786048)
2022-12-01 05:00:38 +02:00
Matthias Camenzind 81ce314e5c Bug 1786048 - Part 3: Merge nsIEmbeddingSiteWindow into nsIBaseWindow. r=emilio
Implementations of nsIEmbeddingSiteWindow and nsIBaseWindow largely
overlap, and where they don't, the nsIEmbeddingSiteWindow implementation
of the otherwise shared interface is primarily stubbed out with the
exception of Get/SetDimensions().

This patch moves a reimplementation of Get/SetDimensions() from
nsIEmbeddingSiteWindow to nsIBaseWindow. The other methods of
nsIEmbeddingSiteWindow remain covered by nsIBaseWindow.
Get/SetDimensions() can be implemented as part of nsIWebBrowserChrome
where nsIBaseWindow is not necessary. This removes the need for
nsIEmbeddingSiteWindow.

Blur() has also been moved to nsIWebBrowserChrome, as only
nsContentTreeOwner has an actual implementation which we in theory also
want to call from BrowserChild/Parent, but the spec suggests to
"selectively or uniformly ignore calls".

GetVisibility() had an implementation in BrowserChild that pretended to
always be visible. Instead of providing an interface for that,
nsDocShell now handles the not implemented case for tree owners.

nsIEmbeddingSiteWindow::GetSiteWindow() used to call through to
nsIBaseWindow::GetParentNativeWindow().

The Get/SetDimensions() implementation has been replaced with a strongly
typed setter, which is now also used directly from nsGlobalWindowOuter
to avoid problems that come with autodetecting unchanged dimensions,
when the current dimensions are outdated (e.g. immediately reverting a
change can be ignored).

Differential Revision: https://phabricator.services.mozilla.com/D160260
2022-11-30 19:37:16 +00:00
Nika Layzell 91a521bf3a Bug 1781129 - Part 1: Use BigBuffer for IPCDataTransfer, r=edgar
The IPCDataTransfer type is used to transfer Clipboard/Drag & Drop payloads
over IPC to allow them to be written to or read from the relevant system
interfaces. Previously, the system which was used was somewhat complex, and
tried to use Shmem in some cases to store buffers out of line. Now that
BigBuffer is available, it can be simplified substantially.

In addition, this change removed the memory buffer overload of GetSurfaceData,
as the only consumer was using it to immediately send the payload over IPC as a
nsCString. It was changed to instead use `BigBuffer` as that is more efficient
in a large buffer situation, and reduces the number of required copies.

Differential Revision: https://phabricator.services.mozilla.com/D151852
2022-08-26 16:08:05 +00:00
Marian-Vasile Laza 9274b092fe Backed out 4 changesets (bug 1781129) for causing mochitest failures on test_bug490879.html. CLOSED TREE
Backed out changeset 37da1d18cde9 (bug 1781129)
Backed out changeset 1ae213bfa43e (bug 1781129)
Backed out changeset dcebc98ea1f1 (bug 1781129)
Backed out changeset 0df2f2832755 (bug 1781129)
2022-08-22 23:07:56 +03:00
Nika Layzell 6c8af6eff5 Bug 1781129 - Part 1: Use BigBuffer for IPCDataTransfer, r=edgar
The IPCDataTransfer type is used to transfer Clipboard/Drag & Drop payloads
over IPC to allow them to be written to or read from the relevant system
interfaces. Previously, the system which was used was somewhat complex, and
tried to use Shmem in some cases to store buffers out of line. Now that
BigBuffer is available, it can be simplified substantially.

In addition, this change removed the memory buffer overload of GetSurfaceData,
as the only consumer was using it to immediately send the payload over IPC as a
nsCString. It was changed to instead use `BigBuffer` as that is more efficient
in a large buffer situation, and reduces the number of required copies.

Differential Revision: https://phabricator.services.mozilla.com/D151852
2022-08-22 15:38:14 +00:00
Marian-Vasile Laza 0bebd4fea4 Backed out 4 changesets (bug 1781129) for causing bustages on nsContentUtils.cpp. CLOSED TREE
Backed out changeset 8557305bcd46 (bug 1781129)
Backed out changeset df6f98df9559 (bug 1781129)
Backed out changeset 905393f66985 (bug 1781129)
Backed out changeset 0d0f19a4db70 (bug 1781129)
2022-08-02 23:29:56 +03:00
Nika Layzell 5eebe3259a Bug 1781129 - Part 1: Use BigBuffer for IPCDataTransfer, r=edgar
The IPCDataTransfer type is used to transfer Clipboard/Drag & Drop payloads
over IPC to allow them to be written to or read from the relevant system
interfaces. Previously, the system which was used was somewhat complex, and
tried to use Shmem in some cases to store buffers out of line. Now that
BigBuffer is available, it can be simplified substantially.

In addition, this change removed the memory buffer overload of GetSurfaceData,
as the only consumer was using it to immediately send the payload over IPC as a
nsCString. It was changed to instead use `BigBuffer` as that is more efficient
in a large buffer situation, and reduces the number of required copies.

Differential Revision: https://phabricator.services.mozilla.com/D151852
2022-08-02 18:09:40 +00:00
Marian-Vasile Laza 00079e8784 Backed out 4 changesets (bug 1781129) for causing bustages on nsContentUtils.cpp. CLOSED TREE
Backed out changeset 4a92d58726aa (bug 1781129)
Backed out changeset bce3f99441c0 (bug 1781129)
Backed out changeset fc135243503e (bug 1781129)
Backed out changeset 726458f976ff (bug 1781129)
2022-08-02 20:32:01 +03:00
Nika Layzell 452233a5a1 Bug 1781129 - Part 1: Use BigBuffer for IPCDataTransfer, r=edgar
The IPCDataTransfer type is used to transfer Clipboard/Drag & Drop payloads
over IPC to allow them to be written to or read from the relevant system
interfaces. Previously, the system which was used was somewhat complex, and
tried to use Shmem in some cases to store buffers out of line. Now that
BigBuffer is available, it can be simplified substantially.

In addition, this change removed the memory buffer overload of GetSurfaceData,
as the only consumer was using it to immediately send the payload over IPC as a
nsCString. It was changed to instead use `BigBuffer` as that is more efficient
in a large buffer situation, and reduces the number of required copies.

Differential Revision: https://phabricator.services.mozilla.com/D151852
2022-08-02 17:15:41 +00:00
Emilio Cobos Álvarez 42b7f1a58c Bug 1780788 - Use abstract strings as in-arguments for ipdl. r=nika,necko-reviewers,media-playback-reviewers,alwu,dragana
This prevents copies and avoids the hack we have to avoid this, which
right now is using nsDependent{C,}String.

Non-virtual actors can still use `nsString` if they need to on the
receiving end.

Differential Revision: https://phabricator.services.mozilla.com/D152519
2022-07-25 20:19:48 +00:00
Emilio Cobos Álvarez ee23efc9b5 Bug 1773813 - Incorporate OS zoom factor in window sizing calculations. r=tnikkel
In bug 1773342 I made OS text scale factor behave like a full zoom
factor which applies to all pages (including the browser chrome). That's
generally straight forward but it makes some callsites that use unzoomed
CSS coordinates misbehave (or behave correctly accidentally actually in
some other cases).

The main fix here is making
nsIBaseWindow::UnscaledDevicePixelsPerCSSPixel() and
nsIScreen::GetDefaultCSSScaleFactor() account for OS zoom as necessary.
However, I also went through the relevant code and cleaned it up to use
typed units and operations when possible.

The setup means:

 * nsIWidget::GetDefaultScale() doesn't account for OS full zoom.
 * nsIBaseWindow and nsIScreen does.

These are the places where this should matter and stuff can get
confused, but this works surprisingly well for all callers (except one
nsDeviceContext one which we use only for PuppetWidget and we can
remove by falling back to 1.0 like all other widgets until the update
comes).

Differential Revision: https://phabricator.services.mozilla.com/D149033
2022-06-14 15:01:52 +00:00
Norisz Fay 60ea7706bd Backed out changeset da5c71190673 (bug 1773813) for causing build bustages CLOSED TREE 2022-06-14 15:13:58 +03:00
Emilio Cobos Álvarez c64d0fcaa6 Bug 1773813 - Incorporate OS zoom factor in window sizing calculations. r=tnikkel
In bug 1773342 I made OS text scale factor behave like a full zoom
factor which applies to all pages (including the browser chrome). That's
generally straight forward but it makes some callsites that use unzoomed
CSS coordinates misbehave (or behave correctly accidentally actually in
some other cases).

The main fix here is making
nsIBaseWindow::UnscaledDevicePixelsPerCSSPixel() and
nsIScreen::GetDefaultCSSScaleFactor() account for OS zoom as necessary.
However, I also went through the relevant code and cleaned it up to use
typed units and operations when possible.

The setup means:

 * nsIWidget::GetDefaultScale() doesn't account for OS full zoom.
 * nsIBaseWindow and nsIScreen does.

These are the places where this should matter and stuff can get
confused, but this works surprisingly well for all callers (except one
nsDeviceContext one which we use only for PuppetWidget and we can
remove by falling back to 1.0 like all other widgets until the update
comes).

Differential Revision: https://phabricator.services.mozilla.com/D149033
2022-06-14 11:37:25 +00:00
Chris Martin 80881746de Bug 1763023 - Push nsBaseWidget::mSizeMode into child classes r=handyman
This member is no longer used on Windows, and having it in the
base class doesn't provide a real abstraction anyway since
the child classes will break if anything about it is changed.

Differential Revision: https://phabricator.services.mozilla.com/D145132
2022-05-02 14:06:17 +00:00
Emilio Cobos Álvarez 88681fbb2f Bug 1767165 - Fix dragend coordinates in child processes after bug 1756241. r=tnikkel
Bug 1756241 changed nsDragService::mDragEndPoint to be relative to the
window. I didn't realize, but that point is passed as-is to child
widgets. Changing the widget event to actually have a widget made the
point be interpreted as widget-relative (which is correct in the parent
process, but not in the child process). Account for this and fix the
mDragEndPoint documentation while at it.

Differential Revision: https://phabricator.services.mozilla.com/D145182
2022-05-02 10:09:41 +00:00
Masayuki Nakano 91e18f14d8 Bug 1760160 - Make `ContentCacheInChild` stop storing content if editable element has already been blurred r=m_kato
It's designed for caching content information of focused editor.  However, at
sending focus notification to the main process, the editor may have already
been blurred but `IMEContentObserver` may have not known it yet.  In this edge
case, only query selection succeeds since IMEContentObserver still has a cache,
but query the others failed because of root content node check of
`IMEContentObserver::HandleQueryContentEvent`.  If a content process meets this
case, it should not send focus notification and stop storing the content since
IME shouldn't get focus nor query non-editable content.

On the other hand, the reported testcase reproduces this with a fuzzing API
called **in** the content process. Therefore, I have no idea how to reproduce
it without the API. That's the reason why this patch does not contain new tests.

Differential Revision: https://phabricator.services.mozilla.com/D141821
2022-04-07 00:58:49 +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
Emilio Cobos Álvarez 9f85342dbb Bug 1758357 - Fix PuppetWidget::SetCursor to avoid sending cursor updates to the parent process over and over. r=mstange
I accidentally regressed this in bug 1705877, so we'd always
force-update the cursor :(

Differential Revision: https://phabricator.services.mozilla.com/D141863
2022-03-23 15:31:02 +00:00
Emilio Cobos Álvarez ef103031be Bug 1759204 - Introduce ShmemImage to easily pass images via IPC. r=aosmond
This shares code with the transferable / cursor stuff which are the
other two non-rendering callers that deal with images over IPC.

We're going to introduce a consumer of this new type in a second, but
this was worth getting reviewed separately.

Differential Revision: https://phabricator.services.mozilla.com/D141110
2022-03-15 18:14:07 +00:00
Masayuki Nakano d450beac6f Bug 1191862 - part 1: Make `nsIWidget::NativeKeyBindingsType` independent from `nsIWidget` and defined in an independent header file r=smaug
I'd like to use it in `IMEData.h`.  However, adding new include into it may
cause bustage with MinGW, and it's included by `nsIWidget.h` because `nsIWidget`
requires some classes defined in `IMEData.h`.  Therefore, I'd like to make a
new header file for avoiding the include hell.

Differential Revision: https://phabricator.services.mozilla.com/D138007
2022-02-15 08:00:05 +00:00
Masayuki Nakano 47397b7081 Bug 1746104 - part 6-2: Make constructors of `ContentCache::Selection` take `IMENotification::SelectionChangeData` or `WidgetQueryContentEvent` r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D137428
2022-02-07 22:33:40 +00:00
Makoto Kato 3da88d8e66 Bug 1743780 - Get rid of PuppetScreenManager and PuppetScreen. r=emilio
Now we use `mozilla::widget::ScreenManager` even if on content process, so no
one uses `PuppetScreen` and `PuppetScreenManager`.

And I would like to remove `Hal.h` reference from `PuppetWidget`, so I remove
unused method.

Differential Revision: https://phabricator.services.mozilla.com/D132564
2021-12-01 15:07:14 +00:00
Emilio Cobos Álvarez 6c858f9e0c Bug 1736441 - Remove a bunch of dead plugins code from widget/. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D128863
2021-10-19 11:19:13 +00:00