Closed Bug 1559192 Opened 5 years ago Closed 2 years ago

Stop using nsDeckFrame in XUL <deck>

Categories

(Toolkit :: XUL Widgets, task)

task
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1689816

People

(Reporter: bgrins, Unassigned)

References

Details

Attachments

(3 files, 1 obsolete file)

I'd like to see if we can stop needing the XUL deck layout frame (which is applied to both deck and tabpanels elements): https://searchfox.org/mozilla-central/search?q=-moz-deck&path=xul.css.

Removing this would allow us to not need to add support for non-XUL-box children for nsDeckFrame in Bug 1558559.

Blocks: 1558559

Fyi: browser_globalwarnings.js was failing (https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=252707111&repo=try&lineNumber=11510) because XUL UI attempts to check visibility of an element from a hiding panel (#list-view), while it should check elements inside of #detail-view. It used to work because deck processed selectedIndex changes asynchronously in nsDeckFrame.cpp.

Assignee: nobody → surkov.alexander
Attached patch grid-xul-hack (obsolete) (deleted) — Splinter Review

Here's a hack to allow you to experiment with using CSS Grid for this.
(this patch should be applied on top of the existing patch in this bug)

The magic spell to trigger the don't-blockify-my-children code is:

flex-direction: column;

(we can change it to something more appropriate later)

It seems to work reasonably well with Page Info, except that the default height (using a fresh profile) uses the max-content size of the children (it seems). Not sure how to avoid that...

Depends on: 1580012

(In reply to Mats Palmgren (:mats) from comment #4)

Created attachment 9089599 [details] [diff] [review]
grid-xul-hack

Here's a hack to allow you to experiment with using CSS Grid for this.
(this patch should be applied on top of the existing patch in this bug)

The magic spell to trigger the don't-blockify-my-children code is:

flex-direction: column;

(we can change it to something more appropriate later)

Thanks for the patch! I think once Bug 1580012 lands we can remove the hack from this patch and use just the CSS part.

It seems to work reasonably well with Page Info, except that the default height (using a fresh profile) uses the max-content size of the children (it seems). Not sure how to avoid that...

What's the difference between the current <deck> behavior and the max-content size? I thought <deck> used the tallest height from the children as well.

Flags: needinfo?(mats)

Sorry, I don't know how the XUL <deck> sizing works exactly.

Flags: needinfo?(mats)
Depends on: 1576946
Blocks: 1597027
Attached patch fix page-info (deleted) — Splinter Review

This seems to fix the page-info issue for me (on Linux).

Attachment #9089599 - Attachment is obsolete: true
Summary: Investigate removing nsDeckFrame (moving the showing/hiding logic into the <xul:deck> and <xul:tabpanels> Custom Elements) → Remove nsDeckFrame (moving the showing/hiding logic into the <xul:deck> and <xul:tabpanels> Custom Elements)
Depends on: 1674890
Assignee: surkov.alexander → nobody
Depends on: 1668219
Depends on: 1524836
Depends on: 1678523
Depends on: 1678547
Depends on: 1678548

I think the way to push this patch forward is to figure out exactly what kind of sizing behaviour the <deck> usages need:

Children with all the same height/usage doesn't care about the height:

  • places.xhtml (#placesViewDeck & #detailsDeck): removed in bug 1678523
  • old about:addons: removed in bug 1674890
  • old perf panel: should be removed in bug 1668219
  • old about:config: removed in bug 1524836
  • #modeDeck (dialog asking you to save or open directly): both children (menulist & button) have 30px height.
  • .wizard-next-deck: both children are fixed-height buttons
  • .wizard-page-box: removed in bug 1689830

Follows the biggest child's height (default deck behaviour):

  • #updateDeck (both about dialog & preferences): removed in bug 1689727
  • #setDefaultPane (preferences): removed in bug 1689742

Only takes the selected child height:

Not sure:

  • #translationEngine: not sure, but the MS translation logo (larger child I think) has only 38px height, so it depends on the parent notification padding
  • #translationStates: not sure, but presumably? depends on whether the parent's default height (56px) is larger or not.
  • #mainDeck (pageInfo window): a combination of largest child height and min-heights

Based on this, going with visibility: collapse seems reasonable.

Depends on: 1689727
Depends on: 1689742
Attachment #9093957 - Attachment is obsolete: true
Attachment #9093957 - Attachment is obsolete: false

So I'm going to go with visibility: collapse or display: none. The usages that need the <deck> height sizing behaviour will be converted to <stack> + visibility (bug 1689727, bug 1689742).

The rest should just work fine with visibility: collapse or display: none given they either already do it themselves with extra CSS (see comment 7) or don't care about the height.

XUL tabpanels will be split out to different bug.

Summary: Remove nsDeckFrame (moving the showing/hiding logic into the <xul:deck> and <xul:tabpanels> Custom Elements) → Stop using nsDeckFrame in XUL <deck>
No longer depends on: 1678547
Component: Layout → XUL Widgets
Product: Core → Toolkit
Blocks: 1689817
Attachment #9093957 - Attachment description: Bug 1559192 - Make xul:deck not use nsDeckFrame. → Bug 1559192 - Stop using nsDeckFrame for XUL <deck>.
Assignee: nobody → ntim.bugs
Status: NEW → ASSIGNED
Blocks: 1689817
Depends on: 1689830
Assignee: ntim.bugs → nobody
Status: ASSIGNED → NEW
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: