Bug 404320 - WebHitTestResult incorrectly assumes every <a> element has 'href' attribute
Summary: WebHitTestResult incorrectly assumes every <a> element has 'href' attribute
Status: RESOLVED FIXED
Alias: None
Product: Falkon
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: David Rosca
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-14 05:30 UTC by Eugene Shalygin
Modified: 2019-02-14 07:54 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
proposed patch (2.19 KB, patch)
2019-02-14 05:46 UTC, Eugene Shalygin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Shalygin 2019-02-14 05:30:47 UTC
SUMMARY
If <a> element does not have 'href' attribute, the JS script in WebHitTestResult generates an error: Uncaught TypeError: Cannot read property 'trim' of null.

Such <a> tags are widely used by Twine/Tweego story formats. Thus debugging such stories using Falkon is greatly complicated.

STEPS TO REPRODUCE
1. Create a HTML document with <a> element which does not have 'href' attribute (handles the link via a script, for example)
2. Open it in Falkon
3. Click the link.

OBSERVED RESULT

"TypeError: Cannot read property 'trim' of null." in the console log.


EXPECTED RESULT
No errors

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: git master
KDE Frameworks Version: git master
Qt Version: 5.12.1

ADDITIONAL INFORMATION

http://www.motoslave.net/tweego/
Comment 1 Eugene Shalygin 2019-02-14 05:46:46 UTC
Created attachment 118055 [details]
proposed patch
Comment 2 David Rosca 2019-02-14 07:54:10 UTC
Git commit b508ed2260a9fd9951a0b7536514be7ff2609ae3 by David Rosca.
Committed on 14/02/2019 at 07:44.
Pushed by drosca into branch 'master'.

WebHitTestResult: Expect null href attribute

Patch by Eugene Shalygin

M  +6    -3    src/lib/webengine/webhittestresult.cpp

https://commits.kde.org/falkon/b508ed2260a9fd9951a0b7536514be7ff2609ae3