Newer versions of the support library do this automatically, but we need to
roll our own implentation for now.
16:9 keyline means that the top of the menu is placed such that a 16:9 window
of application content is still visible above the menu. This is illustrated in:
https://material.io/guidelines/layout/metrics-keylines.html#metrics-keylines-keylines-spacing
(The menu itself is _not_ 16:9.)
MozReview-Commit-ID: FSUdssb5eBN
--HG--
extra : rebase_source : 735cfb9ce7f78e4247780011c76850560f67d40e
This has no benefit right now, but this lets us avoid forgetting to upgrade to the non-deprecated
method once we no longer need to support api 15.
MozReview-Commit-ID: FmRoP5PnGDC
--HG--
extra : rebase_source : 2c5df232fd526f044bd10b3e6cf9920ddb2e4e7b
This seems to be an Android platform bug affecting Android 4.X, which
is visible primarily on tablets (on phones, page titles are often broken
over two lines, which isn't the case on tablets, hence it's easy
to spot if this bug is happening).
MozReview-Commit-ID: AfSw3AJHFqH
--HG--
extra : rebase_source : 125789099f5c7309f2bb049b49341183fa99c3a2
On some devices, ImageView appears to lose it's padding when calling
setBackground[Drawable](). We therefore need to save and restore the
padding on those devices.
Known affected devices are various Asus Transformer tablets,
and also the Motorola Droid 4, running various Android 4.X versions.
We therefore make this workaround conditional on Android 4 to minimise
the number of devices where this workaround is used. (Having the conditional
should also make it easy to notice when we can remove the workaround, i.e.
whenever Android 5 becomes the baseline.)
MozReview-Commit-ID: B88gWwEx48x
--HG--
extra : rebase_source : f22fb850c919a25dd14b46e6dec558e8e8998d7b
Add more callback tests to testEventDispatcher,
1) Test for checking that the callback for a Gecko thread event,
dispatched from Gecko, is synchronous. We depend on this behavior in
several places where we require a "function call" style event.
2) Test for checking that callbacks accept a variety of data types as
the response object, including the standard types supported by
GeckoBundle, as well as primitive types that are convertible to standard
types.
Remove GeckoEventListener and NativeEventListener now that we uniformly
use BundleEventListener. Also remove related classes NativeJSContainer,
NativeJSObject, and GeckoRequest, as well as related tests and C++
code.
The "Messaging" object in Messaging.jsm is replaced with a dummy object
that redirect calls to the global and/or window event dispatcher.
Previously we started the DLC service from GeckoApplication. The reason for that was that we wanted to
download content like fonts as early as possible so that they are available the next time we display
a website.
However we do not know whether we are running in automation until the BrowserApp activity is launched.
This patch will start the service from BrowserApp.onCreate() now if we are not running in automation.
MozReview-Commit-ID: C3Ob6S3yve4
--HG--
extra : rebase_source : 3dbe64f6cbc0a90149e9c46849d4b68e5674b532
This patch adds the ability to run SingletonEventManager handlers in
different modes: sync, async, raw (no exception handling, arg cloning,
or asynchrony), or asyncWithoutClone. When you call the handler,
you're required to specify which variant you want.
Existing uses of SingletonEventManager are all converted to async calls.
Note that some of them were previously synchronous, but it didn't appear
to be necessary.
Also added a callOnClose for SingletonEventManager when the last listener
is removed.
MozReview-Commit-ID: ATHO97dWf3X
--HG--
extra : rebase_source : bf02d79e3fbab84892be8a7e52ea7a1caf2e003d
CLOSED TREE
Backed out changeset 2d42350d209a (bug 1203330)
Backed out changeset 3a12c51c3eca (bug 1203330)
Backed out changeset 31fac390e15d (bug 1203330)
Convert events used in PageActions to bundle events. UI thread events
are used because the listeners require the UI thread. The observer
notifications from Java to Gecko are converted to events as well.
Convert events used in AccountsHelper to bundle events. Most events are
kept as Gecko thread events, but a couple events that start activities
are converted to UI thread events.
Convert events used in IntentHelper to bundle events. UI thread events
are used for most events because the listeners perform operations on
Intent objects, which is best done on the UI thread. For
"Intent:GetHandlers", use a Gecko thread event because it's possible we
want a synchronous callback response.
Convert events used in HomePanelsManager to bundle events. Background
thread events are used because HomePanelsManager processes panel changes
in the background thread. Changing to background thread events also lets
us make the change queue a simple ArrayList instead of a
ConcurrentLinkedQueue, because there is no longer multiple threads
involved.
Convert the "HomePanels:Data" event to a GeckoBundle/BundleEventListener
event. UI thread event is used because the listener invokes the callback
on the UI thread.
Convert events used in FindInPageBar to GeckoBundle/BundleEventListener
events. UI thread events are used because the listener performs UI
operations. FindInPageBar also sends some events like "FindInPage:Find"
from Java to Gecko; those events will be converted in another bug.
Convert observers in ActionBarHandler.js to events that go through
WindowEventDispatcher. "TextSelection:Get" now replies through the
callback interface rather than a "TextSelection:Data" event. The patch
also adds new lazy-loading events in browser.js to replace the
lazy-loading observers that ActionBarHandler relied on.
Convert the events used in MediaCastingBar and ChromeCastPlayer to
GeckoBundle/BundleEventListener events. UI thread events are used
because the listener performs operations on the UI thread.
When going down one folder level, we store the current scroll position of the list view and then scroll to the top of the list, so that we always show a child folder starting from the beginning. When navigating back up to its parent, we then restore the previously stored scroll position.
MozReview-Commit-ID: 9C2RMXrlUm1
--HG--
extra : rebase_source : 7ec5a3f1d602db9454efa52603e0f50704c1418d
Fix up javadoc so it matches the actual function parameter and remove unneeded imports.
MozReview-Commit-ID: I91NuqLlpL1
--HG--
extra : rebase_source : 13366049ee9fe1487b3cf24f4e6f610f66bee5ee
Showing the tab history panel involves a gecko call to retrieve tab history. This
can be slow, meaning we have no idea what state the app will be in when the tab
history data is returned. Thus we need to protect the code that shows the tab
history fragment against a number of scenarios to avoid crashes in those cases
where the app might be shutting down:
1. If onSaveInstanceState() has been called (which might happen before or after onPause(),
and might be linked to app shutdown - but the docs don't appear to give any guarantees),
fragment transactions cannot be performed. We protect against this by accepting loss
of state in fragment transactions.
2. If the Activity has been completely destroyed, trying to perform a fragment transaction
will likewise fail. We protect against this by not even trying to perform the transaction
if we definitively know that the Activity is being shut down (ie isFinishing()).
In both of these cases, we simply must accept that we're potentially losing UI state: i.e.
a user could request the tab history panel via long-back-press, followed by exiting the app;
we now end up never ever showing the panel. This scenario doesn't seem like a major loss - and
fixing this issue properly would require significant investment (i.e. we would need to either
cache tab history on frontend side, or cache the tab-history panel request - and it's not clear
users will still care about seeing the panel the next time they open firefox).
MozReview-Commit-ID: JsAK1By8yqn
--HG--
extra : rebase_source : 9a3b64d2829a969e4de2775c2714874aa8708031
Since bug 1228593, the mobile session store
- once again flushes its data when we are quitting, to make sure the latest state (including any potential cleaning of history/tabs) is flushed to disk
- ignores windows/tabs closing as a byproduct of shutdown
The latter point is dependent on a new shutdown notification introduced in that bug. Because we forgot to add that notification to the restart code used for add-on updates, in that case the session store currently doesn't enter shutdown mode and therefore records the window being closed during shutdown before flushing its data to disk, which means that all open tabs are lost.
MozReview-Commit-ID: LgtdQoYwacM
--HG--
extra : rebase_source : 1bf6c544d9e25961a0e64236678ca5938e8a69fe
A tab object should know how to zombify itself instead of having to rely on the MemoryObserver. This also simplifies the situation for anybody else who wants to call this function since it is no longer necessary to figure out how to load the MemoryObserver for this.
MozReview-Commit-ID: 5IX114QUjBT
--HG--
extra : rebase_source : 964186678848b804e5f0550e1b6a328d7fcfbc50
Actors outside of the session store shouldn't have to poke around within the session store's data structure and end up reimplementing parts of the session store code (and cause data loss if the implementation is incomplete) in order to restore delay loaded zombie tabs. Therefore, we simply expose a method for this via BrowserApp's tab object.
To simplify handling and make the method a little more fool-proof for external callers, the check whether the tab is actually zombified is moved into the restoreZombieTab() function.
Later on, we can also hook up this method to the appropriate web extension API (see bug 1322485).
MozReview-Commit-ID: 85lnbCpMcP3
--HG--
extra : rebase_source : a6f1cfa11debcb18471b49804776521c60655fce
With --with-intl-api, xpcshell test for MozIntl is always failure on Android. So we should add mozIntl.xpt to package.
MozReview-Commit-ID: BWBKSG3gSqr
--HG--
extra : histedit_source : d4091b91221bc2ef282d0855dbf4856adb403c9b
Bug 1319660 - 1. Don't take shortcut if old replacement ranges don't match; r=esawin
The block at [1] is a shortcut we take when we reconcile Java text
changes with Gecko text changes. However, we only checked that the new
ranges are the same, i.e. that the new Gecko text is the same as the new
Java text. We should also be checking that the old ranges are the same,
i.e. that the replaced Gecko text is the same as the replaced Java text.
[1] https://dxr.mozilla.org/mozilla-central/rev/bbbd2f7539f224a482cc6d2dd10e6a5f31c8baf3/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoEditable.java#1233
Bug 1319660 - 2. Use previous node instead of sibling when adjusting last node; r=masayuki r=smaug
nsContentIterator in pre mode adjusts its last node if the node is a
childless node like <br>. However, right now it's using GetPrevSibling,
which can lead to error in some edge cases such as:
<p></p><div><br></div>
In this case, if the last node is <br> with offset 0, GetPrevSibling
will return <p> because <p> is <br>'s parent's previous sibling, and the
last node will be set to <p>. However, the correct last node in this
case is <div>, because <br> with offset 0 refers to the position to the
left of <br>, which is <div> with offset 0. In this case, PrevNode
returns the correct <div> value, so we should set the last node to the
result of PrevNode.
For the first node, for a childless node in pre mode, GetNextSibling and
NextNode are the same, so there is no bug in this case. Nevertheless,
this patch changes the call to NextNode to be consistent with calling
PrevNode for the last node.
Bug 1319660 - 3. Add test for correctly adjusting last node in content iterator; r=masayuki
Add a test for the previous patch that makes sure querying selected text
in an edge case works correctly.
Bug 1319660 - 4. Add test for start node regression; r=me
Add a new test case for the NextNode() regression. r=me for trivial
test-only patch.
Bug 1319660 - 5. Restore GetNextSibling call for first node of pre-content-iterator; r=smaug
The last patch changed the `GetNextSibling()` call to `NextNode()`
because I assumed they're equivalent in this case. That turned out to
not be the case because we can reach this line even if the node has
children -- the index just has to be after the last child. So this patch
restores the `GetNextSibling` call to restore the correct behavior.
I also added some comment to clarify that we can reach this line due to
one of two conditions: 1) the node has no children; 2) the node has
children but the index is after the last child.
This patch also replaces the `HasChildren()` check when setting
`cChild`. If the index is after the last child (i.e. index ==
childCount), `GetChildAt()` fails and we erroneously log an assertion
warning, even though the input was valid. The new check handles all
cases whether start node has children or not.
Bump the Android builders to the latest beta release to reduce
the variance when we update Firefox 53 to 1.15.0 stable early
in the Aurora phase.
Android builds were moved to 1.15 early to address a code generation
issue with devices without neon.
Work around an issue with tarball naming in the cargo packages.
MozReview-Commit-ID: KQfkWmXV9hQ
--HG--
extra : rebase_source : 9448e0b948740fc3905ef70c8df316dc7342d52e
When turning off SPS profiler by configure option, or we build non-SPS arch build such as android/aarch64, Tab.prototype.onStateChange already throws the exception because Profiler isn't defined.
So we should check AppConstants.MOZ_ENABLE_PROFILER_SPS to use Profiler object.
MozReview-Commit-ID: A9ISurxiRmc
--HG--
extra : rebase_source : 25103e97cd4827edef33335e3aec9384a6695526
When a snackbar with a button callback is dismissed, this translates to a rejected promise from sendRequestForResult(). We need to catch this in order to avoid a spurious 'JavaScript Error: "uncaught exception: undefined"' message appearing in the console and possibly causing confusion.
MozReview-Commit-ID: 7hsAOAMTeDP
--HG--
extra : rebase_source : 6c5eb28d2e0dcf39a35b310d1e1c45cfc47f272b
We've been parsing the session store file and doing the initial tab creation on the Java side for a long time now, so the code to open completely new tabs on the session store side instead of using tab stubs is no longer necessary.
Besides, because of bug 1301160 the on-disk session file is now containing tab IDs as well, so this distinction between tabs read directly from the raw session file and those contained in a session string passed over from the Java UI is no longer available.
MozReview-Commit-ID: Hmq0TwClqMQ
--HG--
extra : rebase_source : 1f9ab6da18a7fd0f40a1cb0784082abb2384404f
This patch adds the ability to run SingletonEventManager handlers in
different modes: sync, async, raw (no exception handling, arg cloning,
or asynchrony), or asyncWithoutClone. When you call the handler,
you're required to specify which variant you want.
Existing uses of SingletonEventManager are all converted to async calls.
Note that some of them were previously synchronous, but it didn't appear
to be necessary.
Also added a callOnClose for SingletonEventManager when the last listener
is removed.
MozReview-Commit-ID: ATHO97dWf3X
--HG--
extra : rebase_source : 43988ee453e965e1c591b1c64603c22f5a103cff
The protocol handler is intentionally simple. It works for the entering into the
urlbar case but not a lot else. Included some basic tests.
MozReview-Commit-ID: 4FQ1irdt3Nj
--HG--
extra : rebase_source : 30d9fc7ba2c500f268d282e47d291724d9899ba4