Commit Graph

520 Commits

Author SHA1 Message Date
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
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
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
877bc2ce13 gif: Ensure we never pass NSERROR_OK to error broadcast 2022-11-04 13:52:17 +00:00
Michael Drake
afbd9cd5e8 gif: Mark gifs as complete after scanning source data
This allows libnsgif to distinguish between awaiting more
data, and a broken truncated GIF. In the latter case we
can display what we have.
2022-11-04 11:36:02 +00:00
Michael Drake
217f71357e html: layout: flex: Disable verbose logging 2022-11-02 20:16:41 +00:00
Michael Drake
45b68a3b50 html: layout: flex: Implement align-items and align-self 2022-11-02 20:16:41 +00:00
Michael Drake
47482bd539 html: layout: flex: Implement wrap-reverse 2022-11-02 20:16:41 +00:00
Michael Drake
e9147bdeea html: layout: flex: Don't pass content around unnecessarily 2022-11-02 20:16:41 +00:00
Michael Drake
b91d61b89f html: layout: flex: Compare line main size with available main
When deciding whether to use the grow or shrink flex factor we
we using the available width, rather than the space available in
the main direction.
2022-11-02 20:16:41 +00:00
Michael Drake
d0b1bcb01a html: layout: flex: Unify line item placement 2022-11-02 20:16:41 +00:00
Michael Drake
6c2f9f3285 html: layout helpers: Add helpers for width/height indirection 2022-11-02 20:16:41 +00:00
Michael Drake
991f657ecd html: layout: Remove duplicate typedefs 2022-10-29 22:28:49 +01:00
Michael Drake
094eb9ae48 layout: flex: Squash main is usually a function warning 2022-10-29 22:15:58 +01:00
Michael Drake
8615964c3f html: layout: Initial implementation of display: flex 2022-10-29 20:30:48 +01:00
Michael Drake
06eee4636f html: box_dump: Indicate descendant bounding box values 2022-10-29 20:30:48 +01:00
Michael Drake
6da0bf5b84 layout: minmax pass: Improve handling of {min|max}_width properties 2022-10-29 20:30:48 +01:00
Michael Drake
145d6dfc6c layout: minmax table: Change logging level to error 2022-10-29 20:30:48 +01:00
Michael Drake
63412372b2 layout: calculate_mbp_width: Preserve percentage values 2022-10-29 20:30:48 +01:00
Michael Drake
ab877e680b html: layout: Improve block container assertions 2022-10-29 20:30:48 +01:00
Michael Drake
399f0063ba html: layout: Split out common helpers 2022-10-29 20:30:48 +01:00
Michael Drake
16252bb9f5 css: Fix dump of display: inline-flex 2022-10-29 20:30:48 +01:00
Michael Drake
84d3d1bf7a layout: Constify box through layout_find_dimensions() 2022-10-29 20:30:48 +01:00
Michael Drake
ae57029f83 layout: Constify box through layout_handle_box_sizing() 2022-10-29 20:30:48 +01:00
Michael Drake
86afb06496 layout: Add helpers for various box type checks 2022-10-29 20:30:48 +01:00
Michael Drake
2f98e96c95 layout: Add helper for checking if a style has a border on a side 2022-10-29 20:30:48 +01:00
Michael Drake
f1dbd523b4 layout: Drop redundant else block 2022-10-29 20:30:48 +01:00
Michael Drake
7d833537aa css: Update display property helper for grid 2022-10-29 18:24:38 +01:00
Michael Drake
ce6a2c87da content: image cache: Avoid int overflow before size_t conversion 2022-10-23 17:22:56 +01:00
Michael Drake
743817c205 js: console: Fix argument type for formatting function 2022-10-23 17:22:56 +01:00
Michael Drake
cb5d63768c js: image data: Avoid int overflow before size_t conversion 2022-10-23 17:22:56 +01:00
Vincent Sanders
40acd620b5 Ensure image cache logging does not cause division by zero at exit 2022-09-11 13:50:55 +01:00
Michael Drake
d082717ea6 HTML: CSS media spec: Pass in dark mode preference. 2022-07-30 21:32:37 +01:00
John-Mark Bell
69adc31d07 inttypes: custom format for UnixLib ssize_t
UnixLib defines ssize_t to be a long int, which forces the
corresponding format string to need to be %ld to avoid compiler
warnings. Making this change uncovered a number of places where
we were using the wrong format specifier entirely (namely
PRIssizet where we meant PRIsizet). Fix these, too.
2022-06-03 02:34:22 +01:00
Michael Drake
c90fb03e58 Duktape: Prevent clang static analysis. 2022-05-29 13:41:14 +01:00
Michael Drake
4e3d9127bf Duktape: Update to 2.7.0 release. 2022-05-29 13:40:24 +01:00
Michael Drake
8e56cc3b1a Bitmap: Implement test_opaque in core instead of in every frontend. 2022-03-29 15:25:33 +01:00
Michael Drake
feeda29c27 WebP: Optimisation: If it's opaque avoid any PMA conversions. 2022-03-28 16:06:02 +01:00
Michael Drake
4307230331 PNG: Allow support for premultiplied alpha.
LibPNG doesn't support premultiplied alpha, so now that the core
supports it, we can't just say that the decoded PNG is in the
core bitmap format.

So we now say it's in the core pixel layout, and if it's opaque
we say it has the same premultipled alpha setting as core bitmaps
because the conversion is costly and makes no difference.

On the other hand if it is not opaque we now admit that it is
not premultipled alpha so it gets converted if needed.
2022-03-28 16:05:47 +01:00
Michael Drake
d0da09a7ca Image: JPEG: Decode to client bitmap format where possible. 2022-03-27 13:25:37 +01:00
Michael Drake
bbfc0ca353 Image: JPEG: Warn if not using libjpeg-turbo.
Replaces RISC OS warning with a more general and relevant one.
2022-03-27 11:03:43 +01:00
Michael Drake
d33af42911 Image: WebP: Decode to client bitmap format where possible. 2022-03-27 10:50:29 +01:00
Michael Drake
41995c3999 Image: WebP: Correct output buffer size for rowstride. 2022-03-27 10:41:27 +01:00
Michael Drake
fba7a349c0 Image: Sprite: Avoid multiple bitmap format conversions. 2022-03-27 10:17:48 +01:00
Michael Drake
694a3b4c98 Image: RSVG: Just use bitmap to client for conversion. 2022-03-27 09:58:21 +01:00
Michael Drake
b0e7de8bff Image: PNG: Decode to client bitmap format. 2022-03-27 09:58:21 +01:00
Michael Drake
cde6a10ef4 Image: GIF: Decode directly to client bitmap format. 2022-03-27 09:58:21 +01:00
Michael Drake
d00c049d02 Bitmap: Move bitmap pixel to colour macro to bitmap header. 2022-03-27 09:58:21 +01:00
Michael Drake
1bbb499f88 Image: WebP: Call bitmap format conversion after decode.
Currently a no-op, because we decode to the default format
and no front end requests anything but the default format.
2022-03-27 09:58:21 +01:00
Michael Drake
df6ff85305 Image: RSVG: Call bitmap format conversion after decode.
Currently a no-op, because we decode to the default format
and no front end requests anything but the default format.
2022-03-27 09:58:21 +01:00
Michael Drake
052acc752c Image: PNG: Call bitmap format conversion after decode.
Currently a no-op, because we decode to the default format
and no front end requests anything but the default format.
2022-03-26 15:45:00 +00:00
Michael Drake
7bf6a88c9c Image: Sprite: Call bitmap format conversion after decode.
Currently a no-op, because we decode to the default format
and no front end requests anything but the default format.
2022-03-26 15:45:00 +00:00
Michael Drake
2f0fbbcaa0 Image: JPEG: Call bitmap format conversion after decode.
Currently a no-op, because we decode to the default format
and no front end requests anything but the default format.
2022-03-26 15:45:00 +00:00
Michael Drake
c7dce05437 Image: ICO: Abstract image decode into helper. 2022-03-26 15:45:00 +00:00
Michael Drake
60b12cd9fe Image: ICO: Call bitmap format conversion after decode.
Currently a no-op, because we decode to the default format
and no front end requests anything but the default format.
2022-03-26 15:45:00 +00:00
Michael Drake
e7a355bf8d Image: GIF: Call bitmap format conversion before/after decode.
Currently a no-op, because we decode to the default format
and no front end requests anything but the default format.
2022-03-26 15:45:00 +00:00
Michael Drake
27a89439a2 Image: BMP: Call bitmap format conversion after decode.
Currently a no-op, because we decode to the default format
and no front end requests anything but the default format.
2022-03-26 15:45:00 +00:00
Michael Drake
002c3c1a7c Bitmap API: Clean up creation flags. 2022-03-24 18:09:28 +00:00
Michael Drake
a4cb24ed46 Image: ICO: Update for new libnsbmp API. 2022-03-24 12:01:53 +00:00
Michael Drake
b6238c6c5c Image: BMP: Update for new libnsbmp API. 2022-03-24 12:01:36 +00:00
Michael Drake
1dd3c80d9b PNG: Bytes per pixel is always 4. 2022-03-24 11:12:57 +00:00
Michael Drake
7c3382834e GIF: Update to new libnsgif API.
Set required colour component order.
2022-03-23 17:52:20 +00:00
Michael Drake
ae9047b1ed GIF: Tolerate errors during scan if at least one frame. 2022-03-03 19:03:29 +00:00
Michael Drake
2e9ef8feae GIF: Update to latest libnsgif API. 2022-02-26 14:55:13 +00:00
Michael Drake
251cce29b7 CSS: Selection callbacks: Update to latest LibDOM API. 2021-07-05 14:59:10 +01:00
Michael Drake
fa64d91d12 Switch to new libcss API for unit conversion. 2021-05-30 11:52:33 +01:00
Michael Drake
638a408dde CSS: Update to latest libcss: Remove weird units.
The 'rlh', 'ic' and 'cap' units were never implemented by anyone.
2021-05-30 11:52:33 +01:00
Michael Drake
9e3ef18255 html: layout: Cleanup dom node tag name getting with helper. 2021-02-20 17:03:49 +00:00
Michael Drake
920041a131 html: layout: Fix to ignore non-element children of lists. 2021-02-20 12:00:42 +00:00
Michael Drake
9783296c4f layout: Add support for OL reversed attribute. 2021-02-10 17:59:51 +00:00
Michael Drake
496b1eca08 layout: list handling: Scope reduce some variables in the recursive call. 2021-02-10 17:57:57 +00:00
Michael Drake
d29f6d6c1e html: layout: Change list value step to variable. 2021-02-10 17:57:57 +00:00
Michael Drake
e18bb8fde1 html: Add support for OL start attribute.
Note: Added new box member because rows was unsigned, and it was
      naughty to use something meant for tables.

Note: Now numbers <= 0 can be generated, but LibCSS needs updated
      to support that.
2021-02-10 17:57:57 +00:00
Michael Drake
64680a8edb layout: Add support for list item value attribute. 2021-02-09 21:33:06 +00:00
Michael Drake
41a0c21812 html: Do list item counting at layout time. 2021-02-09 20:36:52 +00:00
Michael Drake
9434fe1ff0 layout: Pass content into list layout function. 2021-02-09 20:36:52 +00:00
Michael Drake
839fb8570a layout: Add counting for list items to layout. 2021-02-09 20:36:52 +00:00
Vincent Sanders
ff225194f3 use list style formatting from libcss 2021-02-07 00:07:24 +00:00
Michael Drake
55fadc802a html: list counter style: Revert to string for {pre|post}fix. 2021-02-02 16:39:41 +00:00
Michael Drake
3b57deb046 html: list counter style: Constify {pre|post}fix memebers. 2021-02-02 15:06:04 +00:00
Michael Drake
87b5fd1bcc html: list counter style: Split out symbol copy. 2021-02-02 15:04:09 +00:00
Vincent Sanders
60d9dbe390 change list counter style formatting to be table driven 2021-02-02 01:19:32 +00:00
Vincent Sanders
bca82dfe83 do not count the null terminator in list counter style length formatting 2021-01-31 23:30:07 +00:00
Vincent Sanders
27b178b04b implement armenian and georgian list counter styles 2021-01-31 22:56:35 +00:00
Vincent Sanders
83ebc3bb8e split counter style handling out of the box code 2021-01-31 10:49:13 +00:00
Michael Drake
13c1b11317 css: hints: Add support for OL type attribute. 2021-01-31 09:36:02 +00:00
Vincent Sanders
4455f1b712 implement list marker counting for roman, latin and greek 2021-01-30 23:00:44 +00:00
Daniel Silverstone
ba4c20a0c7
dukky: Fix assignment in assert
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-10-03 14:21:26 +01:00
Daniel Silverstone
2d58372ec2
Console: Do not try and log through a closed down window
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-10-02 20:15:23 +01:00
Vincent Sanders
5207ecf308 split out the about scheme imagecache page generator 2020-09-20 16:36:01 +01:00
Vincent Sanders
1f2946a710 remove unecessary exported function from plain text content handler 2020-07-27 22:56:17 +01:00
Vincent Sanders
652078f8cf fix erronenous child variable assignment 2020-07-12 18:49:47 +01:00
Vincent Sanders
313e5cabba ensure the html layout is present for text selection
The text selection operations can be called regardless
  of when the html layout box tree is actually
  available (e.g. if it is still loading when opened)

This change ensures the layout box tree is available before
  attempting to traverse it for a selection operation.
2020-07-12 13:47:52 +01:00
Vincent Sanders
402ad02ff5 remove unecessary use of gui_internal in content 2020-06-25 14:37:57 +01:00
Vincent Sanders
82bb483964 remove unesessary header use in protected content 2020-06-25 12:33:52 +01:00
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
2352bea153 use the ascii locale safe handling instead of ctype API 2020-06-24 23:34:09 +01:00
Vincent Sanders
d5d14df76b initial implementation of split messages in c
functional but the compression switch still needs implementing
2020-06-15 00:21:06 +01:00