Commit Graph

16 Commits

Author SHA1 Message Date
Karl Seguin
e7c44d34f4 This updates html5ever and the other Rust dependencies.
Inspired by:
https://github.com/lightpanda-io/browser/security/dependabot/1
2026-04-17 12:39:15 +08:00
Karl Seguin
05229fdc53 Use the document's charset to determine if/how to encode querystring
Whenever we resolve a URL, say from `anchor.href`, we should consider the
document's charset when encoding the querystring. This probably isn't the
most important feature, but it makes tens of thousands of WPT cases pass, e.g

/encoding/legacy-mb-tchinese/big5/big5-encode-href-errors-han.html?3001-4000 and
/encoding/legacy-mb-japanese/euc-jp/eucjp-encode-href-errors-han.html?17001-18000

DOM elements previous called `URL.resolveURL(...)`. They now call
`self.asNode().resolveURL(...)`, where `Node#resolveURL` will provide the
document's charset.
2026-04-10 16:47:42 +08:00
Karl Seguin
828715b751 Improve TextDecoder to support all necessary encoding types
Uses the newly added encoding_rs to implement TextDecoder for all encoding.
Claude wrote 100% of the Rust binding.

Improves various WPT tests, e.g. /encoding/api-basics.any.html.
2026-04-10 16:47:41 +08:00
Karl Seguin
763927c352 Use encoding_rs on non-UTF-8 html to convert to utf-8
Using our existing MIME type detection, this uses encoding_rs to convert non-
UTF-8 content to UTF-8, which can then be passed to html5ever.

Issue: https://github.com/lightpanda-io/browser/issues/2089
2026-04-08 18:32:08 +08:00
Taylor
88e0b39d6b chore: fix dead code and error swallowing warnings
Fixes issues reported by polyglot-scanner:
- Removed explicit `return` keywords and trailing semicolons to resolve DEAD_CODE/DEAD_BRANCH warnings.
- Replaced `epoch::advance().unwrap()` and `stats::resident::read().unwrap()` with safer alternatives (`drop` and `unwrap_or(0)`) to resolve ERROR_SWALLOW warnings.
- Replaced `let _ = Box::from_raw(...)` with `drop(Box::from_raw(...))` to correctly drop the box while fixing the ERROR_SWALLOW warning.
2026-03-26 09:58:49 -07:00
Halil Durak
56d89895a8 initial XML parsing support in DOMParser 2026-01-07 14:37:43 +03:00
Karl Seguin
7c7240d5ab Try to protect against invalid use of document.write
Specifically, try to block multiple document.write which, when combined, have
multiple html documents.
2025-12-30 10:07:56 +08:00
Karl Seguin
9969ff7165 implement html5ever append_based_on_parent_node and append_before_sibling 2025-12-24 07:37:44 +08:00
Karl Seguin
32c83d166d implement html5ever createPI callback 2025-12-21 16:04:59 +08:00
Karl Seguin
218d08b1f6 add some skeleton implementations for various CSS WebAPIs 2025-11-25 13:00:32 +08:00
Karl Seguin
c3ba39c80f add reparent_children html5ever callback 2025-11-16 07:53:55 +08:00
Karl Seguin
ff3a9c51f3 add remove_from_parent html5ever callback 2025-11-16 07:40:07 +08:00
Karl Seguin
19dfea7762 Work on HTMLTemplateElement
Implement Html5ever get_template_contents and add_attrs_if_missing callbacks
2025-11-15 22:04:39 +08:00
Karl Seguin
c311828217 add add_attrs_if_missing callback 2025-11-14 23:33:31 +08:00
Karl Seguin
1164da5e7a copyright notices 2025-11-14 10:52:43 +08:00
Karl Seguin
b047cb6dc1 remove libdom 2025-10-27 22:14:59 +08:00