Пример #1
0
    def __modifyChild__(self, childElement):
        height = childElement.style.pop('height', '')

        if not childElement.displayable:
            self.childElements.append(childElement)
        elif not childElement.tagName or height:
            container = Box()
            container.style['height'] = height
            childElement.style['height'] = "100%"
            container.style['clear'] = "both"
            container.addChildElement(childElement)
            return Box.addChildElement(self, container)
        else:
            childElement.style['clear'] = "both"
            if not childElement.isBlockElement():
                childElement.addClass("WBlock")
            self.childElements.append(childElement)
Пример #2
0
    def __modifyChild__(self, childElement):
        width = childElement.style.pop('width', '')
        align = childElement.style.pop('float', 'left')

        if width == "0" or width == "hide":
            self.childElements.append(childElement)
        if not childElement.displayable:
            self.childElements.append(childElement)
            return

        if not childElement.tagName or width:
            container = Box.addChildElement(self, Box())
            container.addChildElement(childElement)
        else:
            if not childElement.isBlockElement():
                childElement.addClass("WBlock")
            container = childElement
            self.childElements.append(childElement)

        container.style['float'] = align
        if width:
            container.style['vertical-align'] = 'middle'
            container.style['width'] = width