amplesdk icon indicating copy to clipboard operation
amplesdk copied to clipboard

XUL: Hidden dialog box in vbox results in calculated height of -1478%

Open h6w opened this issue 14 years ago • 1 comments

I've cut my code down to this: http://pastebin.com/WbuyLES2

I am testing this on chrome.

If you look at the xul-box---box-child element in the shadow DOM, you'll see that it's of type "display: none" and a height of -1478%, which is why things don't look quite right from then on.

I could be doing this wrong, tho. I don't quite see an appropriate place to put hidden dialogs, so I just appended them hidden to a parent vbox, with this result.

This resulted in my elements with flex="1" no longer filling the screen.

I'm also going to look for a xul schema validator to see where dialogs are allowed.

h6w avatar Oct 25 '11 20:10 h6w

  1. following elements: dialog, window, wizard, page can only be root elements in an XUL fragment/document (in case of Ample, they should either be children of script tag or, if imported, children of ample documentElement).
  2. the miscalculated "-1478%" value is indeed a wrong result. the cause to it is that element's box sizes are calculated when element is not visible. action: we should recalculate box model dimensions for hidden elements. all windowed XUL elements support show/showModal/hide methods which when called will properly recalcuate sizes.

ilinsky avatar Oct 30 '11 19:10 ilinsky