Commit Graph

272 Commits

Author SHA1 Message Date
Vincent Sanders ebe1b05114 improve desktop text search header usage
remove unecessary inclusion of desktop search header in content
  header which has knock on effect of not having ctype or string
  system headers dragged in unecessarily.

Futher this highlighted use of ctype API where internal ascii
  processing ought to be used.
2020-06-24 23:49:59 +01:00
Vincent Sanders 3a7fc30a5f implement content opacity check through the function table 2020-05-13 19:03:14 +01:00
Vincent Sanders 68b9417a6b consolodate the textsearch code into a single module 2020-05-12 21:29:32 +01:00
Vincent Sanders 3c7538a9f9 hoist common text search out of content handlers 2020-05-12 21:09:41 +01:00
Vincent Sanders 5f8b1497e1 clean up content headers and documentation comments
pure formatting and documentation changes, no code difference
2020-05-06 23:38:50 +01:00
Vincent Sanders c2f9bcac19 remove junk content_add_error api 2020-05-06 22:54:52 +01:00
Vincent Sanders b832bfaea8 remove unused junk error values from content struct
saves over half a kilobyte for every content
2020-05-06 22:22:16 +01:00
Daniel Silverstone 92caa16cfc
Add missing unrefs
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-12-01 17:25:49 +00:00
Daniel Silverstone 2e07d955b6
content_saw_insecure_objects: Fix various corner cases
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-12-01 17:05:28 +00:00
Daniel Silverstone 9faca2b940
Add missing include
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-12-01 16:07:45 +00:00
Daniel Silverstone 6fc2666d07
Allow contents to indicate if they believe they may not be secure.
HTML contents reference many other objects.  The browser window
needs to know if any of them may not be secure, in which case it
needs to report that in its page state.  If other content types
might refer to sub-contents, they will need to define the callback
too.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-12-01 15:49:08 +00:00
Michael Drake 8e1154eb1c Content: Remove redundant and unused redraw message fields.
This was archaic support for rendering images as "overlays",
and avoiding a redraw via the browser window redraw and HTML
contents.  Basically it was "plot this image here", but it
was too error prone, so it was removed a long time ago.

These are some last vestiges that made the redraw message
look more complex than it is.
2019-11-11 21:54:15 +00: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
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 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 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 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
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 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
Vincent Sanders 5d6f189d8b Fixup everything the semantic patch missed 2017-09-07 18:12:09 +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
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
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 7d660561cc Update knockout plotter to use new API 2017-02-11 13:57:06 +00:00
Vincent Sanders 3722ff8d86 Update all core use of plotters to new API 2017-02-11 13:55:41 +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 70d700b26c rationalise use of utils/utils.h header 2017-01-19 21:15:08 +00:00
Vincent Sanders 76a68d7dd0 Update content to split public and internal API 2016-06-06 09:01:38 +01:00
Vincent Sanders 667605869f move plotters header into public API 2016-05-30 21:05:57 +01:00
Vincent Sanders 7fc0a4c481 move desktop window header into public API 2016-05-30 17:32:57 +01:00
Vincent Sanders 2dab078f21 move bitmap API header to core include directory 2016-05-26 23:01:03 +01:00
Vincent Sanders 3224d7121a move image content handlers to accomodate core build changes 2016-05-23 23:32:16 +01:00
Vincent Sanders 10ef7b3f1d update content wallclock timing to use monotonic time interface 2016-04-20 22:58:48 +01:00
Vincent Sanders dee7426656 stop content header dragging in so many other headers 2016-04-19 23:20:29 +01:00
Vincent Sanders 392307bb1f reduce content header interdependancy 2016-04-18 23:04:16 +01:00
Vincent Sanders 34f6aa1323 clean up header usage in content hnadling core 2016-04-18 20:58:49 +01:00
Chris Young a0e41a46a3 Stop GIF animations when they are no longer in use, instead of waiting until they are destroyed. 2016-02-11 19:23:32 +00:00
Michael Drake 0a3519fdac Remove torrent of logging during browser window resize. 2016-02-06 12:41:51 +00:00
Vincent Sanders 0d811963c1 fixup all the remaining logging macro callsites
The semantic patch tool appears to have missed some difficult to
reason about callsites which have now been manually cleaned up
2015-05-28 17:06:18 +01:00
Vincent Sanders c105738fa3 Change LOG() macro to be varadic
This changes the LOG macro to be varadic removing the need for all
callsites to have double bracketing and allows for future improvement
on how we use the logging macros.

The callsites were changed with coccinelle and the changes checked by
hand. Compile tested for several frontends but not all.

A formatting annotation has also been added which allows the compiler
to check the parameters and types passed to the logging.
2015-05-28 16:08:46 +01:00
Vincent Sanders ea2e1c4d98 Add scaled content redraw interface.
Add a new interface to the content to allow automaticaly scaled
content redraws. This is intended to replace the thumbnail_redraw
interface with something more generic.
2015-04-23 15:47:28 +01:00
Vincent Sanders f37e52c394 Move bitmap operations into an operation table.
The generic bitmap handlers provided by each frontend are called back
from the core and therefore should be in an operation table. This was
one of the very few remaining interfaces stopping the core code from
being split into a library.
2015-04-13 23:19:04 +01:00
Vincent Sanders 56bb1b03c5 Doxygen cleanups 2014-11-09 12:50:30 +00:00
Vincent Sanders 5562c9a553 Continue doxygen error cleanup. 2014-11-08 22:08:29 +00:00
Vincent Sanders 05a64bfde9 fix up more doxygen errors 2014-11-08 16:49:32 +00:00
Vincent Sanders 3405803280 Improve content encoding information API
Extend the content_get_encoding() API to retrieve the source of
the encoding as well as the actual encoding.
2014-11-07 12:33:34 +00:00