When sending an If-Modified-Since header we should use the
`last_modified` rather than the `date` property of the cached
object in order to not incorrectly assume things have a modification
date when they do not.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
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>
By reference to the MDN and to Duktape's CLI, expose everything
we possibly can on the global object (Window).
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
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>
In order to cope when an entire document is `visibility: hidden`
we default to the <HTML> node when interacting with the document
to ensure we don't drop off the end of the box model without
identifying at least one node to fire events at.
This resolves#2658
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
We were using integer multiplication rather than fixed-point
multiplication when calculating point sizes relative to the viewport.
This fixes that.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
In order to help us debug shutting down with active fetches, this
will abort the process cleanly if we get a callback to an "active"
llcache handle after the abort process has actually killed them
all. This can happen with deferred fetcher aborts in the cURL
fetcher.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
During the process of finalising the hlcache, there won't be
any more fetching going on. As such, we can abort, error, and
then destroy any contents still in the process of loading. This
should reduce our leaks during shutdown.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Sometimes callbacks may be cancelled from within themselves. In
that case we need to simply ensure that should the callback be
wanted to repeat, we instead stop that so that once the callback
is completed we do not attempt to reschedule something which had
already been deleted.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
In order to cope better with modern cURL which prevents making
cURL calls when inside a callback from within cURL, defer fetch
start when we are processing in `fetch_curl_data()`.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
The pushed fragment node holds the reference, so unref it in
the end of createDocumentFragment()
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Since executing a script can cause more scripts to be appended
to the script array, and that can cause a reallocation which might
move the script array, reacquire the script pointer after running
the script so that we don't wander off into the reeds.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
stop curl fetcher logging being special case to standard error and
use the fetch catagory at DEBUG level instead.
The special suppress_curl_debug option is currently still obeyed
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>