OS print drivers/devices know nothing about page dimensions unless we tell
them. Previously, the physical page dimensions (including orientation) have
always been the same, so communicating their dimensions once at the start of
a print has been enough. In preparation for supporting different "physical"
page dimensions (in the immediate future only different page orientations) when
we save to PDF, we need to have the infrastructure to pass dimensions through
on a page-by-page basis. This patch adds that.
None of the PrintTarget subclasses do anything with this extra information yet,
but in a follow-up patch PrintTargetPDF will use this information to create
PDFs with mixed page orientations.
Depends on D179395
Differential Revision: https://phabricator.services.mozilla.com/D179423
Add separate options to control whether we build VA-API and/or V4L2
hardware video decode. These options default to enabled on the
platforms where these decoders are used.
The downstream MOZ_WAYLAND_USE_HWDECODE build option is used within the
FFmpeg platform and is only set when building against a supported
version of the FFmpeg libraries (i.e. not for ffmpeg57).
Differential Revision: https://phabricator.services.mozilla.com/D178945
Bug 1704954 disabled DirectComposition for users with NVIDIA graphics
hardware and mixed monitor refresh rates on Windows 10 and 11, as a
mitigation for bug 1638709. However, that bug is almost -- perhaps
entirely -- unknown on Windows 11 (q.v. for details), and the fallback
path it uses has been shown to cause issues there (bug 1763981).
Restrict the mitigation to only occur on Windows 10, where bug 1638709
is exhibited, but where no issues with the fallback path are known.
This also effectively reverts bug 1816001, which it obviates.
Differential Revision: https://phabricator.services.mozilla.com/D178848
And attach it to the maximized headerbar, not to the regular one. Breeze
styles the button with background-image rather than icon-source.
Differential Revision: https://phabricator.services.mozilla.com/D179389
If we set resize cursor on widget level keep it locked and prevent layout
to switch it back to default (by synthetic mouse events for instance)
until resize is finished.
Differential Revision: https://phabricator.services.mozilla.com/D179049
It creates no range `Selection` if `mSelection` has not been emplaced.
However, we don't want `Selection` in the case because `mText` may be nothing
and that violates the dependency. Therefore, it should stop creating
`Selection` in the case.
Note that first character rect will be cached later even if there is no
`Selection`. However, this should not occur in usual case because `focus`
notification should've already initialized `mText` and `mSelection`.
Differential Revision: https://phabricator.services.mozilla.com/D178731
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
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
The presence of "DriverVersionMismatch" does not seem to be an outlying
indicator in crash reports for Intel 965 Express hardware. This patch
allows hardware WebRender in all channels for that hardware, and we'll
deal with individual driver bugs as they appear.
Differential Revision: https://phabricator.services.mozilla.com/D179147
The EditorEventListener for HTMLEditor is registered on document,
which is problematic because it can't receive events when the focus is
switched between elements in the same shadow tree due to shadow dom
encapsulation.
We fix this by moving the EditorEventListener to nsWindowRoot so the
events can always be received.
Differential Revision: https://phabricator.services.mozilla.com/D178215
I was looking into simplifying our scrollbar styles:
* StyleAppearance::Resizer is not used in content, and some of the
values were only for <xul:window> which are not supported anymore.
* Statusbarpanel and Resizerpanel aren't used. Statusbar is only used
once on macOS so we only need to keep it there.
Differential Revision: https://phabricator.services.mozilla.com/D178374
The EditorEventListener for HTMLEditor is registered on document,
which is problematic because it can't receive events when the focus is
switched between elements in the same shadow tree due to shadow dom
encapsulation.
We fix this by moving the EditorEventListener to nsWindowRoot so the
events can always be received.
Differential Revision: https://phabricator.services.mozilla.com/D178215
I was looking into simplifying our scrollbar styles:
* StyleAppearance::Resizer is not used in content, and some of the
values were only for <xul:window> which are not supported anymore.
* Statusbarpanel and Resizerpanel aren't used. Statusbar is only used
once on macOS so we only need to keep it there.
Differential Revision: https://phabricator.services.mozilla.com/D178374
I was looking into simplifying our scrollbar styles:
* StyleAppearance::Resizer is not used in content, and some of the
values were only for <xul:window> which are not supported anymore.
* Statusbarpanel and Resizerpanel aren't used. Statusbar is only used
once on macOS so we only need to keep it there.
Differential Revision: https://phabricator.services.mozilla.com/D178374
Blocked driver version is borrowed from FEATURE_HW_DECODED_VIDEO_ZERO_COPY block list. From Bug 1831329, the block list range of FEATURE_HW_DECODED_VIDEO_ZERO_COPY might have same problem.
Differential Revision: https://phabricator.services.mozilla.com/D178607
- Remove GlobalRefRelease() from GlobalRefCountDelete(). It matches current scenario where GlobalRefCountCreate() is created an unreferenced counter
so we also should delete it without unref.
- Call explicitly GlobalRefCountDelete() from ~VideoFrameSurface() to avoid bogus error messages. DMABufSurface may be used by other parts of gecko
even when video decoder is deleted so we don't care about DMABufSurface ref state here.
- Explicitly call GlobalRefRelease()/GlobalRefCountDelete() from ~DMABufSurface(). That matches DMABufSurface() life time scenario:
- GlobalRefAdd/GlobalRefRelease in DMABUFSurfaceImage class / RDD process.
- GlobalRefCountImport()/~DMABufSurface() if DMABufSurface is transfered via. IPC bridge to content/render/compositor process.
- Add DmabufRef MOZ_LOG
Depends on D178282
Differential Revision: https://phabricator.services.mozilla.com/D178283
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
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
The one functional change in this patchset: if a name cannot be
extracted from any IShellItem during multiple-selection, fail the entire
operation instead of only quietly dropping the failed items.
(The vast majority of IShellItem instances have filesystem paths -- even
if they're shell-generated nonce paths, sometimes -- so there's not
likely to be any effective difference here for any end-user.)
Depends on D178204
Differential Revision: https://phabricator.services.mozilla.com/D178480
Convert `nsFilePicker` to use the `Command` structs introduced in the
first commit in this patchset. No functional changes -- this should be a
straight reorganization of internal code.
Additionally, remove from `WinUtils` the now-unused function
`GetShellItemPath`, whose functionality has been moved into `Command`'s
associated functions' translation unit. (This function was added to
WinUtils in 2012 as part of supporting the Windows Vista file picker
(bug 718374). It's not overtly filepicker-specific, but in the past
eleven years, no other code has ever used it.)
Differential Revision: https://phabricator.services.mozilla.com/D178204
Perform some cleanup on `nsFilePicker` before refactoring to use the
`Command` type from the previous commit:
- Remove stray `typedef`s/`using`s.
- Remove an unused member `mFilterList`.
- Eliminate the private class `ComDlgFilterSpec`, mostly replacing it
with a plain `nsTArray`.
No functional changes.
Differential Revision: https://phabricator.services.mozilla.com/D178203
In preparation for moving the file picker dialog's invocation out-of-
process (bug 1677170), create an IPC-compatible `Command` type -- a
reification of the method calls we actually perform to set up the file
dialog -- along with supporting functionality to apply those commands to
an IFileDialog, as needed.
No functional changes, as this type isn't yet created by anything:
that's left for a later commit in this patchset.
Differential Revision: https://phabricator.services.mozilla.com/D178202
This does two things:
* Modify `nsXULPopupManager::ShowPopup()` so it calls `ShowPopupAsNativeMenu()`
as long as an anchor wasn't passed in, and only on Mac.
* Modify `-[MOZMenuOpeningCoordinator _openMenu:atScreenPosition:forView:withAppearance:]`
so it also takes a `aIsContextMenu` param. If the param is true, we synthesize
a right-click event and pop up a context menu as usual. If it's false, we use
`-[NSMenu popUpMenuPositioningItem:atLocation:inView:]` instead.
The reason this works is because `-[NSMenu popUpMenuPositioningItem:atLocation:inView:]`
opens the menu in a sensible place when the x-y coords are near the right edge
of the screen. In contrast, `+[NSMenu popUpContextMenu:withEvent:forView:]` will
anchor the menu's top-right corner to the mouse cursor when near the right edge.
Differential Revision: https://phabricator.services.mozilla.com/D177355