Commit Graph

1436 Commits

Author SHA1 Message Date
Hiroyuki Ikezoe
61a6f8e3f2 Bug 1478576 - A mochitest for system font change notification. r=froydnj,jimm,karlt
The test case in this patch fails without the proper fix in the first patch
in this patch series.

In this patch two new nsIDOMWindowUtils APIs are introduced to change the
system font settins in tests.  Currently the APIs work only on GTK+ platform.

Also to work the test case properly we need to open a new XUL window because we
don't propagate font changes into descendant documents yet (bug 1478212).

MozReview-Commit-ID: 4OLxEkEuF8d

--HG--
extra : rebase_source : 683e64f07c4d8820e5499d8c15b90975618559b8
2018-08-07 11:58:36 +09:00
Henri Sivonen
3edc601325 Bug 1402247 - Use encoding_rs for XPCOM string encoding conversions. r=Nika,erahm,froydnj.
Correctness improvements:

 * UTF errors are handled safely per spec instead of dangerously truncating
   strings.

 * There are fewer converter implementations.

Performance improvements:

 * The old code did exact buffer length math, which meant doing UTF math twice
   on each input string (once for length calculation and another time for
   conversion). Exact length math is more complicated when handling errors
   properly, which the old code didn't do. The new code does UTF math on the
   string content only once (when converting) but risks allocating more than
   once. There are heuristics in place to lower the probability of
   reallocation in cases where the double math avoidance isn't enough of a
   saving to absorb an allocation and memcpy.

 * Previously, in UTF-16 <-> UTF-8 conversions, an ASCII prefix was optimized
   but a single non-ASCII code point pessimized the rest of the string. The
   new code tries to get back on the fast ASCII path.

 * UTF-16 to Latin1 conversion guarantees less about handling of out-of-range
   input to eliminate an operation from the inner loop on x86/x86_64.

 * When assigning to a pre-existing string, the new code tries to reuse the
   old buffer instead of first releasing the old buffer and then allocating a
   new one.

 * When reallocating from the new code, the memcpy covers only the data that
   is part of the logical length of the old string instead of memcpying the
   whole capacity. (For old callers old excess memcpy behavior is preserved
   due to bogus callers. See bug 1472113.)

 * UTF-8 strings in XPConnect that are in the Latin1 range are passed to
   SpiderMonkey as Latin1.

New features:

 * Conversion between UTF-8 and Latin1 is added in order to enable faster
   future interop between Rust code (or otherwise UTF-8-using code) and text
   node and SpiderMonkey code that uses Latin1.

MozReview-Commit-ID: JaJuExfILM9
2018-08-14 14:43:42 +03:00
Tim Nguyen
f0ee1746ef Bug 1472276 - Make -moz-cellhighlight distinct from Highlight and -moz-field r=karlt
Since focused+selected tree cells will no longer get an outline, we will start using a different background for the unfocused state.
That background needs to be distinct from Highlight, used on selected and focused items
and also distinct from -moz-appearance: listbox, which is used as the box background.

MozReview-Commit-ID: 7hcnueYlOXR

--HG--
extra : rebase_source : 42bb15e86252d72a3f58831079162d0f4723afc9
2018-06-29 19:23:03 +01:00
Martin Stransky
4854321662 Bug 1481385 - Calculate bitmap mask size with stride. r=lsalzman
--HG--
extra : amend_source : 950b8705896cbe861366f1ea80f657d5debd097a
2018-08-09 12:10:18 +03:00
Neil Deakin
a399d3073b Bug 1473029, convert drag services to internally use CSSIntRegion instead ns nsIScriptableRegion, r=mstange 2018-08-07 09:32:08 -04:00
Neil Deakin
03caccfe9e Bug 1473029, remove the region arguments from InvokeDragSession and InvokeDragSessionWithImage, r=mstange 2018-08-07 09:32:07 -04:00
Jonathan Watt
c39e987a28 Bug 1428676 pt 6. Honor the webkit pref when handling 'menulist-button' on Linux. r=emilio 2018-07-16 19:09:42 +01:00
Martin Stransky
505c25cbf9 Bug 1480409 - [Linux/Gtk] Don't hardcode mHasAlphaVisual to true when WenRender is used, r=jhorak
Original patch author is Sotaro Ikeda [:sotaro] <sotaro.ikeda.g@gmail.com>

MozReview-Commit-ID: AVtDvWFqsxT

--HG--
extra : rebase_source : be77c1a7df0036b454c8795a56a20acc785a548e
2018-08-02 15:18:51 +02:00
Jonathan Watt
11e49726b5 Bug 1428676 pt 1. Add a '-moz-menulist-button' value to '-moz-appearance'. r=emilio
The '-moz-menulist-button' value currently behavies identically to the
'menulist-button' value.  This is not implemented as an alias because later
patches in this patch series will change the behavior of our pre-existing
'menulist-button' value to more closely match what Chrome does.
2018-06-19 20:12:45 +01:00
shindli
0a48a3cd3c Backed out 3 changesets (bug 1428676) for bc failures in browser/base/content/test/static/browser_parsable_css.js on a CLOSED TREE
Backed out changeset 6ba5975115fc (bug 1428676)
Backed out changeset 7f1270a9ec3d (bug 1428676)
Backed out changeset 662bfc31a950 (bug 1428676)
2018-07-31 19:30:46 +03:00
Jonathan Watt
e8a416046f Bug 1428676 pt 1. Add a '-moz-menulist-button' value to '-moz-appearance'. r=emilio
The '-moz-menulist-button' value currently behavies identically to the
'menulist-button' value.  This is not implemented as an alias because later
patches in this patch series will change the behavior of our pre-existing
'menulist-button' value to more closely match what Chrome does.

--HG--
extra : rebase_source : b66bf6427db5be2eb12f4e0aa36d22a4da46555a
2018-06-19 20:12:45 +01:00
Masayuki Nakano
6da4b51b7b Bug 971462 - Hide event type from constructor of WidgetCommandEvent r=smaug
The constructor of WidgetCommandEvent takes 2 nsAtom pointers.  One is for
specifying event type, the other is for specifying the command.  The
difference of these arguments are pretty unclear for other developers and
the former argument is always nsGkAtoms::onAppCommand unless nullptr in
C++ code.  So, we can hide the former argument.

Then, we should create another constructor for creating empty command event
from constructor of dom::CommandEvent.

Differential Revision: https://phabricator.services.mozilla.com/D2506

--HG--
extra : moz-landing-system : lando
2018-07-30 12:20:47 +00:00
Martin Stransky
a0b8933f57 Bug 1401634 - Flush window XID to X server before we pass the XID to gpu process, r=jhorak
Make sure the window XID is propagated to X server, we can fail otherwise
in GPU process.

MozReview-Commit-ID: BMkLvhs4vRt

--HG--
extra : rebase_source : 34269cbf7e088fd15c090f3abc8ee2d46da307c4
2018-07-27 14:00:09 +02:00
Masayuki Nakano
9092695677 Bug 1461307 - Overwrite selection colors of widget which may be referred by IME via IM context with selection colors of GtkTextView r=karlt
IME (e.g., fcitx) may refer selection colors of widget under window which
is associated with IM context to support any colored widget.  So, IME
expects good selection colors which have sufficient contrast between
foreground and background, and also selection background color and
widget background color like GtkTextView.  However, some desktop themes
set our widget to different selection colors from GtkTextView which may
be unreadable.

nsTextFrame (which paints composition string) expects that composition
string colors coming from IME are sufficiently readable and background
color of composition string and background color of our editor's default
style (coming from LookAndFeel) have sufficient contrast because
nsTextFrame assmes that composition string colors coming from IME are
decided for the default style.

Therefore, this patch creates SelectionStyleProvider which overwrites
selection style of our widget with selection style of GtkTextView so
that IME can refer selection colors of GtkTextView via our widget.

MozReview-Commit-ID: 5vdcSgoEYv0

--HG--
extra : rebase_source : edf375ac393a72d3e44839a76d5c44b6db12dc63
2018-07-13 18:12:53 +09:00
Hiroyuki Ikezoe
9388b988a3 Bug 1478519 - Support prefers-reduced-motion for GTK. r=karlt
The corresponding setting for prefers-reduced-motion on GTK is
gtk-enable-animations I belive.

https://developer.gnome.org/gtk3/stable/GtkSettings.html#GtkSettings--gtk-enable-animations

MozReview-Commit-ID: GvfLYfntKym

--HG--
extra : rebase_source : 1c69f59345c381373d610eb4804fb3e0a894aa2c
2018-07-27 14:42:14 +09:00
Csoregi Natalia
3708e71462 Merge inbound to mozilla-central. a=merge 2018-07-27 00:58:11 +03:00
Emilio Cobos Álvarez
517256e365 Bug 1478391: Autogenerate StyleAppearance. r=jwatt
This builds on bug 1428676 and introduces StyleAppearance, which replaces the
NS_THEME_* constants.

Really sorry for the size of the patch.

There's a non-trivial change in the gtk theme, which I submitted separately as
bug 1478385.

Differential Revision: https://phabricator.services.mozilla.com/D2361

MozReview-Commit-ID: DiSmMWK7Krp
2018-07-26 17:06:17 +02:00
Martin Stransky
2866163527 Bug 1478661 - Replace IsComposited() with explicit alpha visual state, r=jhorak
IsComposited() does not reflect Visual selected by GLContextGLX::FindVisual()
which is used by WebRender which leads to shaped window rendering with WebRender.

IsComposited() is replaced by mHasAlphaVisual variable which is explicitly
set when we have an alpha visual and we don't need to use shape X11 extension.

MozReview-Commit-ID: 1kDLwkUyHte

--HG--
extra : rebase_source : 3a60fe8fd66f9e89bfcc729fe5e1fa9e1ce8920d
2018-07-26 13:23:34 +02:00
Martin Stransky
03659d442a Bug 1406533 - Don't force in process rendering for transparent (popup) windows, r=lsalzman
MozReview-Commit-ID: 2TS1CXsp44A

--HG--
extra : rebase_source : c8e8b7b3eadd07d2bf9bdeb9fa3c9625f914dba5
2018-07-24 16:15:43 +02:00
Martin Stransky
6eaa46bc39 Bug 1406533 - Configure compositor widget to shape X11 window on non-compositing WM, r=lsalzman
Also remove mozilla.widget.use-argb-visuals which is useless since we don't allow transparent
toplevel windows.

MozReview-Commit-ID: 2ep3daeLZTG

--HG--
extra : rebase_source : 9ca5f2d0ded6dec1827caf2cb87e81fcb9b11792
2018-07-24 16:11:37 +02:00
Martin Stransky
7cf247d562 Bug 1406533 - Implement a way to transfer shape option from nsWindow to WindowSurfaceX11Image, r=lsalzman
Add a new config attribute to GtkCompositorWidgetInitData to allow transfer
the shape option from nsWindow. Also when shape is requested don't use XRender
or Shm widgets - only X11Image is supported now.

MozReview-Commit-ID: ElxnGQpLOry

--HG--
extra : rebase_source : 03552fc4103f6b22c512c07fe37102701998ed94
2018-07-24 16:07:04 +02:00
Martin Stransky
c7e7412047 Bug 1406533 - Create and apply XShape mask at WindowSurfaceX11Image, r=lsalzman
Derived routines for shape bitmap mask form nsWindow.cpp,
at WindowSurfaceX11Image we compose a final RGBA image and then create
the shape mask from image alpha channel.

Also the implementation is slightly simplified as it's meant as a fallback only.

MozReview-Commit-ID: 6VtGcsVKlcv

--HG--
extra : rebase_source : e8b96d68082ae687e376bc89c79f88f9c34cdc15
2018-07-24 16:02:05 +02:00
Emilio Cobos Álvarez
9004e91bec Bug 1478385: Fix confusion in GetCachedWidgetBorder. r=karlt
aWidgetType is a NS_THEME_* constant. What this code is comparing is not.

This was exposed by a patch of mine converting -moz-appearance to be an enum
class.

MozReview-Commit-ID: 9BsbYk04vop
2018-07-26 14:48:08 +02:00
Jan Horak
294a592750 Bug 1477967 - Fix the popup menu sizes and redrawing on Wayland/hidpi monitor, r=stransky
This patch fixes redrawing of the popup element by removing the scale factor
from the invalid regions because the wl_surface_damage multiplies it with the
scale factor too.

Also we set scaling factor of the wl_surface right after we create it to avoid
flickering when the compositor switches from unscaled to scaled surface.

MozReview-Commit-ID: 1eGoFu87wtF

--HG--
extra : rebase_source : 08abe86889e34865f3eed0f3979b4a584cc74adb
2018-07-24 12:51:34 +02:00
Martin Stransky
ce20ee9233 Bug 1475193 - Use nsWindow::IsComposited() where possible, r=jhorak
MozReview-Commit-ID: E28fUnRFWaY

--HG--
extra : rebase_source : e9b2d5b1f159479299978353e6521882b6021a8e
2018-07-12 11:51:38 +02:00
Martin Stransky
cd921ebea3 Bug 1470047 - Implement InitBySystemSettingsWayland() and get key modifiers on Wayland, r=ashie
Use wl_keyboard_listener and keymap event to get key mapping on Wayland. Weston simple-im.c example
is used as a reference implementation and actual key modifiers are derived from Wayland/GDK code from
gdkkeys-wayland.c.

MozReview-Commit-ID: 9fMwCvxkYy0

--HG--
extra : rebase_source : 21212cadfa7b1e8bacec2d6fb6970d2aaba7b3f6
2018-07-10 18:28:32 +02:00
Martin Stransky
df210ffb15 Bug 1444437 - [Wayland] Don't map mozcontainer subsurface until parent surface is commited, r=ashie
MozReview-Commit-ID: 4qoyGH8VCAU

--HG--
extra : rebase_source : 32c2e5d80268d082b4a9a8ae8c90d2ee86537fd2
2018-06-28 13:37:31 +02:00
Martin Stransky
1f770d80e5 Bug 1467128 - [Wayland] Get VSync from Gtk/Wayland, r=lsalzman
VSync on Wayland is a bit tricky as we can get only "last VSync" event signal with
CLOCK_MONOTONIC timestamp or none (if application is hidden/minimized).

That means we should draw a next frame at "last Vsync + frame delay" time and also
approximate next VSync event when we don't get any.

MozReview-Commit-ID: FI3Z4nkmDNK

--HG--
extra : rebase_source : 8a0f6148990cf4e7ad26ff287eadff87cb0215fc
2018-06-29 13:15:41 +02:00
Cosmin Sabou
a612a6fdf5 Merge mozilla-central to mozilla-inbound. a=merge 2018-06-28 13:13:46 +03:00
Samuel Thibault
01084d60d8 Bug 1376756 - gtk: while drawing nsTreeBodyFrame, fetch current row attributes for proper style rendering. r=karlt 2018-06-27 05:11:00 +03:00
Masayuki Nakano
d4325e3dc9 Bug 1215818 - part 3: Add telemetry probe to collect IM share on Linux r=m_kato
Different from Windows and macOS, we cannot check if active keyboard layout
works as "IME" actually.  Therefore, this patch add the telemetry probe
to the dispatcher of eCompositionStart.  However, composition string is also
used by some Wester keyboard layouts which have dead keys.  So, the meaning
of the result is deferent from the other platforms, but it must be useful
information which IM (e.g., fcitx, ibus) is used by most users.

MozReview-Commit-ID: A7vYuGtcrRw

--HG--
extra : rebase_source : 1f0948b58b999eee4b539d7db05d455b34f4be72
2018-06-20 14:55:46 +09:00
Jeff Gilbert
5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Margareta Eliza Balazs
14cb8f1c23 Merge inbound to mozilla-central. a=merge 2018-06-26 17:53:19 +03:00
Chris Peterson
2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Martin Stransky
daff99d97a Bug 1467125 - [Wayland] Get events from Wayland display faster on compositor thread, r=jhorak
MozReview-Commit-ID: AmarsYA2INc

--HG--
extra : rebase_source : c30015ba1a45e98691abdeb012bede816eb8c440
2018-06-06 15:25:15 +02:00
Chris Peterson
ed185e6484 Bug 1469769 - Part 5: widget/gtk: Replace failing NS_NOTREACHED with NS_ERROR. r=karlt
I'm replacing non-failing calls to NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE, but this NS_NOTREACHED fails when running the browser/base/content/test/general/browser_tab_dragdrop2.js test because mContainer is unexpectedly *not* null. This is bug 1469183.

This patch DOES NOT fix the cause of the assertion failure. It just replaces this failing NS_NOTREACHED with NS_ERROR because I can't replace with a fatal MOZ_ASSERT_UNREACHABLE.

MozReview-Commit-ID: KeVjvKGihxZ

--HG--
extra : rebase_source : dc08a8e15d1e98cda0fa755be43c6d06910bfbe8
extra : intermediate-source : 562cc0bfc636f29b1708acd3284567bb8492e030
extra : source : 4f14f18eccd6bb18ed92f1d39a265a30ccdd21a1
2018-06-04 01:43:02 -07:00
Doug Thayer
10ff9c706f Bug 1448040 - Remove HangMonitor/ChromeHangs r=Nika
Fairly straightforward, just a blanket removal. Haven't heard
anything on dev-platform or fx-data-dev regarding this removal,
so I think it's likely safe to remove on Nightly, and we can
revert if anyone makes a fuss.

As part of removing the HangMonitor, I renamed a few things and
reorganized the namespaces to not depend on a HangMonitor
namespace. Hopefully this doesn't produce too much noise in the
diff, it just seemed appropriate to move everything around
rather than keep dangling vestiges of the old system.

MozReview-Commit-ID: 8C8NFnOP5GU

--HG--
extra : rebase_source : dd000a05bfc2da40c586644d33ca4508fa5330f6
2018-04-29 18:21:20 -07:00
Martin Stransky
99a9d4a1c3 Bug 1441743 - [Wayland] Don't draw directly to frame buffer for partial window updates, r=jhorak
When only a part of window is updated we need to clip that drawing.
We use image surface for that as WindowSurfaceX11Image does.

MozReview-Commit-ID: 13znE1ZszB8

--HG--
extra : rebase_source : a236799fa33d73037913df94c0d5e619c5d3c47e
2018-06-15 09:41:56 +02:00
Takuro Ashie
06d69fd42b Bug 1468670 - Enablel Alt modifier key on Wayland r=stransky
MozReview-Commit-ID: 3nxxJabsTkx

--HG--
extra : rebase_source : 11b19f1fce05714177c9782485b9a1cb5fadd491
extra : source : 5b0768baf0b7cb2fe1728ba1dcce1344b8e4bcfd
2018-06-20 16:24:27 +09:00
Martin Stransky
46f6ecf022 Bug 1464823 - [Wayland] Don't paint until we have a visible wl_surface, r=jhorak,lsalzman
It's based on a solution by Takuro Ashie <ashie@clear-code.com>

MozReview-Commit-ID: FqcdUJQJLdl

--HG--
extra : rebase_source : d4ed4d66439a3693a2f4d5e6a4037ed62969d64f
2018-06-06 11:30:27 +02:00
Martin Stransky
5753c81b38 Bug 1466775 - [Wayland] Configure WebRender on X11, r=jhorak
MozReview-Commit-ID: ChXp7m5XeOI

--HG--
extra : rebase_source : 3b00ba11aad25be75e33138fefa4285b1b19ae21
2018-06-05 11:35:45 +02:00
Cosmin Sabou
0f45148664 Backed out changeset 531593bacc4e (bug 1448040) for Android build bustages on HangAnnotations.h. CLOSED TREE
--HG--
extra : rebase_source : ea3618023c548a8ca6ca14749633c194606af52f
2018-06-07 19:22:31 +03:00
Doug Thayer
87bf13e093 Bug 1448040 - Remove HangMonitor/ChromeHangs r=Nika
Fairly straightforward, just a blanket removal. Haven't heard
anything on dev-platform or fx-data-dev regarding this removal,
so I think it's likely safe to remove on Nightly, and we can
revert if anyone makes a fuss.

As part of removing the HangMonitor, I renamed a few things and
reorganized the namespaces to not depend on a HangMonitor
namespace. Hopefully this doesn't produce too much noise in the
diff, it just seemed appropriate to move everything around
rather than keep dangling vestiges of the old system.

MozReview-Commit-ID: 8C8NFnOP5GU

--HG--
extra : rebase_source : 59e4a6ced7d14d2a01c0b79e944078ea84cae523
2018-04-29 18:21:20 -07:00
Andreea Pavel
4ced6e8b2d Merge mozilla-central to autoland. a=merge 2018-06-03 07:27:01 +03:00
Mats Palmgren
8f2a5e19c9 Bug 1466330 - Make nsITheme::GetWidgetBorder return the border directly instead of using an out-param (idempotent patch). r=emilio 2018-06-02 19:10:48 +02:00
Csoregi Natalia
468205953d Merge inbound to mozilla-central. a=merge 2018-06-02 01:01:33 +03:00
Emilio Cobos Álvarez
fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Martin Stransky
6d3e29e131 Bug 1464808 - [Wayland] Emulate gdk_drag_context_get_actions(), nsWaylandDragContext::GetSelectedDragAction returns available D&D actions when no one is selected by user, r=jhorak
MozReview-Commit-ID: 586XiJXYZ3D

--HG--
extra : rebase_source : 32d006922cf93f2048f0dda236a69f730fc0f8a0
2018-06-01 12:24:17 +02:00
Noemi Erli
1fd69fa2bc Backed out 18 changesets (bug 1462784) for failures in devtools/client/performance/test/unit/test_tree-model-08.js on a CLOSED TREE
Backed out changeset a74d36598442 (bug 1462784)
Backed out changeset c8192175f360 (bug 1462784)
Backed out changeset cde492240e99 (bug 1462784)
Backed out changeset 8c8d30fa406c (bug 1462784)
Backed out changeset ad3802ffb780 (bug 1462784)
Backed out changeset 2fe10732076c (bug 1462784)
Backed out changeset 268a72b7c3c4 (bug 1462784)
Backed out changeset 4055eb6c3bc6 (bug 1462784)
Backed out changeset 3901070e2e60 (bug 1462784)
Backed out changeset 2faf787fbbdf (bug 1462784)
Backed out changeset 8f06963c7c6f (bug 1462784)
Backed out changeset 036e6f64e224 (bug 1462784)
Backed out changeset e670f156a603 (bug 1462784)
Backed out changeset cd39588aece4 (bug 1462784)
Backed out changeset 2ac65d100fa2 (bug 1462784)
Backed out changeset ea05ff70a51d (bug 1462784)
Backed out changeset 8a06c0ba42f7 (bug 1462784)
Backed out changeset 52ed9a039ad2 (bug 1462784)
2018-06-01 01:06:29 +03:00
Markus Stange
bdb6a5f828 Bug 1462784 - Annotate idle stacks in the native event loop on Linux. r=froydnj
MozReview-Commit-ID: 3Q2A7ytsn1Y

--HG--
extra : rebase_source : 83271e841a84fc2ac7a2fdd5cc66812fb09f61f1
2018-05-18 18:59:47 -04:00