Ticket #3887 (new task)

Opened 2 years ago

Last modified 12 months ago

Do layout in CSS not JS

Reported by: bill Owned by: peller
Priority: normal Milestone: future
Component: Dijit Version: 0.9
Severity: normal Keywords: bordercontainer
Cc:

Description (last modified by peller) (diff)

As per

http://www.alistapart.com/articles/conflictingabsolutepositions

try to do pane layout in CSS rather than JS. There are three goals to this:

1. make resizing smoother. It's especially bad on FF but IE also shows a little lag on resizing something big like themeTester.html

2. ideally it would also solve the problem of having layout containers inside hiddens divs (IE, a hidden content pane), which currently isn't supported because when the layout container initializes it fails trying to do calls like getMarginBox(), which returns 0 since it can't figure out the real answer. But not sure if that's feasible to avoid, since we still need to do some JS calculations, like to get the height of the tab labels in a TabContainer? (which depends on the font size and whether or not the labels overflow from one row to two rows).

3. avoid race conditions on initialization. The layout widgets in 0.4 had lots of setTimeout() calls because initial size calculations would fail or give incorrect answers, and in 1.0 we go to pains to never call setMarginBox() immediately followed by getContentBox(), which fails since the margin box size doesn't actually readjust until the whole block of JS code finishes executing.

Even SplitContainer/AccordionContainer? may be convertible. See attached split.html for an example (it basically divides the screen into three equal section, each of which has a 10px divider and the remaining space is for content).

Attachments

split.html (0.7 kB) - added by bill 2 years ago.
example of doing split container in CSS (except for dragging the dividers!)
TabBorder.patch (8.0 kB) - added by peller 14 months ago.
I think I've got it working.

Change History

Changed 2 years ago by bill

example of doing split container in CSS (except for dragging the dividers!)

Changed 2 years ago by bill

  • type changed from defect to task
  • description modified (diff)

Changed 2 years ago by bill

  • description modified (diff)

Changed 21 months ago by bill

  • owner changed from bill to peller

Adam is working on this for BorderLayout? container; that work should be extended to TabContainer? also (after all it's just a top+center layout), and AccordionContainer?. SplitContainer? and LayoutContainer? are obsoleted by BorderLayout?. So I think we can use this technique for all the layout widgets (but time will tell).

Changed 21 months ago by bill

  • milestone changed from 2.0 to 1.1

Changed 18 months ago by bill

  • milestone changed from 1.1 to 2.0

Changed 18 months ago by bill

  • description modified (diff)

Changed 18 months ago by peller

  • keywords bordercontainer added

Changed 17 months ago by alex

  • milestone changed from 2.0 to 1.3

Milestone 2.0 deleted

Changed 14 months ago by peller

  • description modified (diff)
  • milestone changed from 1.3 to 1.2

Feels like it's close enough that we should give this a shot for 1.2.

Changed 14 months ago by peller

I think I've got it working.

Changed 12 months ago by peller

  • milestone changed from 1.2 to future
Note: See TracTickets for help on using tickets.