Commit graph

13835 commits

Author SHA1 Message Date
MacDue
bbc149ebb9 Meta+Userland: Pass Gfx::Color by value
Gfx::Color is always 4 bytes (it's just a wrapper over u32) it's less
work just to pass the color directly.

This also updates IPCCompiler to prevent from generating
Gfx::Color const &, which makes replacement easier.
2022-12-07 11:48:27 +01:00
Marcus Nilsson
f76c7f3788 LibGL: Generate GL_OUT_OF_MEMORY error in glBufferData when OOM 2022-12-07 11:46:37 +01:00
Linus Groh
54abfcf835 LibJS: Remove redundant AK_MAKE_NON{COPYABLE,MOVABLE} from Symbol class
These are already applied to the Cell base class.
2022-12-07 09:58:59 +00:00
Linus Groh
f490ba13ff LibJS: Move creation of global symbols into Symbol.for()
This is now according to the spec. Having a non-standard lookup API
that creates symbols on the fly doesn't seem ideal.
2022-12-07 09:58:59 +00:00
Linus Groh
b821356ba6 LibJS: Add const/non-const VM::global_symbol_registry() getters
This will allow us to replace the strange get_global_symbol() API that
creates symbols on the fly when not found.
2022-12-07 09:58:59 +00:00
Linus Groh
d5457375e6 LibJS: Store NonnullGCPtr<Symbol> values in m_global_symbol_registry 2022-12-07 09:58:59 +00:00
Linus Groh
2c579ed0df LibJS: Rename m_global_symbol_map to m_global_symbol_registry
The spec calls it "GlobalSymbolRegistry".
2022-12-07 09:58:59 +00:00
Linus Groh
112b3f7342 LibJS: Convert MarkupGenerator to the new String 2022-12-07 09:58:38 +00:00
Linus Groh
daec065fde LibJS: Move initialize_instance_elements() from VM to Object
This makes more sense as an Object method rather than living within the
VM class for no good reason. Most of the other 7.3.xx AOs already work
the same way.
Also add spec comments while we're here.
2022-12-07 00:23:51 +00:00
Linus Groh
cdeaced54e LibJS: Add spec link and comment to VM::execution_context_stack() 2022-12-07 00:14:10 +00:00
Linus Groh
91a9f41155 LibJS: Add spec link and comment to VM::running_execution_context() 2022-12-07 00:14:01 +00:00
Linus Groh
1832474a37 LibJS: Remove forgotten VM::construct() declaration
This has been a standalone AO function for a long time now.
2022-12-06 23:46:47 +00:00
Linus Groh
1f4437ff2b LibJS: Remove unused VM::join_arguments() function
The last uses of this were removed in ff5e07d.
2022-12-06 23:45:24 +00:00
Linus Groh
c756585deb LibWeb: Ignore -Wshadow in TRY_OR_RETURN_OOM() 2022-12-06 21:31:00 +00:00
Hendiadyoin1
fcc3348bc8 LibJS: Intercept returns through finally blocks in Bytecode
This is still not perfect, as we now actually crash in the
`try-finally-continue` tests, while we now succeed all
`try-catch-finally-*` tests.

Note that we do not yet go through the finally block when exiting the
unwind context through a break or continue.
2022-12-06 16:09:24 +03:30
Hendiadyoin1
c2108489a5 LibJS: Don't try to manage unwind contexts in the execution loop in BC
We are already doing this in a good manner via the generated code,
doing so in the execution loop as well will cause us to pop contexts
multiple times, which is not very good.
2022-12-06 16:09:24 +03:30
Hendiadyoin1
133faa0acc LibJS: Remove FinishUnwind instruction
This is essentially a LeaveUnwind+Jump, so lets just do that, that will
make it easier to optimize it, or see unwind state transitions
2022-12-06 16:09:24 +03:30
Hendiadyoin1
fc332be2e5 LibJS: Leave unwind contexts on enter of finally blocks in Bytecode
Before we were doing so while exiting the catch-block, but not when
exiting the try-block.
This now centralizes the responsibility to exit the unwind context to
the finalizer, ignoring return/break/continue.
This makes it easier to handle the return case in a future commit.
2022-12-06 16:09:24 +03:30
Linus Groh
57dc179b1f Everywhere: Rename to_{string => deprecated_string}() where applicable
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
2022-12-06 08:54:33 +01:00
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
Aliaksandr Kalenik
f74251606d LibWeb: Do not try to place out-of-flow blocks in anonymous nodes
Currently placing floating blocks in anonymous nodes makes
https://stackoverflow.com/ hang so let's leave it to try
to place only absolute blocks in anonymous nodes for now.

Also it breaks flex formatting when element with floating is
flex child.
2022-12-06 08:53:10 +01:00
Tim Schumacher
312a41fddf LibAudio: Use NonnullOwnPtr to keep track of LoaderPlugin streams
This doesn't have any immediate uses, but this adapts the code a bit
more to `Core::Stream` conventions (as most functions there use
NonnullOwnPtr to handle streams) and it makes it a bit clearer that this
pointer isn't actually supposed to be null. In fact, MP3LoaderPlugin
and FlacLoaderPlugin apparently forgot to check for that completely
before starting to decode data.
2022-12-05 17:49:47 +01:00
Tim Schumacher
c57be0f474 LibAudio: Switch LoaderPlugin to a more traditional constructor pattern
This now prepares all the needed (fallible) components before actually
constructing a LoaderPlugin object, so we are no longer filling them in
at an arbitrary later point in time.
2022-12-05 17:49:47 +01:00
Tim Schumacher
3cf93d0dd2 LibAudio: Stop passing Bytes by reference
`Bytes` is very slim, so the memory and/or performance gains from
passing it by reference isn't that big, and it passing it by value is
more compatible with xvalues, which is handy for things like
`::try_create(buffer.bytes())`.
2022-12-05 17:49:47 +01:00
MacDue
385ba1280b LibWeb: Fix box-shadows where the border-radius is < the blur-radius
This fixes a rendering issue where box-shadows would not appear or
render completely broken if the blur radius was larger than the
border radius (border-radius < 2 * blur-radius to be exact).
2022-12-05 17:48:51 +01:00
Aliaksandr Kalenik
ca123350cc LibWeb: Inherit TableFormattingContext from FC instead of BFC 2022-12-05 17:47:48 +01:00
Aliaksandr Kalenik
fae0b96fe4 LibWeb: Add vertical-align support for table cells 2022-12-05 17:47:48 +01:00
Aliaksandr Kalenik
ba64d0462c LibWeb: Move box_baseline from LineBuilder.cpp to LayoutState.cpp 2022-12-05 17:47:48 +01:00
Aliaksandr Kalenik
2f38f8c84a LibWeb: Implement intrinsic width calculation for TFC 2022-12-05 17:47:48 +01:00
Aliaksandr Kalenik
dbf76e8ae1 LibWeb: Take rowspan into account while table formatting 2022-12-05 17:47:48 +01:00
Aliaksandr Kalenik
1c6783cd7e LibWeb: Start implementation of CSS Table 3 spec
Here I try to address bug where content of table overflows
it's width (hacker news is an example of such site) by
reimplementing some parts of table formatting context.

Now TFC implements first steps of:
https://www.w3.org/TR/css-tables-3/#table-layout-algorithm
but column width and row height distribution steps are
still very incomplete.
2022-12-05 17:47:48 +01:00
Cameron Youell
4e3b965d7f LibGUI: Fix a typo 2022-12-05 13:59:00 +00:00
Victor Song
88ecc4a1e5 WebContent+WebDriver: Implement POST /session/{id}/window endpoint 2022-12-04 09:33:55 -05:00
Štěpán Balážik
e3112a3d2e LibGUI: Swap Next and Previous button on IncrementalSearchBanner
This order seems more natural as it is used in basically all apps on
other systems (e.g. Firefox, CLion,...).
2022-12-04 10:46:30 +01:00
Linus Groh
babfc13c84 Everywhere: Remove 'clang-format off' comments that are no longer needed
https://github.com/SerenityOS/serenity/pull/15654#issuecomment-1322554496
2022-12-03 23:52:23 +00:00
Linus Groh
d26aabff04 Everywhere: Run clang-format 2022-12-03 23:52:23 +00:00
Linus Groh
0d63b7a515 LibCodeComprehension: Add .clang-format to disable formatting for tests
Same as 42865b8975.
2022-12-03 23:52:23 +00:00
Andrew Kaster
ad9c24ffc2 LibC: Add definitions for missing ELF constants
Qt 6.4.0 relies on the definitions of ELFOSABI_GNU, ELFOSABI_AIX, and
EM_S390 existing.
2022-12-03 23:16:16 +00:00
davidot
cf0d30add6 LibJS: Add a function to ensure calls are made within the same second
Before these tests could be flaky if they happened to be called around
the edge of a second. Now we try up to 5 times to execute the tests
while staying within the same second.
2022-12-03 23:04:08 +00:00
Taj Morton
146d45a652 LibC: Return h_aliases array from gethostbyname() and gethostbyaddr()
The hostent struct's h_aliases field conventionally contains a pointer
to an array of alternate hostnames, where the final entry in this array
is a nullptr (signifying the end of the list).
At least one POSIX application (Pine email client) does not expect
`h_aliases` itself to be nullptr.
2022-12-03 22:12:13 +00:00
MacDue
6dbe7b06b3 LibWeb: Fix integer overflow in gradient painting
This would cause rendering glitches at the edges of gradients (at
certain angles).
2022-12-03 16:05:02 +00:00
MacDue
40e978df85 LibGfx: Fix some more antialiased line off-by-ones
Turns out most things expect lines to include the endpoint,
e.g. 0,0 -> 3,0 is a 4px long line. But the fill_path() implementation
seems to expect the line to be the distance between the two points
(so the above example is a 3px line instead).

This now adds an option to pick between PointToPoint line length or
Distance line length and uses the latter for fill_path().
2022-12-03 15:36:58 +00:00
MacDue
acc0fceaae LibGfx: Remove some unused AntiAliasingPainter methods 2022-12-03 15:36:58 +00:00
MacDue
b85af4e9bf LibGfx: Add some AntiAliasingPainter FIXMEs
Also fixup the style on some comments.

See #16270... Hopefully someone will land on these :^)
2022-12-03 15:36:58 +00:00
Hendiadyoin1
eb50969781 LibJS: Add an EliminateLoads pass to Bytecode
This pass tries to eliminate repeated lookups of variables by name, by
remembering where these where last loaded to.

For now the lookup cache needs to be fully cleared with each call or
property access, because we do not have a way to check if these have any
side effects on the currently visible scopes.

Note that property accesses can cause getters/setters to be called, so
these are treated as calls in all cases.
2022-12-03 15:25:05 +00:00
Hendiadyoin1
fafe498238 LibJS: Expose some internals of Instructions
These will be needed in the future to allow optimization passes to check
against these
2022-12-03 15:25:05 +00:00
Hendiadyoin1
fd6e75fd01 LibJS: Add a way to replace references to registers in Bytecode 2022-12-03 15:25:05 +00:00
Hendiadyoin1
f5e7fa4d0e LibJS: Make Register comparable 2022-12-03 15:25:05 +00:00
MacDue
28028be2fc LibWeb: Support repeating-radial-gradient()s 2022-12-03 09:06:51 -05:00
Hendiadyoin1
186237aec8 LibJS: Don't try to merge blocks not ending in Jumps 2022-12-03 17:07:30 +03:30