MantisBT - NetSurf
View Issue Details
0002751NetSurfJavascriptpublic2020-04-19 21:252020-05-21 20:27
ReporterKrsna 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusacknowledgedResolutionopen 
Platformx86_64OSVoid LinuxOS VersionKernel 5.6.3_1
Product Version3.9 
Target VersionFixed in Version 
Fixed in CI build #
Reported in CI build #
URL of problem pagehttps://www.w3schools.com/js/tryit.asp?filename=tryjs_alert
Summary0002751: Javascript errors out
DescriptionAll JS that invokes document (basically everything) errors out:



(6.569686) content/handlers/html/html.c:94 fire_dom_event: Dispatching 'click' against 0x559f88549a50
(6.570662) content/handlers/javascript/duktape/dukky.c:1084 dukky_generic_event_handler: was at: ?inline script? line 34
(6.570703) content/handlers/javascript/duktape/dukky.c:1087 dukky_generic_event_handler: Stack trace: TypeError: cannot read property 'document' of undefined
    at [anon] (content/handlers/javascript/duktape/duktape.c:56524) internal
    at submitTryit (?inline script?:34)
    at [anon] (internal raw uncompiled handler:1) preventsyield


Tried to build with latest version of duktape as well and same issue.
Steps To Reproduce1. Enable JS in netsurf.
2. navigate to a simple test https://www.w3schools.com/js/tryit.asp?filename=tryjs_alert
3. click the Run button
Additional InformationThe "search from url bar" option also seems to have no effect.
TagsNo tags attached.
Attached Files

Notes
(0002185)
Krsna   
2020-04-25 07:09   
(11.889771) content/fs_backing_store.c:753 write_entries: Wrote out 11 entries
(14.430525) content/handlers/html/html.c:118 fire_generic_dom_event: Dispatching 'click' against 0x5555b084fac0
(14.431023) content/handlers/javascript/duktape/dukky.c:1211 dukky_generic_event_handler: was at: ?inline script? line 34
(14.431042) content/handlers/javascript/duktape/dukky.c:1214 dukky_generic_event_handler: Stack trace: TypeError: cannot read property 'document' of undefined
    at [anon] (content/handlers/javascript/duktape/duktape.c:57262) internal
    at submitTryit (?inline script?:34)
    at [anon] (internal raw uncompiled handler:1) preventsyield


saminsh error built from bf4cbc95b0a4d57dd90908dca5524801af4ca91e
(0002190)
Vincent Sanders   
2020-05-21 20:27   
this is a deficiency in the current javascript implementation which will be addressed in future improvements

Issue History
2020-04-19 21:25KrsnaNew Issue
2020-04-25 07:09KrsnaNote Added: 0002185
2020-05-21 20:27Vincent SandersSeverityblock => feature
2020-05-21 20:27Vincent SandersStatusnew => acknowledged
2020-05-21 20:27Vincent SandersNote Added: 0002190