Commit Graph

28198 Commits

Author SHA1 Message Date
Tobias Christiansen
610f14992a LibWeb: Flexbox: Wrap inline Nodes if their parent is display: flex 2021-09-29 17:55:57 +02:00
Luke Wilde
881e9d1341 LibWeb: Make StyleSheetList.item an IDL getter 2021-09-29 14:57:59 +01:00
Ali Mohammad Pur
398435277b RequestServer: Use an OwnPtr for cached connections
Otherwise we'd end up trying to delete the wrong connection if a
connection made before us is deleted.
Fixes _some_ RequestServer spins (though not all...).
This commit also adds a small debug mechanism to RequestServer (which
can be enabled by turning REQUEST_SERVER_DEBUG on), that can dump all
the current active connections in the cache, what they're doing, and how
long they've been doing that by sending it a SIGINFO.
2021-09-29 11:47:18 +02:00
Liav A
ef9b8ff0c7 Kernel/PCI: Remove all macros and replace them with enum classes 2021-09-29 11:24:33 +02:00
Liav A
9d9d57056e Kernel/PCI: Remove Address from enumeration callback
If we need that address, we can always get it from the DeviceIdentifier.
2021-09-29 11:24:33 +02:00
Liav A
a411a44fda Kernel/PCI: Cache interrupt line and interrupt pin of a device
This allows us to remove the PCI::get_interrupt_line API function. As a
result, this removes a bunch of not so great patterns that we used to
cache PCI interrupt line in many IRQHandler derived classes instead of
just using interrupt_number method of IRQHandler class.
2021-09-29 11:24:33 +02:00
Liav A
057f5a12c2 Kernel/PCI: Propagate usage of DeviceIdentifier everywhere
This allows us to remove a bunch of PCI API functions, and instead to
leverage the cached data from DeviceIdentifier object in many places.
2021-09-29 11:24:33 +02:00
Liav A
da327746a2 Kernel: Rename two PCI components
Rename ID => HardwareID, and PhysicalID => DeviceIdentifier.
This change merely does that to clarify what these objects really are.
2021-09-29 11:24:33 +02:00
Liav A
82bb08a15c Kernel/PCI: Cache more details about PCI devices when enumerating them
There's no good reason to fetch these values each time we need them.
2021-09-29 11:24:33 +02:00
Idan Horowitz
e22d9dc360 LibWeb: Add the missing EventInit property to Event constructor 2021-09-29 10:09:33 +03:00
Idan Horowitz
071a358ffb LibWeb: Add support for converting IDL dictionaries to native structs 2021-09-29 10:09:33 +03:00
Idan Horowitz
5ce468338e LibJS: Drop the Temporal prefix from TemporalMissingRequiredProperty
This allows us to use it for other exposed JS APIs that accept options
objects.
2021-09-29 10:09:33 +03:00
Idan Horowitz
c3810b827a LibWeb: Add support for parsing IDL dictionaries 2021-09-29 10:09:33 +03:00
Idan Horowitz
87f655f2af LibWeb: Change IDL::parse_interface's return type to NonnullOwnPtr
We always returned an interface, so there's no need for the null state.
2021-09-29 10:09:33 +03:00
Ali Mohammad Pur
2020ced9f1 RequestServer: Correctly start preconnected TLS sockets
We need to set the root certificates, and tell the connection cache that
the preconnect job finished (otherwise it would spin forever, waiting
for us to tell it that).
2021-09-29 00:47:54 +02:00
Andreas Kling
63d971d33b LibWeb: Support window.screen{X,Y,Left,Top}
Some sites query these properties for whatever reason, so let's support
them. (But let's always pretend the screen coordinates are (0, 0))
2021-09-29 00:22:46 +02:00
Andreas Kling
0a90d466a0 LibWeb: Expose CSSStyleDeclaration on the window object 2021-09-28 23:28:44 +02:00
Andreas Kling
651f30dfbe WebContent: Coalesce paint invalidations to avoid spamming client
Some content cause a lot of paint invalidations (e.g someone drawing to
a <canvas> repeatedly) and we don't need to spam the client about this.
Instead, accumulate a dirty rect, and send it once per event loop step.
2021-09-28 22:53:59 +02:00
Andreas Kling
82af69376b LibJS: Avoid unnecessary HashMap copy in FunctionEnvironment 2021-09-28 22:32:40 +02:00
Andreas Kling
d294a3f54a LibJS: Avoid unnecessary HashMap growth in Interpreter::enter_scope()
Don't bother pre-allocating a hash map if we're not gonna put anything
into it anyway.
2021-09-28 22:32:40 +02:00
Andreas Kling
5855b19ff3 LibJS: Avoid unnecessary HashMap copy in ECMAScriptFunctionObject 2021-09-28 22:32:40 +02:00
Ali Mohammad Pur
3d24850db5 LibTLS: Mark the connection as finished and disconnected on TLS error 2021-09-28 22:32:31 +02:00
Ali Mohammad Pur
f0e2c517fc LibWeb: Implement the dns-prefetch and preconnect link relationships 2021-09-28 22:32:31 +02:00
Ali Mohammad Pur
e9b9f89e70 LibWeb: Use Document::parse_url() for preload links 2021-09-28 22:32:31 +02:00
Ali Mohammad Pur
3ec39fc62e RequestServer+LibProtocol: Add an 'EnsureConnection' IPC endpoint
This will allow LibWeb (and other components) to request a connection to
be premade and cached, to make subsequent loads faster.
2021-09-28 22:32:31 +02:00
Andreas Kling
6b2e4f896b LibDebug: Add missing break in AddressRanges::for_each_range() 2021-09-28 18:05:42 +02:00
Rodrigo Tobar
a8fae3d2c8 LibPthread: Add first test cases for RWlock 2021-09-28 18:36:20 +03:30
Rodrigo Tobar
69b64a6b04 AK: Accept StringView in LexicalPath::join
The first argument for LexicalPath::join was a String const&, which
resulted in an unnecessary memory copy when invoked with a StringView.
Changing the type of the parameter to StringView avoids the extra cost.

This was noticed while working on #10230.
2021-09-28 18:06:06 +03:00
Andreas Kling
0af0ee4293 LibWeb: Fire "keyup" events as well :^)
This was easy, now that we have KeyboardEvent.
2021-09-28 16:56:24 +02:00
Andreas Kling
554c344ffe LibWeb: Add a basic KeyboardEvent and fire "keydown" events :^) 2021-09-28 16:56:24 +02:00
Itamar
09153b8997 LibDebug: Use DW_AT_ranges to get address ranges of DIEs
Previously, we only supported DIEs with a contiguous address ranges and
ignored ones with a non-contiguous set of ranges.

We now check if a DIE has the DW_AT_ranges attribute, and if it does we
parse its range list.

This improves the quality of our backtraces - we previously missed many
inlined function calls because their DIEs had non-contigues address
ranges.
2021-09-28 16:54:39 +02:00
Itamar
26a96d315d LibDebug: Support parsing non-contiguous DWARF address ranges
This adds support for parsing DWARF "range lists", which are identified
by the DW_AT_ranges form.

They contain code addresses for DIEs whose location is not contiguous.
2021-09-28 16:54:39 +02:00
Itamar
2b04a86d4d LibDebug: Add Dwarf::CompilationUnit::base_address()
The base address of the compilation unit is used in some range lists
entry types.
2021-09-28 16:54:39 +02:00
Idan Horowitz
01417c82c5 LibWeb: Make URLSearchParams iterable
This uses the new support for the iterable IDL property.
2021-09-28 16:51:27 +02:00
Idan Horowitz
14e99b9b68 LibJS: Change create_iterator_result_object's return type to Object*
This always returns an Object, so there's no reason to return a less
explicit Value.
2021-09-28 16:51:27 +02:00
Idan Horowitz
cdde3ba5c5 LibWeb: Add partial support for IDL Iterable declarations
This currently only supports pair iterables (i.e. iterable<key, value>)
support for value iterables (i.e. iterable<value>) is left as TODO().

Since currently our cmake setup calls the WrapperGenerator separately
and unconditionally for each (hard-coded) output file iterable wrappers
have to be explicitly marked so in the CMakeLists.txt declaration, we
could likely improve this in the future by querying WrapperGenerator
for the outputs based on the IDL.
2021-09-28 16:51:27 +02:00
Idan Horowitz
2fab43ba5d LibWeb: Add support for wrapping arbitrary values to WrapperGenerator
This patch essentially just splits the non return-specific logic from
generate_return_statement (i.e. the wrapping of the cpp value into
a javascript one) into a separate function generate_wrap_statement that
can be used to wrap any cpp value during wrapper generation.
2021-09-28 16:51:27 +02:00
Idan Horowitz
a11f7868a4 LibWeb: Only consume [a-zA-Z0-9_] characters for IDL types 2021-09-28 16:51:27 +02:00
Ali Mohammad Pur
72a45a472a LibPthread: Correct nonsensical loop exit condition in RWLock unlock
The loop should terminate after the exchange happens, we shouldn't
repeat the operation until the count hits zero.
Fixes #10241.
2021-09-28 12:34:51 +03:30
Ali Mohammad Pur
b63ea3bad1 LibPthread: Calculate the correct lock value in RWLock {rd,un}lock
The previous version was putting the old count in the control bits,
which is all kinds of wrong.
2021-09-28 12:32:46 +03:30
Brian Gianforcaro
ca7bb812f6 Meta: Explicitly disable caching in the Sonar Cloud workflow
Sonar Cloud raises a warning if this is not Explicitly enabled or
disabled, so lets mark it disabled to avoid that.
2021-09-28 10:58:09 +02:00
Brian Gianforcaro
ea2d68d14b Assistant: Zero initialize fuzzy match array
SonarCloud flagged the read of the matches array as a potential garbage
read. I don't believe the case it flagged was possible to reach due to
how the code is structured, however we should really just be zero
initializing these stack arrays.
2021-09-28 10:58:09 +02:00
Brian Gianforcaro
998234f9e9 LibCpp: Remove redundant comparison to Token::Type::PipePipe
SonarCloud flagged this 'Identical sub-expressions on both sides of
operator "||"'. When looking at the git history it looks like it was
just a copy / paste mistake that happened when Token::Type::Arrow
support was added.
2021-09-28 10:58:09 +02:00
Brian Gianforcaro
69bc04d870 LibDSP: Remove unused Effects::Delay::m_old_delay_size member
SonarCloud flagged this as m_delay_buffer is technically uninitialized
at the point at which the POD types are initialized in a constructor.

I don't check to see if this was actually a real issue, as the member
is ultimately unused. So lets just get rid of it.
2021-09-28 10:58:09 +02:00
Brian Gianforcaro
8fcdc255ff man: Add "-z seperate-code" to man7/Mitigations.md
Update the mitigations documentation with the lateest mitigation.
2021-09-28 10:57:00 +02:00
Brian Gianforcaro
afb09e84db Documentation: Add AK::SourceLocation pattern to Patterns.md
Document the emergent pattern of using `SourceLocation` for capture
file, line, function name information when calling an API.
2021-09-28 10:57:00 +02:00
Brian Gianforcaro
f71f1d66d6 Documentation: Add operator"" sv pattern to Patterns.md 2021-09-28 10:57:00 +02:00
Rodrigo Tobar
ad33efbc8c SystemMonitor: Unveil /usr/local/lib
This is necessary to symbolicate libraries installed under
/usr/local/lib.
2021-09-28 10:55:14 +02:00
Rodrigo Tobar
12e18e44ae LibSymbolication: Look for libraries under /usr/local/lib
While trying to investigate a problem with the ssl module in the python
port I found that the SystemMonitor Stack tab for a process wouldn't
show the symbols for the libssl and libcrypto shared libraries that are
installed under /usr/local/lib. The main reason for this is that
LibSymbolication didn't look for libraries under /usr/local/lib.

This commit adds support for looking for libraries under /usr/local/lib.
Absolute paths are still respected, and lookup gives precedence to
/usr/lib, just like dynamic linker does.
2021-09-28 10:55:14 +02:00
Rodrigo Tobar
f4ebcf4867 LibSymbolication: Return empty value on error
This was probably the intended behavior, but a return statement was
missing.
2021-09-28 10:55:14 +02:00