1. ms2ger
  2. Anolis


Geoffrey Sneddon  committed bfa61a0

Move tuples into frozensets and don't create them on every call.

  • Participants
  • Parent commits 16d9614
  • Branches default

Comments (0)

Files changed (1)

File specGen/utils.py

View file
 sectioning_content = frozenset([u"body", u"section", u"nav", u"article", u"aside"])
 sectioning_root = frozenset([u"blockquote", u"figure", u"td", u"datagrid"])
+always_interactive_content = frozenset([u"a", u"bb", u"details", u"datagrid"])
+media_elements = frozenset([u"audio", u"video"])
 non_sgml_name = re.compile("[^A-Za-z0-9_:.]+")
 if sys.maxunicode == 0xFFFF:
 def isInteractiveContent(element):
-	if element.tag in (u"a", u"bb", u"details", u"datagrid") \
-	or element.tag in (u"audio", u"video") and element.get(u"controls") is not None \
+	if element.tag in always_interactive_content \
+	or element.tag in media_elements and element.get(u"controls") is not None \
 	or element.tag == u"menu" and element.get(u"type") is not None and element.get(u"type").lower() == u"toolbar":
 		return True