1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

WebHitTestResult: Fix isContentSelected

Was returning always true on right click
This commit is contained in:
David Rosca 2015-10-05 20:29:26 +02:00
parent 150252aea9
commit 3050913d21

View File

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