- We need to do javascript layout because CSS is designed for print.
- It's unwieldy to have a Widget for every node that needs layout. Layout system straddles the DOM/Widget divide.
- We can't rely on onresize events on arbitrary nodes (?), so we attach
onSizeChange
events to nodes of interest.
- Any code that messes with node pos/size should invoke
onSizeChange
, so we can rely on it.
update
- layouts attach a custom reflow method to nodes that can reflow
- layouts attach a custom boundschange method to nodes that can reflow
- boundschange calls reflow
- boundschange calls onboundschange
- layouts invoke onboundschange on a node after they change it's bounds
- as needed, client code invokes boundschange (cause), but overrides onboundschange (effect)