Commit Graph

1277 Commits

Author SHA1 Message Date
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