WebHitTestResult: Fix isContentSelected

Was returning always true on right click
remotes/origin/falkon
David Rosca 11 years ago
parent 150252aea9
commit 3050913d21
  1. 8
      src/lib/webengine/webhittestresult.cpp

@ -40,12 +40,18 @@ WebHitTestResult::WebHitTestResult(const WebPage *page, const QPoint &pos)
" return e.getAttribute('readonly') != 'readonly';" " return e.getAttribute('readonly') != 'readonly';"
" return false;" " return false;"
"}" "}"
"function isSelected(e) {"
" var selection = window.getSelection();"
" if (selection.type != 'Range')"
" return false;"
" return window.getSelection().containsNode(e, true);"
"}"
"var res = {" "var res = {"
" alternateText: e.getAttribute('alt')," " alternateText: e.getAttribute('alt'),"
" boundingRect: ''," " boundingRect: '',"
" imageUrl: ''," " imageUrl: '',"
" contentEditable: isEditableElement(e)," " contentEditable: isEditableElement(e),"
" contentSelected: window.getSelection().containsNode(e, true)," " contentSelected: isSelected(e),"
" linkTitle: ''," " linkTitle: '',"
" linkUrl: ''," " linkUrl: '',"
" mediaUrl: ''," " mediaUrl: '',"

Loading…
Cancel
Save