Commit Graph

256 Commits

Author SHA1 Message Date
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
Vincent Sanders
8c2cfecfb5 Allow content handlers to have debug values set through API
Previously content handler debugging features were accessed by global
variables. This allows the setting of debugging parameters via a
content API giving per content control over debugging features.
Currently only used by the html content handler to toggle global
redraw debugging.
2014-11-06 22:51:46 +00:00
Vincent Sanders
8ec7ad053a Make the fetching of a contents encoding generic.
The frontends previously had to use an html renderer API to get the
encoding of a content. This also required the explicit checking of the
contents type rather than using the existing content API to abstract
this knowledge.
2014-11-05 23:44:31 +00:00
Vincent Sanders
c31c4babe1 Change contextual content retrieval to browser features.
Update the API which allows frontends to acquire the page features
(images, link urls or form elements) present at the given coordinates
within a browser window.

By making this an explicit browser_window API and using the browser.h
header for the associated data structure with a more appropriate API
naming the usage is much more obvious and contained.

Additionally the link url is now passed around as a nsurl stopping it
being converted from nsurl to text and back again several times.
2014-11-02 15:46:42 +00:00
Vincent Sanders
af16c38d2d fix DOM tree dump debug 2014-08-04 00:37:21 +01:00
Vincent Sanders
4d4d74c8cd move page search gui callbacks to their own operations table 2014-03-18 22:32:52 +00:00
Vincent Sanders
fba58ad4b0 remove unecessary include 2014-02-04 15:19:46 +00:00
Michael Drake
f2aa7202ba Fix Coverity #1109872. 2013-10-23 16:25:48 +01:00
Michael Drake
f45bc88b3d Fix Coverity #1109867. 2013-10-23 15:40:27 +01:00
Vincent Sanders
ee6e6eec05 move options include 2013-05-28 14:16:10 +01:00
Michael Drake
ba9769bc8c Pass fetch redirect info up to content layer as content_msg. Mark redirect origin URLs as visited in browser window content callback. Note this doesn't mean we track redirects, it just lets us get the :visited link style on links that redirect. 2013-05-27 14:51:00 +01:00
Michael Drake
8b6665fe03 Merge branch 'master' of git://git.netsurf-browser.org/netsurf into tlsa/selection-search-refactor 2013-05-07 14:56:42 +01:00
Michael Drake
3afd9c9731 Remove search context from browser window, simplify search interface for front ends.
Added content interface for search.

Removed bw->cur_search search context. Desktop layer now does nothing
except pass search requests from front end onto the bw's current_content
via the content interface.

Search API reduced to a pair of functions at each level:
  {desktop|content|html|textplain}_search
and
  {desktop|content|html|textplain}_search_clear

Updated front ends to use simplified search API.  Only tested GTK and RO builds.

These confine the search stuff to render/.  However search still uses struct
selection.  The handling for which is still spread over desktop/ and render/.
Also the render/search code itself still fiddles inside html and textplain
privates.
2013-05-07 14:41:40 +01:00
Vincent Sanders
7e2a93bb72 ensure correct cleanup of user list sentinal in content clone 2013-05-04 16:50:59 +01:00
Vincent Sanders
560faaa7be free memory on error condition 2013-05-04 08:45:04 +01:00
Vincent Sanders
f889f0ccbf fix leak in error path 2013-05-03 14:31:23 +01:00
Michael Drake
c2a718075a A load of refactoring of how content selection and input work.
Keypresses now go via content interface.
Contents don't shove the selection object into browser windows any more.
Contents report selection existence by sending message.
HTML content keeps track of where selections in it exist.
Contents report whether they have input focus via caret setting msg.
Caret can be hidden (can still input/paste) or removed.
Consolidate textarea selection handling.
Make textarea report its selection status changes to client.
Various textarea fixes.
Changed how we decide when to clear selections, and give focus.
2013-02-22 12:19:35 +00:00