(attr: str, node: html.HtmlElement)
| 165 | return '' if str is None else str.strip()[:500] |
| 166 | |
| 167 | def check_attr(attr: str, node: html.HtmlElement) -> bool: |
| 168 | tag = node.tag |
| 169 | if ( |
| 170 | ( attr == 'role' and node.attrib.get(attr, '') in ['presentation', 'none', 'link'] ) |
| 171 | or ( attr == 'type' and node.attrib.get(attr, '') == 'hidden' ) |
| 172 | # or ( attr == 'value' and tag in ['option'] ) |
| 173 | ): |
| 174 | return False |
| 175 | return True |
| 176 | |
| 177 | def is_visible(node: html.HtmlElement, bid: str) -> bool: |
| 178 | if self.dataset == 'mind2web': |
nothing calls this directly
no outgoing calls
no test coverage detected