for (Slot slot : widgetToSlot.values()) {
Element slotElement = slot.getElement();
slotElement.removeAttribute("aria-hidden");
Style slotStyle = slotElement.getStyle();
slotStyle.clearVisibility();
slotStyle.clearMarginLeft();
slotStyle.clearMarginTop();
if (slot.getExpandRatio() != 0) {
// FIXME expandRatio might be <0
double size = 100 * (slot.getExpandRatio() / total);
if (vertical) {
slot.setHeight(size + "%");
if (slot.hasRelativeHeight()) {
Util.notifyParentOfSizeChange(this, true);
}
} else {
slot.setWidth(size + "%");
if (slot.hasRelativeWidth()) {
Util.notifyParentOfSizeChange(this, true);
}
}
} else if (slot.isRelativeInDirection(vertical)) {
// Relative child without expansion gets no space at all
if (vertical) {
slot.setHeight("0");
} else {
slot.setWidth("0");
}
slotStyle.setVisibility(Visibility.HIDDEN);
slotElement.setAttribute("aria-hidden", "true");
} else {
// Non-relative child without expansion should be unconstrained
if (BrowserInfo.get().isIE8()) {
// unconstrained in IE8 is auto
if (vertical) {
slot.setHeight("auto");
} else {
slot.setWidth("auto");
}
} else {
if (vertical) {
slotStyle.clearHeight();
} else {
slotStyle.clearWidth();
}
}
}
}
}