summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2021-10-27LibWeb: Remove Layout::Box::width_of_logical_containing_block()Andreas Kling
This was a hack to percentages within tables relative to the nearest table-row ancestor instead of the nearest table container. That didn't actually make sense, so this patch simply removes the hack in favor of containing_block()->width().
2021-10-27LibWeb: Add fast_is<T>() for HTML::HTMLHtmlElementAndreas Kling
Another one spotted in a scroll-up-and-down profile.
2021-10-27LibWeb: Add fast_is<T>() for Layout::LabelAndreas Kling
Spotted this in a profile while wheel scrolling up & down.
2021-10-27Kernel + WindowServer: Re-define the interface to framebuffer devicesLiav A
We create a base class called GenericFramebufferDevice, which defines all the virtual functions that must be implemented by a FramebufferDevice. Then, we make the VirtIO FramebufferDevice and other FramebufferDevice implementations inherit from it. The most important consequence of rearranging the classes is that we now have one IOCTL method, so all drivers should be committed to not override the IOCTL method or make their own IOCTLs of FramebufferDevice. All graphical IOCTLs are known to all FramebufferDevices, and it's up to the specific implementation whether to support them or discard them (so we require extensive usage of KResult and KResultOr, together with virtual characteristic functions). As a result, the interface is much cleaner and understandable to read.
2021-10-26LibWeb: Implement URLSearchParams.getAllLuke Wilde
2021-10-26LibJS: Clarify mathematical types in Temporal AOs and functionsLinus Groh
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/e480d40
2021-10-26LibWeb: Fix inline blocks swallowing trailing whitespaceFelix Rauch
In #10434 an issue with leading whitespace in new lines after a <br> element was fixed by checking whether the last fragment of LineBox is empty. However, this introduced a regression by which whitespace following inline elements was swallowed, so `<b>Test</b> 123` would appear like `Test123`. By asking specifically if we are handling a forced linebreak instead of implicity asking for a property that may be shared by other Node types, we can maintain the correct behavior in regards to leading whitespace on new lines, as well as trailing whitespace of inline elements.
2021-10-26LibC: Remove debug spam from openpty()Andreas Kling
2021-10-25LibCore: Add File::size()Leandro Pereira
Returns the size in bytes for a file path given its filename. Useful when file size is needed without having to open the file to query it using fstat() or seeking to the end.
2021-10-25Kernel+LibC: Default to 8-bit characters in TTYDaniel Bertalan
Some ports (like `bc` with history enabled) sensibly set the termios character size to 8 bits. Previously, we left the character size value (given by the bitmask CSIZE) as zero by default (meaning 5 bits per character), and returned ENOTIMPL whenever someone modified it. This was dumb.
2021-10-25LibJS: Support calling result of a computed MemberExpression in bytecodeAndreas Kling
This patch adds support for calls of the form o.f[expr]()
2021-10-25LibJS: Simplify MemberExpression::generate_bytecode()Andreas Kling
Use the get-from-reference helper in BytecodeGenerator.
2021-10-25LibJS: Tweak Value::to_property_key() fast path for Int32Andreas Kling
Move the check for Int32 *before* we call to_primitive().
2021-10-25LibJS: Support more assignment expressions in the bytecode VMAndreas Kling
Use the new reference get/put helpers in BytecodeGenerator to support assignment expressions other than just plain assignment.
2021-10-25LibJS: Generate bytecode for UpdateExpression with MemberExpression argAndreas Kling
2021-10-25LibJS: Add BytecodeGenerator helpers for reference get/putAndreas Kling
This allows code sharing between all AST nodes that want to get and/or put through a reference.
2021-10-25LibJS: Add fast paths for <, >, <=, and >= with Int32 on both sidesAndreas Kling
This gives us a ~5% speed-up on Kraken's ai-astar.js
2021-10-25LibJS: Always inline the bytecode instruction iterator's operator++Andreas Kling
2021-10-25LibJS: Add default constructor for PrivateNameAndreas Kling
This avoids a round-trip through FlyString("") for every Reference.
2021-10-25LibSQL: Add better error handling to `evaluate` and `execute` methodsJan de Visser
There was a lot of `VERIFY_NOT_REACHED` error handling going on. Fixed most of those. A bit of a caveat is that after every `evaluate` call for expressions that are part of a statement the error status of the `SQLResult` return value must be called.
2021-10-25LibSQL: First cut of SQL `WHERE` clauseJan de Visser
Filters matching rows by doing a table scan and evaluating the `WHERE` expression for every row. Does not use indexes, for one because they do not exist yet.
2021-10-25LibSQL: Implement evaluate() method of BinaryOperatorExpressionJan de Visser
Mostly just calls the appropriate methods on the Value objects. Exception are the `Concatenate` (string concat), and the logical `and` and `or` operators which are implemented directly in `BinaryOperatorExpression::evaluate`
2021-10-25LibSQL: Implement binary operators for Value objectsJan de Visser
The behaviour of the various operators is supposed to mimic that of the same operators in PostgreSQL; the '+' operator for example will successfully add '98' (string) and 2 (integer), but not 'foo' and 2. Also removed some redundant const& parameter declarations for intrinsic types (ints and doubles etc). Passing those by const& doesn't make a lot of sense.
2021-10-25LibJS: Propagate exceptions across bytecode executable boundariesAndreas Kling
To support situations like this: function foo() { throw 1; } try { foo(); } catch (e) { } Each unwind context now keeps track of its origin executable. When an exception is thrown, we return from run() immediately if the nearest unwind context isn't in the current executable. This causes a natural unwind to the point where we find the catch/finally block(s) to jump into.
2021-10-25LibJS: Make eval() code run in the bytecode VMAndreas Kling
If we have an active bytecode interpreter, let's make eval() use it.
2021-10-25LibJS: Make bytecode interpreter leave unwind context immediatelyAndreas Kling
We were missing some "break" statements, causing us to actually finish executing everything within "try" blocks before actually jumping to the "catch" and/or "finally" blocks.
2021-10-25LibJS: Make bytecode VM throw TypeError on attempt to call non-callableAndreas Kling
This isn't perfect, but allows us to progress instead of crashing in the TODO().
2021-10-25LibJS: Fix bogus bytecode codegen for "catch" parametersAndreas Kling
Add a missing '!' so that catch clauses with a named parameter actually generate a SetVariable opcode.
2021-10-25LibX86: Take load base address into consideration during disassemblyDaniel Bertalan
Since our executables are position-independent, the address values extraced from processes don't correspond to their values within the ELF file. We have to offset the absolute addresses by the load base address to get the relative symbol that we need for disassembly.
2021-10-24LibC: Fix `%n` conversion specifier in scanf() formatJelle Raaijmakers
Also add a test to prevent this from happening again. There were two bugs: * The number of bytes just after processing the last value was written, instead of the number of bytes after skipping remaining whitespace. Confirmed by testing against GNU's `scanf()` since the man page leaves something to be desired. * The number of bytes was written to the wrong variable argument; i.e. the first argument was overwritten.
2021-10-24LibTest: Introduce a macro to only compare truthinessTim Schumacher
2021-10-24LibHTTP: Reset m_content_length if there's a Transfer-Encoding headerKarol Kosek
2021-10-24LibHTTP: Trim the last packet if it exceeded the Content-Length valueKarol Kosek
Used these commands to test it: printf 'HTTP/1.0 200 OK\r\n%s\r\n\r\n%s' 'Content-Length: 4' \ 'well hello friends!' | nc -lN 0.0.0.0 8000 pro http://0.0.0.0:8000
2021-10-24LibHTTP: Store Content-Length value in the HTTP Job classKarol Kosek
This way we can save some calculations, but more importantly this will also be needed in next commits. :P
2021-10-24LibHTTP: Fix buffer overflow when body is larger than the Content-LengthKarol Kosek
(Actually, this also needs a Content-Encoding header, as response streaming is disabled then. It didn't fit in the title.) We were creating too small buffer -- instead of assigning the total received buffer size, we were using the Content-Length value. As you can see, the m_buffered_size might now exceed the Content-Length value, but that will be handled in next commits, regardless if the response can be streamed or not. :^) Here's a minimal code that caused crash before: printf 'HTTP/1.0 200 OK\r\n%s\r\n%s\r\n\r\n%s' \ 'Content-Encoding: anything' 'Content-Length: 3' \ ':^)AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' | nc -lN 0.0.0.0 8000 pro http://0.0.0.0:8000
2021-10-24LibWeb: Remove now-unnecessary String copy when parsing CSS colorsSam Atkins
Color::from_string() now does a case-insensitive comparison of color names, so we don't need this copy. :^)
2021-10-24LibGfx: Make Color::from_string() case-insensitiveSam Atkins
This function implements CSS color syntax, which is case-insensitive in HTML contexts. Making it insensitive here means not having to remember to do it in every user, (many of the HTML elements do not do this,) and means they don't have to produce a lowercase copy of the input string before passing it.
2021-10-24LibGfx: Make Color use east-constSam Atkins
2021-10-24LibJS: Optimize Value::to_property_key() for numeric property namesAndreas Kling
If the Value is a non-negative Int32, create a numeric PropertyKey instead of making a string key. This makes "ai-astar" test from the Kraken benchmark run in 30 seconds, down from 42 seconds. :^)
2021-10-24LibJS: Make Value::to_property_key() return a JS::PropertyKeyAndreas Kling
Instead of returning JS::StringOrSymbol, which is a space-optimized type used in Shape property tables, this now returns JS::PropertyKey which is *not* space-optimized, but has other niceties like optimized storage of numeric ("indexed") properties.
2021-10-24LibJS: Provide default hash traits for JS::PropertyKeyAndreas Kling
Let's not require people to use PropertyNameTraits everywhere when we can just specialize AK::Traits<JS::PropertyKey> instead. :^)
2021-10-24LibJS: Use PropertyKey in MemberExpression::to_reference()Andreas Kling
2021-10-24LibJS: Make make_super_property_reference() take a PropertyKeyAndreas Kling
Let's get rid of StringOrSymbol usage outside of Shape.
2021-10-24LibJS: Rename PropertyName to PropertyKeyAndreas Kling
Let's use the same name as the spec. :^)
2021-10-24LibJS: Add the "fast non-local access" optimization to the bytecode VMAndreas Kling
The GetVariable bytecode op now caches environment coordinates for fast cross-scope variable lookup.
2021-10-24LibJS: Add a separate "identifier table" to bytecode executablesAndreas Kling
This is a specialized string table for storing identifiers only. Identifiers are always FlyStrings, which makes many common operations faster by allowing O(1) comparison.
2021-10-24LibJS: Use String and move semantics in Bytecode::StringTableAndreas Kling
Avoid creating new AK::String objects when we already have one.
2021-10-24LibJS: Implement 'this' in the bytecode VMAndreas Kling
ThisExpression now emits a "ResolveThisBinding" bytecode op, which simply loads the VM's current 'this' binding into the accumulator.
2021-10-24LibJS: Alphabetize the bytecode opcode listAndreas Kling
2021-10-24LibJS: Include executable name in bytecode dumpsAndreas Kling