Linus Groh
88a31f3bac
LibJS: Fix [[TimeZoneOffsetString]] value in ParseTemporalInstantString
...
This is a normative change in the Temporal spec.
See: 78c3b8b
2021-09-15 00:23:11 +01:00
Andreas Kling
70398645f3
LibWeb: Improvements to error handling in HTML foreign content parsing
...
Follow the spec more closely when encountering an invalid start or end
tag during foreign content parsing.
2021-09-14 23:49:45 +02:00
Tobias Christiansen
fad825e94e
LibWeb: Flexbox: Avoid division by zero
...
This is not a good thing, one should not divide by zero! :^)
2021-09-14 22:52:48 +02:00
Tobias Christiansen
85af2ac450
LibWeb: Flexbox: Change the name of a variable to correspond to spec
...
The spec used two different names for the same thing, and it was
confusing to read the spec on the one side and have the other name in
the code.
2021-09-14 22:52:48 +02:00
Tobias Christiansen
15b61ce143
LibWeb: Flexbox: Resolve relative size of flex-items more correctly
...
This is still very much not the right thing to do, but at least
relatively sized flex-items get the right size.
2021-09-14 22:52:48 +02:00
Ali Mohammad Pur
8e3fe80c06
LibRegex: Avoid using GenericLexer::consume() when at eof
...
Fixes #10027 .
2021-09-14 22:02:25 +02:00
kleines Filmröllchen
047c013be0
LibWeb: Add several computed CSS styles
...
These are mostly combined styles such as background, as well as handling
the Invalid and Custom property IDs (which both make no sense).
2021-09-14 22:02:14 +02:00
kleines Filmröllchen
6865a5a447
LibWeb: Add CombinedBoderRadiusStyleValue for CSS border-radius
...
This style value can hold all four border radii and format them into
valid CSS for the `border-radius` property.
2021-09-14 22:02:14 +02:00
kleines Filmröllchen
dc026db800
Base: Add developer's tests to computed-style.html
2021-09-14 22:02:14 +02:00
Andreas Kling
20fb900937
LibJS+LibWeb: Move script parse time logging from JS::Script to LibWeb
...
Let's only log HTML::ClassicScript parse times for now. Otherwise things
will get excessively noisy in test-js and the test262 runner.
2021-09-14 21:41:51 +02:00
Andreas Kling
0a09eaf3a1
LibJS+LibTest: Use JS::Script and JS::SourceTextModule in test-js
...
Instead of creating a Parser and Lexer manually in test-js, we now
use either JS::Script::parse() or JS::SourceTextModule::parse()
to load tests.
2021-09-14 21:41:51 +02:00
Andreas Kling
10c489713d
LibJS+LibWeb: Let JS::Script::parse() return a list of errors (on error)
...
These are really supposed to be a list of SyntaxError objects, but for
now we simply return all the Parser::Error objects we got from Parser.
2021-09-14 21:41:51 +02:00
Andreas Kling
5fa02b8a9e
LibJS: Add a barebones SourceTextModule class
...
This corresponds to "Source Text Module Record" from the spec.
2021-09-14 21:41:51 +02:00
Andreas Kling
405b8e7915
LibTest: Decorate cleanup_and_exit() with [[noreturn]]
2021-09-14 21:41:51 +02:00
Andreas Kling
f08a46bd9e
LibJS: Make JS::Script keep the VM alive
...
Script has a Handle member (m_realm), and for handles to remain valid,
the VM must stay alive.
2021-09-14 21:41:51 +02:00
Andreas Kling
d553fd7f4f
LibJS: Add a barebones Module class
...
This corresponds to the "Abstract Module Record" from the spec.
2021-09-14 21:41:51 +02:00
Andreas Kling
df5414f47f
LibJS: Reorganize ExecutionContext a little bit
...
- Move it to a separate header file
- Annotate the members that represent spec slots
- Reorganize the members (by spec vs non-spec)
2021-09-14 21:41:51 +02:00
Ali Mohammad Pur
72ddaa31e3
LibJS: Implement parsing and execution of optional chains
2021-09-14 20:03:27 +01:00
Ali Mohammad Pur
4f7e14e0aa
LibJS: Reorder the global eval function call detection conditions a bit
...
This just makes it clearer, since the actual check is off-screen, making
the reader wonder what that check is for.
2021-09-14 20:03:27 +01:00
Ali Mohammad Pur
f7a68ae998
LibJS: Mark two JS::Reference functions const
...
These two are inherently const, and the next commit needs to call them
on a const object, so let's just mark them const.
2021-09-14 20:03:27 +01:00
Brian Gianforcaro
fbb31b4519
Kernel: Disable lock rank enforcement by default for now
...
There are a few violations with signal handling that I won't be able to
fix it until later this week. So lets put lock rank enforcement under a
debug option for now so other folks don't hit these crashes until rank
enforcement is more fleshed out.
2021-09-14 18:31:16 +00:00
Ali Mohammad Pur
44cc6e1662
Profiler: Make the ProfileModel searchable
...
Note that this only searches the items at the same level as the selected
index.
2021-09-14 21:33:15 +04:30
Ali Mohammad Pur
bf0315ff8f
LibRegex: Avoid excessive Vector copy when compiling regexps
...
Previously we would've copied the bytecode instead of moving the chunks
around, use the fancy new DisjointChunks<T> abstraction to make that
happen automagically.
This decreases vector copies and uses of memmove() by nearly 10x :^)
2021-09-14 21:33:15 +04:30
Ali Mohammad Pur
7e75a16e6f
Meta: Tweak the error in check-ak-test-files.sh a bit
...
This can also be tripped when the change was simply not being committed,
avoid confusing the author by simply mentioning that.
2021-09-14 21:33:15 +04:30
Ali Mohammad Pur
ccb53c64e9
AK: Add an abstraction over multiple disjoint buffers
...
DisjointChunks<T> provides a nice interface over multiple sequential
Vector<T>'s, allowing the user to iterate over/index into/slice from
said buffers as if they were a single contiguous buffer.
To work with views on such objects, DisjointSpans<T> is provided, which
has the same behaviour but does not own the underlying objects.
2021-09-14 21:33:15 +04:30
Andreas Kling
910de95e7a
LibJS: Add a fast failure path to try_parse_arrow_function_expression()
...
The save/load of parser state performed by lookahead parsing is quite
expensive so let's try to avoid it in the most common case.
This is a 15-20% speedup on various chunks of JS I've tested. :^)
2021-09-14 02:51:16 +02:00
Linus Groh
a50e33abe3
LibJS: Skip ID_{Start,Continue} property lookup for any ASCII characters
...
Before this change, Lexer::is_identifier_{start,middle}() would do a
Unicode property lookup via Unicode::code_point_has_property() quite
frequently, especially for common characters like .,;{}[]() etc.
Since these and any other ASCII characters not covered by the alpha /
alphanumeric check are known to not have the ID_Start / ID_Continue
(except '_', which is special-cased now) properties, we can easily
avoid this function call.
2021-09-14 02:48:57 +02:00
Luke Wilde
e4d97add3d
LibWeb: Implement ParentNode.children
...
Required by Web Platform Tests for the innerHTML/outerHTML tests.
2021-09-14 02:09:18 +02:00
Luke Wilde
8e0f3436a2
LibWeb: Make the innerHTML setter spec compliant
...
This adds innerHTML to ShadowRoot in the process.
2021-09-14 02:09:18 +02:00
Luke Wilde
f62477c093
LibWeb: Implement HTML fragment serialisation and use it in innerHTML
...
The previous implementation was about a half implementation and was
tied to Element::innerHTML. This separates it and puts it into
HTMLDocumentParser, as this is in the parsing section of the spec.
This provides a near finished HTML fragment serialisation algorithm,
bar namespaces in attributes and the `is` value.
2021-09-14 02:09:18 +02:00
Idan Horowitz
ed5128d759
LibWeb: Add the URL::{protocol, pathname, search, hash} attributes
2021-09-14 00:14:45 +02:00
Idan Horowitz
7f9818bcbc
LibWeb: Add the URL::host, URL::hostname & URL:port attributes
2021-09-14 00:14:45 +02:00
Idan Horowitz
e89320887e
LibWeb: Add the URL::username, URL::password & URL::origin attributes
2021-09-14 00:14:45 +02:00
Idan Horowitz
fe32c9c3bd
LibWeb: Add the URL::searchParams attribute
2021-09-14 00:14:45 +02:00
Idan Horowitz
1841fbd3e4
LibWeb: Add the URL::href attribute and URL::to_json method
2021-09-14 00:14:45 +02:00
Idan Horowitz
e6abc1b44e
LibWeb: Add a bare implementation of the URL built-in
...
This only has the constructor implemented for now.
2021-09-14 00:14:45 +02:00
Idan Horowitz
30849b10d5
AK: Move the path argument of URL::append_path instead of copying it
2021-09-14 00:14:45 +02:00
Idan Horowitz
d6cfa34667
AK: Make URL::m_port an Optional<u16>, Expose raw port getter
...
Our current way of signalling a missing port with m_port == 0 was
lacking, as 0 is a valid port number in URLs.
2021-09-14 00:14:45 +02:00
Idan Horowitz
1c9c43785d
AK: Add URL::cannot_have_a_username_or_password_or_port
...
As defined by the URL specification:
https://url.spec.whatwg.org/#cannot-have-a-username-password-port
2021-09-14 00:14:45 +02:00
Idan Horowitz
929af64a67
AK: Change URL::cannot_be_a_base_url, URL::is_valid return type to bool
...
There's no need to return a const reference (8 bytes) when the value is
always used as a temporary bool (1 byte).
2021-09-14 00:14:45 +02:00
Idan Horowitz
55b67ba7a7
AK: Accept optional url and state override parameters in URLParser
...
These are required in the specification and used by the web's URL
built-in, this commit also removes the Badge<AK::URL> from URLParser
to allow other classes that need to call the parser directly like the
web's URL built-in to do so.
2021-09-14 00:14:45 +02:00
Idan Horowitz
6fa4fc8353
AK: Add URL::serialize_origin based on HTML's origin definition
2021-09-14 00:14:45 +02:00
Idan Horowitz
af5b62d8cd
LibWeb: Move url_{encode, decode} to URL/URLSearchParams.{h, cpp}
...
The new URL built-in that will reside in URL.{h, cpp} will have an
URLSearchParams member, which means it has to include its header, and
as such URLSearchParams.h can't include URL's header, which it needs as
it uses the url_{encode, decode} functions.
2021-09-14 00:14:45 +02:00
Idan Horowitz
23997005cf
LibWeb: Allow IDL attribute setters to throw DOMExceptions
2021-09-14 00:14:45 +02:00
Idan Horowitz
f9a169380c
LibWeb: Consume the extra whitespace in stringifier attributes
2021-09-14 00:14:45 +02:00
Mustafa Quraish
0f749681a9
Everywhere: Use my fancy new serenityos.org email :^)
2021-09-13 20:51:50 +00:00
Andreas Kling
268b36e2d1
Meta: Add Mustafa Quraish to the contributors list :^)
2021-09-13 22:21:57 +02:00
Andreas Kling
bf86419979
LibWeb: Use ComputedCSSStyleDeclaration to generate data for inspector
2021-09-13 22:21:57 +02:00
Andreas Kling
2e4b34b8c3
LibWeb: Generate CSS::{first,last}_property_id constants
...
These will allow us to iterate through all known CSS properties.
2021-09-13 22:21:57 +02:00
Andreas Kling
3ca2e701e6
LibJS: Log scripts parsed by JS::Script::parse() and how long it took
2021-09-13 22:21:57 +02:00