I tried to use the `?android:attr/...` method listed in the nearby comments but
kept receiving a "ResourceNotFound" exception. I wonder if this is related to
the way we inherit and then override the themes.
This patch reintroduced changes behind a nightly flag removed by:
1161638: Remove the chrome at the bottom of the screen in the Tabs Tray
1164723: Inherit from Tablet UI on Mobile UI (aka compact tabs)
1193745: Implement the tablet tabs tray grid view on mobile
I've also done a bit of work to allow the chrome to sit at the correct Y location in landscape on mobile devices when the tabs panel is shown to account for bug 1193374 which adjusts the aspect ratio of the tabs panel thumnbnails and didn't need to be hidden behind a nightly flag. Tablets remain unaffected by this change.
When used to do our own animation when opening the browser from the
share overlay. That caused this bug: we didn't call `finish` until
`onAnimationEnd` but since `startActivity` was called, the application
was switched before `onAnimationEnd`, and thus `finish`, could be
called. When we returned to the share overlay, it was in an unexpected
state (`isAnimating` was true) and the user could no longer interact
with it, blocking access to the app the ShareOverlay was opened from.
We fix this by not doing our custom animations and just calling `finish`.
Note: in any case, overriding the animation when opening the browser
could be unintuitive to users because they might expect a consistent
app-switch animation throughout the system.
The call to setResolution has (I believe) not been needed since bug 732971. Prior
to that resolutions used to be applied on the root document in Fennec, and so
browser.js would have to reapply the desired resolution on every tabswitch.
After that bug, the resolution was saved on the content documents for each tab
and so browser.js no longer needed to reapply the resolution. Until recently
doing this was redundant but harmless.
With bug 1180267 though the browser.js code that tracks the resolution may have
the wrong resolution initially, because that is determined in C++ code. Only
after the Java-side code process the setFirstPaintViewport message and sends
that information to browser.js does everything have the correct resolution. In
the case where a tab loaded in the background is brought into the foreground, the
tab-selected code runs before the setFirstPaintViewport code, and therefore uses
an incorrect resolution. This then screws up the viewport clamping code and causes
the page to get scrolled.
The intent of this check is to avoid setting the same margins more than once.
However this is redundant because the code in nsLayoutUtils::SetDisplayPortMargins
already has an equivalent check. Further, this code is wrong because it stores
the old margins per-tab, and so once a new document is loaded the margins may be
the same as "before" but they apply to a different element. In order to be correct
the check would have to track the target element as well as the margin values,
but it's easier to just get rid of this and let nsLayoutUtils handle it.