summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-16LibJS: Change GetISOPartsFromEpoch's return type to ISODateTimeIdan Horowitz
This AO can't throw so its optional is never empty.
2021-09-16LibJS: Convert ZonedDateTime AOs to ThrowCompletionOrIdan Horowitz
2021-09-16LibJS: Convert ordinary_create_from_constructor<T> to ThrowCompletionOrIdan Horowitz
2021-09-16Revert "LibTLS: Close the underlying socket on EOF"Brian Gianforcaro
This reverts commit 23febbed41d8296cf9e532a17145822cd099b591. It breaks the TestTLSHandshake test used in CI, it causes it to hang, and all CI jobs have been hanging.
2021-09-16LibJS: Fix Clang Toolchain CI buildBrian Gianforcaro
Clang was failing because because it rightfully saw we were attempting to call a deleted constructor of `MarkedValueList`. If you explicitly called move(list) then GCC would complain that the move was unnecessary. For what ever reason both tool chains accept when we construct the ThrowCompletionOr explicitly that we move the list into and return that.
2021-09-16LibWeb: Don't dump full data URLs in ResourceLoader loggingAndreas Kling
Some pages use *really* large data URLs. :^)
2021-09-16LibWeb: Add fast_is<HTMLTemplateElement>()Andreas Kling
This was showing up as hot in profiles, as the HTML parser calls it quite a lot.
2021-09-16LibWeb: Move Attribute into the DOM namespaceAndreas Kling
2021-09-15LibJS: Use ThrowCompletionOr in get_prototype_from_constructor()Linus Groh
Also add spec step comments to it while we're here.
2021-09-15LibJS: Use ThrowCompletionOr in get_function_realm()Linus Groh
2021-09-15LibJS: Use ThrowCompletionOr in species_constructor()Linus Groh
Also add spec step comments to it as well as a missing exception check while we're here.
2021-09-15LibJS: Use ThrowCompletionOr in create_list_from_array_like()Linus Groh
Also add spec step comments to it while we're here.
2021-09-15LibJS: Use ThrowCompletionOr in require_object_coercible()Linus Groh
2021-09-15LibJS: Add a JS::Completion class and JS::ThrowCompletionOr<T> templateLinus Groh
We decided that we want to move away from throwing exceptions in AOs and regular functions implicitly and then returning some default-constructed value (usually an empty JS::Value) - this requires remembering to check for an exception at the call site, which is error-prone. It's also awkward for return values that cannot be default-constructed, e.g. MarkedValueList. Instead, the thrown value should be part of the function return value. The solution to this is moving closer to the spec and using something they call "completion records": https://tc39.es/ecma262/#sec-completion-record-specification-type This has various advantages: - It becomes crystal clear whether some AO can fail or not, and errors need to be handled and values unwrapped explicitly (for that reason compatibility with the TRY() macro is already built-in, and a similar TRY_OR_DISCARD() macro has been added specifically for use in LibJS, while the majority of functions doesn't return ThrowCompletionOr yet) - We no longer need to mix "valid" and "invalid" values of various types for the success and exception outcomes (e.g. null/non-null AK::String, empty/non-empty JS::Value) - Subsequently it's no longer possible to accidentally use an exception outcome return value as a success outcome return value (e.g. any AO that returns a numeric type would return 0 even after throwing an exception, at least before we started making use of Optional for that) - Eventually the VM will no longer need to store an exception, and temporarily clearing an exception (e.g. to call a function) becomes obsolete - instead, completions will simply propagate up to the caller outside of LibJS, which then can deal with it in any way - Similar to throw we'll be able to implement the functionality of break, continue, and return using completions, which will lead to easier to understand code and fewer workarounds - the current unwinding mechanism is not even remotely similar to the spec's approach The spec's NormalCompletion and ThrowCompletion AOs have been implemented as simple wrappers around the JS::Completion constructor. UpdateEmpty has been implemented as a JS::Completion method. There's also a new VM::throw_completion<T>() helper, which basically works like VM::throw_exception<T>() - it creates a T object (usually a JS::Error), and returns it wrapped in a JS::Completion of Type::Throw. Two temporary usage patterns have emerged: 1. Callee already returns ThrowCompletionOr, but caller doesn't: auto foo = TRY_OR_DISCARD(bar()); 2. Caller already returns ThrowCompletionOr, but callee doesn't: auto foo = bar(); if (auto* exception = vm.exception()) return throw_completion(exception->value()); Eventually all error handling and unwrapping can be done with just TRY() or possibly even operator? in the future :^) Co-authored-by: Andreas Kling <kling@serenityos.org>
2021-09-15AK: Rename the local variable in the TRY() macro to avoid name clashesLinus Groh
"result" is a tad bit too generic to provide a clash-free experience - we found instances in LibJS where this breaks already. Essentially this doesn't work: auto foo = TRY(bar(result)); Because it expands to the following within the TRY() scope: { auto result = bar(result); ... } And that of course fails: error: use of ‘result’ before deduction of ‘auto’ The simple solution here is to use a name that is much less likely to clash with anything used in the expression ("_temporary_result"). :^)
2021-09-15LibTLS: Increase the maximum socket read size to 4MiBAli Mohammad Pur
There's no reason to limit ourselves to 4KiB, this socket is not blocking anyway.
2021-09-15LibTLS: Close the underlying socket on EOFAli Mohammad Pur
There's no reason to keep waiting when there's nothing else to come. This makes RequestServer not spin on Core::Socket::read() (in some scenarios).
2021-09-15LibWeb: Avoid setting definite {width,height} when "auto" is specifiedTobias Christiansen
Auto is not specified at all.
2021-09-15LibWeb: Flexbox: Somewhat suppport "align-items"Tobias Christiansen
There probably are a lot of edge cases missing but this moves us forward at least a bit.
2021-09-15LibWeb: Flexbox: Make step 11 of the layout algorithm more align awareTobias Christiansen
2021-09-15LibWeb: Add proper parsing of the AlignItems propertyTobias Christiansen
This teaches all the relevant places about 'align-items'.
2021-09-15Meta: Make QtCreator aware of all CMake filesBen Wiederhake
2021-09-15Kernel: Use move semantics in sys$sendfd()Andreas Kling
Avoid an unnecessary NonnullRefPtr<OpenFileDescription> copy.
2021-09-15LibWeb: Support "c" and "C" curves in SVG <path> dataAndreas Kling
These instructions now generate cubic Bézier curves.
2021-09-15LibGfx: Add Path::cubic_bezier_curve_to()Andreas Kling
This is pretty unsophisticated as it will simply add a fixed number of of line segments approximating the curve. Still better than nothing.
2021-09-15LibGfx: Add some interpolation helpers for Gfx::Point<T>Andreas Kling
- linear_interpolate - quadratic_interpolate - cubic_interpolate
2021-09-15LibWeb: Remove unused SVGSVGElement::m_bitmapAndreas Kling
2021-09-15LibJS: Return default-constructed values instead of the INVALID constantLinus Groh
This is much more common across the whole codebase and even these two files. The same is used to return an empty JS::Value in an exception check, for example.
2021-09-15LibJS: Remove two unused includes from AbstractOperations.cppLinus Groh
2021-09-15LibTextCodec: Ignore BYTE ORDER MARK at the start of utf8/16 stringsSam Atkins
Before, this was getting included as part of the output text, which was confusing the HTML parser. Nobody needs the BOM after we have identified the codec, so now we remove it when converting to UTF-8.
2021-09-15Documentation: Update CLionConfiguration for SuperBuildAndrew Kaster
Extra configure options may need passed to CLion in order for it not to choke on the new CMake setup. In particular, it's now a very bad idea to pass CMAKE_CXX_COMPILER and CMAKE_C_COMPILER to the target build.
2021-09-15Ports: Use new CMakeToolchain.txt located in the build directoryAndrew Kaster
Now that we're generating the CMake toolchain file in the build directory, we need to redirect the ports that use CMake to the new location. Looking into this showed that there's still a bunch of work to do in general to make the ports agnostic to which toolchain they're using, there's a lot of hard-coded ${ARCH}-pc-serenity-gcc assumptions still here.
2021-09-15Meta+Toolchain: Rename CMAKE_CXXFILT to SERENITY_CXXFILTAndrew Kaster
The "CMAKE_<foo>" variable namespace is reserved, and CXXFILT is not currently a variable known to upstream CMake.
2021-09-15Meta: Add FIXME for not setting BUILD_SHARED_LIBS in Lagom buildAndrew Kaster
This is really the business of the consuming project. We will need to make changes to libjs-test262 and to oss-fuzz to address this properly.
2021-09-15Documentation: Document new SuperBuild build infrastructureAndrew Kaster
Add additional clarification for the CMake cache, and add missing extra targets as well.
2021-09-15Meta: Update serenity.sh for the SuperBuildAndrew Kaster
Direct build commands to the SuperBuild's binary directory, and image/run commands to the Serenity binary directory. As a side benefit, make the lagom target only build Lagom instead of the entire OS alongside Lagom.
2021-09-15Meta: Switch to a SuperBuild that splits host and target buildsAndrew Kaster
Replace the old logic where we would start with a host build, and swap all the CMake compiler and target variables underneath it to trick CMake into building for Serenity after we configured and built the Lagom code generators. The SuperBuild creates two ExternalProjects, one for Lagom and one for Serenity. The Serenity project depends on the install stage for the Lagom build. The SuperBuild also generates a CMakeToolchain file for the Serenity build to use that replaces the old toolchain file that was only used for Ports. To ensure that code generators are rebuilt when core libraries such as AK and LibCore are modified, developers will need to direct their manual `ninja` invocations to the SuperBuild's binary directory instead of the Serenity binary directory. This commit includes warning coalescing and option style cleanup for the affected CMakeLists in the Kernel, top level, and runtime support libraries. A large part of the cleanup is replacing USE_CLANG_TOOLCHAIN with the proper CMAKE_CXX_COMPILER_ID variable, which will no longer be confused by a host clang compiler.
2021-09-15Meta: Move all options to targetname_options.cmake filesAndrew Kaster
This common strategy of having a serenity_option() macro defined in either the Lagom or top level CMakeLists.txt allows us to do two things: First, we can more clearly see which options are Serenity-specific, Lagom-specific, or common between the target and host builds. Second, it enables the upcoming SuperBuild changes to set() the options in the SuperBuild's CMake cache and forward each target's options to the corresponding ExternalProject.
2021-09-15Meta: Add Meta/CMake to the CMAKE_MODULE_PATH for Serenity and LagomAndrew Kaster
This makes it so we don't need to specify the full path to all the helper scripts we include() from different places in the codebase and feels a lot cleaner.
2021-09-15Meta: Use Lagom:: namespaced names for code generatorsAndrew Kaster
This will be required when we switch to a SuperBuild that has Lagom as a configure time dependency, but is a distinct enough change to be separate.
2021-09-15Meta: Allow specifying alternative paths for downloaded Unicode dataAndrew Kaster
This lets us possibly share downloaded artifacts between different builds without re-downloading them every time you change toolchains.
2021-09-15Meta: Define and use lagom_tool() CMake helper function for all ToolsAndrew Kaster
We'll use this to prevent repeating common tool dependencies. They all depend on LibCore and AK only. We also want to encapsulate common install rules for them.
2021-09-15Breakout: Tag fallthrough statementMatheus Vinicius
Tag key changes with fallthrough statement to document the intention.
2021-09-15Breakout: Add possibility to play with A and DMatheus Vinicius
This change will make the player able to control the game with A and D keys, in addition to the current arrow keys and mouse.
2021-09-15LibWeb: Make Layout::Node::paint() pure virtualAndreas Kling
In the past, the base class implementation of this was used to descend into subtrees and paint children. That is now taken care of by StackingContext::paint_descendants() instead, and nothing used this.
2021-09-15LibWeb: Avoid some redundant calls to Layout::Box::absolute_rect()Andreas Kling
Computing the absolute rect of a box requires walking the chain of containing blocks and apply any offsets encountered. This can be slow in deeply nested box trees, so let's at least avoid doing it multiple times when once is enough.
2021-09-15LibWeb: Remove unused NodeWithStyle::m_position fieldSam Atkins
2021-09-15LibWeb: Make flex-box ignore out-of-flow child boxesSam Atkins
Previously, out-of-flow children still took up space inside a flex-box container, leaving an odd gap. Now they don't! :^)
2021-09-15LibWeb: Implement "out-of-flow" property of Layout BoxSam Atkins
In some situations, a layout box should not participate in the standard layout process, for example when set to `position: absolute`.
2021-09-15Base: Add test page for testing weird flexbox combinationsSam Atkins
Specifically, this is to help fix a bug with `position: absolute` children of a flex-box still taking up space, when they should not.