netsurf/content
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
..
fetchers Avoid integer types with platform dependent size 2023-06-17 10:29:39 +01:00
handlers html: layout: Ensure all object types are reflowed if appropriate 2023-11-25 21:09:01 +00:00
backing_store.h
content_debug.h
content_factory.c
content_factory.h
content_protected.h remove unesessary header use in protected content 2020-06-25 12:33:52 +01:00
content.c improve desktop text search header usage 2020-06-24 23:49:59 +01:00
content.h improve desktop text search header usage 2020-06-24 23:49:59 +01:00
fetch.c hoist the Referer header generation logic up to the low level cache 2021-03-25 23:36:41 +00:00
fetch.h hoist the Referer header generation logic up to the low level cache 2021-03-25 23:36:41 +00:00
fetchers.h
fs_backing_store.c content: backing store: Remove unused typedef. 2023-06-17 11:21:02 +01:00
hlcache.c Clean up print format specifier usage 2023-06-17 11:20:09 +01:00
hlcache.h
llcache.c Clean up print format specifier usage 2023-06-17 11:20:09 +01:00
llcache.h
Makefile move the file fetcher sources into a single directory 2020-07-03 18:07:21 +01:00
mimesniff.c
mimesniff.h
no_backing_store.c
textsearch.c improve desktop text search header usage 2020-06-24 23:49:59 +01:00
textsearch.h improve desktop text search header usage 2020-06-24 23:49:59 +01:00
urldb.c urldb: Handle snprintf error 2022-10-23 17:22:56 +01:00
urldb.h