Merge branch 'master' of ssh://cmpl.cc:2323/qutebrowser

Conflicts:
	qutebrowser/utils/webelem.py
This commit is contained in:
Florian Bruhin 2014-07-16 11:09:13 +02:00
commit 23baab1fc0
3 changed files with 12 additions and 1 deletions

View File

@ -102,6 +102,8 @@ Bugs
window has a bigger size hint instead of tabs getting smaller than the
minimum size (iggy)
- Opening editor is broken on http://p.cmpl.cc/
- Segfault on subsonic when clicking next track
- Assertion failure on subsonic with debug build

View File

@ -737,7 +737,11 @@ class CommandDispatcher:
if elem.isNull():
raise CommandError("Element vanished while editing!")
if webelem.is_content_editable(elem):
log.misc.debug("Filling element {} via setPlainText.".format(
webelem.debug_text(elem)))
elem.setPlainText(text)
else:
log.misc.debug("Filling element {} via javascript.".format(
webelem.debug_text(elem)))
text = webelem.javascript_escape(text)
elem.evaluateJavaScript("this.value='{}'".format(text))

View File

@ -249,7 +249,7 @@ def is_editable(elem, strict=False):
# pylint: disable=too-many-return-statements
roles = ('combobox', 'textbox')
log.misc.debug("Checking if element is editable: {}".format(
compact_text(elem.toOuterXml(), 500)))
debug_text(elem)))
tag = elem.tagName().lower()
if is_content_editable(elem) and is_writable(elem):
return True
@ -279,3 +279,8 @@ def focus_elem(frame):
frame: The QWebFrame to search in.
"""
return frame.findFirstElement(SELECTORS[Group.focus])
def debug_text(elem):
"""Get a text based on an element suitable for debug output."""
return compact_text(elem.toOuterXml(), 500)