Bug 1394588 - Include the gNavToolbox offset in the calculation of the library drop animation. r=Gijs

MozReview-Commit-ID: 90eUNtqE0ee

--HG--
extra : rebase_source : 833a1738599b9620a05859a40e687329a229368a
This commit is contained in:
Jared Wein 2017-09-05 14:50:52 -04:00
Родитель e1f1db7272
Коммит 8a5df47f41
2 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -1539,13 +1539,16 @@ var LibraryUI = {
!this.COSMETIC_ANIMATIONS_ENABLED) { !this.COSMETIC_ANIMATIONS_ENABLED) {
return; return;
} }
let animatableBox = document.getElementById("library-animatable-box"); let animatableBox = document.getElementById("library-animatable-box");
let navBar = document.getElementById("nav-bar"); let navBar = document.getElementById("nav-bar");
let libraryIcon = document.getAnonymousElementByAttribute(libraryButton, "class", "toolbarbutton-icon"); let libraryIcon = document.getAnonymousElementByAttribute(libraryButton, "class", "toolbarbutton-icon");
let dwu = window.getInterface(Ci.nsIDOMWindowUtils); let dwu = window.getInterface(Ci.nsIDOMWindowUtils);
let iconBounds = dwu.getBoundsWithoutFlushing(libraryIcon); let iconBounds = dwu.getBoundsWithoutFlushing(libraryIcon);
let libraryBounds = dwu.getBoundsWithoutFlushing(libraryButton); let libraryBounds = dwu.getBoundsWithoutFlushing(libraryButton);
let toolboxBounds = dwu.getBoundsWithoutFlushing(gNavToolbox);
animatableBox.style.setProperty("--toolbox-y", toolboxBounds.y + "px");
animatableBox.style.setProperty("--library-button-y", libraryBounds.y + "px"); animatableBox.style.setProperty("--library-button-y", libraryBounds.y + "px");
animatableBox.style.setProperty("--library-button-height", libraryBounds.height + "px"); animatableBox.style.setProperty("--library-button-height", libraryBounds.height + "px");
animatableBox.style.setProperty("--library-icon-x", iconBounds.x + "px"); animatableBox.style.setProperty("--library-icon-x", iconBounds.x + "px");

Просмотреть файл

@ -467,8 +467,9 @@ toolbar[brighttext] .toolbarbutton-1 {
overflow: hidden; overflow: hidden;
/* Position the sprite at the y-position of the library-button, then adjust /* Position the sprite at the y-position of the library-button, then adjust
based on the size difference between half of the button height and half based on the size difference between half of the button height and half
of the sprite height. */ of the sprite height. The titlebar may have padding from -moz-appearance
top: calc(var(--library-button-y) + var(--library-button-height) / 2 - 27px); that needs to be accounted for. */
top: calc(var(--library-button-y) + var(--library-button-height) / 2 - 27px - var(--toolbox-y));
/* Set a margin relative to the difference in widths of the .toolbarbutton-icon /* Set a margin relative to the difference in widths of the .toolbarbutton-icon
and the .toolbar-animatable-box. This is correct even in RTL because the item and the .toolbar-animatable-box. This is correct even in RTL because the item
is positioned using `left`. */ is positioned using `left`. */