Commit Graph

41358 Commits

Author SHA1 Message Date
Andreas Kling
389f47f6fe LibWeb: Check both top and bottom of float position when looking for fit
We have to check that there's enough space at both the top and bottom of
the float's margin box, otherwise we risk overlapping existing content.
2022-09-22 16:54:12 +02:00
Timothy Flynn
82e730eba1 LibJS: Change default time display options to "always" for digital style
This is a normative change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/d28076b
2022-09-22 14:39:24 +01:00
Xexxa
5f4c59e2c1 Base: Add and improve more emoji flags
🇨🇾 - U+1F1E8 U+1F1FE FLAG: CYPRUS
🇫🇮 - U+1F1EB U+1F1EE FLAG: FINLAND
🇬🇲 - U+1F1EC U+1F1F2 FLAG: GAMBIA
🇬🇺 - U+1F1EC U+1F1FA FLAG: GUAM
🇮🇪 - U+1F1EE U+1F1EA FLAG: IRELAND
🇰🇮 - U+1F1F0 U+1F1EE FLAG: KIRIBATI
🇰🇼 - U+1F1F0 U+1F1FC FLAG: KUWAIT
🇱🇸 - U+1F1F1 U+1F1F8 FLAG: LESOTHO
🇲🇦 - U+1F1F2 U+1F1E6 FLAG: MOROCCO
🇲🇭 - U+1F1F2 U+1F1ED FLAG: MARSHALL ISLANDS
🇲🇶 - U+1F1F2 U+1F1F6 FLAG: MARTINIQUE
🇲🇹 - U+1F1F2 U+1F1F9 FLAG: MALTA
🇴🇲 - U+1F1F4 U+1F1F2 FLAG: OMAN
🇵🇸 - U+1F1F5 U+1F1F8 FLAG: PALESTINIAN TERRITORIES
🇸🇪 - U+1F1F8 U+1F1EA FLAG: SWEDEN
🇸🇻 - U+1F1F8 U+1F1FB FLAG: EL SALVADOR
🇿🇼 - U+1F1FF U+1F1FC FLAG: ZIMBABWE
2022-09-22 08:15:27 -04:00
Xexxa
721e70e1df Base: Make some emoji flag 10px high
🇦🇨 - U+1F1E6 U+1F1E8 FLAG: ASCENSION ISLAND
🇦🇩 - U+1F1E6 U+1F1E9 FLAG: ANDORRA
🇦🇫 - U+1F1E6 U+1F1EB FLAG: AFGHANISTAN
🇦🇮 - U+1F1E6 U+1F1EE FLAG: ANGUILLA
🇦🇱 - U+1F1E6 U+1F1F1 FLAG: ALBANIA
🇦🇷 - U+1F1E6 U+1F1F7 FLAG: ARGENTINA
🇦🇸 - U+1F1E6 U+1F1F8 FLAG: AMERICAN SAMOA
🇧🇱 - U+1F1E7 U+1F1F1 FLAG: ST. BARTHÉLEMY
🇧🇲 - U+1F1E7 U+1F1F2 FLAG: BERMUDA
🇧🇳 - U+1F1E7 U+1F1F3 FLAG: BRUNEI
🇧🇶 - U+1F1E7 U+1F1F6 FLAG: CARIBBEAN NETHERLANDS
🇧🇿 - U+1F1E7 U+1F1FF FLAG: BELIZE
🇨🇨 - U+1F1E8 U+1F1E8 FLAG: COCOS (KEELING) ISLANDS
🇨🇰 - U+1F1E8 U+1F1F0 FLAG: COOK ISLANDS
🇨🇻 - U+1F1E8 U+1F1FB FLAG: CAPE VERDE
🇨🇽 - U+1F1E8 U+1F1FD FLAG: CHRISTMAS ISLAND
🇩🇬 - U+1F1E9 U+1F1EC FLAG: DIEGO GARCIA
🇩🇲 - U+1F1E9 U+1F1F2 FLAG: DOMINICA
🇩🇿 - U+1F1E9 U+1F1FF FLAG: ALGERIA
🇪🇨 - U+1F1EA U+1F1E8 FLAG: ECUADOR
🇪🇷 - U+1F1EA U+1F1F7 FLAG: ERITREA
🇪🇹 - U+1F1EA U+1F1F9 FLAG: ETHIOPIA
🇫🇯 - U+1F1EB U+1F1EF FLAG: FIJI
🇫🇰 - U+1F1EB U+1F1F0 FLAG: FALKLAND ISLANDS
🇬🇩 - U+1F1EC U+1F1E9 FLAG: GRENADA
🇬🇪 - U+1F1EC U+1F1EA FLAG: GEORGIA
🇬🇮 - U+1F1EC U+1F1EE FLAG: GIBRALTAR
🇬🇵 - U+1F1EC U+1F1F5 FLAG: GUADELOUPE
🇬🇶 - U+1F1EC U+1F1F6 FLAG: EQUATORIAL GUINEA
🇬🇸 - U+1F1EC U+1F1F8 FLAG: SOUTH GEORGIA & SOUTH SANDWICH ISLANDS
🇮🇴 - U+1F1EE U+1F1F4 FLAG: BRITISH INDIAN OCEAN TERRITORY
🇰🇾 - U+1F1F0 U+1F1FE FLAG: CAYMAN ISLANDS
🇲🇸 - U+1F1F2 U+1F1F8 FLAG: MONTSERRAT
🇳🇺 - U+1F1F3 U+1F1FA FLAG: NIUE
🇳🇿 - U+1F1F3 U+1F1FF FLAG: NEW ZEALAND
🇵🇳 - U+1F1F5 U+1F1F3 FLAG: PITCAIRN ISLANDS
🇸🇭 - U+1F1F8 U+1F1ED FLAG: ST. HELENA
🇹🇦 - U+1F1F9 U+1F1E6 FLAG: TRISTAN DA CUNHA
🇹🇨 - U+1F1F9 U+1F1E8 FLAG: TURKS & CAICOS ISLANDS
🇻🇬 - U+1F1FB U+1F1EC FLAG: BRITISH VIRGIN ISLANDS
2022-09-22 08:15:27 -04:00
Timothy Flynn
73fcaaeda4 Taskbar: Add a context menu to open clock settings from the clock widget 2022-09-22 11:46:53 +01:00
Sam Atkins
c64a5ccf29 LibWeb: Avoid unnecessary copies in CSS Parser 2022-09-22 02:04:23 +02:00
Sam Atkins
a211c06e99 LibWeb: Use llroundf() when rounding floats 2022-09-22 02:04:23 +02:00
Sam Atkins
188d9f1326 LibWeb: Resolve some trivial clang-tidy warnings in the CSS Parser
Issues resolved:
- Unnecessary `move()`s
- `else` after `return`
- `auto&` that could be `auto const&`

Why yes, I did just get clang-tidy set up. :^)
2022-09-22 02:04:23 +02:00
Ben Wiederhake
48062b3cca Meta: Remove 'time' invocation in lint-ci
Some systems don't have /usr/bin/time available, and during most runs
of lint-ci we don't actually care that much about the exact timing.
Therefore, let's just remove it. It's easy enough to add back in, if
someone wants to investigate an issue.
2022-09-22 00:45:10 +02:00
Linus Groh
edfef8e2f5 Everywhere: Rename WrapperGenerator to BindingsGenerator
This code generator no longer creates JS wrappers for platform objects
in the old sense, instead they're JS objects internally themselves.
Most of what we generate now are prototypes - which can be seen as
bindings for the internal C++ methods implementing getters, setters, and
methods - as well as object constructors, i.e. bindings for the internal
create_with_global_object() method.

Also tweak the naming of various CMake glue code existing around this.
2022-09-21 23:06:08 +01:00
Linus Groh
4270ede7c4 LibWeb: Remove WRAPPER_HACK() macro
We no longer access Bindings::FooWrapper anywhere for a Foo platform
object, so these can be removed :^)
2022-09-21 21:12:24 +01:00
Linus Groh
6055b0e850 LibWeb: Remove no-op impl() methods from the WEB_PLATFORM_OBJECT macro
These are leftovers from when wrapper objects still had an internal
implementation, which is no longer the case.
2022-09-21 21:12:24 +01:00
Linus Groh
2cab2a8e8f LibWeb: Turn is_platform_object() ifs into an Array 2022-09-21 21:12:24 +01:00
Linus Groh
464368f94a LibWeb: Rename is_wrappable_type() to is_platform_object()
This name more accurately reflects what we are checking. Also add an
explanatory note that only a hand-curated subset of platform object
types is checked in the absence of a full generated list.
2022-09-21 21:12:24 +01:00
Linus Groh
daf0a8dd91 LibWeb: Remove impl_is_wrapper() check from WrapperGenerator
This concept no longer applies to GC'd platform objects. The only place
where this was still used can use is_wrappable_type() instead.
2022-09-21 21:12:24 +01:00
Linus Groh
64a1992040 LibWeb: Remove support for RefPtr types in idl_type_name_to_cpp_type()
This is not used anymore.
2022-09-21 21:12:24 +01:00
Linus Groh
38b3ce8f03 LibIDL+LibWeb: Remove stale references to "wrapper class" concept
There are no wrappers for the platform object types anymore :^)
2022-09-21 21:12:24 +01:00
Sam Atkins
fb2e1c4611 headless-browser: Install EventLoop and Font plugins so it doesn't crash 2022-09-21 20:42:36 +01:00
Sam Atkins
6b2a916069 LibWeb+WebContent: Move Serenity EventLoop and Font plugins into LibWeb
These are exactly what's wanted by headless-browser too, so this saves
us some duplication. LibWeb already links LibCore so it should not
cause any issues for Ladybird.
2022-09-21 20:42:36 +01:00
Sam Atkins
69dd158f91 LibJS: Create Console using a Realm instead of a VM 2022-09-21 20:03:49 +01:00
Sam Atkins
7a2da4cabf Browser+WebContent+LibJS: Support %c specifiers in Console.log()
...and the other Console methods.

This lets you apply styling to a log message or any other text that
passes through the Console `Formatter` operation.

We store the CSS on the ConsoleClient instead of passing it along with
the rest of the message, since I couldn't figure out a nice way of
doing that, as Formatter has to return JS::Values. This way isn't nice,
and has a risk of forgetting to clear the style and having it apply to
subsequent messages, but it works.

This is only supported in the Browser for now. REPL support would
require parsing the CSS and figuring out the relevant ANSI codes. We
also don't filter this styling at all, so you can `position: absolute`
and `transform: translate(...)` all you want, which is less than
ideal.
2022-09-21 20:03:49 +01:00
Sam Atkins
a875713f2e Browser: Ignore whitespace-only input in the JS console 2022-09-21 20:03:49 +01:00
Sam Atkins
a1f1369775 LibJS: Implement Console Formatter operation
This matches the recent changes to `Formatter` and `Logger`.

`%s`, `%d`, `%i`, and `%f` are all implemented. `%o`, `%O`, and `%c`
will come later.
2022-09-21 20:03:49 +01:00
Andreas Kling
010be491a9 LibWeb: Fix e-mail address mishap 2022-09-21 18:42:09 +02:00
davidot
4912b22e3b LibWeb+WebContent: Setup the js console client earlier
This allows us to print messages in inline scripts. Also add an example
of this in the welcome page to test this.
2022-09-21 17:34:32 +01:00
davidot
446a10a1ac LibJS: Implement normative change in String.prototype.substr
And add spec comments while we're in the neighborhood.
2022-09-21 16:59:58 +01:00
Timothy Flynn
60a6bae53d LibJS: Change digital default style from "narrow" to "short"
This is a normative change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/4c24876
2022-09-21 16:09:38 +01:00
Timothy Flynn
51854e345a LibUnicode: Update to Unicode version 15.0.0
https://unicode.org/versions/Unicode15.0.0/
2022-09-21 14:04:22 +01:00
Timothy Flynn
739798e075 LibUnicode: Use recently added Core::Stream::read_all in code generators
The generators had a manual implementation when Core::Stream did not
have a read_all method.
2022-09-21 14:04:22 +01:00
Andreas Kling
a5bb30d2ba LibWeb: Make Node.childNodes vend the same NodeList every time 2022-09-21 13:51:58 +02:00
Andreas Kling
4814e1bd65 Browser: Ignore title updates when history has no current item
The Browser::History class is oblivious to the state of the browsing
context's session history over on the LibWeb side. We need to hook a lot
more thing up here, but for now just ignore updates when there's no
current history item. This fixes a VERIFY() error on startup.
2022-09-21 13:06:17 +02:00
Daniel Bertalan
2b69af2dfe AK+LibJS: Handle NaN-boxing pointers on AArch64
JS::Value stores 48 bit pointers to separately allocated objects in its
payload. On x86-64, canonical addresses have their top 16 bits set to
the same value as bit 47, effectively meaning that the value has to be
sign-extended to get the pointer. AArch64, however, expects the topmost
bits to be all zeros.

This commit gates sign extension behind `#if ARCH(X86_64)`, and adds an
`#error` for unsupported architectures, so that we do not forget to
think about pointer handling when porting to a new architecture.

Fixes #15290
Fixes SerenityOS/ladybird#56
2022-09-21 11:55:57 +02:00
Andreas Kling
62fed2a31d LibWeb: Add id field to Environment
This is a unique string that identifies the environment. We just use a
simple incrementing number for now.
2022-09-21 11:51:18 +02:00
Andreas Kling
1f95943274 LibWeb: Remove confusing NOTE in WindowEnvironmentSettingsObject
HTML::Window has absorbed what was formerly known as WindowObject.
2022-09-21 11:51:18 +02:00
Andreas Kling
66f4e2b3b0 LibWeb: Add two more scheme helpers to the Fetch infrastructure 2022-09-21 11:51:18 +02:00
Andreas Kling
b02402e116 LibWeb: Fix null dereference in ResourceClient::set_resource()
If resource_did_load() results in the ResourceClient being destroyed,
we can't dereference the weak ResourceClient right after.
2022-09-21 11:51:18 +02:00
Andreas Kling
68d0f30368 LibWeb: Abort the active document when navigating a browsing context 2022-09-21 11:51:18 +02:00
Andreas Kling
51d7ea7ece LibWeb: Make WESO allow cross-origin isolated APIs for now
Instead of panicking in a TODO(), let's just allow them and leave the
FIXME's in this function.
2022-09-21 11:51:18 +02:00
Andreas Kling
6c33dea6a6 LibWeb: Implement the "close" algorithm for browsing contexts
This is used by window.close() programmatically, but of course the user
can also decide to close a top-level browsing context at any time by
closing the tab.
2022-09-21 11:51:18 +02:00
Andreas Kling
0c7ab663c1 LibWeb: Flesh out most of the "unload" algorithm for documents
Yet another small steps towards spec-compliant document lifecycles.
2022-09-21 11:51:18 +02:00
Andreas Kling
797d28adca LibWeb: Save begin/end timestamps for load and DOMContentLoaded events 2022-09-21 11:51:18 +02:00
Andreas Kling
d4fc1367f6 LibWeb: Save document load timing when creating browsing context 2022-09-21 11:51:17 +02:00
Andreas Kling
270de12d59 LibWeb: Save document load timing when updating document readiness 2022-09-21 11:51:17 +02:00
Andreas Kling
67559b1279 LibWeb: Add load/unload timing structures to Document
We don't populate these with information just yet, but we will soon!
2022-09-21 11:51:17 +02:00
Jan Metzger
931458c337 LibWeb: Update visibility when Node was invisible before 2022-09-21 10:47:41 +01:00
CenTdemeern1
d1de7f7782 Base: Add a few more emoji
U+2328 KEYBOARD
U+2697 ALEMBIC
U+303D PART ALTERNATION MARK
U+1F408 CAT
U+1F408_U+2B1B BLACK CAT
U+1F40A CROCODILE
U+1F431 CAT FACE
U+1F4A0 DIAMOND SHAPE WITH A DOT INSIDE
U+1F4BB PERSONAL COMPUTER
U+1F6A7 CONSTRUCTION SIGN
2022-09-21 10:19:02 +01:00
Orel
d8474805e8 SystemMonitor: Save configuration of columns
Save the columns configuration from the last run in the respective
config file, and add a function to check whether a column should be
visible by default.
2022-09-21 10:14:40 +01:00
Linus Groh
290920222a Meta: Add Brandon Jordan to the contributors list :^) 2022-09-21 10:06:25 +01:00
electrikmilk
07af23ec1c Base: Add 17 new emojis
👻 - U+1F47B GHOST
🍧 - U+1F367 SHAVED ICE
🖼️ - U+1F5BC FRAMED PICTURE
👓 - U+1F453 GLASSES
🪖 - U+1FA96 MILITARY HELMET
🔇 - U+1F507 MUTED SPEAKER
🔈 - U+1F508 SPEAKER LOW VOLUME
🔉 - U+1F509 SPEAKER MEDIUM VOLUME
🔊 - U+1F50A SPEAKER HIGH VOLUME
🎬 - U+1F3AC CLAPPER BOARD
🔖 - U+1F516 BOOKMARK
💸 - U+1F4B8 MONEY WITH WINGS
🗒️ - U+1F5D2 SPIRAL NOTEPAD
🪠 - U+1FAA0 PLUNGER
🪦 - U+1FAA6 HEADSTONE
🔼 - U+1F53C UPWARDS BUTTON
🔽 - U+1F53D DOWNWARDS BUTTON
2022-09-21 09:57:19 +01:00
Andreas Kling
92deba7197 LibWeb: Implement Document/BrowsingContext hookup according to spec
We now implement the browsing context's "set active document" algorithm
from the spec, as well as the "discard" algorithm for browsing contexts
and documents.
2022-09-20 23:44:59 +02:00