Ejemplo n.º 1
0
 def getStyleAttributeFromRegion_(region: Element, styles, attribute):
     ttsNs = styleNs_
     if not region:
         return None
     attr = region.getAttributeNS(ttsNs, attribute)
     if attr:
         return attr
     return TtmlTextParser.getInheritedStyleAttribute_(region, styles, attribute)
Ejemplo n.º 2
0
 def getInheritedAttribute_(element: Element, attributeName: str, nsName: str):
     ret = None
     while element:
         if nsName:
             ret = element.getAttributeNS(nsName, attributeName)
         else:
             ret = element.getAttribute(attributeName)
         if ret:
             break
         parentNode = element.parentNode
         if isinstance(parentNode, Element):
             element = parentNode
         else:
             break
     return ret
Ejemplo n.º 3
0
 def getStyleAttributeFromElement_(cueElement: Element, styles, attribute: str):
     ttsNs = styleNs_
     elementAttribute = cueElement.getAttributeNS(ttsNs, attribute)
     if elementAttribute:
         return elementAttribute
     return TtmlTextParser.getInheritedStyleAttribute_(cueElement, styles, attribute)