Commit Graph

1769 Commits

Author SHA1 Message Date
Daniel Silverstone
4d987798af
cert-viewer: Fix typo
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2024-10-13 11:07:49 +01:00
Vincent Sanders
79127cce82 ensure libsvgtiny plot style is correctly set up 2024-09-27 09:15:52 +01:00
Vincent Sanders
8249898501 Ensure error reporting in resource, about and file scheme fetchers is translated 2024-09-24 09:00:12 +01:00
Michael Drake
a885818d78 html: css: Update to new css_computed_width API 2024-05-27 13:51:31 +01:00
Daniel Silverstone
087f88ae8c
box_construct: clamp rowspan and colspan
In order to not blow up on massive rowspan/colspan values (which
could be an issue according to #2873) we clamp them according to
the HTML spec section 4.9.11

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2024-05-27 09:36:02 +01:00
Michael Drake
15d3de0d37 content: css: dump: Handle CALC unit type
We won't actually reach this, because the type won't be SET if
it's CALC.
2024-05-26 19:51:10 +01:00
Michael Drake
e1d7a346dd calc(): layout: find dimensions: Use new css width getter API 2024-05-26 13:30:19 +01:00
Michael Drake
68e6876c8d calc(): layout: table: Use new css width getter API 2024-05-26 11:50:12 +01:00
Michael Drake
052550c667 calc(): layout: minmax block: Use new css width getter API 2024-05-26 11:45:35 +01:00
Michael Drake
09b076c141 calc(): layout: minmax line: Use new css width getter API 2024-05-26 10:47:33 +01:00
Michael Drake
0f18e7a7fd calc(): layout: minmax table: Use new css width getter API 2024-05-26 10:11:31 +01:00
Michael Drake
9448c44bab css, html: Update to new LibCSS css_computed_width API
Currently using the static variant, but in future we'll
switch to using the one that resolves to pixels for us.
2024-05-25 22:41:57 +01:00
Michael Drake
120be3d771 html: layout: FPCT_OF_INT_TOINT is now in LibCSS 2024-05-25 22:41:57 +01:00
Michael Drake
67005a0d7e content caches: Squash -Wcalloc-transposed-args (gcc-14) 2024-05-24 21:09:24 +01:00
Michael Drake
2bffbebad7 image handlers: Squash -Wcalloc-transposed-args (gcc-14) 2024-05-24 21:09:24 +01:00
Michael Drake
0843a9b43d fetch: Squash -Wcalloc-transposed-args (gcc-14) 2024-05-24 21:09:24 +01:00
Michael Drake
a87ff23666 js: duktape bindings: Squash -Wcalloc-transposed-args (gcc-14) 2024-05-24 21:09:24 +01:00
John-Mark Bell
bda0a97fea Socket: fix win32/aos3 build 2024-03-13 23:22:31 +00:00
John-Mark Bell
e3a6ad7173 Fetch/curl: expose socket open/close via fetch vtable
This allows frontends to customise the behaviour of sockets. The
default implementation simply maps to socket(2)/close(2).
2024-03-13 23:03:34 +00:00
John-Mark Bell
3be91870a4 fetchers: drop support for ancient OpenSSL
We now require 1.1.1 or later (and, preferably, 3.x).

Also take the opportunity to add support for LibreSSL 3.5.0 or
later (we still support ancient versions of this because 3.5.0 is
still relatively modern -- give it a few more years and support
for old LibreSSL can go, too)
2024-03-13 21:26:01 +00:00
Vincent Sanders
b5f4d905f9 use attributes to indicate switch fall through instead of comments 2024-03-05 21:33:13 +00:00
Vincent Sanders
199f86dcf1 avoid increased alignment warning 2024-03-05 11:58:16 +00:00
Vincent Sanders
07d09bbdfc res variable could possibly be used without being set 2024-02-27 13:24:48 +00:00
Vincent Sanders
cea268ddc6 width variable is only required with misconfigured libjpeg 2024-02-27 13:23:49 +00:00
John-Mark Bell
91b29b626f HTML/forms: fix radio button group handling 2024-02-25 15:00:39 +00:00
Vincent Sanders
bce0aa6fc9 Do not crash if radio form has no name attribute 2024-02-25 10:28:03 +00:00
John-Mark Bell
2a37e5e64c Revert "fetchers: drop support for ancient OpenSSL"
ciworker{8,12} (respectively: FreeBSD, aarch64 Linux) are running
obsolete OS versions. Disappointment ensues.

This reverts commit 6bb70e8810.
2024-02-11 19:06:07 +00:00
John-Mark Bell
6bb70e8810 fetchers: drop support for ancient OpenSSL
We now require 1.1.1 or later (and, preferably, 3.x).

Also take the opportunity to add support for LibreSSL 3.5.0 or
later (we still support ancient versions of this because 3.5.0 is
still relatively modern -- give it a few more years and support
for old LibreSSL can go, too)
2024-02-08 20:29:31 +00:00
John-Mark Bell
2ee5e21b09 fetchers/curl: modernise TLS 1.2 cipher suites
* Drop support for DHE completely (logjam plus compat woes
    caused other browsers to do this some time ago)
  * Minimise CBC-mode suites
  * Fall back to non-PFS RSA suites if really necessary (we treat
    this as a protocol downgrade as anything modern should either
    be using TLS 1.3 or have support for the ECDHE suites)
2024-02-04 18:52:02 +00:00
John-Mark Bell
283f73dcaa HSTS: propagate enabled state for HTTPS URLs, too
While we have no need to transform the URL in the HTTPS case, the
HSTS policy should still result in a hard failure when something
is untoward (i.e. not providing the user with a way to proceed).
Ensure this is so.
2024-01-20 18:12:52 +00:00
John-Mark Bell
33ba78065a content/textplain: fix U+FFFD encoding 2023-12-21 00:57:08 +00:00
Vincent Sanders
188f6dd5c0 Fix use of uninitialised code variable in error reporting 2023-12-13 13:52:22 +00:00
Vincent Sanders
7f8ea62269 Attempt to fix maybe uninitialised error 2023-12-13 13:41:15 +00:00
Vincent Sanders
aa050729b4 Resolve progress function deprication in curl later than 7.32.0 2023-12-12 08:53:16 +00:00
Vincent Sanders
da4a1a4561 Remove use of depricated API after libcurl 7.56 2023-12-12 08:53:16 +00:00
Michael Drake
f68aca93b7 jpegxl: Ensure decoded bitmap format is converted to front end format 2023-11-26 17:26:09 +00:00
Michael Drake
d59f30c683 jpegxl: Tell libjxl to decode unpremultiply alpha if needed
On some platforms our bitmap format does not use premultiplied alpha.
2023-11-26 17:26:09 +00:00
Michael Drake
6fa4c04dea jpegxl: Designated initialiser for output format struct
So I could see the meanings of how we'd set up the decode.
2023-11-26 17:26:09 +00:00
Vincent Sanders
b19fcdd26f avoid the unecessary callback API 2023-11-26 17:26:09 +00:00
Vincent Sanders
dbe5d1ef87 Implement simple jpeg xl image handler 2023-11-26 17:26:09 +00:00
Michael Drake
dcdd0148b2 html: css: Remove redundant origin filtering for author_level_css 2023-11-26 10:50:38 +00:00
Michael Drake
571a9ca0c9 html: Avoid processing STYLE elements if author_level_css disabled 2023-11-26 10:50:38 +00:00
Michael Drake
33bba1d9fd html: Avoid fetching (and decoding) linked stylesheets
When the `author_level_css` option is disabled, avoid fetching
stylesheets that won't be used for selection.
2023-11-26 10:50:38 +00:00
Michael Drake
74ab1eb244 html: css: Minor code style fix 2023-11-26 10:50:38 +00:00
Michael Drake
c38be94bf9 css: Fix blocking of presentational hints for author_level_css=0 2023-11-25 21:37:06 +00:00
Michael Drake
3f764b0459 html: layout: Ensure all object types are reflowed if appropriate
The SVGTiny content handler uses the reflow method to set the
content width/height. The when the content first broadcasts "done",
the HTML handler checks if there had already been a layout. If there
has, it calls the SVG's content reflow method with the box dimensions.
If not, it calls the reflow method with width/height zero.

Since the layout code was only reflowing objects if they were HTML,
these SVG contents were never getting their actual dimensions.

The result of this was that when we came to plot these SVGs we were
dividing by zero in the building of the transformation matrix:

    transform[0] = (float) width / (float) c->width;
...
    transform[3] = (float) height / (float) c->height;

These divided the plot size by the content size.

The result of this on the GTK front end was infinities in the
transformation matrix passed to Cairo, and the turning of the
whole nsgtk window into a glitchy ruin while the SVG was on
screen.

It may have affected other front ends too; these divide by zeros
were happening in the core, and passed to the front ends' plotters.

This issue only affected SVGs on HTML pages, and not when viewed
directly. Also the SVGs had to be completely fetched and converted
before the document had undergone layout.

This was the case with SVGs at the top of both Wikipedia and The
Register. In both cases the glitching window would be fixed by
scrolling down the page past the SVG.
2023-11-25 21:09:01 +00:00
Michael Drake
4cb38c4704 css: Add option to ignore author level CSS
This adds a new config option, `author_level_css`.

When it is disabled, NetSurf will ignore all CSS from the web
page. In this case only the default CSS rules from the browser
and user CSS rules will be applied. It is enabled by default.

Tested by running:

    ./nsgtk3 --author_level_css=0
2023-11-25 20:02:23 +00:00
Michael Drake
5035408503 content: backing store: Remove unused typedef. 2023-06-17 11:21:02 +01:00
Michael Drake
c987b043b1 Clean up print format specifier usage 2023-06-17 11:20:09 +01:00
DeltaVonNeumann
a16d5ff10b Avoid integer types with platform dependent size 2023-06-17 10:29:39 +01:00