Commit graph

27599 commits

Author SHA1 Message Date
Andrew Kaster
9dff6acc55 Ports: Use new CMakeToolchain.txt located in the build directory
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-15 19:04:52 +04:30
Andrew Kaster
b9e3647e66 Meta+Toolchain: Rename CMAKE_CXXFILT to SERENITY_CXXFILT
The "CMAKE_<foo>" variable namespace is reserved, and CXXFILT is not
currently a variable known to upstream CMake.
2021-09-15 19:04:52 +04:30
Andrew Kaster
368d2ace55 Meta: Add FIXME for not setting BUILD_SHARED_LIBS in Lagom build
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-15 19:04:52 +04:30
Andrew Kaster
a488041d54 Documentation: Document new SuperBuild build infrastructure
Add additional clarification for the CMake cache, and add missing extra
targets as well.
2021-09-15 19:04:52 +04:30
Andrew Kaster
bd7b158c71 Meta: Update serenity.sh for the SuperBuild
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-15 19:04:52 +04:30
Andrew Kaster
b5c98ede08 Meta: Switch to a SuperBuild that splits host and target builds
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-15 19:04:52 +04:30
Andrew Kaster
904a268872 Meta: Move all options to targetname_options.cmake files
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-15 19:04:52 +04:30
Andrew Kaster
6e7cc40b18 Meta: Add Meta/CMake to the CMAKE_MODULE_PATH for Serenity and Lagom
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-15 19:04:52 +04:30
Andrew Kaster
a269a32a17 Meta: Use Lagom:: namespaced names for code generators
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-15 19:04:52 +04:30
Andrew Kaster
fc8d1bf3ce Meta: Allow specifying alternative paths for downloaded Unicode data
This lets us possibly share downloaded artifacts between different
builds without re-downloading them every time you change toolchains.
2021-09-15 19:04:52 +04:30
Andrew Kaster
a6d83e02d2 Meta: Define and use lagom_tool() CMake helper function for all Tools
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-15 19:04:52 +04:30
Matheus Vinicius
567104607c Breakout: Tag fallthrough statement
Tag key changes with fallthrough statement to document the intention.
2021-09-15 14:22:34 +00:00
Matheus Vinicius
ef3f9b24dd Breakout: Add possibility to play with A and D
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-15 14:22:34 +00:00
Andreas Kling
28fabd4728 LibWeb: Make Layout::Node::paint() pure virtual
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-15 15:25:47 +02:00
Andreas Kling
eac31e21f2 LibWeb: Avoid some redundant calls to Layout::Box::absolute_rect()
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-15 14:18:17 +02:00
Sam Atkins
1103eb8d44 LibWeb: Remove unused NodeWithStyle::m_position field 2021-09-15 13:55:25 +02:00
Sam Atkins
ee671a20cc LibWeb: Make flex-box ignore out-of-flow child boxes
Previously, out-of-flow children still took up space inside a flex-box
container, leaving an odd gap. Now they don't! :^)
2021-09-15 13:55:25 +02:00
Sam Atkins
2844f89a83 LibWeb: Implement "out-of-flow" property of Layout Box
In some situations, a layout box should not participate in the standard
layout process, for example when set to `position: absolute`.
2021-09-15 13:55:25 +02:00
Sam Atkins
e80396e044 Base: Add test page for testing weird flexbox combinations
Specifically, this is to help fix a bug with `position: absolute`
children of a flex-box still taking up space, when they should not.
2021-09-15 13:55:25 +02:00
Ali Mohammad Pur
741886a4c4 LibRegex: Make the optimizer understand references and capture groups
Otherwise the fork in patterns like `(1+)\1` would be (incorrectly)
optimized away.
2021-09-15 15:52:28 +04:30
Andreas Kling
7de23aede2 LibWeb: Parse the <svg viewBox> attribute
Just parse it into an SVG::ViewBox object for now, we don't actually use
it for anything yet.
2021-09-15 11:56:26 +02:00
Andreas Kling
63c4fcdc69 LibWeb: Add SVG::ViewBox to represent SVG view boxes
This also comes with a simple little parsing helper. :^)
2021-09-15 11:56:26 +02:00
Andreas Kling
8949b0def6 LibWeb: Add an SVG::AttributeNames namespace
There are a whole bunch of SVG attributes, and we shouldn't mix them in
with the HTML attributes. This patch adds some of them to the new
namespace, but there are more to be added. :^)
2021-09-15 11:56:26 +02:00
Ali Mohammad Pur
53d24fbd65 LibJS: Make References see into Environment's bindings as well
'bindings' is the spec-compliant version of 'variables', but we were
simply not even looking at them, which made things using bindings (such
as named function expressions) break in unexpected ways after the move
to using references in call expressions.

Co-Authored-By: davidot <david.tuin@gmail.com>
2021-09-15 11:56:00 +02:00
Sam Atkins
3f31f109b5 LibWeb: Speed up computed style calculation
Rather than destroying and rebuilding the entire document layout tree in
every call to `ComputedCSSStyleDeclaration::property()`, we now just
make sure that the layout tree exists.

This speeds up the DOM Inspector significantly, from taking several
seconds to select an element, to almost instant. :^)
2021-09-15 11:24:11 +02:00
Zyper
344397557c PixelPaint: Add ability to draw squares and circles
Shift-key modifier for tools forces square aspect ratio.
It allows drawing squares with Rectangle Tool and circles
with Ellipse Tool.
2021-09-15 00:10:14 +00:00
Zyper
12e76bb3df LibGfx: Add method for calculating square aspect ratio end point 2021-09-15 00:10:14 +00:00
Linus Groh
88a31f3bac LibJS: Fix [[TimeZoneOffsetString]] value in ParseTemporalInstantString
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/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