autohiding toolbars: Wait for [sessionrestored] before setting urlbar transition

--urlbar-container-height, which is set for #urlbar-container, is computed
dynamically early on startup. If we set transition to it, then it will transition
from the initial height to the new value and because of that the computed value
is determined using the initial height instead of the "correct" value set by
toolbar density options. The issue most noticeably occurs when initial window
has startup page as blank, and when compact density is selected, but it does
but really it can also happen without them, the effect just might be so subtle
that it's not perceivable.
This commit is contained in:
MrOtherGuy
2026-01-04 12:35:58 +02:00
parent ab752a5b27
commit 1a3b86bff8
3 changed files with 3 additions and 3 deletions

View File

@@ -83,7 +83,7 @@ See the above repository for updates as well as full license text. */
:root[window-modal-open] #urlbar[popover],
#mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#selection-shortcut-action-panel,#chat-shortcuts-options-panel,#tab-preview-panel)) ~ toolbox #urlbar[popover],
#navigator-toolbox:is(:hover,:focus-within) #urlbar[popover],
#urlbar-container > #urlbar[popover]:is([focused],[open]){
:where(:root[sessionrestored]) #urlbar-container > #urlbar[popover]:is([focused],[open]){
opacity: 1;
pointer-events: auto;
transition-delay: 100ms;

View File

@@ -69,7 +69,7 @@ See the above repository for updates as well as full license text. */
transition-delay: 0ms;
transform: translateY(0);
}
#urlbar-container > #urlbar[popover]:is([focused],[open]){
:where(:root[sessionrestored]) #urlbar-container > #urlbar[popover]:is([focused],[open]){
transition-duration: 100ms; /* Faster when focused */
}
/* This ruleset is separate, because not having :has support breaks other selectors as well */

View File

@@ -46,7 +46,7 @@ See the above repository for updates as well as full license text. */
:root[window-modal-open] #urlbar[popover],
#mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#selection-shortcut-action-panel,#chat-shortcuts-options-panel,#tab-preview-panel), > #tab-group-editor > [panelopen]) ~ toolbox #urlbar[popover],
#navigator-toolbox:is(:hover,:focus-within,[movingtab]) #urlbar[popover],
#urlbar-container > #urlbar[popover]:is([focused],[open]){
:where(:root[sessionrestored]) #urlbar-container > #urlbar[popover]:is([focused],[open]){
pointer-events: auto;
opacity: 1;
transition-delay: 33ms;