Commit graph

426 commits

Author SHA1 Message Date
6fd16295df Use new parsers for DOMParser in PHP 8.4 when available
Because the new HTML parser uses UTF-8 as a fallback encoding, we have adjusted the configured fallback encoding of our parser to match
2024-12-29 09:48:58 -05:00
024011fed0 Update for PHP 8.4 2024-12-27 07:34:07 -05:00
a5c94cc577 Fix XML encoding unconditionally
This is required because document encoding might be in the naughty list
2024-05-15 17:47:50 -04:00
d1e2d1b51a Add XML parsing error info to attributes
Also cleans up XML parsing functionality to be easier to override
2024-05-15 13:48:28 -04:00
08b0e3855b Specification update 2024-05-14 20:01:31 -04:00
445fd545c7 Don't trust libxml to handle standard encodings
Many standard encoding labels are not understood by libxml, so we must insert
our own XML declarations to add encoding information which libxml will
understand.
2024-04-20 11:01:50 -04:00
4e41632769 Document test filtering a bit more generically 2023-04-20 16:01:51 -04:00
2b8a31ce47 Add search element 2023-04-20 15:55:47 -04:00
d499fac607 Document DOMParser 2023-04-01 21:38:10 -04:00
6b863a1a85 Polish off DOMParser tests 2023-04-01 15:35:47 -04:00
504d713139 Simplify UTF-16 handling in DOMParser 2023-04-01 11:28:05 -04:00
b7535c9b61 Avoid modifying the XML string where possible 2023-04-01 09:50:28 -04:00
03a42a2343 Move the creation of documents to separate functions
This will make document creation easier to override for e.g. enhanced
DOM implementations.
2023-04-01 09:07:11 -04:00
fbdd72cf7f Don't use DOMs as encoding signals
Instead convert UTF-16 and manipulate XML declarations
2023-03-31 20:12:31 -04:00
bcbe74d6b9 Add first tests for DOMParser
This has exposed an error in the assumptions about BOM handling in the
XML parser. Proper handling of external encoding information will take
more effort than aniticpated.
2023-03-31 15:16:19 -04:00
2b39319894 Fall back on XML parser in cases of unsupported encodings 2023-03-31 11:33:03 -04:00
f9e4029b5b Fix syntax error 2023-03-30 17:55:24 -04:00
9dcc379950 Allow encoding detection in DOMParser
For HTML the HTML parser's machinery is used; for XML we implement our
own logic for known encodings
2023-03-30 10:50:15 -04:00
7e688adf17 Add XML parsing to DOMParser
Handling of XML parse error may be wrong
2023-03-29 22:58:37 -04:00
398180fee6 Partial implementation of DOMParser 2023-03-29 20:04:09 -04:00
82b76b192c Handle xmlns on HTML elements correctly
The test for when to produce a parse error was not correct previously
2023-03-10 12:46:21 -05:00
bd43403aa7 Fix xmlns on HTML elements when using HTML ns 2023-03-10 11:26:19 -05:00
da0a4b12e3 Spec-related update
See https://github.com/whatwg/html/pull/8271

Also removed test patches which are no longer needed, and fixed a bug
exposed by new tests

The testsuite includes tests for the new <search> element, but this is
not included in the specification yet, so the tests have been suppressed
2023-03-09 17:17:56 -05:00
fa0591bd9c Remove changelog
It was not being kept up to date
2023-01-25 17:49:58 -05:00
98c7b5bbae Update dependencies 2023-01-25 17:46:55 -05:00
e11401d10d Avoid dynamic property creation 2023-01-25 17:46:01 -05:00
9097e61d97 Avoid use of @ operator 2023-01-25 17:45:30 -05:00
02ec5df3fe Make Serializer "block" query look for descendants rather than children 2022-02-15 14:47:49 -06:00
61b842fa74 Added 'groupElements' serializer option 2022-02-15 12:24:04 -06:00
c1dc4b55ce Added form elements to serializer "block" elements
• select, fieldset, datalist, option, and optgroup are now treated as 
block when pretty printing
• input, textarea, button, output are now treated as block only if not 
the only child when pretty printing
2022-02-14 09:18:44 -06:00
8e087054df Dependency updates, added tbody to serializer "block" elements 2022-02-13 17:09:28 -06:00
37f0fa8647 More Serializer fixes 2021-12-16 14:25:19 -06:00
b908068603 Fixed error in pretty printing templates in preformatted content 2021-12-16 09:29:51 -06:00
a8435f7c35 Added PHP 8.1 attributes to Stack methods to suppress deprecation errors 2021-12-05 09:00:39 -06:00
f33cc4344b Updates to documentation 2021-11-29 12:54:16 -06:00
afaf10d602 Fixed yet another xmlns issue... 2021-11-21 19:55:09 -06:00
cb57dd8e11 Added tests for serializer config warnings 2021-11-19 11:18:05 -06:00
5495e7c81e Fixed parameters for Serializer::getTemplateContent 2021-11-18 11:39:20 -06:00
a76081fd18 Minor cleanup 2021-11-18 11:29:57 -06:00
a4e1aa55d1 Changed typing for config in Serializer 2021-11-18 11:18:34 -06:00
6ff01ee4f7 Changed serializer configuration to array 2021-11-18 11:12:09 -06:00
ad57bbd5a2 Added test to cover tab indention 2021-11-18 09:55:51 -06:00
5f1a97295e Minor clean-up 2021-11-17 16:31:40 -06:00
08ba468214 100% coverage on pretty printing 2021-11-17 16:29:22 -06:00
8361ea0d88 Working on inline whitespace collapsing, not quite right yet 2021-11-16 23:59:36 -06:00
b145e1ebc9 Started fixing whitespace collapsing per specification 2021-11-16 16:47:08 -06:00
6da73a3dab Fixing bugs exposed when trying to extend Serializer 2021-11-15 11:11:02 -06:00
7defc1cc1d Changed to using recursion to simplify pretty printing 2021-11-15 09:18:26 -06:00
4cd3a9b03d Trying a rewrite with recursion to simplify pretty printing 2021-11-12 16:33:41 -06:00
50943199b2 Tons of fixes 2021-11-12 15:06:04 -06:00