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

6096 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 6755393273 Bug 1765714 - Move Wayland popup bounds check to LayoutPopup(). r=stransky
It is the right place to do it, otherwise we don't have the guarantee of
it invalidating ancestor sizes or anything.

It's also what we invalidate in WaylandPopupPropagateChangesToLayout().

We otherwise do not have the guarantee of SetPopupPosition running
before or after layout, if sizes do not change. That caused the popup
size to remain big, which caused a resize loop.

Differential Revision: https://phabricator.services.mozilla.com/D144314
2022-04-22 08:44:58 +00:00
Mike Hommey 63c7aa24f6 Bug 1765474 - Fix unused-but-set-variable warning in nsSprocketLayout.cpp. r=emilio
layout/xul/nsSprocketLayout.cpp:1116:14: error: variable 'pass' set but not used [-Werror,-Wunused-but-set-variable]
    for (int pass = 1; true == limit; pass++) {
             ^

Differential Revision: https://phabricator.services.mozilla.com/D144143
2022-04-22 01:25:07 +00:00
Emilio Cobos Álvarez 20b8aec4d5 Bug 1764354 - Propagate color-scheme preference to SVG images on chrome documents. r=aosmond
This allows favicons to respect the user theme even when it doesn't
match the content theme.

Differential Revision: https://phabricator.services.mozilla.com/D143639
2022-04-17 20:38:01 +00:00
Emilio Cobos Álvarez 8edd7b11cf Bug 1762152 - Remove XULPopupElement.isAnchored. r=Gijs
On Wayland popup flipping and such is not Firefox's responsibility.

Once we've decided the final popup position because the compositor told
us, we move the popup to a fixed position, and internally the popup
becomes unanchored.

Using this boolean to make decisions after the initial popuppositioned
event is wrong, so avoid exposing it to JS.

Differential Revision: https://phabricator.services.mozilla.com/D142679
2022-04-04 13:29:30 +00:00
stransky 9cac822f97 Bug 1761435 [Wayland] Store only move-to-rect popup size r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D142048
2022-03-28 10:13:40 +00:00
stransky 588b7423e7 Bug 1760276 [Wayland] Fix loop in popup move-to-rect resizes r=emilio
Use mMoveToRectPopupRect popup constrains in nsMenuPopupFrame::SetPopupPosition only and make it pernament.
In such setup works as screen size constraints.

Don't call SetPopupPosition from move-to-rect callback and let layout code to handle that.

Remove MoveToRectPopupRectClear() as it's not needed, we keep mMoveToRectPopupRect
in nsMenuPopupFrame as well as we keep screen sizes there.

Differential Revision: https://phabricator.services.mozilla.com/D141602
2022-03-25 11:15:39 +00:00
Norisz Fay d29d98d869 Backed out 3 changesets (bug 1760276) for causing build bustages on nsMenuPopupFrame.cpp CLOSED TREE
Backed out changeset e98dce4c58db (bug 1760276)
Backed out changeset 3d351d90db7b (bug 1760276)
Backed out changeset e8e0571ab13b (bug 1760276)
2022-03-25 12:02:18 +02:00
stransky 0226068db9 Bug 1760276 [Wayland] Fix loop in popup move-to-rect resizes r=emilio
Use mMoveToRectPopupRect popup constrains in nsMenuPopupFrame::SetPopupPosition only and make it pernament.
In such setup works as screen size constraints.

Don't call SetPopupPosition from move-to-rect callback and let layout code to handle that.

Remove MoveToRectPopupRectClear() as it's not needed, we keep mMoveToRectPopupRect
in nsMenuPopupFrame as well as we keep screen sizes there.

Differential Revision: https://phabricator.services.mozilla.com/D141602
2022-03-25 09:33:18 +00:00
stransky 19c39f9ec2 Bug 1760172 [Wayland] Rename PreferredPopupRect to MoveToRectPopupRect r=emilio
Rename PreferredPopupRect* methods/attributes to MoveToRectPopupRect* ones as it holds info about coordinates received from move-to-rect popup placement done by Wayland compositor.

Differential Revision: https://phabricator.services.mozilla.com/D141425
2022-03-22 20:04:54 +00:00
Hector Zhao 777803423b Bug 1757800 - Calculate scrollbar marks' positions with explicit `window.scrollMin{X,Y}`. r=jfkthame,emilio
In `vertical-rl` & `sideways-rl` writing modes, `window.scrollMinX` is not 0.

Differential Revision: https://phabricator.services.mozilla.com/D140485
2022-03-08 05:27:42 +00:00
Emilio Cobos Álvarez cff9bc48a3 Bug 1757996 - Improve context menu handling on Wayland. r=stransky
What caused the issue was that nsMenuPopupFrame::MoveTo didn't account
for the change in bug 312891. But our context menu / popup positioning
code can be much simpler if we account for the context menu offset
before-hand as an extra horizontal / vertical margin in all directions.

Then we don't need to special-case it at all.

Differential Revision: https://phabricator.services.mozilla.com/D140263
2022-03-04 11:45:41 +00:00
Noemi Erli d69b2997c4 Backed out changeset 86a8141f5590 (bug 1757996) for causing failures in test_popup_attribute.xhtml CLOSED TREE 2022-03-04 13:27:43 +02:00
Emilio Cobos Álvarez 9c57b41359 Bug 1757996 - Improve context menu handling on Wayland. r=stransky
What caused the issue was that nsMenuPopupFrame::MoveTo didn't account
for the change in bug 312891. But our context menu / popup positioning
code can be much simpler if we account for the context menu offset
before-hand as an extra horizontal / vertical margin in all directions.

Then we don't need to special-case it at all.

Differential Revision: https://phabricator.services.mozilla.com/D140263
2022-03-04 10:31:32 +00:00
stransky 52970abaec Bug 1755521 - Don't lose track of anchor rect width on popup position change. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D138827
2022-03-02 12:33:27 +00:00
stransky 88a2067f30 Bug 1755521 Store SizedToPopup attribute to use in nsMenuPopupFrame::MoveTo() to avoid unwanted popup resize r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D139944
2022-03-02 10:27:54 +00:00
Hector Zhao 37cef69543 Bug 1700292 - reftest for marks on horizontal scrollbar. r=layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D139002
2022-03-01 13:19:00 +00:00
Hector Zhao 1efb3c674c Bug 1700292 - Draw scroll marks on horizontal scrollbar as well. r=emilio,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D139001
2022-03-01 13:19:00 +00:00
Emilio Cobos Álvarez a8d5f9838a Bug 312891 - Right align RTL context menus on non-Wayland platforms. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D139484
2022-03-01 11:58:22 +00:00
Emilio Cobos Álvarez a0014f1385 Bug 1757106 - Fix early-out in nsMenuPopupFrame::MoveTo to account for margins. r=stransky
This was also broken.

Differential Revision: https://phabricator.services.mozilla.com/D139670
2022-03-01 01:11:20 +00:00
Emilio Cobos Álvarez 4b49d8b1fa Bug 1757106 - Clean up menu popup rect handling. r=stransky
Store preferred rect in dev pixels, which simplifies a bit other calculations,
and ensures that the nsMenuPopupFrame code accounts for zoom etc.

Use existing conversion methods for GDK <-> Device <-> CSS conversions.

Differential Revision: https://phabricator.services.mozilla.com/D139623
2022-03-01 01:06:37 +00:00
Emilio Cobos Álvarez 8724285359 Bug 1757402 - Add basic native context menu support on GTK. r=stransky
I had this written somewhere in a branch, but given bug 1419151, I
cleaned it up a bit and turned it into an actual patch that works.

Behind a pref for now, because at the very least it needs:

 * Support for some testing-only functions.
 * Support for custom icons (for web extensions and so on).

The key point is that this adds the relevant code to map a XUL menu to a
GMenuModel, which we could then export via
`g_dbus_connection_export_menu_model()`, which seems like a much simpler
approach to support stuff like bug 1419151.

See the MenuModel class in NativeMenuGtk as for how is this done.

Differential Revision: https://phabricator.services.mozilla.com/D139845
2022-02-28 14:53:24 +00:00
Emilio Cobos Álvarez 8fbe4e5c08 Bug 1750487 - Fix weird full-zoom handling for unanchored popups in nsMenuPopupFrame positioning. r=mstange
I don't see why ever mScreenRect would deal with zoom-less coordinates.
I _suspect_ this might have been accounting for screenX/Y not dealing
with zoom in the past, but that was fixed (not long ago, actually) in
bug 1753836.

Also, browser.xhtml never has zoom. I haven't seen this causing problems
in practice in non-Wayland platforms, but I think it's the right thing
to do and the code as is is extremely confusing, since other places
applying screen rects and context menu offsets treat them as real CSS
pixels:

  https://searchfox.org/mozilla-central/rev/73a8000b0c0eb527faef01ea17c6d2398622a386/layout/xul/nsMenuPopupFrame.cpp#2407-2411

So I don't think this changes behavior in practice in non-wayland
platforms given we never have full zoom in browser.xhtml and we mostly
hit this code path for context menus, but given the above I think it's
simpler and more correct.

Depends on D139670

Differential Revision: https://phabricator.services.mozilla.com/D139671
2022-02-25 00:35:51 +00:00
Nicolas Silva 50ca258be2 Bug 1755747 - Add support for antialiased non-snapped rectangles. r=gfx-reviewers,aosmond
We need them for SVG primitives.

This patch adds a bit of plumbing to disable snapping some of the primitives and forcing the antialiasing shader feature where needed, and uses it for SVG solid rectangles and images.

Differential Revision: https://phabricator.services.mozilla.com/D139024
2022-02-23 13:37:39 +00:00
Miko Mynttinen ddec6eef59 Bug 1714584 - Part 1: Decouple nsDisplayList internal list from nsDisplayItems r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D138152
2022-02-22 23:42:18 +00:00
Norisz Fay 2121660ce9 Backed out 2 changesets (bug 1714584) per devs request for causing crashes a=backout
Backed out changeset 3baead3e079b (bug 1714584)
Backed out changeset a2da895a58ce (bug 1714584)
2022-02-22 16:41:57 +02:00
Miko Mynttinen 28474c7ad2 Bug 1714584 - Part 1: Decouple nsDisplayList internal list from nsDisplayItems r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D138152
2022-02-22 00:44:25 +00:00
Emilio Cobos Álvarez a8ddbfd586 Bug 1756323 - Fix tooltip coordinates in presence of full zoom. r=jfkthame
And cleanup similar code in nsXULTooltipListener. That code shouldn't
need to deal with zoom since the target and the tooltip are in the same
document.

Differential Revision: https://phabricator.services.mozilla.com/D139235
2022-02-21 17:30:08 +00:00
Emilio Cobos Álvarez 0e94643a7d Bug 1755165 - Check MayShowMenu synchronously in async OpenMenu. r=NeilDeakin
This preserves the previous behavior, though arguably we shouldn't call OpenMenu
to begin with if the menu has been rolled up.

Differential Revision: https://phabricator.services.mozilla.com/D138637
2022-02-14 23:40:57 +00:00
Timothy Nikkel b12ec7f651 Bug 1754435. Add a simple cache for nsDeckFrame::GetSelectedBox. r=emilio
It's easy to do and stops us from being wasteful.

Differential Revision: https://phabricator.services.mozilla.com/D138289
2022-02-10 12:27:44 +00:00
Daniel Holbert d724bbe121 Bug 1754105: Fix non-unified build errors in layout/xul, and mark it as safe to build in non-unified mode. r=emilio
Build errors being fixed here:

layout/xul/nsDeckFrame.cpp:164:43: error: unknown type name 'nsSetAttrRunnable'

layout/xul/nsMenuBarListener.cpp:45:7: error: cannot initialize a member subobject of type 'mozilla::dom::EventTarget *' with an rvalue of type 'nsINode::Document *' (aka 'mozilla::dom::Document *')
(...where "Document" is not defined; this patch includes the header that defines it, which fixes this.)

layout/xul/nsBoxFrame.cpp:270:10: error: 'return' will never be executed [-Werror,-Wunreachable-code-return]

dist/include/nsIRollupListener.h:36:38: error: no type named 'LayoutDeviceIntPoint' in namespace 'mozilla'
(For this error, this patch is changing a header outside of layout/xul, but
it's still required in order for layout/xul to build properly, since it's
#included by layout/xul/nsXULPopupManager.cpp (indirectly, via its .h file).

Differential Revision: https://phabricator.services.mozilla.com/D138092
2022-02-08 20:16:55 +00:00
Iulian Moraru 5d2d64aa7e Backed out changeset c43ced1d19d9 (bug 1754105) for causing bp-hybrid bustages on nsBoxFrame. 2022-02-08 07:46:15 +02:00
Daniel Holbert dbdeaeabaf Bug 1754105: Fix non-unified build errors in layout/xul, and mark it as safe to build in non-unified mode. r=emilio
Build errors being fixed here:

layout/xul/nsDeckFrame.cpp:164:43: error: unknown type name 'nsSetAttrRunnable'


layout/xul/nsMenuBarListener.cpp:45:7: error: cannot initialize a member subobject of type 'mozilla::dom::EventTarget *' with an rvalue of type 'nsINode::Document *' (aka 'mozilla::dom::Document *')
(...where "Document" is not defined; this patch includes the header that defines it, which fixes this.)


dist/include/nsIRollupListener.h:36:38: error: no type named 'LayoutDeviceIntPoint' in namespace 'mozilla'
(For this error, this patch is changing a header outside of layout/xul, but
it's still required in order for layout/xul to build properly, since it's
#included by layout/xul/nsXULPopupManager.cpp (indirectly, via its .h file).

Differential Revision: https://phabricator.services.mozilla.com/D138092
2022-02-08 01:04:19 +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 70d562520d Bug 1748181 - Provide a pref to make scrollbar-width: thin behave as auto. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D137898
2022-02-07 18:14:31 +00:00
Andi-Bogdan Postelnicu 30631a4a9b Bug 1519636 - Reformat recent changes to the Google coding style. r=sylvestre
Updated with clang-format version 13.0.0 (taskcluster-dIIauZE0TkuXy6_23BQhcw)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D137147
2022-01-31 17:00:21 +00:00
Emilio Cobos Álvarez dc4988bbd0 Bug 1729805 - Make async OpenMenu simpler/sound. r=NeilDeakin,mstange
There's only one caller of it and it's not sound: The runnable captures a
raw frame pointer etc. Instead, just do a dispatch to the main thread
and call OpenMenu there. This simplifies the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D131082
2022-01-25 21:40:22 +00:00
Gijs Kruitbosch 25603b04b3 Bug 1749032 - fix C++ consumers of nsISound to access it as a service, r=NeilDeakin
Depends on D136481

Differential Revision: https://phabricator.services.mozilla.com/D136482
2022-01-24 12:09:59 +00:00
Ting-Yu Lin 653f4b3694 Bug 1745113 Part 5 - Make grapheme cluster break iterators implement SegmentIteratorUtf16, and adapt the callers. r=necko-reviewers,jfkthame,kershaw
This is the main patch for the bug. It aims to change the grapheme cluster
break's `Next()` API by implementing SegmentIteratorUtf16 interface, and adapt
the callers. It shouldn't change the behavior.

While rewriting the caller, one caveat worth mentioning is the loop termination
condition. If the old code relies on `!AtEnd()` as the loop termination
condition, and it advances the iterator at the end of the loop, it meant
to *skip* its logic when the break position is at the end of the string. For
example, see the `mozTXTToHTMLConv::NumberOfMatches`.

This patch also hooks grapheme cluster break iterator into
Segmenter::TryCreate() interface.

Existing test coverage for the file changed:
- netwerk/test/unit/test_mozTXTToHTMLConv.js
- layout/reftests/forms/input/file/dynamic-max-width.html

Differential Revision: https://phabricator.services.mozilla.com/D135643
2022-01-13 18:36:04 +00:00
Ting-Yu Lin 948b11a2dc Bug 1745113 Part 2 - Move ClusterReverseIterator into Segmenter.h, and rename it. r=necko-reviewers,kershaw
Include "nsLayoutUtils.h" in nsFileControlFrame to get rid of warnings in my
editor because it uses utilities such as `nsLayoutUtils::AppUnitWidthOfString`.
We compile it without issues because of unified build.

Differential Revision: https://phabricator.services.mozilla.com/D135640
2022-01-13 18:36:03 +00:00
Ting-Yu Lin e522533f4e Bug 1745113 Part 1 - Move ClusterIterator into Segmenter.h, and rename it. r=necko-reviewers,kershaw
This patch doesn't change the behavior. Just move the code around.

Differential Revision: https://phabricator.services.mozilla.com/D135639
2022-01-13 18:36:03 +00:00
Andi-Bogdan Postelnicu 120496a230 Bug 1519636 - Reformat recent changes to the Google coding style. r=sylvestre
Updated with clang-format version 13.0.0 (taskcluster-dn0nWlPhT22vaQNfMnFkSg)

Differential Revision: https://phabricator.services.mozilla.com/D135325
2022-01-11 15:49:03 +00:00
Cristian Tuns dea3b789a7 Backed out 2 changesets (bug 1617369, bug 1519636) for causing lint failures on multiple files. CLOSED TREE
Backed out changeset 6726892a0012 (bug 1617369)
Backed out changeset c08caa5f8504 (bug 1519636)
2022-01-11 04:38:34 -05:00
Andi-Bogdan Postelnicu f4ea362111 Bug 1519636 - Reformat recent changes to the Google coding style. r=sylvestre
Updated with clang-format version 13.0.0 (taskcluster-dn0nWlPhT22vaQNfMnFkSg)

Differential Revision: https://phabricator.services.mozilla.com/D135325
2022-01-11 09:16:56 +00:00
Cristian Tuns 263078f4c0 Backed out changeset e7b991987ae5 (bug 1742797) for causing bug 1748808 CLOSED TREE 2022-01-07 02:32:44 -05:00
Hiroyuki Ikezoe a74d5debf3 Bug 1742797 - Discard WebRender resources when popup hides. r=Gijs,emilio
The browser test in this change was originally written by Gijs.

Differential Revision: https://phabricator.services.mozilla.com/D134444
2022-01-06 02:51:38 +00:00
Noemi Erli e560c5d324 Backed out changeset 14f484747a66 (bug 1742797) for causing failures in nsMenuPopupFrame.cpp CLOSED TREE 2022-01-06 00:49:35 +02:00
Hiroyuki Ikezoe bd03f6e7ce Bug 1742797 - Discard WebRender resources when popup hides. r=Gijs,emilio
The browser test in this change was originally written by Gijs.

Differential Revision: https://phabricator.services.mozilla.com/D134444
2022-01-05 21:24:20 +00:00
Andrew Osmond 99ecadd31a Bug 1748216 - Ensure that we invalidate previously decoded images without a surface ready. r=jrmuizel
Part of how invalidation works with WebRender is that we assume frames
with a WebRenderUserData object attached to them are in view. This means
for images that we must ensure we create an empty
WebRenderImageProviderData object even when we have no provider or
surface for display. This will allow us to invalidate properly when we
get the FRAME_COMPLETE notification from imagelib indicating that the
redecode has completed.

Differential Revision: https://phabricator.services.mozilla.com/D135077
2022-01-04 22:01:26 +00:00
Mike Hommey fce6eb7d83 Bug 1747165 - Replace TK_FLAGS/TK_LIBS with MOZ_GTK3_FLAGS/MOZ_GTK3_LIBS. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D134464
2021-12-23 20:29:07 +00:00
Kagami Sascha Rosylight 964184af24 Bug 1539884 - Part 31: Mark nsTreeBodyFrame::FireScrollEvent as CAN_RUN_SCRIPT r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D134414
2021-12-23 16:27:24 +00:00