Commit Graph

31 Commits

Author SHA1 Message Date
Daniel Silverstone 9742a8317f Dukky: Add and utilise a jserrors category
Normal, and verbose logging will now also log all JS errors in order that we
stand a chance of debugging things more easily when testing.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-02 10:12:45 +01:00
Daniel Silverstone e85e2f7cdf dukky.c: Correct typo (BUTTOM -> BUTTON)
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-01 21:57:36 +01:00
Daniel Silverstone f365e75407 Dukky: Support console logging better
Add a polyfill for Array.from(), and fix the console formatter so that
it won't keep exploding.  This should improve matters in the tests.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-01 21:40:54 +01:00
Daniel Silverstone bb3e0e51f1 dukky: Attempt to make the fallback to HTMLUnknownElement more useful.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-01 21:03:07 +01:00
Vincent Sanders 90530c419e when owning context is destroyed ensure that active js compartment is destroyed first 2019-07-12 13:37:04 +01:00
Daniel Silverstone 196c2fc845 Add dodgy window method to clear callbacks
Until we can determine *how* the compartment isn't cleaning
up properly in the duktape context, this will at least mean
we don't get unpleasant callback related issues when compartments
are reset during browsing.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-25 16:23:37 +01:00
Daniel Silverstone d77ed689e6 Quieten dukky a little more in default log levels
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-06 15:36:49 +01:00
Daniel Silverstone 378383ea3b Support context dump safely in duktape
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-06 15:09:39 +01:00
Vincent Sanders 35bc2ccbb8 change content get_source_data interfaces to return uint8_t and size_t
previously these interfaces returned char * and unsigned int which was
undesirable.
2019-05-05 22:50:25 +01:00
Daniel Silverstone 8b4ec11b89 Dukky: Change from specifically named generics
Instead of specifically having to extract each generic by name,
such as makeListProxy, instead support the entire generics table
and use `dukky_push_generics()` to gain access to it.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-05 22:17:10 +01:00
Daniel Silverstone 3ba50e8574 Force a GC to ensure old compartment goes away
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-05 18:51:41 +01:00
Daniel Silverstone 9a3b644bf0 Replace zd with PRIsizet to appease Windows
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-05 14:55:08 +01:00
Daniel Silverstone 6dfc0f1486 Support nodelist indexing
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-04 23:06:20 +01:00
Daniel Silverstone 85a4792280 Add createElementNS
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-04 17:57:45 +01:00
Daniel Silverstone ed829a4772 JS: Attribute external JS to the URI it came from in backtraces
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-04 17:32:17 +01:00
Daniel Silverstone 36d83668c2 Support Window as an event target for dukky
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-04 15:49:21 +01:00
Daniel Silverstone e4f57437f6 Unref body when finished getting event handler
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-04 15:01:15 +01:00
Daniel Silverstone 99809ee646 Better dukky debug for node creation
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-04 15:01:15 +01:00
Daniel Silverstone 4f9a373960 Support Document::createEvent()
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-03 13:32:23 +01:00
Daniel Silverstone c17e588b66 Javascript: Support setTimeout and friends
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-03 11:33:07 +01:00
Daniel Silverstone 519f029420 dukky: Clean up the logging levels a little
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-02 21:18:30 +01:00
Daniel Silverstone d4d57bc0ed DUKKY: Remove LOG/JS_LOG macros, update to dukky category
Update the logging levels, change to NSLOG across the board,
and ensure that we use the `dukky` category now added for us.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-02-17 11:33:37 +00:00
Vincent Sanders 5b235b5195 fix logging level in duktape binding 2018-11-06 21:54:03 +00:00
Daniel Silverstone 44082f9988 Slightly nicer handling of js_exec() and errors 2018-11-04 09:56:41 +00:00
Vincent Sanders 75018632a9 Use coccinelle to change logging macro calls in c files
for F in $(git ls-files '*.c');do spatch --sp-file foo.cocci --in-place ${F};done

@@ expression E; @@
-LOG(E);
+NSLOG(netsurf, INFO, E);
@@ expression E, E1; @@
-LOG(E, E1);
+NSLOG(netsurf, INFO, E, E1);
@@ expression E, E1, E2; @@
-LOG(E, E1, E2);
+NSLOG(netsurf, INFO, E, E1, E2);
@@ expression E, E1, E2, E3; @@
-LOG(E, E1, E2, E3);
+NSLOG(netsurf, INFO, E, E1, E2, E3);
@@ expression E, E1, E2, E3, E4; @@
-LOG(E, E1, E2, E3, E4);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4);
@@ expression E, E1, E2, E3, E4, E5; @@
-LOG(E, E1, E2, E3, E4, E5);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5);
@@ expression E, E1, E2, E3, E4, E5, E6; @@
-LOG(E, E1, E2, E3, E4, E5, E6);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6);
@@ expression E, E1, E2, E3, E4, E5, E6, E7; @@
-LOG(E, E1, E2, E3, E4, E5, E6, E7);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6, E7);
2017-09-06 18:45:27 +01:00
Michael Drake 5d39972b9f Duktape 2.X: duk_error now returns a duk_ret_t
https://github.com/svaarala/duktape/blob/master/doc/release-notes-v2-0.rst#duk_error-duk_error_va-duk_throw-duk_fatal-have-a-return-value

This also changes Console.bnd to return on error, rather than ignoring it.
2017-03-23 14:56:32 +00:00
Michael Drake ff8e5c99a0 Duktape 2.x: duk_safe_call callbacks now have a void ptr user data param.
https://github.com/svaarala/duktape/blob/master/doc/release-notes-v2-0.rst#duk_safe_call-userdata
2017-03-23 14:56:32 +00:00
Daniel Silverstone 2858aec1c2 Add EventListener support to duktape binding.
This paves the way for EventTarget and its associated event listener support.
In particular it ensures the generic event handling we do supports the
semantics of the addEventListener() and removeEventListener() managed lists of
callbacks.
2017-02-05 12:05:04 +00:00
Daniel Silverstone 108cc0cebd Support fixed nsgenbind bindings 2017-02-05 11:20:08 +00:00
Vincent Sanders 6075feb487 create netsurf inttypes header to have portable integer formatting macros 2017-01-21 14:20:55 +00:00
Vincent Sanders 042fcb82b8 Move javascript content handler as appropriate for updated source format 2016-06-07 16:01:04 +01:00
Renamed from javascript/duktape/dukky.c (Browse further)