Commit Graph

1325 Commits

Author SHA1 Message Date
sotaro
2ef480f239 Bug 1448271 - Update some names of #include guards r=nical 2018-03-23 22:40:04 +09:00
Boris Zbarsky
29d232e53f Bug 1447098 part 1. Rename FromContent on various DOM classes to FromNode. r=mystor
MozReview-Commit-ID: 202nkbmkwfR
2018-03-21 17:39:04 -04:00
shindli
55e9f63bac Merge inbound to mozilla-central. a=merge 2018-03-20 12:11:27 +02:00
Boris Zbarsky
1a7c5067ca Bug 1446851. Get rid of nsIDOMWheelEvent. r=qdot
We can't include WheelEventBinding.h in MouseEvents.h because that produces
this include loop:

WheelEventBinding.h -> MouseEventBinding.h -> UIEventBinding.h ->
nsGlobalWindow.h -> nsGlobalWindowInner.h -> nsRefreshDriver.h ->
AnimationEventDispatcher.h -> AnimationComparator.h -> Animation.h ->
EffectCompositor.h -> PseudoElementHashEntry.h -> Element.h ->
PointerEventHandler.h -> MouseEvents.h -> WheelEventBinding.h

MozReview-Commit-ID: 5KNwH69aJYW
2018-03-20 00:16:05 -04:00
Masayuki Nakano
e6ee7e1c05 Bug 1423693 - Make IMContextWrapper::Init() resolve actual IM if active IM context ID is "xim" and there is XMODIFIERS env r=m_kato
On some Linux environment, GTK_IM_MODULE env may be "xim".  Then, actual
IM is specified with XMODIFIERS env with "@im=".  Therefore, if active IM
context ID is xim, IMContextWrapper::Init() needs to look for actual IM name
in XMODIFIERS.

MozReview-Commit-ID: 1aGjBkF4AQn

--HG--
extra : rebase_source : 8c50baa517c61ec2d872c036abc989b4a07e8e36
2018-03-19 14:22:52 +09:00
Jeff Muizelaar
b0c6c75854 Bug 1439006. Allow multiple kinds of WebRenderUserData on a DisplayItem. r=mstange
Currently we can only have one type of WebRenderUserData on an Item. We already
have a hash table of WebRenderUserData so it's not hard to include type in the
hash to support one per type.

MozReview-Commit-ID: geJ0BeWv8b
2018-03-16 19:15:27 -04:00
James Willcox
8a43a8baff Bug 1401455 - Use correct GLX visual when rendering with WebRender r=karlt
MozReview-Commit-ID: AKT4bgdIkfV
2018-03-16 17:19:23 -05:00
James Willcox
1d6a993884 Back out Bug 1401455 due to Marionette failures on a CLOSED TREE 2018-03-16 11:19:40 -05:00
James Willcox
895d15231e Bug 1401455 - Use correct GLX visual when rendering with WebRender r=karlt
MozReview-Commit-ID: AKT4bgdIkfV
2018-03-16 08:39:48 -05:00
Masayuki Nakano
7744988cce Bug 1444571 - Prevent IIIM module from being unloaded with grabbing GtkIMContextIIIM class with static variable r=karlt
IIIMF is really old IME framework.  In these days, it's not used as default IM
module of any major distributions.  However, ATOK X which is old proprietary
IME requires IIIMF and it's still used by some Japanese IME users.  Therefore,
we need to take back the hack to prevent crash caused by IIIMF.

We did increment refcount of GtkIMContextIIIM class to prevent IIIM module
from being unloaded.  However, it was not ported when we changed default
toolkit from GTK2 to GTK3.  So, this is doing the porting.

Unfortunately, the instance of GtkIMContextIIIM is wrapped by opacity struct.
So, it's not safe to access the pointer with declaring a mimic struct.
Therefore, we should directly get GType from the name with calling
g_type_from_name("GtkIMContextIIIM") instead of using G_TYPE_FROM_INSTANCE()
and g_type_name().

MozReview-Commit-ID: GCZaSUtPiS9

--HG--
extra : rebase_source : 3b959023bf47fa26393fc04e722c9da79a50991d
2018-03-12 22:32:43 +09:00
Masayuki Nakano
162ea38a55 Bug 1444572 - IMContextWrapper should dispatch fake eKeyDown event during composition if active IM is uim r=m_kato
uim is an old IM which uses key snooper to listen to key events rather than
via filter key event API which should be called by applications.  It's still
used by Debian 9.x, so, we still need to support this.

Unfortunately, we cannot detect if uim actually uses key snooper because it's
switch by build option of uim.  Currently, Debian builds uim as using key
snooper.  So, we should assume uim uses key snooper always.  On the other
hand, somebody *might* use uim built as not using key snooper, so, let's
decide if uim uses key snooper with new pref,
"intl.ime.hack.uim.using_key_snooper", but its default should be true.

Note that ibus and Fcitx also have the mode to use key snooper (perhaps for
backward compatibility with uim).  However, it's not enabled in default
settings and even if it's enabled, Firefox is in whitelist in the default
settings of them for stop using key snooper.  Therefore, we don't need to
support key snooper mode for them unless we'll get some requests to
support their key snooping mode.

MozReview-Commit-ID: 6fTsfKrHzvo

--HG--
extra : rebase_source : 8ddf4541db635246e6bb0ddc73b012c9be001c6d
2018-03-12 15:41:39 +09:00
Andreea Pavel
067622ac36 Merge mozilla-inbound to mozilla-central. a=merge on a CLOSED TREE 2018-03-15 00:07:17 +02:00
Michael Webster
deda6780be Bug 1445503 - Use MIN instead of unnecessary CLAMP r=karlt
CLAMP is unnecessary as the minimum acceptable value is 0, and
progressPercent is unsigned. CLAMP can trigger the following warning/error in some builds:
error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]

--HG--
extra : rebase_source : 0dfcf4286a74adac03f7498f1d35fee069528826
2018-03-14 00:50:00 +02:00
Masayuki Nakano
28e4c11d86 Bug 1443421 - part 2: IMContextWrapper should dispatch eKeyDown or eKeyUp event as "processed by IME" even when IM sent some signals without sending key event again r=m_kato
ibus and fcitx usually post key event to other IME process, then, if it causes
some signals to updating composition string, they may not send the posted
key event to us again.  Then, IMContextWrapper dispatches neither eKeyDown nor
eKeyUp event since mProcessingKeyEvent becomes non-nullptr only while
OnKeyEvent() is called.  So, IMContextWrapper need to store key event if
OnKeyEvent() assumes that given key event is posted to different process.
Then, if IMContextWrapper receives some signals, it should dispatch eKeyDown
and eKeyUp event with stored key event.

Note that we cannot compare the pointer of first event and following event
directly even though usually both events are same address as far as I checked
because according to the source code of ibus, fcitx and GDK, they use
gdk_event_copy() to keep storing original event.  According to the document of
the API, it might just increment refcount.  However, the actual implementation
of the API always creates another instance and return it.  So, it might be
used same address by arena allocation or something accidentally.   Anyway,
we shouldn't compare them.  Instead, we need to compare each information of
two key events.  Unfortunately, we also cannot compare them simply.  Both
ibus and fcitx set unused bits of GdkEventKey::state to true when they send
back the event to us.  Therefore, we should compare some of or all of the
members by ourselves.  I think that matching time must be enough in most
cases since its value of native key events are properly set.  However, for
safer code, this patch also checks type, keyval and part of state.

MozReview-Commit-ID: FZSwN61v0Sd

--HG--
extra : rebase_source : e57a654392f476f5ec52d82bdd238eed2eb91e83
2018-03-09 12:39:40 +09:00
Masayuki Nakano
22ab980e4c Bug 1443421 - part 1: Make IMContextWrapper not dispatch eKeyDown and eKeyUp event if the native key event is being handled by other IME process r=m_kato
ibus and fcitx have asynchronous key event handling mode and it's enabled in
default settings.  That is, when they receive a key event from application via
a call of gtk_im_context_filter_keypress(), they may post the key event
information to other IME process, then does nothing but store the copy of the
event with gdk_event_copy() and returns true for the result of
gtk_im_context_filter_keypress().  When the other IME process handles the
event, returns the result to them in our process.  Then, they send the stored
key event to us again.  Finally, they actually handles the event in our process
actually.

Therefore, we may receive every key event twice.  So, this causes dispatching
eKeyDown event and eKeyUp event twice.  Preceding key event is always marked
as "processed by IME" since gtk_im_context_filter_keypress() returns true
temporarily and following key event is dispatched as expected.  So, we need
to ignore the first event only when gtk_im_context_filter_keypress() returns
true but the event is posted to different process.

Unfortunately, we cannot know if the key event is actually posted to different
process directly.  However, we can know if active IM is ibus, fcitx or another
one and if ibus or fcitx is in asynchronous key handling mode.

The former information is provided by gtk_im_multicontext_get_context_id().
It returns a string which is set to the IM multicontext instance by creator.
We'll get "ibus" if IM is ibus, get "fcitx" if IM is fcitx.

The latter information is not provided.  However, they consider the mode from
env value.  ibus checks IBUS_ENABLE_SYNC_MODE.  fcitx checks both
IBUS_ENABLE_SYNC_MODE and FCITX_ENABLE_SYNC_MODE.

Additionally, we can know if received key event has already been posted to
other IME process.  They use undefined bit of GdkEventKey::state to store
if the key event has already been posted (1 << 25, they called "ignored" flag).
Although their approach is really hacky but we can refer the information at
least for now.

Finally, when we guess a key event is posted to other IME process, let's
IMContextWrapper::OnKeyEvent() not dispatch eKeyDown nor eKeyUp event.
Note that if it's handled synchronously as unexpected, it may causes
dispatching one or more composition events and/or delete content event.
So, in such case, we dispatch a keyboard event for processing key event
anyway.  There is only once case we'll fail to dispatch keyboard event.
If we receive signals to dispatch composition events or delete content
command event when IM receives the result from other IME process but
it doesn't send the key event to us.  This will be fixed by the following
patch.

MozReview-Commit-ID: 94PrlnmQ3uJ

--HG--
extra : rebase_source : fc31b0293ff0f0688dd39b0094fdf8f98b6c64d3
2018-03-09 00:46:52 +09:00
Masayuki Nakano
3db8525089 Bug 1343451 - part 3-2: Make IMContextWrapper dispatch eKeyDown event or eKeyUp event if IME handles native key event but we have not dispatched DOM event for it yet r=m_kato
Currently, IMContextWrapper doesn't dispatch eKeyDown event and eKeyUp event
if it's handled by IME.  However, for conforming to UI Events, it should
not eat given keyboard events completely.

This patch makes IMContextWrapper dispatches eKeyDown event or eKeyUp event
before dispatching first event of composition events or content command
event.

MozReview-Commit-ID: H2jHpViTH5Q

--HG--
extra : rebase_source : a1f4127ba87e03e1ff97690f97fb7bf64b4d4818
2018-02-22 20:56:08 +09:00
Masayuki Nakano
896e893f72 Bug 1343451 - part 3-1: Make KeymapWrapper::InitKeyEvent() mark given key event as "processed by IME" if it has been handled by IME r=m_kato
For conforming UI Events spec, KeymapWrapper::InitKeyEvent() should initialize
mKeyCode and mKeyNameIndex with NS_VK_PROCESSKEY and KEY_NAME_INDEX_Process if
given keyboard event has already been handled by IME.

For making it know if given keyboard event has been handled by IME, this patch
adds additional bool argument to it and its callers.

Note that this patch changes keyCode value and key value of "keydown" event if
it's fired before "compositionstart" since Chromium does so on Linux.

MozReview-Commit-ID: FC3tfyeeopU

--HG--
extra : rebase_source : b7e2a70db1fbb4ca7d20379fd1c14f7dc38e656d
2018-02-22 19:52:53 +09:00
Dorel Luca
4295ed1070 Backed out 2 changesets (bug 1443421) for Valgrind leak on Linux x64 opt
Backed out changeset 6afa399e604a (bug 1443421)
Backed out changeset edc1455e7082 (bug 1443421)
2018-03-14 12:31:23 +02:00
Dorel Luca
b10a3945a4 Backed out changeset e226de7caa88 (bug 1444572) for conflicts while backing out 1443421 2018-03-14 12:28:59 +02:00
Masayuki Nakano
d23a5323b4 Bug 1444572 - IMContextWrapper should dispatch fake eKeyDown event during composition if active IM is uim r=m_kato
uim is an old IM which uses key snooper to listen to key events rather than
via filter key event API which should be called by applications.  It's still
used by Debian 9.x, so, we still need to support this.

Unfortunately, we cannot detect if uim actually uses key snooper because it's
switch by build option of uim.  Currently, Debian builds uim as using key
snooper.  So, we should assume uim uses key snooper always.  On the other
hand, somebody *might* use uim built as not using key snooper, so, let's
decide if uim uses key snooper with new pref,
"intl.ime.hack.uim.using_key_snooper", but its default should be true.

Note that ibus and Fcitx also have the mode to use key snooper (perhaps for
backward compatibility with uim).  However, it's not enabled in default
settings and even if it's enabled, Firefox is in whitelist in the default
settings of them for stop using key snooper.  Therefore, we don't need to
support key snooper mode for them unless we'll get some requests to
support their key snooping mode.

MozReview-Commit-ID: 6fTsfKrHzvo

--HG--
extra : rebase_source : 8ddf4541db635246e6bb0ddc73b012c9be001c6d
2018-03-12 15:41:39 +09:00
Masayuki Nakano
863964eb27 Bug 1443421 - part 2: IMContextWrapper should dispatch eKeyDown or eKeyUp event as "processed by IME" even when IM sent some signals without sending key event again r=m_kato
ibus and fcitx usually post key event to other IME process, then, if it causes
some signals to updating composition string, they may not send the posted
key event to us again.  Then, IMContextWrapper dispatches neither eKeyDown nor
eKeyUp event since mProcessingKeyEvent becomes non-nullptr only while
OnKeyEvent() is called.  So, IMContextWrapper need to store key event if
OnKeyEvent() assumes that given key event is posted to different process.
Then, if IMContextWrapper receives some signals, it should dispatch eKeyDown
and eKeyUp event with stored key event.

Note that we cannot compare the pointer of first event and following event
directly even though usually both events are same address as far as I checked
because according to the source code of ibus, fcitx and GDK, they use
gdk_event_copy() to keep storing original event.  According to the document of
the API, it might just increment refcount.  However, the actual implementation
of the API always creates another instance and return it.  So, it might be
used same address by arena allocation or something accidentally.   Anyway,
we shouldn't compare them.  Instead, we need to compare each information of
two key events.  Unfortunately, we also cannot compare them simply.  Both
ibus and fcitx set unused bits of GdkEventKey::state to true when they send
back the event to us.  Therefore, we should compare some of or all of the
members by ourselves.  I think that matching time must be enough in most
cases since its value of native key events are properly set.  However, for
safer code, this patch also checks type, keyval and part of state.

MozReview-Commit-ID: FZSwN61v0Sd

--HG--
extra : rebase_source : e54284c27a171f899a6cf87a65935669e2d57021
2018-03-09 12:39:40 +09:00
Masayuki Nakano
6a306796a7 Bug 1443421 - part 1: Make IMContextWrapper not dispatch eKeyDown and eKeyUp event if the native key event is being handled by other IME process r=m_kato
ibus and fcitx have asynchronous key event handling mode and it's enabled in
default settings.  That is, when they receive a key event from application via
a call of gtk_im_context_filter_keypress(), they may post the key event
information to other IME process, then does nothing but store the copy of the
event with gdk_event_copy() and returns true for the result of
gtk_im_context_filter_keypress().  When the other IME process handles the
event, returns the result to them in our process.  Then, they send the stored
key event to us again.  Finally, they actually handles the event in our process
actually.

Therefore, we may receive every key event twice.  So, this causes dispatching
eKeyDown event and eKeyUp event twice.  Preceding key event is always marked
as "processed by IME" since gtk_im_context_filter_keypress() returns true
temporarily and following key event is dispatched as expected.  So, we need
to ignore the first event only when gtk_im_context_filter_keypress() returns
true but the event is posted to different process.

Unfortunately, we cannot know if the key event is actually posted to different
process directly.  However, we can know if active IM is ibus, fcitx or another
one and if ibus or fcitx is in asynchronous key handling mode.

The former information is provided by gtk_im_multicontext_get_context_id().
It returns a string which is set to the IM multicontext instance by creator.
We'll get "ibus" if IM is ibus, get "fcitx" if IM is fcitx.

The latter information is not provided.  However, they consider the mode from
env value.  ibus checks IBUS_ENABLE_SYNC_MODE.  fcitx checks both
IBUS_ENABLE_SYNC_MODE and FCITX_ENABLE_SYNC_MODE.

Additionally, we can know if received key event has already been posted to
other IME process.  They use undefined bit of GdkEventKey::state to store
if the key event has already been posted (1 << 25, they called "ignored" flag).
Although their approach is really hacky but we can refer the information at
least for now.

Finally, when we guess a key event is posted to other IME process, let's
IMContextWrapper::OnKeyEvent() not dispatch eKeyDown nor eKeyUp event.
Note that if it's handled synchronously as unexpected, it may causes
dispatching one or more composition events and/or delete content event.
So, in such case, we dispatch a keyboard event for processing key event
anyway.  There is only once case we'll fail to dispatch keyboard event.
If we receive signals to dispatch composition events or delete content
command event when IM receives the result from other IME process but
it doesn't send the key event to us.  This will be fixed by the following
patch.

MozReview-Commit-ID: 94PrlnmQ3uJ

--HG--
extra : rebase_source : 0bb58ed432bacef8ad13264babd2b21fe950b71c
2018-03-09 00:46:52 +09:00
Masayuki Nakano
48703c7384 Bug 1443091 - IMContextWrapper should dispatch eKeyDown and eKeyUp event as "Dead" keys rather than "Process" if user pressed a dead key r=m_kato
On Linux, dead key is implemented with "table-based input methods" which are
available even on GtkIMContextSimple (i.e., available even in password fields).
Therefore, IMContextWrapper handles dead key sequence as usual composition of
IME.  However, on the other platforms, we dispatch "Dead" eKeyDown and eKeyUp
events for dead key.

We started to mark keyboard events which are handled by IME as "processed by
IME" since bug 1343451, i.e., we started to set mKeyNameIndex to
KEY_NAME_INDEX_Process.  However, we should keep previous behavior, i.e., keep
setting it to KEY_NAME_INDEX_Dead.  Fortunately, GDK's key event tells us
whether the keyboard event is a dead key event with keysym.  So, we can detect
if we're in a dead key sequence simply.

MozReview-Commit-ID: Dv336WptfXN

--HG--
extra : rebase_source : e8a7b5a7eb7c57e1e45de20ebebd56f88457cfc6
2018-03-05 22:03:58 +09:00
Martin Stransky
41ee718162 Bug 1439834 - Draw titlebar with some extent, r=dao
Some themes (Adwaita for instance) draws bold dark line at
titlebar bottom. It does not fit well with Firefox tabbar UI so
draw themed titlebar with some extent to make the titlebar
bottom part invisible (it's clipped by cairo).

MozReview-Commit-ID: 3rs4UzFJdPa

--HG--
extra : rebase_source : ca9270f549a3106711afac8ee0c7a30839ab2bf3
2018-02-28 14:28:40 +01:00
Martin Stransky
0a0c720a69 Bug 1443481 - [Linux/Titlebar] Construct widget tree to get correct titlebar icon style before we render the actual icon, r=jhorak
MozReview-Commit-ID: DEb2pU31os9

--HG--
extra : rebase_source : f68034829b16c9def34436dc6e33b393865348bc
2018-03-06 16:45:19 +01:00
Michael Webster
1a8239407b Bug 1418749 - Add a TaskbarProgress implementation for gtk3/x11. r=paolo,karlt
This adds support for download progress reporting via the XApp
method currently used in the Cinnamon desktop, by establishing a new
X11 window property to be supported/read by the window manager.

See https://github.com/linuxmint/xapps/blob/master/libxapp/xapp-gtk-window.c,
as well as https://github.com/linuxmint/muffin/commit/39045da0ea06f
for more details.

The property-setting code lives in nsWindow - it's a small and stable
enough chunk that it made more sense to do this than actually depend on
another external library.  As nsWindow is already using x11 calls, this
seemed the safest place for it, without affecting the build.

The TaskbarProgress instance is initialized via the DownloadsTaskbar
js module, and is handed a pointer to the current main window to call
SetProgress on.  Most of the javascript side of this is in line with
how the other platforms are handled.

Without a supporting window manager/desktop environment (currently just
Cinnamon/Muffin 3.6,) the simplest way to observe working behavior is
by calling 'xprop -spy' on the browser window being testing and watching
for updates during a download.

--HG--
extra : rebase_source : 0606f6c87116204ec290c19276072d0c1c35691e
2018-03-08 18:43:00 +02:00
Kartikaya Gupta
45d31fa895 Bug 1442627 - Stop exporting APZCTreeManager.h in mozilla/layers/. r=botond
MozReview-Commit-ID: GC5fSWOYtF5

--HG--
extra : rebase_source : e2dfe679595bf9208e082699a99375cd509b66e3
2018-03-06 10:25:39 -05:00
Martin Stransky
ae33d849f9 Bug 1438132 - Don't return false-positive data from clipboard, r=jhorak
MozReview-Commit-ID: 5I9DbpYJ8EL

--HG--
extra : rebase_source : 6b7207cd45b2b6f758f6e882c0829538ca2fe95e
2018-03-01 14:07:15 +01:00
Martin Stransky
066945c7bc Bug 1434646 - Titlebar rendering - Place titlebar buttons in GtkBox, r=jhorak
Some themes (Ambiance for instance) uses first-child/last-child css selectors
to style titlebar buttons. Ubuntu Ambiance theme places titlebar buttons closer
by negative margin applied to them.

We put titlebar buttons to GtkBox as well as Gtk+ does and also keep
the button order here to match first-child/last-child selectors. It also means
we must have maximize/restore as one button to keep the correct order.

MozReview-Commit-ID: 9mqljOa4Vu7

--HG--
extra : rebase_source : 9c31a2073d1bb247ce9d0240333143661b8ae4b8
2018-02-23 21:28:37 +01:00
Narcis Beleuzu
1d1a8b086b Backed out changeset 9d1f52cabe41 (bug 1440461) for build bustages on nsWindow.cpp 2018-03-01 05:32:33 +02:00
Martin Stransky
b75128438f Bug 1440461 - Disable titlebar rendering for Linux/Firefox 59, r=glandium
The titlebar rendering on Linux/Gtk+ is recently enabled at Beta59 but with many bugs fixed at Nightly.
Let's disable this feature for Beta / Release 59 and ship it at Firefox 60 where majority of the issues are fixed.

MozReview-Commit-ID: FQL7tNhcvUG

--HG--
extra : rebase_source : 03a495ebc81b5ae5b4093406bd40daf83251343a
2018-02-22 21:56:58 +01:00
Martin Stransky
6e94e535b0 Bug 1433092 - Add spacing around titlebar buttons, r=jhorak
GtkHeaderBar has property "spacing" which defines space between buttons at titlebar.
Get this property and apply as margin to titlebar buttons when there's more than one.
Also cache this value for furter use at titlebar metrics cache.

MozReview-Commit-ID: J7qAIWEnK4Y

--HG--
extra : rebase_source : 73f0f605444cf4e4ada3da335ff003e9df05c9c4
2018-02-23 10:37:07 +01:00
Jan Horak
2fec7aac11 Bug 1440413 - Use original mouse event position when checking for doubleclick on titlebar; r=stransky
The DispatchEvent can manipulate with the mRefPoint we're later using to check if the
double click happened on the titlebar. We need to save it for later check to avoid
unwanted restore/maximize event when mouse event occurs near top border of any widget.

Also don't handle doubleclick on titlebar when CSD is not enabled.

MozReview-Commit-ID: KjxM1EsT4Lg

--HG--
extra : rebase_source : b880e4d89ebe3546b7ef70e3d94926a628f98598
2018-02-26 16:23:34 +01:00
Jan Horak
b69949883c Bug 1441108 - Don't print warning for less than 1 scaling factor; r=stransky
A lot of "WARNING: Invalid monitor scale: -1" appering for the puppet widget since
fix for bug 1439881 landed. We don't need to print the warning, fallback to 1 is
sufficient enough.

MozReview-Commit-ID: 73BGc8neUmu

--HG--
extra : rebase_source : 74b2a818a29514095b5c56b05966cff5e4e9ba60
2018-02-26 11:44:25 +01:00
Jan Horak
6958445862 Bug 1439881 - Avoid returning monitor scale 0; r=stransky
Because of rounding errors there's a change that returned monitor scale
is 0. That would lead to SIGFPE because it's later used in division.

MozReview-Commit-ID: 4d7nHaBm4XG

--HG--
extra : rebase_source : d7fb5c64698d1e99afc223d401b30e0eb168fdb4
2018-02-22 13:59:38 +01:00
Jan Horak
f77af604c8 Bug 1439857 - Fix too big fonts when devPixelsPerPx is set; r=stransky
This fixes regression introduced by hidpi support for wayland in
case devPixelsPerPx is set (bug 1431337).

MozReview-Commit-ID: DOh0aTcxbVG

--HG--
extra : rebase_source : ac3ac449a99e0123b8a64ea36f25d312bb3c4483
2018-02-22 10:41:30 +01:00
Adrian Wielgosik
2d4df58ad8 Bug 1439751 - Remove all members from nsIDOMHTMLInputElement. r=qdot
MozReview-Commit-ID: JVagEzvSONN

--HG--
extra : rebase_source : a7e1cf2e5ccc1925f3a11c7d935438ef6307c70c
2018-02-20 23:10:44 +01:00
Gurzau Raul
67898ab5c2 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-02-21 19:32:45 +02:00
Martin Stránský
924797ef59 Bug 1434621 - part 2: ignore vertical titlebar padding from the Gtk+ theme since we set it with CSS on #titlebar-buttonbox. r=dao
MozReview-Commit-ID: ETrNNianj3e
2018-02-21 16:43:11 +01:00
Martin Stransky
fb13e4d63d Bug 1433068 - Titlebar/Linux - load and draw HiDPI titlebar icons on HiDPI screens, r=jhorak
MozReview-Commit-ID: KxbBvf6mgo1

--HG--
extra : rebase_source : f1c3b083d4e83684b1046a3c439d802de6547c21
2018-02-20 16:16:23 +01:00
Martin Stransky
f6623f64ce Bug 1433068 - Reload WidgetstyleCache when theme changes, r=jhorak
MozReview-Commit-ID: 1cZmJNWjS4N

--HG--
extra : rebase_source : 1e9406c2090b19049c37ac21eff11e05e0be2cc9
2018-02-20 13:15:52 +01:00
Masayuki Nakano
ed18f14624 Bug 1036008 - Use alternative ASCII capable keyboard layout information to decide keyCode even if the key produces an ASCII punctuation character r=smaug
Gecko decides keyCode from an ASCII character which is produced by the key
by itself or with Shift on active keyboard layout or alternative ASCII capable
keyboard layout if active keyboard layout isn't ASCII capable.  However, we've
ignored alternative ASCII capable keyboard layout's character if both the
key itself and with Shift don't produce ASCII alphabet nor ASCII numeral,
i.e., ASCII punctuation characters are not used in alternative ASCII capable
keyboard layout because of avoiding mapping a keyCode value to 2 or more keys.

However, setting 0 to keyCode value makes Firefox unusable with some web
applications which are aware of neither KeyboardEvent.key nor
KeyboardEvent.code.  So, even if we map same keyCode value to a key, we should
avoid setting keyCode value to 0 as far as possible.

This patch's approach is, we behave same keyCode value as the alternative ASCII
capable keyCode is selected when computed keyCode value of active keyboard
layout is 0.  This means that we will make some language users whose keyboard
layout for their language is not ASCII capable can use global web services
which support US keyboard layout of Firefox since the new keyCode values
are mostly computed with US layout on Windows or actual alternative ASCII
capable keyboard layout on macOS and Linux.  In other words, we cannot improve
compatibility with web applications which don't support Firefox  by this patch
since our keyCode values are really different from Chrome's.  So, unfortunately,
if we'd use exactly same keyCode computation as Chromium, we'd break
compatibility with existing web applications which are aware of Firefox since
it's necessary to check UA name or something before using keyCode values.

Note that the most important difference between Windows and the others is,
such keyCode value is computed with alternative ASCII capable keyboard
layout on macOS and Linux but only on Windows, it's computed with OEM virtual
keycode.  This means that only on Windows, the keyCode value may be different
from actual alternative ASCII capable keyboard layout's keyCode.

MozReview-Commit-ID: As289r9wp6i

--HG--
extra : rebase_source : 66181403dbe8ca8dab893edc8f4eec1991d544d0
2018-02-16 15:54:07 +09:00
Jan Horak
6c58e369e7 Bug 1431337 - Scale content for the actual monitor, not the first one; r=stransky
We need to use scaling factor of the monitor on which application is actually positioned.
Previously we used ScreenHelperGTK::GetGTKMonitorScaleFactor() which use the first monitor.
This does not work on hidpi+normal dpi monitors setup.

The GetSystemFontInfo() cannot return scaled value of the font by default monitor
scale factor. We need to scale it in nsLookAndFeel::GetFontImpl
by aDevPixPerCSSPixel like implementation for Windows does.

We also need to check layout.css.devPixelsPerPx because we cannot
scale per monitor when this preference is set to positive number.

MozReview-Commit-ID: AwT2NvkEqvz

--HG--
extra : rebase_source : 5b956a6abd7d215b06ebcd8c56e34c038d012940
2018-01-18 11:52:59 +01:00
Jan Horak
6234216f8c Bug 1417847 - [CSD] Doubleclick event on draggable area restores/maximizes window; r=stransky
The drag area should process doubleclick event as request for restore/maximize
because otherwise there's no other option to do the action when Firefox
is drawing window decoration. We follow similar path as mac which handles this
in mouseUp event.

MozReview-Commit-ID: KpCnHTdteLr

--HG--
extra : rebase_source : bf0680e33fd5a5b6c931b5260430fdd3fd995769
2018-02-15 09:50:56 +01:00
Martin Stransky
45ea89eb15 Bug 1433866 - Rename CSD_SUPPORT_FULL/FLAT to better names, r=jhorak
MozReview-Commit-ID: 8btSuxa5oeT

--HG--
extra : rebase_source : 775f98623f5fd9b11c6d7bb152ddf74fc8c7d7e1
2018-02-19 16:35:43 +01:00
Martin Stransky
1bca24f221 Bug 1423985 - Force CSD titlebar mode when GTK_CSD is set, r=jhorak
MozReview-Commit-ID: KxKI20TEY7U

--HG--
extra : rebase_source : a4194276c65c22d5c45429469e4a8cda6f6bb040
2018-02-19 16:26:50 +01:00
Martin Stransky
d59d4f1d86 Bug 1434572 - [Wayland] Implement Gtk+ clipboard shortcut for copy->paste between Firefox windows, r=jhorak
When we perform copy -> paste in one Firefox process on Wayland we're locked because Wayland clipboard paste
operation just reads data from filedescriptor and does not run main event loop.

A solution is to use Gtk+ shortcut here, when clipboard selection owner is the same as data receiver.
Gtk+ then does not go through X11/Wayland but calls clipboard data getter callback directly,
which we can use on Wayland because it also does not main event loop and the operation
stays synchronous.

MozReview-Commit-ID: G8myCBUSzxb

--HG--
extra : rebase_source : 34cb3095be4b2f00d19c589dc5f676b1b895eb15
2018-02-01 11:23:01 +01:00
Chris Peterson
fe5cd3d5d9 Bug 1436263 - Part 3: Remove virtual from final virtual function declarations. r=froydnj
MozReview-Commit-ID: 8pjYjEvQF42

--HG--
extra : rebase_source : 5eb0bea2ef5f06a811b4f3daf57ce8720f12dd07
2018-02-08 21:22:43 -08:00
Chris Peterson
d09123f248 Bug 1436263 - Part 1: Replace final override virtual function specifiers with just final. r=froydnj
MozReview-Commit-ID: DE5HkIhsZ6D

--HG--
extra : rebase_source : 94831c1e13a840dd2ea0600f64bcf70c2bf938d9
extra : source : cf9283bf1b0bca3a6311c98e227329d451f80ecb
2018-02-05 22:46:57 -08:00
Boris Zbarsky
9bdcffc985 Bug 1436902 part 3. Replace usage of NS_IMPL_ISUPPORTS_INHERITED0 with NS_INLINE_DECL_REFCOUNTING_INHERITED when possible. r=mccr8
The change to RootAccessible.cpp fixes an obvious bug introduced in bug 741707.

The visibility changes in gfx/thebes are because NS_DECL_ISUPPORTS has a
trailing "public:" that those classes were relying on to have public
constructors.

MozReview-Commit-ID: IeB8KIJCGhU
2018-02-12 15:44:40 -05:00