Commit Graph

1507 Commits

Author SHA1 Message Date
Daniel Silverstone
609ee9b71c Window: Provide a little more info on why not EXPOSE()ing some stuff
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-02 09:27:06 +01:00
Daniel Silverstone
ce7e6d91f5 Window: Restructure EXPOSE()d globals
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>
2019-08-02 09:17:12 +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
Daniel Silverstone
acee5faa3f html_interaction.c: Default node to <HTML> node
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>
2019-08-01 13:56:42 +01:00
Daniel Silverstone
a325d6b474 Console.bnd: Support attempts to log when Window has gone
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-01 09:22:09 +01:00
Michael Drake
4b6967fee4 Layout: Apply min/max width to replaced elements when width is given. 2019-07-30 21:55:29 +01:00
Vincent Sanders
730d59776a cleanup some javascript documentation comments 2019-07-12 13:40:26 +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
Vincent Sanders
c2fa6af0ff make content close check the content status itself
make content handler open and close return error status
2019-07-10 16:42:52 +01:00
Vincent Sanders
1ae0ee21ee add isFinite to global context 2019-07-01 23:26:11 +01:00
Daniel Silverstone
43f8e77df7 css/utils.c: Fix vw/vh handling in len2pt
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>
2019-06-30 11:27:58 +01:00
Michael Drake
1c3ce67c62 HTML: Viewport width/height in length context are fixed point. 2019-06-29 21:59:15 +01:00
Vincent Sanders
dc9762fef3 revert 8265b8b66f as ssize_t is not available everywhere 2019-06-25 08:49:29 +01:00
Daniel Silverstone
8265b8b66f Duktape: Probably should use ssize_t
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-06-15 21:34:47 +01:00
Daniel Silverstone
84b8e7dfa1 Duktape: Hopefully silence issue with %lld
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-06-15 21:33:59 +01:00
Daniel Silverstone
659c9161ee llcache: Abort cleanly if called back during shutdown
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>
2019-06-15 21:13:09 +01:00
Daniel Silverstone
09fa61eb73 hlcache.c: Clean up LOADING contents during finalise
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>
2019-06-15 21:12:58 +01:00
John-Mark Bell
c1dc4e61bd LLCache: validate max-age before use 2019-06-10 21:36:52 +00:00
John-Mark Bell
047c82cfce LLCache: use Cache-Control parser 2019-06-10 21:02:26 +00:00
Vincent Sanders
9893b05b08 use jmb suggested fix to cache-control header parse error 2019-06-10 21:58:46 +01:00
Vincent Sanders
e598dcd139 fix parsing of invalid syntax max-age value Cache-control header 2019-06-10 20:53:12 +01:00
Daniel Silverstone
e82107a296 Window.bnd: Suppress some unnecessary stack frame dumps
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-06-09 15:59:05 +01:00
Daniel Silverstone
c5c8a49276 Window.bnd: Expose isNan
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-06-09 15:20:01 +01:00
Daniel Silverstone
04cf2fe588 Window.bnd: Do not remove in-train callbacks
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>
2019-06-09 11:04:15 +01:00
Vincent Sanders
dddc5eac94 Update schedulers return codes
The GTK and monkey frontends schedulers now return NSERROR_NOT_FOUND
 when a caller is using a negative schedule time to remove a callback.
2019-06-08 13:33:16 +01:00
Daniel Silverstone
64ee8e1b00 html.c: Correct ordering for reformat time
Fix a minor bug where we'd likely never end up reformatting.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-06-05 22:59:49 +01:00
Daniel Silverstone
3d80e825e1 content/fetchers/curl.c: Defer fetch start if inside cURL
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>
2019-06-05 19:51:47 +01:00
Daniel Silverstone
c07b2edd77 Document.bnd: createDocumentFragment() unref fragment
The pushed fragment node holds the reference, so unref it in
the end of createDocumentFragment()

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-06-01 13:59:36 +01:00
Daniel Silverstone
9c32564085 html_script.c: html_script_exec() reqacquire script ptr
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>
2019-06-01 13:25:14 +01:00
Vincent Sanders
a6de56583c Improve javascript unimplemented bnding documentation generation 2019-05-31 19:40:10 +01:00
Vincent Sanders
13a5b8f74a make curl fetcher log debug using NSLOG
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
2019-05-28 11:16:49 +01:00
Daniel Silverstone
57094c84ed Expose NaN on Window
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-25 20:11:52 +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
87be4e7a17 Log when we finalise window objects
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-25 16:13:57 +01:00
Daniel Silverstone
c42039c546 Use generics for makeListProxy properly
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-25 16:13:57 +01:00
Daniel Silverstone
9ee92823e2 Use generics for makeListProxy properly
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-25 16:13:57 +01:00
Daniel Silverstone
78385629c3 Remove unnecessary generics magic
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-25 16:13:57 +01:00
Michael Drake
b330fd9f0e HTML: Update selection media data for new libcss API. 2019-05-07 14:01:51 +01:00
Michael Drake
31655be43b CSS: One inch is 96 css pixels. 2019-05-07 09:53:31 +01:00
Michael Drake
51feeadcf9 HTML: Set up the CSS length measuring context in CSS pixels. 2019-05-06 21:30:05 +01:00
Michael Drake
041e9426c1 CSS: Use helper to convert form css to physical pixels. 2019-05-06 21:25:54 +01:00
Michael Drake
ffc199d778 CSS: Add helpers to convert between css and physical pixels. 2019-05-06 21:22:55 +01:00
Michael Drake
7567f64075 CSS: Extern the nscss_baseline_pixel_density value.
Front ends should be able to set this, or it should
be a config option.
2019-05-06 21:21:44 +01:00
Michael Drake
e02020198d Convert css_len2pt and css_len2px for CSS pixels. 2019-05-06 20:49:48 +01:00
Michael Drake
a43b83de03 HTML: Squash error-path leaks in select box construction. 2019-05-06 17:29:53 +01:00
Michael Drake
65b16f4c54 Curl fetcher: Force HTTP1.1 to fix HTTP2 crash.
On ubuntu 19.4, curl is built with HTTP2 support, and we
segfault.

==18174== Invalid read of size 1
==18174==    at 0x4ACCE7D: ??? (in /usr/lib/x86_64-linux-gnu/libcurl.so.4.5.0)
==18174==    by 0x4B054B1: ??? (in /usr/lib/x86_64-linux-gnu/libcurl.so.4.5.0)
==18174==    by 0x4AD398A: ??? (in /usr/lib/x86_64-linux-gnu/libcurl.so.4.5.0)
==18174==    by 0x4AD7A0B: ??? (in /usr/lib/x86_64-linux-gnu/libcurl.so.4.5.0)
==18174==    by 0x4AE93EE: ??? (in /usr/lib/x86_64-linux-gnu/libcurl.so.4.5.0)
==18174==    by 0x4AEA8A8: curl_multi_perform (in /usr/lib/x86_64-linux-gnu/libcurl.so.4.5.0)
==18174==    by 0x1F2EF7: fetch_curl_poll (curl.c:1209)
==18174==    by 0x1EEC5C: fetcher_poll (fetch.c:271)
==18174==    by 0x2A1ED4: schedule_run (schedule.c:160)
==18174==    by 0x15F941: framebuffer_run (gui.c:596)
==18174==    by 0x15F941: main (gui.c:2206)
==18174==  Address 0x9de95a8 is 3,224 bytes inside a block of size 6,304 free'd
==18174==    at 0x483997B: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==18174==    by 0x4AD497B: ??? (in /usr/lib/x86_64-linux-gnu/libcurl.so.4.5.0)
==18174==    by 0x4AE158C: curl_easy_cleanup (in /usr/lib/x86_64-linux-gnu/libcurl.so.4.5.0)
==18174==    by 0x1F30DE: fetch_curl_cache_handle (curl.c:761)
==18174==    by 0x1F30DE: fetch_curl_stop (curl.c:840)
==18174==    by 0x1F30DE: fetch_curl_done (curl.c:1122)
==18174==    by 0x1F30DE: fetch_curl_poll (curl.c:1223)
==18174==    by 0x1EEC5C: fetcher_poll (fetch.c:271)
==18174==    by 0x2A1ED4: schedule_run (schedule.c:160)
==18174==    by 0x15F941: framebuffer_run (gui.c:596)
==18174==    by 0x15F941: main (gui.c:2206)
==18174==  Block was alloc'd at
==18174==    at 0x483AB35: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==18174==    by 0x4AE165F: curl_easy_duphandle (in /usr/lib/x86_64-linux-gnu/libcurl.so.4.5.0)
==18174==    by 0x1F15EB: fetch_curl_get_handle (curl.c:738)
==18174==    by 0x1F15EB: fetch_curl_start (curl.c:750)
==18174==    by 0x1EEB22: fetch_dispatch_job (fetch.c:156)
==18174==    by 0x1EEB22: fetch_choose_and_dispatch (fetch.c:187)
==18174==    by 0x1EEB22: fetch_dispatch_jobs (fetch.c:247)
==18174==    by 0x1EF1BB: fetch_start (fetch.c:573)
==18174==    by 0x26C779: llcache_object_refetch (llcache.c:916)
==18174==    by 0x26D5E4: llcache_object_fetch (llcache.c:979)
==18174==    by 0x26D5E4: llcache_object_retrieve_from_cache (llcache.c:1767)
==18174==    by 0x26D5E4: llcache_object_retrieve (llcache.c:1865)
==18174==    by 0x26E42C: llcache_fetch_redirect (llcache.c:2110)
==18174==    by 0x26E42C: llcache_fetch_callback (llcache.c:2810)
==18174==    by 0x1F1295: fetch_curl_process_headers (curl.c:922)
==18174==    by 0x1F13A0: fetch_curl_data (curl.c:1324)
==18174==    by 0x4ACD4C3: ??? (in /usr/lib/x86_64-linux-gnu/libcurl.so.4.5.0)
==18174==    by 0x4AE00DA: ??? (in /usr/lib/x86_64-linux-gnu/libcurl.so.4.5.0)
2019-05-06 17:12:14 +01:00
Michael Drake
0db71994ea HTML: Before building the box tree, get viewport dimensions. 2019-05-06 15:38:33 +01:00
Michael Drake
0f3b279167 HTML content handler: Handle content msg for getdims. 2019-05-06 15:38:33 +01:00
Michael Drake
6ad7b3e608 Content: Add content message to get viewport dimensions. 2019-05-06 15:38:33 +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
52ef77ceef Do not prevent reattempting conversion of HTML contents
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-06 15:10:01 +01:00
Daniel Silverstone
654e1ee12a Use new safe context dump
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-06 15:09:47 +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
Daniel Silverstone
cdc7713662 Add some missing unrefs
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-06 12:20:04 +01:00
Vincent Sanders
dbf02c37f4 complete basic binding documentation
improve the alert() method parameter handling
2019-05-06 12:04:06 +01:00
Daniel Silverstone
10930fcbaf Properly set log levels
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-06 10:17:00 +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
67da94a537 Use consoleFormatter in Console.bnd
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-05 22:17:10 +01:00
Daniel Silverstone
846e811760 Generics: Add consoleFormatter
In order to support the console logging formatting specification
as per https://console.spec.whatwg.org/#logger we need to implement
the Formatter(...) algorithm which is easier done within JavaScript

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-05 22:17:10 +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
8474c5d4c0 Logging: migrate and provide content interface
Migrate the console enums into netsurf/console.h and add
support so that contents can raise a message to log to
the console.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-05 22:17:10 +01:00
Michael Drake
5e1f4c406d data url handler: drop logging to DEEPDEBUG. 2019-05-05 20:39:26 +01:00
Michael Drake
fb1d9862f9 data url handler: Keep nsurl to avoid copy. 2019-05-05 20:36:19 +01:00
Michael Drake
47e47244a9 data url handling: avoid needless allocation / copy. 2019-05-05 20:23:25 +01:00
Michael Drake
c76b5ef4d5 data URL handler: constify some string pointers. 2019-05-05 20:11:21 +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
ac512958ff Ensure we clear the cbt entry after finishing a non-recurring callback
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-05 18:51:25 +01:00
Vincent Sanders
e27df0c0b8 make missing xxd command fail the build correctly 2019-05-05 16:07:27 +01:00
Daniel Silverstone
3021142aad Support content_exec for content_html
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-05 16:00:03 +01:00
Daniel Silverstone
f3892c98fd Add content_exec and associated vtable entry
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-05 16:00:03 +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
4394dbd9d4 Add missing semi-colon. Sorry
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-04 23:15:13 +01:00
Vincent Sanders
d566debc48 change back to unsigned long to avoid warning on gnueabihf platforms 2019-05-04 23:11:14 +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
Vincent Sanders
38a65c0242 add some comments to window location binding 2019-05-04 22:48:50 +01:00
Daniel Silverstone
274b4a2d2e Support Document::createDocumentFragment
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-04 21:56:07 +01:00
Daniel Silverstone
2f1526653f Expose Number and Error on Window
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-04 21:55:54 +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
8009444918 Expose encodeURI{,Component}
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-04 17:31:46 +01:00
Daniel Silverstone
83f24af275 Restore newlines for unimplemented javascript in doxygen
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-04 17:03:46 +01:00
Daniel Silverstone
9769e8f2c0 Clean up async/defer JS contents during parent finalisation
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-04 16:42:47 +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
Michael Drake
a03b4a3c14 CSS: Update for change to libcss append sheet API.
When appending stylesheets to the selection context, it now
takes the media query string associated with the sheet, rather
than the type bitfield.

TODO:

We need to pass all the sheets in, with their full media
query string, rather than filtering it ourselves and setting
the ones we pass in to "screen".

Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
2019-05-04 14:51:42 +01:00
Michael Drake
920d6fa23d CSS: Update for change to libcss select style API.
LibCSS now takes the client media spec, rather than just the
media type we're selecting for.

Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
2019-05-04 14:51:42 +01:00
Michael Drake
637b4e5fc0 CSS: Update for change to libcss imported sheet API.
The media is not exposed and sent back into libcss now.

Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
2019-05-04 14:51:42 +01:00
Daniel Silverstone
19b45fb494 Support script insertion after conversion has begun
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-04 12:18:21 +01:00
Daniel Silverstone
90cabaf8c8 Add auto-generated getters and setters for HTMLFrameSetElement events
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-03 14:30:10 +01:00
Daniel Silverstone
ed9894d750 Add auto-generated getters/setters on body element
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-03 14:26:12 +01:00
Daniel Silverstone
dd02849df0 Add global handlers to Window
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-03 13:45:24 +01:00
Daniel Silverstone
b2e4c2ec58 UnimplementedJavascript.txt: Remove spurious newlines
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-03 13:39:07 +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
2739a47d83 Event: Implement initEvent() and getter isTrusted
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-03 12:20:10 +01:00
Daniel Silverstone
177a047752 Update UnimplementedJavascript with the window functions now implemented
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-03 11:54:38 +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
Chris Young
178d4bc25c Fix some bsdsocket.library usage
NetSurf now builds against libcurl-AmiSSL
2019-04-08 12:49:13 +01:00
Michael Forney
6455a2ea83 SVG content handler: Fix plot style stroke_width
In 8332bf6b2a, when the stroke width was moved from a parameter to
the plot style field, it accidentally used the `stroke` field of
the svgtiny shape (the color) instead of `stroke_width`.

Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
2019-03-05 11:17:07 +00:00
Vincent Sanders
826474a1a3 use memcpy instead of strcpy to make the dom string copy intention explicit 2019-03-04 17:32:41 +00:00
Vincent Sanders
61891ada50 validate the form button element type attribute as per spec
https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-type
says if the type attribute is anything but "reset" or "button" it
 is of "submit" type. The previous logic was incorrect and only used
 the button if its type was explicitly submit and noting else.
2019-02-22 21:11:34 +00:00
Vincent Sanders
070c74b648 add webp image handler 2019-02-17 12:09:17 +00:00
Vincent Sanders
6185b254ca improve some comments 2019-02-17 12:08:23 +00:00
Vincent Sanders
09bbb4571b tidy up bmp and ico makefile entries to be one per line 2019-02-17 12:07:06 +00: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
Daniel Silverstone
41eed8eeaf Use NSLOG rather than LOG/JS_LOG
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-02-17 11:33:28 +00:00
Michael Drake
e1a3e0427f HTML handler: Reformat passing viewport height when triggered by object.
Previously we correctly used the viewport width, but we were using the
document height instead of viewport height when an HTML child content
triggered a reformat of the parent HTML document.
2019-02-17 09:06:58 +00:00
Michael Drake
07242c7415 Content: Make the content structure aware of viewport height.
It was always aware of viewport width, but since adding support for
vh CSS units, the HTML content handler also needs viewport height.

Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
2019-02-17 09:06:58 +00:00
Michael Drake
776b0242a6 Layout: Add debug logging to show viewport dimensions passed into layout.
Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
2019-02-17 09:06:58 +00:00
Michael Drake
0a3a40c23e Box construction: Don't handle IMAGE specially. 2018-12-13 12:31:38 +00:00
Vincent Sanders
7264ff6f4d ensure url buffer is sufficient to not truncate output 2018-11-06 21:58:53 +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
e275b3175b check dom call return and improve handling of missing form type 2018-10-09 17:00:22 +01:00
Vincent Sanders
7a61c95724 rewrite form_successful_controls_dom as form_dom_to_data
Trying to reason about error propagation and resource leakage within
 the form submission code was impossible because of the
 form_successful_controls_dom function.

This function was over six hundred lines long, had twenty six top
 level local variables and six levels of indent in places.

This commit splits it out into thirteen shorter and more obvious
 functions. The resulting operation is identical except errors are
 properly propagated (all failures were reported as out of memory)
 and resource management can be reasoned about.

The compiler appears to inline the entirety of the code from
 form_submit() down excepting a handful of leaf functions. This
 results in similar code output size as previous implementation.

The new implementation has a greater number of variables passed to sub
 functions than desirable because multiple character sets are required
 to encode names and values in the multipart data list. However as
 noted the compiler effectively inlines all these functions so this
 does not actually become a major problem.
2018-09-29 16:59:34 +01:00
Vincent Sanders
a268252629 gcc on openbsd is unable to reason about res variable usage and generates bogus warning 2018-09-26 21:32:35 +01:00
Vincent Sanders
5c96acd6f1 fix url encoding to be compatible with nsurl API changes.
As part of this fix the form submission error handling and
 reporting has been improved.
2018-09-26 17:21:48 +01:00
Vincent Sanders
e4537cb37e allow comments to supress implicit fallthrough warnings 2018-09-07 12:53:51 +01:00
Michael Drake
9d8f37ca10 HTML: Don't try to finish an HTML document's conversion twice. 2018-08-27 20:47:37 +01:00
Vincent Sanders
eee67a65e8 remove warning by replacing sprintf snprintf 2018-08-24 11:49:56 +01:00
Vincent Sanders
5dd5d5da4b remove warning by replacing strcpy with safer strncpy 2018-08-24 10:26:26 +01:00
Vincent Sanders
5f1defd4a7 fix size_t format specifiers 2018-08-18 23:44:15 +01:00
Michael Drake
5e97a3cb26 API: Don't expose urldb_{g|s}et_auth_details to frontends. 2018-08-15 07:29:58 +01:00
Michael Drake
9fa6c1e0fb Text handling: Display application/json, rather than offering download. 2018-08-14 16:15:12 +01:00
Vincent Sanders
92424b6946 refactor llcache header processing
refactor the header processing in the low level object cache to make
 cache control header processing more explicit.
2018-08-12 12:50:57 +01:00
Michael Drake
0601b7dbec Duktape: Make declaration match definition for memcmp and double_div. 2018-08-10 12:30:48 +01:00
Michael Drake
80e8c74a69 Duktape: Make declaration match definition for duk_refzero_check_fast() 2018-08-10 11:30:17 +01:00
Michael Drake
ad0a75af8f Duktape: Make declarations match definitions for fastint-enabled functions. 2018-08-10 11:29:39 +01:00
Michael Drake
e5f2ea9d7a Duktape: Make declarations match definitions for duk_raw_read_xxx_be 2018-08-10 11:28:27 +01:00
Michael Drake
c986c212bf Duktape: Make declarations match definitions for inline functions. 2018-08-10 11:27:56 +01:00
Michael Drake
f5f2ebb37a Duktape: Prevent clang static analysis. 2018-08-10 11:12:20 +01:00
Michael Drake
ae126cfdd5 Duktape: Update to version 2.3.0 release. 2018-08-10 11:11:08 +01:00
Michael Drake
97f9e2d9f5 Curl fetcher: Jiggle logging levels. 2018-08-09 16:43:37 +01:00
Michael Drake
9fecbc6554 Content: Log URLs with nsurl_access_log().
This reduces the log file size for startup and a single visit
to https://www.bbc.co.uk/news from 266133 to 178777 bytes,
by not dumping big data URLs over and over into the log.
2018-08-09 16:31:16 +01:00
Michael Drake
ca0514ea92 Curl fetcher: Move poll logging from INFO to DEEPDEBUG. 2018-08-09 14:58:49 +01:00
Michael Drake
09b015bf11 Browser: Rename function to access bw URL. 2018-07-23 10:47:26 +01:00
Michael Drake
62e3ee6c7e Layout: Use box helper for first child checks. 2018-06-29 15:03:47 +01:00
Michael Drake
049695fa07 Box: Add helper to check if box is first child. 2018-06-29 15:03:10 +01:00
Michael Drake
948207472a Layout: Tidy condition so it can be read. 2018-06-29 14:58:32 +01:00
Michael Drake
8a931f01b9 Plotters: Expose array of font family strings to front ends. 2018-05-23 14:02:53 +01:00
Michael Drake
8332bf6b2a Plotters: Remove width param from path plotter.
We now use the stroke_width in the plot_style.
2018-05-23 13:48:17 +01:00
Michael Drake
66493421e6 Plotters: Change stroke width in the plot_style_t to fixed point. 2018-05-23 13:04:19 +01:00
Michael Drake
a58d97a41a Plotters: Add plot_style_fixed type, and use for font size. 2018-05-23 11:48:35 +01:00
Vincent Sanders
216fb88f58 clean up html content handler header use
Improve header use in preperation for making browser window a corewindow
2018-05-11 13:18:54 +01:00
Vincent Sanders
2a03ea3049 move html and text content handlers where they belong 2018-05-10 13:37:02 +01:00
Michael Drake
2290c208ba Disc cache: Squash armhf warnings. 2018-05-08 12:26:04 +01:00
Michael Drake
6e0e3ea81f Duktape: Squash armhf warnings.
content/handlers/javascript/duktape/duktape.c: In function 'duk_resolve_nonbound_function':
content/handlers/javascript/duktape/duktape.c:14609:25: warning: cast increases required alignment of target type [-Wcast-align]
    duk_push_tval(thr, &((duk_hboundfunc *) h)->target);
                         ^
content/handlers/javascript/duktape/duktape.c: In function 'duk_bi_function_prototype_bind':
content/handlers/javascript/duktape/duktape.c:32423:20: warning: cast increases required alignment of target type [-Wcast-align]
    h_boundtarget = (duk_hboundfunc *) h_target;
                    ^
content/handlers/javascript/duktape/duktape.c: In function 'duk_free_hobject':
content/handlers/javascript/duktape/duktape.c:46072:23: warning: cast increases required alignment of target type [-Wcast-align]
   duk_hboundfunc *f = (duk_hboundfunc *) h;
                       ^
content/handlers/javascript/duktape/duktape.c: In function 'duk__mark_hobject':
content/handlers/javascript/duktape/duktape.c:47889:23: warning: cast increases required alignment of target type [-Wcast-align]
   duk_hboundfunc *f = (duk_hboundfunc *) h;
                       ^
content/handlers/javascript/duktape/duktape.c: In function 'duk_hobject_refcount_finalize_norz':
content/handlers/javascript/duktape/duktape.c:49866:23: warning: cast increases required alignment of target type [-Wcast-align]
   duk_hboundfunc *f = (duk_hboundfunc *) h;
                       ^
content/handlers/javascript/duktape/duktape.c: In function 'duk__handle_bound_chain_for_call':
content/handlers/javascript/duktape/duktape.c:61533:14: warning: cast increases required alignment of target type [-Wcast-align]
    h_bound = (duk_hboundfunc *) func;
              ^
content/handlers/javascript/duktape/duktape.c: In function 'duk_js_instanceof':
content/handlers/javascript/duktape/duktape.c:78165:24: warning: cast increases required alignment of target type [-Wcast-align]
   duk_push_tval(thr, &((duk_hboundfunc *) func)->target);
                        ^
2018-05-08 12:21:41 +01:00
Michael Drake
8319ead530 Duktape: Squash -Wcast-align warnings on armhf. 2018-05-05 21:19:36 +01:00
Michael Drake
0ee536b083 Duktape: Make declarations match definitions for inline functions. 2018-05-04 16:54:36 +01:00
Michael Drake
dcb12cab51 Duktape: Make declarations match definitions for fastint-enabled functions. 2018-05-04 16:54:33 +01:00
Michael Drake
4bf20cc693 Duktape: Make declaration match definition for duk_refzero_check_fast() 2018-05-04 16:54:30 +01:00
Michael Drake
f6073cd699 Duktape: Make declarations match definitions for duk_raw_read_xxx_be 2018-05-04 16:54:27 +01:00
Michael Drake
af8bde6214 Duktape: Prevent clang static analysis. 2018-05-04 16:54:23 +01:00
Michael Drake
b16b525cd3 Duktape: Update to 2.2.1 release. 2018-05-04 16:50:55 +01:00
John-Mark Bell
a8bf9b05aa HTTPS: restrict ciphersuites 2018-04-22 12:54:23 +00:00
John-Mark Bell
7d4349035d Explicitly re-enable TLS session tickets.
Libcurl disables this by default.
2018-04-22 12:24:56 +00:00
John-Mark Bell
842513f10b URLdb: fix comparison 2018-04-22 12:09:05 +00:00
Daniel Silverstone
70b6ca4376 Force SSL session caching on, Ubuntu seems to have it off by default 2018-04-22 13:04:21 +01:00
Daniel Silverstone
5efc6407d3 Revert "Disable SSL session ID caching."
This reverts commit debe0e345b.
2018-04-22 12:58:39 +01:00
John-Mark Bell
103c015784 HSTS: make llcache update policy on 3xx responses 2018-04-22 11:39:12 +00:00
John-Mark Bell
ec1936cc93 HSTS: prevent llcache being nice
If the server has defined a HSTS policy, then the user no longer
gets to click-through a garbage certificate. Additionally, if
the server has provided a HSTS policy, it should do TLS properly,
so don't permit client-driven TLS version downgrades in that case,
either.
2018-04-22 11:39:12 +00:00
John-Mark Bell
83f5332708 HSTS: teach llcache to update and enforce policy. 2018-04-22 11:39:12 +00:00
John-Mark Bell
a6014cae15 HSTS: support policy in urldb 2018-04-22 11:39:12 +00:00
John-Mark Bell
badc0d437a LLCache: correct typos/grammar/etc. 2018-04-22 11:16:26 +00:00
Vincent Sanders
f3eb366679 Fix dependency declaration for dukky.c 2018-04-21 11:54:09 +01:00
John-Mark Bell
fe45bc1dbe JPEG: handle CMYK/YCCK images
No real colourspace conversion here, so expect oversaturated images

Fixes #2570.
2018-01-20 17:58:42 +00:00
John-Mark Bell
17ae38771d Backing store: clean up resources properly.
Patch from Felix S. Fixes #2579.
2018-01-20 16:18:51 +00:00
John-Mark Bell
328a29d22f RSVG: fix colour conversion 2018-01-20 15:33:05 +00:00
Michael Drake
6be6fa1b21 CSS utils: Handle new units in length conversion routines.
This causes a ripple effect of all the callsites needing
information they didn't have.
2018-01-05 13:49:51 +00:00
Michael Drake
5776d3448c CSS computed style composition: Update for new CSS units.
Since the nscss_compute_font_size callback now needs to convert
new units to absolute values, and some of these units require info
from the root element's style, there are knock-on changes to ensure
that the required info is available where its needed.
2018-01-05 13:49:51 +00:00
Michael Drake
d1c656b55f CSS: Add new libcss unit types to computed style dump. 2018-01-02 15:38:35 +00:00
Michael Drake
046977507b Duktape: Squash -Wcast-align warnings on armhf. 2017-11-02 16:34:59 +00:00
Michael Drake
8f73414c06 Revert "Duktape: Attempt to squash aarch64 cast increases required alignment warnings."
This reverts commit 8cc3adee5a.

These warnings don't show up with the CI updated to Debian Stretch.
2017-11-01 16:02:20 +00:00
Michael Drake
8cc3adee5a Duktape: Attempt to squash aarch64 cast increases required alignment warnings.
content/handlers/javascript/duktape/duktape.c: In function 'duk_resolve_nonbound_function':
content/handlers/javascript/duktape/duktape.c:14585:25: error: cast increases required alignment of target type [-Werror=cast-align]
duk_push_tval(thr, &((duk_hboundfunc *) h)->target);
^
content/handlers/javascript/duktape/duktape.c: In function 'duk_bi_function_prototype_bind':
content/handlers/javascript/duktape/duktape.c:32399:20: error: cast increases required alignment of target type [-Werror=cast-align]
h_boundtarget = (duk_hboundfunc *) h_target;
^
content/handlers/javascript/duktape/duktape.c: In function 'duk_free_hobject':
content/handlers/javascript/duktape/duktape.c:46048:23: error: cast increases required alignment of target type [-Werror=cast-align]
duk_hboundfunc *f = (duk_hboundfunc *) h;
^
content/handlers/javascript/duktape/duktape.c: In function 'duk__mark_hobject':
content/handlers/javascript/duktape/duktape.c:47865:23: error: cast increases required alignment of target type [-Werror=cast-align]
duk_hboundfunc *f = (duk_hboundfunc *) h;
^
content/handlers/javascript/duktape/duktape.c: In function 'duk_hobject_refcount_finalize_norz':
content/handlers/javascript/duktape/duktape.c:49842:23: error: cast increases required alignment of target type [-Werror=cast-align]
duk_hboundfunc *f = (duk_hboundfunc *) h;
^
content/handlers/javascript/duktape/duktape.c: In function 'duk__handle_bound_chain_for_call':
content/handlers/javascript/duktape/duktape.c:61509:14: error: cast increases required alignment of target type [-Werror=cast-align]
h_bound = (duk_hboundfunc *) func;
^
content/handlers/javascript/duktape/duktape.c: In function 'duk_js_instanceof':
content/handlers/javascript/duktape/duktape.c:78117:24: error: cast increases required alignment of target type [-Werror=cast-align]
duk_push_tval(thr, &((duk_hboundfunc *) func)->target);
^
2017-10-30 16:50:38 +00:00
Michael Drake
448228a30c Duktape: Use align-by-8 on all platforms by default
This reproduces upstream commit de7ae8a2ecc597e1c2024c15dbeae4d28c9f2a2c.

*   de7ae8a2ec

It was applied to master after the release of Duktape 2.2.0.  See also:

*   https://github.com/svaarala/duktape/issues/1783
*   https://github.com/svaarala/duktape/issues/812#issuecomment-337058737
2017-10-29 15:17:06 +00:00
Michael Drake
0687687c37 Duktape: Revert alignment of struct duk_hobject. 2017-10-29 15:16:21 +00:00
Michael Drake
ea7da966de Duktape: Another attempt to squash aarch64 increases required alignment warnings. 2017-10-29 14:50:10 +00:00
Michael Drake
6619be2b72 Duktape: Attempt to squash aarch64 cast increases required alignment warnings.
content/handlers/javascript/duktape/duktape.c: In function 'duk_resolve_nonbound_function':
content/handlers/javascript/duktape/duktape.c:14585:25: error: cast increases required alignment of target type [-Werror=cast-align]
duk_push_tval(thr, &((duk_hboundfunc *) h)->target);
^
content/handlers/javascript/duktape/duktape.c: In function 'duk_bi_function_prototype_bind':
content/handlers/javascript/duktape/duktape.c:32399:20: error: cast increases required alignment of target type [-Werror=cast-align]
h_boundtarget = (duk_hboundfunc *) h_target;
^
content/handlers/javascript/duktape/duktape.c: In function 'duk_free_hobject':
content/handlers/javascript/duktape/duktape.c:46048:23: error: cast increases required alignment of target type [-Werror=cast-align]
duk_hboundfunc *f = (duk_hboundfunc *) h;
^
content/handlers/javascript/duktape/duktape.c: In function 'duk__mark_hobject':
content/handlers/javascript/duktape/duktape.c:47865:23: error: cast increases required alignment of target type [-Werror=cast-align]
duk_hboundfunc *f = (duk_hboundfunc *) h;
^
content/handlers/javascript/duktape/duktape.c: In function 'duk_hobject_refcount_finalize_norz':
content/handlers/javascript/duktape/duktape.c:49842:23: error: cast increases required alignment of target type [-Werror=cast-align]
duk_hboundfunc *f = (duk_hboundfunc *) h;
^
content/handlers/javascript/duktape/duktape.c: In function 'duk__handle_bound_chain_for_call':
content/handlers/javascript/duktape/duktape.c:61509:14: error: cast increases required alignment of target type [-Werror=cast-align]
h_bound = (duk_hboundfunc *) func;
^
content/handlers/javascript/duktape/duktape.c: In function 'duk_js_instanceof':
content/handlers/javascript/duktape/duktape.c:78117:24: error: cast increases required alignment of target type [-Werror=cast-align]
duk_push_tval(thr, &((duk_hboundfunc *) func)->target);
^
2017-10-29 14:02:10 +00:00
Michael Drake
e418416c77 Squash remaining GCC7 -Wimplicit-fallthrough warnings. 2017-10-23 09:46:02 +01:00
Michael Drake
a47edd3733 Duktape: Make declarations match definitions for inline functions. 2017-10-21 16:33:03 +01:00
Michael Drake
8e7fc8e2ac Duktape: Make declarations match definitions for fastint-enabled functions.
Restore ff20edbfbe for 2.2.0 import.
2017-10-21 16:23:16 +01:00
Michael Drake
0759139c61 Duktape: Make declaration match definition for duk_refzero_check_fast()
Restore 9a8577fead for 2.2.0 import.
2017-10-21 16:21:48 +01:00
Michael Drake
0a7f62ceb0 Duktape: Make declarations match definitions for duk_raw_read_xxx_be
Restore 6d63f7959a for 2.2.0 import.
2017-10-21 16:20:33 +01:00
Michael Drake
6f33e48ca3 Duktape: Prevent clang static analysis.
Restore 336326af3a for 2.2.0 import.
2017-10-21 15:54:33 +01:00
Michael Drake
3356906904 Duktape: Update to 2.2.0 release. 2017-10-21 15:51:55 +01:00
Michael Drake
f7f18042bf CSS: Wrappers for computed style getters that return unsupported values.
We don't yet handle the Flexbox-related values for certain properties.
2017-10-20 17:46:37 +01:00
Michael Drake
f64a22c228 CSS hints: Ensure length and unit are initialised for vertical-align. 2017-10-13 10:28:42 +01:00
Vincent Sanders
b9bdc8d312 fix image cache format specifiers signedness 2017-09-11 17:29:57 +01:00
Vincent Sanders
8fb2fc6fc3 rationalise history icon bitmap handling to ensure correct lifetime 2017-09-10 16:06:38 +01:00
Vincent Sanders
8b88e44090 fix time_t logging 2017-09-08 20:47:22 +01:00
Daniel Silverstone
50cbb98941 Hopefully quash warning about time_t formatting on openbsd 2017-09-08 19:38:11 +01:00
Vincent Sanders
5d6f189d8b Fixup everything the semantic patch missed 2017-09-07 18:12:09 +01:00
Vincent Sanders
71225624f6 update fetch debug logging to use catagory 2017-09-06 18:45:35 +01:00
Vincent Sanders
72e6050eb3 add low level cache category and use it 2017-09-06 18:45:35 +01:00
Vincent Sanders
63f5ba6f62 update bindings with logging changes 2017-09-06 18:45:35 +01: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
Vincent Sanders
8d9b2efc11 use nslog library for logging if available. 2017-09-03 23:40:32 +01:00
Michael Drake
c2ac1a713f Errorcodes: Add SPRITE_ERROR and use it in sprite content handler. 2017-08-30 09:43:13 +01:00
Michael Drake
1670dc33af Sprite content handler: Ensure we broadcast error on librosprite error. 2017-08-29 11:57:34 +01:00
Michael Drake
a9d18a8efd Sprite content handler: Fix leaked rosprite_mem_context on rosprite_load error. 2017-08-29 11:55:46 +01:00
Michael Drake
ba0283f526 RSVG content handler: Remove unused assignement. 2017-08-28 12:16:24 +01:00
Michael Drake
4a014fecde hlcache content callback: Use designated initialiser for hlcache_event. 2017-08-28 11:52:54 +01:00
Michael Drake
e411c84e9b SVG content handler: Convert to using content_broadcast_errorcode(). 2017-08-28 10:24:04 +01:00
Michael Drake
9e64f37846 RSVG content handler: Convert to using content_broadcast_errorcode(). 2017-08-28 10:21:11 +01:00
Michael Drake
cae1c44f8f PNG content handler: Convert to using content_broadcast_errorcode(). 2017-08-28 10:14:22 +01:00
Michael Drake
36c01fc03b Sprite content handler: Convert to using content_broadcast_errorcode(). 2017-08-28 10:06:47 +01:00
Vincent Sanders
cde300133e initialise event struct correctly to avoid compiler warning 2017-08-27 16:01:58 +01:00
Michael Drake
d1a493f569 ICO content handler: Convert to using content_broadcast_errorcode(). 2017-08-27 13:32:53 +01:00
Michael Drake
d83f6ea3c1 GIF content handler: Convert to using content_broadcast_errorcode(). 2017-08-27 13:28:21 +01:00
Michael Drake
337bd98f6c BMP content handler: Convert to using content_broadcast_errorcode(). 2017-08-27 13:28:21 +01:00
Michael Drake
d4cdcf3067 CSS content handler: Convert to using content_broadcast_errorcode(). 2017-08-27 13:09:44 +01:00
Michael Drake
e94fe1632e Content API: Avoid content message copy in content user callback. 2017-08-26 16:38:18 +01:00
Michael Drake
d70beb28db Content API: Make content_broadcast take pointer to content_msg_data. 2017-08-26 15:50:03 +01:00
Vincent Sanders
2467a0a990 fix coverity issue 1372473 Out-of-bounds write 2017-06-09 19:51:12 +01:00
Vincent Sanders
703427a486 Update documentation removing junk and moving to markdown for most text files 2017-06-09 17:30:00 +01:00
Michael Drake
ff20edbfbe Duktape: Make declarations match definitions for fastint-enabled functions. 2017-04-21 11:33:28 +01:00
Michael Drake
6da983ca27 Duktape: Enable fastints.
Suggested by svaarala.
2017-04-20 12:12:29 +01:00
Michael Drake
9a8577fead Duktape: Make declaration match definition for duk_refzero_check_fast() 2017-04-16 17:36:25 +01:00
Michael Drake
40e589531e Duktape: Make declarations match definitions for duk_raw_read_xxx_be
Restore 6d63f7959a for 2.1.0 import.
2017-04-16 16:58:57 +01:00
Michael Drake
8449b13a3a Duktape: Prevent clang static analysis.
Restore 336326af3a for 2.1.0 import.
2017-04-16 16:58:35 +01:00
Michael Drake
db9b0dfe00 Duktape: Update to 2.1.0 release. 2017-04-16 16:57:01 +01:00
Michael Drake
5d5081eb57 CSS: Handle presentational hint for HR's "width" attribute. 2017-04-10 09:33:09 +01:00
Michael Drake
abdab90859 Presentational hints: Ensure length is initialised for auto margins.
Although the length is unused when margin is auto, having
uninitialised values present in a computed style means that
the style hashing may give the same style different hashes
depending on the unintitialised info.

The effect of this would have been be to reduce the chance
of computed style sharing.  It would have had no effect on
page rendering.
2017-04-06 17:14:58 +01:00
Vincent Sanders
4e750bdab6 fix doc comment spelling mistake 2017-03-28 11:45:24 +01:00
Michael Drake
0a0e7b5bd7 Duktape: Suppress warnings about increasing alignment of pointer type. 2017-03-23 17:52:28 +00:00
Michael Drake
ae793a3ad9 Duktape: Atari Mint lacks trunc, log2 and cbrt.
build/Linux-atari/content_handlers_javascript_duktape_duktape.o:build/Linux-atari/content_handlers_javascript_duktape_duktape.o:(.text+0x978): undefined reference to `_trunc'

build/Linux-atari/content_handlers_javascript_duktape_duktape.o:build/Linux-atari/content_handlers_javascript_duktape_duktape.o:(.text+0x990): undefined reference to `_log2'

build/Linux-atari/content_handlers_javascript_duktape_duktape.o:build/Linux-atari/content_handlers_javascript_duktape_duktape.o:(.text+0x99c): undefined reference to `_cbrt'
2017-03-23 16:02:48 +00:00
Michael Drake
bc204a469a Duktape: Make declarations match definitions for duk_raw_read_xxx_be
Restore 6d63f7959a for 2.0.2 import.
2017-03-23 15:30:22 +00:00
Michael Drake
c98fc7999a Duktape: Prevent clang static analysis.
Restore 336326af3a for 2.0.2 import.
2017-03-23 14:56:32 +00: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
Michael Drake
736bbbed71 Duktape 2.X: Update to Duktape 2.0.2.
Note that DUK_OPT_XXX feature selection has been removed.

This means we can't use `DUK_OPT_HAVE_CUSTOM_H`, so we need another
way to tell duktape about our custom header.

This means assembling our own duktape distribution with a
duktape "tools/configure.py" invocation.

Instructions for updating duktape have been added to NetSurf's
`Docs/` directory.

See:
https://github.com/svaarala/duktape/blob/master/doc/release-notes-v2-0.rst#duk_opt_xxx-feature-option-support-removed
2017-03-23 14:56:32 +00:00
Michael Drake
be77f764e2 Improve content logging with content IDs (pointer values).
This makes it easier to track a content by its ID through a log.
2017-03-23 14:23:57 +00:00
Vincent Sanders
f39d78dc2e mimimal mime sniffing test 2017-03-20 00:48:11 +00:00
Vincent Sanders
0866314d96 reduce hlcache handle api usage in mimesniff 2017-03-19 22:29:23 +00:00
Vincent Sanders
93e2b4855b make mimesniffing use core strings 2017-03-19 15:00:21 +00:00
Vincent Sanders
2406acfeb3 fix urldb numerical v6 address handling 2017-03-13 23:44:06 +00:00
Vincent Sanders
27aa56cbf6 make the urldb content type setting API return an error 2017-03-13 21:55:39 +00:00
Vincent Sanders
92b5f114ba make urldb persistance setting API return an error 2017-03-13 21:19:59 +00:00
Vincent Sanders
5078bffad7 change urldb_set_title API to return an error status 2017-03-13 16:38:24 +00:00
Vincent Sanders
5ebec85282 actually check the generated database files against reference test data 2017-03-08 22:22:54 +00:00
Vincent Sanders
0da0dcc342 remove urldb_add_host and path from public API
The urldb_add_host and urldb_add_path API were only public for the
urldb test code which was calling them incorrectly in any case as the
url bloom filters were not updated so serialising and adding data to
entries was inconsistent.

This also changes the tests to use the urldb_add_url API which is less
buggy and results in a smaller, cleaner urldb API.
2017-03-08 13:27:00 +00:00
Vincent Sanders
b78887c7c8 make update data api return an result 2017-03-08 13:13:21 +00:00
Vincent Sanders
670110b171 use robust handling of time_t value (de)serialisation
The previous implementation was wrong on systems where time_t was not
an int type. This changes urldb to use the portable implementation
netsurf has available.
2017-03-08 10:54:17 +00:00
Vincent Sanders
c41d42644b clean up url database documentation comments and formatting 2017-03-06 23:21:12 +00:00
Vincent Sanders
a88254897b Revert "make urldb internal parse macros less prone to control flow errors"
This reverts commit 718da3ffff.
These macros are used in a way that causes safe macros to break
2017-03-05 15:28:05 +00:00
Vincent Sanders
3217c82cdb attempt to remove unintended sign extension warning in fs backing store 2017-03-05 13:02:47 +00:00
Vincent Sanders
718da3ffff make urldb internal parse macros less prone to control flow errors
fixes issue highlighted by coverity (CID 1361696)
2017-03-05 12:11:48 +00:00