Fix word hinting

This commit is contained in:
Florian Bruhin 2016-07-27 16:54:26 +02:00
parent ffdaf8d470
commit e051de4843
2 changed files with 6 additions and 1 deletions

View File

@ -1094,7 +1094,7 @@ class WordHinter:
})
return (attr_extractors[attr](elem)
for attr in extractable_attrs[elem.tagName()]
for attr in extractable_attrs[elem.tag_name()]
if attr in elem or attr == "text")
def tag_words_to_hints(self, words):

View File

@ -327,6 +327,11 @@ class WebElementWrapper(collections.abc.MutableMapping):
self._check_vanished()
return utils.compact_text(self._elem.toOuterXml(), 500)
def tag_name(self):
"""Get the tag name for the current element."""
self._check_vanished()
return self._elem.tagName()
def rect_on_view(self, *, elem_geometry=None, adjust_zoom=True, no_js=False):
"""Get the geometry of the element relative to the webview.