mikiubo
cd576e594d
LibXml: Notify listener when doctype is parsed
2025-01-20 14:48:19 +01:00
Shannon Booth
51102254b5
LibWeb/HTML: Scroll to the fragment before loading the document
...
Otherwise nowhere ends up scrolling to the fragment specified by the
fragment in document's URL. This fixes ladybird scrolling to the
correct location in the document when navigating to a link that
has a fragment, e.g:
https://html.spec.whatwg.org/multipage/browsing-the-web.html#try-to-scroll-to-the-fragment
As well as use of the :target selector.
2025-01-15 12:43:48 +00:00
Tim Ledbetter
1e9e2b6564
LibWeb: Clone all attribute properties when cloning a single node
...
Previously, the namespace of the attributes on the cloned element was
not being set.
2025-01-11 23:10:09 +01:00
Glenn Skrzypczak
08589741f5
LibWeb: Correctly implement event listeners default passive attribute
...
This commit implements the default value of the passive attribute of
event listeners according to the spec.
2024-12-25 14:57:22 +00:00
Tyler Dence
0378645c25
LibWeb: PlatformObject::DefineOwnProperty fix 'has own property' check
...
PlatformObjects with named properties does not qualify as 'has own
property' just by virtue of a named property existing.
This fixes at least one WPT test, which is imported.
2024-12-20 15:10:24 +01:00
Tim Ledbetter
d8511e39c9
LibWeb: Report exceptions that occur during mutation observer microtask
2024-12-19 15:25:08 +00:00
Shannon Booth
18dddaa742
LibWeb/HTML: Use DOM's post-connection steps for iframe elements
...
See: c8ec987d1
2024-12-14 12:06:41 -08:00
Lucien Fiorini
7feb8eb5bf
Tests: Import WPT test for firstElementChild namespace in xhtml
2024-12-09 09:13:24 +00:00
Tim Ledbetter
f1bbba2ba5
Tests: Enable imported WPT tests that were previously too slow for CI
2024-12-04 21:25:33 +00:00
Tim Ledbetter
61ae388140
Tests: Create imported WPT test output from completion callback data
...
This allows us to disable test output, which performs expensive assert
tracking. This was making our imported tests run significantly slower
than tests run via `WPT.sh`.
Formatting the output ourselves also allows us to remove unnecessary
information from the test output.
This commit also rebaselines all existing imported WPT tests to follow
the new format.
2024-12-02 22:41:51 +00:00
Pavel Shliak
e02fd4ca8c
Tests: Reimport Event-constants WPT
...
I reimported and rebaselined it using the latest version
of our WPT importer. Now it passes.
2024-12-01 22:01:48 +01:00
Netanel Haber
d743fcb376
LibWeb: Take namespace into account when matching attribute
2024-11-30 16:47:14 +00:00
Pavel Shliak
f2a406f8cc
Tests: Import WPTs to prevent optional string argument regressions
2024-11-29 20:23:01 +00:00
Milo van der Tier
15741350ba
LibWeb: Make replaceData create new surrogate pairs
...
When inserting a new utf-16 surrogate next to an existing surrogate
with replaceData, the surrogates would not get merged correctly into a
single code point. This is because internally the text data is stored
as utf-8, and the two surrogates would be converted seperately. This
has now been fixed by first recreating the whole string in utf-16 and
then converting it back to utf-8.
It's not the most efficient solution, but this fixes at least 6 WPT
subtests.
2024-11-24 13:04:06 +00:00
Milo van der Tier
54b0476d70
LibWeb: Handle second condition in NamedNodeMap's property names
...
This removes the FIXME and fixes a WPT subtest.
2024-11-23 23:21:50 +00:00
Tim Ledbetter
f378f41526
LibWeb: Use correct comparison logic in NamedNodeMap::get_attribute()
...
Previously, we were doing a case insensitive comparison, which could
return the wrong result if the attribute name was uppercase.
2024-11-23 21:19:28 +00:00
Gingeh
7444f76b0d
LibWeb: Make querySelectorAll match each element at most once
2024-11-23 09:49:33 +01:00
Gingeh
bb678e75f9
LibWeb: Reject selectors with named namespaces in querySelectorAll
2024-11-23 09:49:33 +01:00
Gingeh
ba0cc7fe46
LibWeb: Use correct case-sensitivity when matching attribute selectors
...
Also removed get_attribute_with_lowercase_qualified_name
because it was buggy, duplicated logic, and now unused.
2024-11-23 09:49:33 +01:00
Gingeh
a2cf1d17fd
LibWeb: Require CSS combinators to be followed by a simple selector
2024-11-23 09:49:33 +01:00
Gingeh
bb5678a175
LibWeb: Don't allow trailing commas in selector lists
...
comma-separated list != #-multiplier
2024-11-23 09:49:33 +01:00
Timothy Flynn
488034477a
Revert "LibWeb: Set doctype node immediately while parsing XML document"
...
This reverts commit cd446e5e9c
.
This broke about 20k WPT subtests, all related to XML parsing. See:
https://wpt.fyi/results/html/the-xhtml-syntax/parsing-xhtml-documents?diff=&filter=ADC&run_id=5154815472828416&run_id=5090731742199808
2024-11-20 19:11:56 -05:00
Andreas Kling
4203b7823f
LibWeb: Fix incorrect exception on replaceChild() with doctypes
...
We were checking for presence of the wrong child in the parent.
2024-11-20 16:10:57 +01:00
Andreas Kling
cd446e5e9c
LibWeb: Set doctype node immediately while parsing XML document
...
Instead of deferring it to the end of parsing, where scripts that
were expecting to look at the doctype may have already run.
2024-11-20 16:10:57 +01:00
Andreas Kling
ab0dc83d28
LibWeb: Make Node.normalize() ignore CDATASection nodes
...
We hadn't modeled the "exclusive text node" concept correctly.
2024-11-20 16:10:57 +01:00
Andreas Kling
6ffc7ea36d
LibWeb: Make Node::is_text() return true for CDATASection nodes
...
CDATASection inherits from Text, and so it was incorrect for them to
claim not to be Text nodes.
This fixes at least two WPT subtests. :^)
It also exposed a bug in the DOM Parsing and Serialization spec,
where we're not told how to serialize CDATASection nodes.
Spec bug: https://github.com/w3c/DOM-Parsing/issues/38
2024-11-19 19:24:37 +00:00
Andreas Kling
564dc0a434
LibWeb: Use correct factory function when cloning a Document node
...
Cloning an XMLDocument should produce a new XMLDocument. Same for
HTMLDocument.
This fixes at least one WPT test, which we're also importing. :^)
2024-11-19 19:24:37 +00:00
Andreas Kling
3e8c8b185e
LibWeb: Use WindowProxy instead of Window in UI Events IDL
...
I believe this is an error in the UI Events spec, and it should be
updated to match the HTML spec (which uses WindowProxy everywhere).
This fixes a bunch of issues already covered by existing WPT tests.
Spec bug: https://github.com/w3c/uievents/issues/388
Note that WebKit has been using WindowProxy instead of Window in
UI Events IDL since 2018:
816158b4aa
2024-11-17 23:47:24 +01:00
Shannon Booth
634823d5b4
LibWeb: Implement HTMLIFrameElement.sandbox
2024-11-17 22:12:29 +01:00
Shannon Booth
a4b43cae9a
LibWeb: Implement HTMLLinkElement.sizes
2024-11-17 22:12:29 +01:00
Shannon Booth
061ac1f8c7
Tests: Import WPT test for DOMTokenList coverage on attributes
2024-11-17 22:12:29 +01:00
Andreas Kling
69c84d3f63
LibWeb: Make sure we don't fire "once" event listeners twice
...
Spec bug: https://github.com/whatwg/dom/issues/1323
2024-11-17 14:56:35 +01:00
Andreas Kling
aa9ed71ff3
Tests: Import a bunch of WPT tests from /dom/events
2024-11-17 14:56:35 +01:00
Gingeh
f88f41cf1e
LibWeb: Reject invalid processing instructions
2024-11-06 18:48:50 +01:00