Commit Graph

14736 Commits

Author SHA1 Message Date
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
303d5f251f tests: Add author_level_css to list of all options 2023-11-25 21:49:43 +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
Vincent Sanders
41de6cb6f8 Ensure the current scaffold remains valid
When a scaffold was being destroyed the currently selected scaffold could become a reference to a destroyed object. This would result in crashes subsequently when the current scaffold was referenced.

The change is simply to ensure the selected scaffold is changed to something valid during destruction.
2023-11-25 12:02:58 +00:00
John-Mark Bell
d448436cdb Update root CA bundle 2023-09-17 16:03:47 +01:00
Michael Drake
5035408503 content: backing store: Remove unused typedef. 2023-06-17 11:21:02 +01:00
Michael Drake
23102ff601 test: Use YAML SafeLoader 2023-06-17 11:20:52 +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
Michael Drake
21e636a3a6 ci: Add ccache to github workflows 2023-03-16 15:47:43 +00:00
John-Mark Bell
b56d74b5df Retire long-dead code 2023-03-12 21:38:10 +00:00
John-Mark Bell
7e6acf326b arm-riscos-gnueabi: require SharedULib 1.16 2023-03-06 00:36:52 +00:00
John-Mark Bell
700c12aa9d RISC OS: add ARMEABISupport 1.05 2023-03-06 00:22:20 +00:00
John-Mark Bell
ec9d6b15d5 RISC OS: update SharedULib to 1.16 2023-03-06 00:21:33 +00:00
John-Mark Bell
9ad2be2205 jenkins-build: add arm-riscos-gnueabi 2023-03-05 23:48:48 +00:00
John-Mark Bell
a8ff4ab228 fetchers/curl: tolerate lack of TLS1.3
If we are building against a modern version of libcurl, but it was
built against a version of OpenSSL that does not support TLS1.3,
then attempting to configure TLS1.3 ciphersuites will fail with
CURLE_NOT_BUILT_IN. Tolerate this scenario by treating such a
return code as non-fatal in this case.
2023-03-05 21:37:22 +00:00
Michael Drake
b22e61871c gtk: Don't try to make zero-size bitmaps
Fixes complete failure to render wikipedia and the register when
built against rsvg.
2023-01-24 15:30:57 +00:00
Michael Drake
f7a0135300 html: layout: flex: Don't freeze already-frozen items
This fixes an error in the used main size tracking.
2022-12-16 14:18:46 +00:00
Michael Drake
73dab84ef8 html: layout: flex: shrink: Avoid rounding error accumulation 2022-12-16 14:18:46 +00:00
Michael Drake
dbd7f5bcd8 html: layout: flex: grow: Avoid rounding error accumulation 2022-12-16 14:18:46 +00:00
Michael Drake
71765dd1e8 html: layout: flex: Handle auto margins in main direction 2022-12-15 21:57:15 +00:00
Michael Drake
88e6fc918a html: layout: flex: Track used size and count auto margins for main 2022-12-15 21:57:15 +00:00
Michael Drake
cab66fb1ac html: layout: flex: Helper to get main margin end size 2022-12-15 21:57:15 +00:00
Daniel Silverstone
651deffcf7 (curl): Add extra logging to fetcher initialisation
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
2022-12-15 10:40:22 +00:00
Michael Drake
e754f31cb7 html: layout: flex: Support reversed main direction 2022-12-14 22:53:35 +00:00
Michael Drake
fbc4f141f7 html: layout: Helpers to get cross/main box size 2022-12-14 22:53:35 +00:00
Michael Drake
25acf1a5dd html: layout: flex: Rename indirected box w/h functions 2022-12-14 22:53:35 +00:00
Michael Drake
73ce30325f html: layout: flex: Scope reduce variables 2022-12-14 22:53:35 +00:00
Michael Drake
3760bbcd2a html: layout: flex: Only distribute positive remaining cross space 2022-12-14 22:53:35 +00:00
Michael Drake
b07bda787c html: layout: flex: Minor code style change 2022-12-14 22:53:35 +00:00
Michael Drake
43d5ce44ac html: layout: flex: Add code documentation 2022-12-14 22:53:35 +00:00
Michael Drake
8d4176e4d4 html: layout: flex: Hoist item placement out of line resolver 2022-12-14 22:53:35 +00:00
Michael Drake
6da16e5648 html: layout: flex: Return NULL for pointer 2022-12-14 22:53:35 +00:00
Michael Drake
fbb39f0d49 html: layout: Helper for whether flex direction is reversed 2022-12-14 22:53:35 +00:00
Michael Drake
f30f869ea4 rsvg246: Fix build against librsvg 2.48
The version of librsvg is used on Ubuntu 20.04TLS.
2022-12-13 13:02:44 +00:00
Michael Drake
68a4cd39cd rsvg246: Split out width/height acquisition 2022-12-13 13:02:44 +00:00
Vincent Sanders
9b57f64c55 add rsvg image decoder that uses the new API 2022-11-27 17:34:41 +00:00
Daniel Silverstone
550900b1cb
(Element): Honour [SameObject] for ::classList getter
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2022-11-27 14:52:48 +00:00
Daniel Silverstone
f29f12a5df
(docs): Update the unimplemented JS bits list
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2022-11-27 09:43:23 +00:00
Daniel Silverstone
7bcd4fd246
DOMTokenList: Add support and testing for this
We add both DOMTokenList and DOMSettableTokenList and introduce
polyfills for stringifying it until nsgenbind can do that.

We also bring in a test to demonstrate all that we have.

Note: This does not implement the extra methods that exist according
to MDN, we may need a polyfill to bring that up to snuff.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2022-11-27 09:40:47 +00:00
Daniel Silverstone
764fca4f3a
utils/utf8.c: Fix missing format string for snprintf
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2022-11-26 16:55:47 +00:00
Vincent Sanders
0c25ae5e8e remove the ambiguity around the reallocation in utf8_to_html() 2022-11-26 15:21:16 +00:00
Vincent Sanders
1d82ef411a consolodate duplicated conversion descriptor cache code 2022-11-26 15:21:16 +00:00
Vincent Sanders
6780766fb7 Improve utf8 conversion function
Newer compilers were (correctly) pointing out use after free.

Slightly reworkeed conversion function to remove compiler warnings
and clean up implementation.
2022-11-26 15:21:16 +00:00
Daniel Silverstone
3d739479ea
(duktape): Clear some warnings by adding base data to css rule and stylesheet
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2022-11-26 14:55:20 +00:00
Michael Drake
14fba9afdc GitHub CI: Make codeql job name match other jobs 2022-11-09 17:10:48 +00:00
Michael Drake
d893a6d602 GitHub CI: Update for new env.sh 2022-11-09 17:10:48 +00:00