Commit Graph

1432 Commits

Author SHA1 Message Date
Vincent Sanders
fca421e204 remove user warning and propogate error return 2019-11-06 23:13:20 +00:00
Vincent Sanders
cbb0c05258 remove unecessary user warning calls and improve error propogation in html box 2019-11-05 23:05:42 +00:00
Vincent Sanders
78aa34e5d7 remove user warnings from hotlist load and curl poll 2019-11-05 00:07:06 +00:00
Vincent Sanders
4eb06ad2cf move the fallback text for about handler into messages handler 2019-10-30 21:33:27 +00:00
Vincent Sanders
4b0c3f0efe add internal query handler for fetch errors
Any errors from the fetch which are not already handled are
  reported with an internal query page instead of a modal
  dialog.

This is much less invasive for the user and much more in
  keeping with how this is handled by other browsers.

The handler is similar to the timeout handler but the
  functionality is kept separate as it is intended timeout
  handling be extended in future.
2019-10-30 18:56:38 +00:00
Vincent Sanders
76eac19227 add internal query page for request timeouts 2019-10-29 22:29:22 +00:00
Vincent Sanders
1176ce4271 Improve timeout error messaging 2019-10-28 23:50:01 +00:00
Daniel Silverstone
a5766db2b9 fetchers/curl: Restrict AUTH to BASIC
cURL will prevent channel reuse if NTLM auth is enabled because
NTLM authenticates a channel not a request.  As such we were
unable to reuse curl handles since we handed off connection
reuse to curl instead of our own handle cache.  This mitigates
the effect, though curl authors are looking at fixing it upstream
too.

Fixes: #2707

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-10-21 10:03:46 +01:00
Vincent Sanders
4372104e0e fix utils configuration header ordering 2019-10-11 17:39:33 +01:00
Vincent Sanders
972e13ca3f remove unused external declaration and unecessary header use 2019-10-06 18:02:17 +01:00
Vincent Sanders
c9296f79a8 Use curl API (versions after 7.56.0) to determine if openssl is in use 2019-10-01 21:23:35 +01:00
Vincent Sanders
0a3786fed2 Allow the curl fetcher to be built without openssl.
The curl fetcher can operate without openssl library being
 available, additionaly curl itself may be compiled with a
 different TLS library.

In either case this will simply cause the "unknown" error to be
 reported for all TLS failiures and page information to lack any
 certificate information.
2019-09-30 23:57:49 +01:00
Vincent Sanders
12cca32059 fix core find in page behaviour when case sensitivity is toggled 2019-09-21 10:53:41 +01:00
Vincent Sanders
d94afaa0e1 make the gtk_search structure private to teh gtk search object 2019-09-21 10:53:41 +01:00
Daniel Silverstone
b03786920a hlcache_fini(): Deschedule cleanups on finalisation
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-09-07 15:23:45 +01:00
Daniel Silverstone
524965b867 Box Conversion: Cancel conversion during html_destroy
If dom_to_box is still in progress when we destroy an HTML
content, we need to cancel the conversion otherwise we will
end up with a scheduled callback into infinity.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-23 21:58:07 +01:00
Daniel Silverstone
df496cc8bc Window: set{Timeout,Interval}() default delay 10ms
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-21 21:46:52 +01:00
Daniel Silverstone
44f3846727 SSL Error: Enable OpenSSL hostname verification
Since OpenSSL 1.0.2 there has been hostname verification support
which cURL doesn't turn on for some reason.  Turn it on so that
we get better hostname verification handling.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-14 20:11:11 +01:00
Vincent Sanders
820fb0e7ff add English message text for ssl errors 2019-08-10 12:51:46 +01:00
Vincent Sanders
98f4525073 add common name ssl certificate error
This adds an ssl faliure code and explanation why curl fetcher
 does not currently set it.
2019-08-10 12:50:23 +01:00
Michael Drake
c6a2c76867 About: Tweak the new about query page renderng. 2019-08-09 13:20:08 +01:00
Vincent Sanders
3a23e944dd rework about scheme handlers to be consistant with output buffer handling 2019-08-08 17:12:42 +01:00
Vincent Sanders
746010a757 apply tlsa styling improvements to about scheme query pages 2019-08-07 16:05:45 +01:00
Vincent Sanders
1b030bd8de add basic styling to about scheme privacy query page 2019-08-07 14:19:37 +01:00
Vincent Sanders
8cec045cb7 Improve the about scheme query page generation be be bounds safe 2019-08-06 13:16:20 +01:00
Daniel Silverstone
1cf1ec55bc Support SSL verification through new about: handler
In doing this, also propagate why the certificates were bad
so that the page can display a reason.  We will need FatMessages
for all these.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-06 13:15:23 +01:00
Daniel Silverstone
8469f4cc8e Reimplement handling of BAD_AUTH inside browser_window
We now handle authentication requests via an `about:` page
which presents a nice form built into the browser window.
In order to do this, we add internal navigation as a concept
to the browser window and we strip the 401login support from all
frontends except monkey.

The 401login callback is now intended for password safe type support
rather than an immediately interactive prompt.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-06 11:26:47 +01:00
Vincent Sanders
9c9c26a308 futher refinement on about scheme query styling 2019-08-06 10:51:31 +01:00
Vincent Sanders
6a1c64ff7b improve css formatting in about scheme query handlers 2019-08-06 10:07:35 +01:00
Vincent Sanders
ea549da8df fix url reference counting in about scheme query handlers 2019-08-06 10:07:35 +01:00
Michael Drake
5e45c4498c HTML: Don't allow objects to redraw until we have a layout. 2019-08-06 09:42:37 +01:00
Vincent Sanders
c238325b12 add about scheme query handlers 2019-08-06 08:45:56 +01:00
Vincent Sanders
a888922612 Improve about scheme doc comments and formatting 2019-08-05 22:29:14 +01:00
Daniel Silverstone
ddfa76b1fc curl.c: Don't use OpenSSL 1.1 only serialNumber fetcher
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-05 22:03:42 +01:00
Daniel Silverstone
f3ac1fad69 nssprite: content_broadcast_error fix
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-05 21:33:46 +01:00
Daniel Silverstone
9318ee5d6a html_begin_conversion: If we pause in completing parse, try again later.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-05 21:29:18 +01:00
Michael Drake
be23d522db HTML: Box coordinates: Take fast route to float container.
And assert that floats have a float_container.
2019-08-05 21:15:28 +01:00
Daniel Silverstone
170dc5d524 Excise the llcache query pathway.
In further preparation for the auth and cert queries being handled
as special contents from `about:` this excises the query pathway
from the llcache pretty much entirely.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-05 20:56:07 +01:00
Daniel Silverstone
bfb1bb1192 Migrate SSL certificate storage to the browser window
* Fetchers now provide the certificates before headers
* This is propagated all the way to the browser window
* When a query occurs, we retrieve it from there and fire
  the query with those stored certificates.
* The serial number is a bignum, store it as hex.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-05 18:12:47 +01:00
Daniel Silverstone
2be3ebd918 content: Rename content_broadcast_errorcode()
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-05 15:25:15 +01:00
Daniel Silverstone
6ba199c7d7 Content messages: Remove ERRORCODE, rework ERROR
This reworks CONTENT_MSG_ERROR to be structured data and
removes the CONTENT_MSG_ERRORCODE message kind.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-05 14:30:30 +01:00
Vincent Sanders
2171f13ab3 enable gnu extensions to get strcasestr from string.h 2019-08-05 10:01:13 +01:00
Daniel Silverstone
b15b204f49 form: Fix situation where a gadget initialises with NULL value
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-04 22:12:10 +01:00
Daniel Silverstone
05c6ee02d9 html: Mirror gadget values in and out of the DOM
Currently only supporting text input, password input, and hidden
input, along with text areas, this mirrors the text values in
and out of the DOM, allowing JS to adjust the gadget values and
for the gadget values to be interrogated from JS.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-04 22:07:42 +01:00
Vincent Sanders
3be2b98cc2 change browser_window_drop_file_at_point() to take unscaled coordinates 2019-08-04 14:24:33 +01:00
Vincent Sanders
f21c41a2e5 change browser_window_redraw to use unscaled coordinates 2019-08-04 11:25:35 +01:00
Daniel Silverstone
1905200154 Add content handlers for queries
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-04 11:22:40 +01:00
Daniel Silverstone
6b4610edc9 llcache: Do not delete objects if they were iterator targets
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-04 11:22:40 +01:00
Daniel Silverstone
b48e462f0f content, hlcache: Propagate query events upward
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-04 11:22:40 +01:00
Daniel Silverstone
f59a726f68 llcache.h: Migrate query event to own struct type
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-04 11:22:40 +01:00
Daniel Silverstone
386d803371 llcache: pass the cb_pw in query_finished
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-04 11:22:40 +01:00
Michael Drake
90fe920e07 Duktape element binding: Check dom_string_create for error. 2019-08-04 11:11:35 +01:00
Michael Drake
a0fbf56a1d CSS hints: Change css_hint_advance to advance pointer by parameter. 2019-08-04 11:10:26 +01:00
Vincent Sanders
357e8a8ad2 remove unnecessary browser_window_redraw_rect interface 2019-08-03 21:58:21 +01:00
Daniel Silverstone
09eb89e3c3 Migrate query dispatch up from llcache to hlcache
As a first step in refactoring query handling to be managed
by `browser_window`, this migrates the calling of the query
handler from the llcache object code up to the hlcache.

In theory this may result in multiple queries happening for one
object, but we mitigate multiple-responses in the llcache so
all should be well.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-03 21:13:19 +01:00
Vincent Sanders
d4c01894c2 change browser_window_get_features to use unscaled coordinates 2019-08-03 14:29:06 +01:00
Vincent Sanders
0ebfff259f change browser_window_mouse_track to use unscaled coordinates 2019-08-03 14:29:05 +01:00
Vincent Sanders
0a8ed41a1a change browser_window_mouse_click to use unscaled coordinates
this means frontends no longer need to scale mouse click events thus
simplifying their implementation.
2019-08-03 14:29:05 +01:00
Daniel Silverstone
182c4ddefe box_construct: Check error return from dom_has_attribute
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-03 14:27:44 +01:00
Daniel Silverstone
4421d1bab6 llcache: Ensure we preserve iteratorness when sending messages
In order to prevent a problem where iterating causes an abort
which causes an iteration which clears the iteratorness of a
user allowing it to delete itself causing a segfault, preserve
the iteratorness when iterating in send_message

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-02 16:57:55 +01:00
Daniel Silverstone
1150cf684d dukky: Remove unused dukky_safe_get()
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-02 15:08:46 +01:00
Daniel Silverstone
1f24336d6c curl: Change where we lodge inside_curl
Because we need to be slightly more careful now, lodge ourselves
`inside_curl` whenever we might be processing via the cURL messages
or similar.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-02 15:02:45 +01:00
Daniel Silverstone
09cce349da dukky: Clean up our stacktrace reporting
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-02 14:55:34 +01:00
Daniel Silverstone
c9384d65f6 curl: Immediately abort fetchers when we can
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-02 14:38:54 +01:00
Daniel Silverstone
0eb5aa68fb Duktape: Hopefully silence issue with %lld
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-02 14:19:13 +01:00
Michael Drake
15a3c21232 Duktape: Make declaration match definition for memcmp and double_div. 2019-08-02 14:19:13 +01:00
Michael Drake
ee338c9b24 Duktape: Make declaration match definition for duk_refzero_check_fast() 2019-08-02 14:19:13 +01:00
Michael Drake
1c2a0021b3 Duktape: Make declarations match definitions for fastint-enabled functions. 2019-08-02 14:19:13 +01:00
Michael Drake
80116bfe9f Duktape: Make declarations match definitions for duk_raw_read_xxx_be 2019-08-02 14:19:13 +01:00
Michael Drake
22a348fa31 Duktape: Make declarations match definitions for inline functions. 2019-08-02 14:19:13 +01:00
Michael Drake
f320725307 Duktape: Prevent clang static analysis. 2019-08-02 14:19:13 +01:00
Michael Drake
b4bbca89cd Duktape: Update to 2.4.0 release. 2019-08-02 14:19:13 +01:00
Daniel Silverstone
095a0639d3 Document.bnd: Fix cookies getter and implement setter
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-02 12:23:45 +01:00
Daniel Silverstone
d196dee05b llcache: Use last_modified instead of date
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>
2019-08-02 12:22:30 +01:00
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
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