Commit Graph

41760 Commits

Author SHA1 Message Date
Andreas Kling
c7d592dd01 LibWeb: Generate a BlockContainer box for display:inline-flex
We were previously generating an InlineNode, which is not a Box. We need
some type of Box to do flex layout, so let's just make a BlockContainer.
2022-10-06 21:08:50 +02:00
Andreas Kling
97bbb630c8 LibWeb: Make IFC happy to layout anything as long as it's inline outside
Before this, whenever encountering something other than dumb text
content in an inline flow, we assumed it had to be either a replaced
element, or an inline-block.

This removes the special-casing of inline-block so that IFC can size and
layout anything as long as it's inline on the outside.
2022-10-06 21:08:50 +02:00
Gunnar Beutner
be80ac619f Browser: Add a custom icon for the "New Window" action 2022-10-06 20:51:04 +02:00
Andreas Kling
19494b436b LibWeb: Fix unsafe capture in fetch_external_module_script_graph()
We can't be capturing the AK::URL by reference here, since on_complete
may be called later, after the value is no longer alive.
2022-10-06 18:29:52 +02:00
Andreas Kling
b9a45cf1aa LibWeb: Don't try to layout inside of replaced elements in BFC 2022-10-06 18:29:52 +02:00
Andreas Kling
5ff1fc4347 LibWeb: Make sure replaced elements never create a BFC 2022-10-06 18:29:52 +02:00
Andreas Kling
829ba4afb9 LibWeb: Remove unnecessary verify_cast in greatest_child_width() 2022-10-06 18:29:52 +02:00
Kemal Zebari
90719d34af Browser: Provide ability to create new browser windows
This change allows a user to spawn new browser processes by either
going to "File -> New Window" or by the shortcut "Ctrl + N".
2022-10-06 16:52:57 +01:00
Baitinq
48389f4179 Toolchain: serenity.nix: Fix fuse2fs not being installed
Nix (nixpkgs) have updated a while back how the e2fsprogs derivation
works and now fuse2fs wasnt being installed with it. It is now needed to
add a new derivation (package) to the dependency list: "fuse2fs". This
fixes the Meta/serenity.sh script not finding the fuse2fs binary for
rootless image building :^)
2022-10-06 16:16:51 +01:00
Andreas Kling
7354ac724e WebContent: Don't pthread_setname_np() non-SerenityOS platforms 2022-10-06 17:15:28 +02:00
Andreas Kling
2baad565ca LibWeb: Remove bogus verify_cast when dimensioning inline-blocks
There's no need to make the assumption that any inline-block box will
be represented by a BlockContainer. Nothing we do with the box here
requires that specific type anyway.
2022-10-06 17:15:28 +02:00
Andreas Kling
f190e394b3 LibUnicode: Let's use the GCC 11/12 workaround on all platforms
I seem to be getting some miscompiles on Linux as well, so let's make
the hitherto macOS-specific workaround universal.
2022-10-06 17:15:28 +02:00
Andreas Kling
9d50191dca LibWeb: Tidy up FormattingContext::creates_block_formatting_context()
We use comments from MDN here, since the rules for creating a BFC are
inconsistently spread across many different specifications.
2022-10-06 17:15:28 +02:00
EWouters
bc5d77ac40 Ports/ccache: Update ccache to version 4.6.3 2022-10-06 16:14:40 +01:00
EWouters
7c93eabffe LibC: Implement mkstemps() in stdlib and add a test
`mkstemps` generates a unique temporary file name from a pattern like
`prefixXXXXXXsuffix` where `prefix` and `suffix` can be any string with
only characters that are valid in a filename. The second parameter is
the length of the suffix.

`mkstemp` is `mkstemps` with suffix length 0, so to avoid code
duplication it calls `mkstemps`. It is unlikely this has any
significant performance impact on SerenityOS.

`generate_unique_filename` now takes the suffix length as a `size_t`.
The original behavior of this function is preserved when specifying a
suffix length of 0. All original uses of this function have been
adapted.

`mkstemps()` was added because it is required by version 4.6.3 of the
ccache port.
2022-10-06 16:14:40 +01:00
kleines Filmröllchen
678d385a3f Base: Add most Japanese infographic emoji
🈚 U+1F21A "free of charge"
🈯 U+1F22F "reserved" (or pointing finger)
🈲 U+1F232 "prohibited"
🈵 U+1F235 "no vacancy"
🈹 U+1F239 "discount"
🈺 U+1F23A "open for business"
🉐 U+1F250 "bargain"
2022-10-06 16:12:16 +01:00
Thomas Voss
5a4ee4df34 rev: Document the '-' filename 2022-10-06 16:06:50 +01:00
Thomas Voss
b556bfe8eb rev: Read from stdin if the filename '-' is given
The implementation of `rev` found on Linux systems does not have this
behavior, however other utilities do offer this behavior and so there
really isn't too much of an argument to be made for *not* having this as
a feature.
2022-10-06 16:06:50 +01:00
Thomas Voss
58d50d2657 Meta: Ignore vim's .exrc config
With the vim setting `exrc` enabled, vim automatically looks for a .exrc
file in the current directory for project-specific configuation.
2022-10-06 16:06:50 +01:00
networkException
a182bc9806 LibWeb: Push the realm execution context before linking modules
This patch adds a non standard step pushing the realm execution context
of fetching client's settings object onto the execution context stack
before linking a module script. Without the realm execution context
there is no current settings object, leading to a crash in
HostResolveImportedModule.
2022-10-06 16:41:36 +02:00
networkException
f92d95224e LibWeb: Add support for type module in HTMLScriptElement
This patch adds support for script elements with the type attribute set
to "module". As a first cut the changes are mainly focused around inline
scripts.

Co-authored-by: davidot <davidot@serenityos.org>
2022-10-06 16:41:36 +02:00
networkException
c51cf66347 LibWeb: Implement two module related host hooks
This patch adds support for the HostGetSupportedImportAssertions and
HostResolveImportedModule host hooks.

Co-authored-by: davidot <davidot@serenityos.org>
2022-10-06 16:41:36 +02:00
networkException
f0c4f8931c LibWeb: Implement fetching module scripts
This patch adds various algorithms required to fetch and link module
scripts.

Some parts such as actually creating a request and error handling are
not implemented or use temporary non spec compliant code to get us
further.

Co-authored-by: davidot <davidot@serenityos.org>
2022-10-06 16:41:36 +02:00
networkException
4de4e1828a LibWeb: Implement ModuleScript and JavaScriptModuleScript
This patchs adds the Web::HTML::Script subclass ModuleScript and
JavaScriptModuleScript as a type of ModuleScript as well as various
algorithms related to JavaScript module scripts.

Co-authored-by: davidot <davidot@serenityos.org>
2022-10-06 16:41:36 +02:00
networkException
ea34cb302d LibJS: Add accessor for requested modules to CyclicModule 2022-10-06 16:41:36 +02:00
networkException
992311c0ee LibWeb: Implement ModuleMap and expose it on EnvironmentSettingsObject
This patch adds the ModuleMap class used to keep track of the type and
url of a module as well as the fetching state associated. Each
environment settings object now also has a module map.
2022-10-06 16:41:36 +02:00
networkException
83554526f0 LibWeb: Allow all Script types to be used as [[HostDefined]] values
This patch adds support for all child classes of Web::HTML::Script to be
used in the [[HostDefined]] field of JS::Modules and JS::Scripts.
2022-10-06 16:41:36 +02:00
networkException
5a3e079deb LibJS: Mark [[HostDefined]] accessor on scripts as const 2022-10-06 16:41:36 +02:00
networkException
fb6de442c6 LibJS: Add [[HostDefined]] field to Modules
This patch adds the [[HostDefined]] field defined in
https://tc39.es/ecma262/#table-module-record-fields to module records.

Co-authored-by: davidot <davidot@serenityos.org>
2022-10-06 16:41:36 +02:00
networkException
cfa0c9bf9f LibWeb: Implement module type allowed
This patch adds the module type allowed steps given a module type string
and an environment settings object.
2022-10-06 16:41:36 +02:00
networkException
297e293a3f LibWeb: Implement more close to spec javascript mime type checking
Previously we would simply check the an input string against a list of
mime type essences, ignoring that the input might not be a valid mime
type or contain parameters.

This patch moves the helpers into the MimeSniff namespace and properly
parses an input string before comparing the essence.
2022-10-06 16:41:36 +02:00
networkException
93464d4e41 LibJS: Visit GC allocated members of ModuleEnvironment 2022-10-06 16:41:36 +02:00
Andreas Kling
a4ccdce011 LibWeb: Generate WebContent IPC endpoints for Lagom's LibWebView
This is pretty hackish but should get us back to building.
2022-10-06 16:35:53 +02:00
Andreas Kling
b4c90e35df LibWeb: Use CSS::Display::is_flow_inside() in InlineLevelIterator
This is a more correct check than !is_inline_block(), as it now enters
all elements that have inline behavior on the outside and flow behavior
on the inside.
2022-10-06 16:25:26 +02:00
Andreas Kling
13834cfdff LibWeb: Use Layout::Node::display() everywhere 2022-10-06 16:25:26 +02:00
Andreas Kling
49eb324535 LibWeb: Add Layout::Node::display()
This will return something sensible for style-less nodes as well.
2022-10-06 16:25:26 +02:00
networkException
277465e699 Meta: Add networkException's GitHub sponsors to the funding options list 2022-10-06 15:45:12 +02:00
Andreas Kling
a0e6882d99 LibWeb: Remove Layout::Node::set_inline()
Now that this flag is no longer used, we can stop setting it.
2022-10-06 15:29:38 +02:00
Andreas Kling
8a3ca6416d LibWeb: Make labels be display: inline-block in the default UA style
This is weird, but matches the behavior we've had so far. Leaving a
FIXME about how this doesn't seem right.
2022-10-06 15:29:38 +02:00
Andreas Kling
34a2797211 LibWeb: Remove ad-hoc <hr> element rule from default UA style
This element is already covered by spec rules. :^)
2022-10-06 15:29:38 +02:00
Andreas Kling
0cd82d2da7 LibWeb: Add a little header to the top of the default UA stylesheet
Since all the spec sections are annotated with comments already, let's
also have a comment mentioning that the file starts with ad-hoc rules.
2022-10-06 15:29:38 +02:00
Andreas Kling
5989a3ee77 LibWeb: Honor CSS display value in is_inline() and is_inline_block()
These were totally ad-hoc before, is_inline() was based on a boolean
flag on Layout::Node that we set in various situations.

Meanwhile, is_inline_block() was a combination on is_inline() plus a
type check to see if the layout node inherited from BlockContainer.

This patch replaces the above mess with simple lookups of the CSS
display value. Note that layout nodes without their own style (i.e text
nodes) are automatically assumed to be inline and non-blocks. This has
to be special-cased since layout nodes without style will consult the
style of their parent, so without short-circuiting this would break.
2022-10-06 15:29:38 +02:00
Andreas Kling
fe03149a47 LibWeb: Base Layout::TreeBuilder decisions on CSS display property
This is one of many small steps towards being able to remove the ad-hoc
Layout::Node::is_inline() in favor of honoring the CSS display value
everywhere instead.
2022-10-06 15:29:38 +02:00
Andreas Kling
1ab7a8e0db LibWeb: Simplify construction of :before and :after pseudo elements
Let create_pseudo_element_if_needed() take care of inserting the pseudo
elements into the layout tree as well.
2022-10-06 15:29:38 +02:00
Andreas Kling
da781e90c1 AK: Print VERIFY() error messages in release builds
Until now, VERIFY() failures would just cause a __builtin_trap() in
release builds, which made them a bit too harsh. This commit adds an
out-of-line helper function that prints the error before trapping.
2022-10-06 15:29:38 +02:00
Andreas Kling
4fdfaff4ca LibWeb: Split out helper functions in TreeBuilder::create_layout_tree()
Let's make this function a little easier to understand by splitting out
helpers into separate functions.
2022-10-06 15:29:38 +02:00
Andreas Kling
1e26d3d02d LibWeb: Make the initial containing block style have display:block
We always create a Layout::InitialContainingBlock for the ICB, but in a
future where we always honor the CSS::Display everywhere, we need to
make sure everyone has the right display values.
2022-10-06 15:29:38 +02:00
Xexxa
6bbd6b1453 Base: Adjust size of emoji flags
🇬🇫 - U+1F1EC U+1F1EB FLAG: FRENCH GUIANA
🇬🇬 - U+1F1EC U+1F1EC FLAG: GUERNSEY
🇬🇭 - U+1F1EC U+1F1ED FLAG: GHANA
🇮🇳 - U+1F1EE U+1F1F3 FLAG: INDIA
🇮🇸 - U+1F1EE U+1F1F8 FLAG: ICELAND
🇯🇪 - U+1F1EF U+1F1EA FLAG: JERSEY
🇯🇵 - U+1F1EF U+1F1F5 FLAG: JAPAN
🇰🇬 - U+1F1F0 U+1F1EC FLAG: KYRGYZSTAN
🇰🇳 - U+1F1F0 U+1F1F3 FLAG: ST. KITTS & NEVIS
🇰🇵 - U+1F1F0 U+1F1F5 FLAG: NORTH KOREA
🇲🇦 - U+1F1F2 U+1F1E6 FLAG: MOROCCO
🇲🇪 - U+1F1F2 U+1F1EA FLAG: MONTENEGRO
🇲🇰 - U+1F1F2 U+1F1F0 FLAG: NORTH MACEDONIA
🇲🇱 - U+1F1F2 U+1F1F1 FLAG: MALI
🇲🇻 - U+1F1F2 U+1F1FB FLAG: MALDIVES
🇳🇫 - U+1F1F3 U+1F1EB FLAG: NORFOLK ISLAND
🇳🇬 - U+1F1F3 U+1F1EC FLAG: NIGERIA
🇵🇷 - U+1F1F5 U+1F1F7 FLAG: PUERTO RICO
🇵🇼 - U+1F1F5 U+1F1FC FLAG: PALAU
🇶🇦 - U+1F1F6 U+1F1E6 FLAG: QATAR
🇷🇴 - U+1F1F7 U+1F1F4 FLAG: ROMANIA
🇷🇺 - U+1F1F7 U+1F1FA FLAG: RUSSIA
🇷🇼 - U+1F1F7 U+1F1FC FLAG: RWANDA
🇸🇨 - U+1F1F8 U+1F1E8 FLAG: SEYCHELLES
🇸🇬 - U+1F1F8 U+1F1EC FLAG: SINGAPORE
🇸🇲 - U+1F1F8 U+1F1F2 FLAG: SAN MARINO
🇹🇬 - U+1F1F9 U+1F1EC FLAG: TOGO
🇹🇭 - U+1F1F9 U+1F1ED FLAG: THAILAND
🇹🇯 - U+1F1F9 U+1F1EF FLAG: TAJIKISTAN
🏴󠁧󠁢󠁥󠁮󠁧󠁿 - U+1F3F4 U+E0067 U+E0062 U+E0065 U+E006E U+E0067 U+E007F
FLAG: ENGLAND
🏴󠁧󠁢󠁳󠁣󠁴󠁿 - U+1F3F4 U+E0067 U+E0062 U+E0073 U+E0063 U+E0074 U+E007F
FLAG: SCOTLAND
🏴󠁧󠁢󠁷󠁬󠁳󠁿 - U+1F3F4 U+E0067 U+E0062 U+E0077 U+E006C U+E0073 U+E007F
FLAG: WALES
2022-10-06 14:17:12 +01:00
Xexxa
75a81f0603 Base: Adjust emoji
🥒 - U+1F952 CUCUMBER
📞 - U+1F4DE TELEPHONE RECEIVER
2022-10-06 14:17:12 +01:00
kleines Filmröllchen
fbe6ea7897 Meta: Add my GitHub sponsor profile to the repository list 2022-10-06 14:59:04 +02:00