You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-dev@incubator.apache.org by James Margaris <jm...@nexaweb.com> on 2007/02/23 01:05:16 UTC

Changes to BorderPane

Right now BorderPane uses a passive layout rather than an active one.

Passive layout: A layout based on tables or CSS that the browser can
handle without code.
Active layout: A layout that is performed by code that must be called
when the container changes size.

Passive layouts are a better strategy in general because they don't
suffer from weird visual quirks during resizing, don't require code, and
integrate better with plain HTML and other HTML widgets. For an active
layout you have to detect when the size of something changes and cascade
that down to children, which is tricky.

However, certain things are simply not achievable with a passive layout.

The BorderPane we have today works well in Mozilla but in IE it does not
work, it sizes too large vertically. (It does work in quirks mode in IE,
but quirks mode has plenty of other problems)

Our strategy was to divide a border pane into three rows, with the
middle row set to height 100% and the middle cell of the middle row set
to width 100%. In IE this will unfortunately ALWAYS make the center row
100% of the table size as set, which then forces the table to grow
vertically. So if you try to make a 300x300 table it might size to
300x360 instead. (If the the top and bottom rows are both 30px tall)

Converting BorderPane to an active layout fixes these problems. I'm
going to check in a new BorderPane that uses active layout, I've tested
all the samples and they seem to work ok. 

I would expect some difference in behavior if you don't set the size of
the BorderPane initially or put it in something like a splitPane that
fixes the size. Under the old scheme the size of the borderPane would
end up calculated as relatively correct because the components were
stuck in a table with the appropriate structure. Now all the children
are just random stacked divs until the borderPane performs layout.

This is annoying, but I would rather have a borderPane that works the
same on all browsers than one with some better edge-case behavior that
doesn't work for simple cases in IE.

James Margaris