summaryrefslogtreecommitdiff
path: root/Userland/Services/WebContent
AgeCommit message (Collapse)Author
2022-02-10LibWeb: Perform CSS custom property cascade once instead of per-propertyAndreas Kling
Previously we would re-run the entire CSS selector machinery for each property resolved. Instead of doing that, we now resolve a final set of custom property key/value pairs at the start of the cascade.
2022-02-09LibJS: Replace uses of MarkedValueList with MarkedVector<Value>Linus Groh
This is effectively a drop-in replacement.
2022-02-08Browser+LibWeb: Add "Dump Local Storage" item to Browser's Debug menuAndreas Kling
2022-02-08LibWeb: Introduce the Environment Settings ObjectLuke Wilde
The environment settings object is effectively the context a piece of script is running under, for example, it contains the origin, responsible document, realm, global object and event loop for the current context. This effectively replaces ScriptExecutionContext, but it cannot be removed in this commit as EventTarget still depends on it. https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
2022-02-08LibJS+Everywhere: Remove all VM::clear_exception() callsdavidot
Since VM::exception() no longer exists this is now useless. All of these calls to clear_exception were just to clear the VM state after some (potentially) failed evaluation and did not use the exception itself.
2022-02-06LibWeb: Plumb OOPWV focus state across the IPC boundaryAndreas Kling
This makes focus outlines show up in OOPWV at last! :^)
2022-02-05Browser: Add Debug menu action for dumping the stacking context treeAndreas Kling
2022-01-28Revert "Userland: Invoke tzset in apps that care about time zones"Timothy Flynn
This reverts most of commit ede5c9548e55d8216dba21ed431b9e53d085a248. The one change not reverted is ClockWidget.h, so that the taskbar clock can continue to notice time zone changes.
2022-01-25Userland: Invoke tzset in applications that care about time zonesTimothy Flynn
In most applications, we invoke tzset once at startup for now. Most of these are short lived and don't need to know about time zone changes. The exception is the ClockWidget in the taskbar. Here, we invoke tzset each time we update the system time. This way, any time zone changes can take effect immediately.
2022-01-23Userland: Add promises to programs that will read /etc/timezoneTimothy Flynn
This will require unveiling /etc/timezone itself for reading, as well as the rpath pledge promise.
2022-01-22LibJS: Refactor interpreter to use Script and Source Text ModulesLuke Wilde
This also refactors interpreter creation to follow InitializeHostDefinedRealm, but I couldn't fit it in the title :^) This allows us to follow the spec much more closely rather than being completely ad-hoc with just the parse node instead of having all the surrounding data such as the realm of the parse node. The interpreter creation refactor creates the global execution context once and doesn't take it off the stack. This allows LibWeb to take the global execution context and manually handle it, following the HTML spec. The HTML spec calls this the "realm execution context" of the environment settings object. It also allows us to specify the globalThis type, as it can be different from the global object type. For example, on the web, Window global objects use a WindowProxy global this value to enforce the same origin policy on operations like [[GetOwnProperty]]. Finally, it allows us to directly call Program::execute in perform_eval and perform_shadow_realm_eval as this moves global_declaration_instantiation into Interpreter::run (ScriptEvaluation) as per the spec. Note that this doesn't evalulate Source Text Modules yet or refactor the bytecode interpreter, that's work for future us :^) This patch was originally build by Luke for the environment settings object change but was also needed for modules. So I (davidot) have modified it with the new completion changes and setup for that. Co-authored-by: davidot <davidot@serenityos.org>
2022-01-20Userland: Add horizontal mouse scroll supportDmitry Petrov
2022-01-15LibCore+LibIPC+Everywhere: Return Stream::LocalSocket from LocalServersin-ack
This change unfortunately cannot be atomically made without a single commit changing everything. Most of the important changes are in LibIPC/Connection.cpp, LibIPC/ServerConnection.cpp and LibCore/LocalServer.cpp. The notable changes are: - IPCCompiler now generates the decode and decode_message functions such that they take a Core::Stream::LocalSocket instead of the socket fd. - IPC::Decoder now uses the receive_fd method of LocalSocket instead of doing system calls directly on the fd. - IPC::ConnectionBase and related classes now use the Stream API functions. - IPC::ServerConnection no longer constructs the socket itself; instead, a convenience macro, IPC_CLIENT_CONNECTION, is used in place of C_OBJECT and will generate a static try_create factory function for the ServerConnection subclass. The subclass is now responsible for passing the socket constructed in this function to its ServerConnection base; the socket is passed as the first argument to the constructor (as a NonnullOwnPtr<Core::Stream::LocalServer>) before any other arguments. - The functionality regarding taking over sockets from SystemServer has been moved to LibIPC/SystemServerTakeover.cpp. The Core::LocalSocket implementation of this functionality hasn't been deleted due to my intention of removing this class in the near future and to reduce noise on this (already quite noisy) PR.
2022-01-08LibJS: Convert Interpreter::run() to ThrowCompletionOr<Value>Linus Groh
Instead of making it a void function, checking for an exception, and then receiving the relevant result via VM::last_value(), we can consolidate all of this by using completions. This allows us to remove more uses of VM::exception(), and all uses of VM::last_value().
2021-12-30Userland: Link directly against LibUnicodeData where neededTimothy Flynn
This is partially a revert of commits: 10a8b6d4116c6a627a6c189154af032f69b29c21 561b67a1add82538502ef2f5733f1d86718898ad Rather than adding the prot_exec pledge requried to use dlopen(), we can link directly against LibUnicodeData in applications that we know need that library. This might make the dlopen() dance a bit unnecessary. The same purpose might now be fulfilled with weak symbols. That can be revisted next, but for now, this at least removes the potential security risk of apps like the Browser having prot_exec privileges.
2021-12-27LibJS+WebContent+Browser+js: Implement console.group() methodsSam Atkins
This implements: - console.group() - console.groupCollapsed() - console.groupEnd() In the Browser, we use `<details>` for the groups, which is not actually implemented yet, so groups are always open. In the REPL, groups are non-interactive, but still indent any output. This looks weird since the console prompt and return values remain on the far left, but this matches what Node does so it's probably fine. :^) I expect `console.group()` is not used much outside of browsers.
2021-12-27LibJS+WebContent+js: Bring console.trace() to specSam Atkins
The spec very kindly defines `Printer` as accepting "Implementation-specific representations of printable things such as a stack trace or group." for the `args`. We make use of that here by passing the `Trace` itself to `Printer`, instead of having to produce a representation of the stack trace in advance and then pass that to `Printer`. That both avoids the hassle of tracking whether the data has been html-encoded or not, and means clients don't have to implement the whole `trace()` algorithm, but only the code needed to output the trace.
2021-12-27LibJS+WebContent+js: Bring console.assert() to specSam Atkins
2021-12-27LibJS+WebContent+js: Bring console.clear() to specSam Atkins
This is identical to before, since we don't have "group stacks" yet, but clear() now uses ThrowCompletionOr.
2021-12-27LibJS+WebContent+js: Bring console.count[Reset]() to specSam Atkins
The `CountReset` log level is displayed as a warning, since the message is always to warn that the counter doesn't exist. This is also in line with the table at https://console.spec.whatwg.org/#loglevel-severity
2021-12-27LibJS+WebContent+js: Reimplement console.log() and friends to specSam Atkins
This implements the Logger and Printer abstract operations defined in the console spec, and stubs out the Formatter AO. These are then used for the "output a categorized log message" functions.
2021-12-21Userland: Add unveil/pledge requisites for dynamic Unicode data loadingTimothy Flynn
Loading libunicodedata.so will require dlopen(), which in turn requires mmap(). The 'prot_exec' pledge is needed for this. Further, the .so itself must be unveiled for reading. The "real" path is unveiled (libunicodedata.so.serenity) as the symlink (libunicodedata.so) itself cannot be unveiled.
2021-12-10Browser+LibWeb+WebContent: Add variables display to InspectorSam Atkins
This allows us to see which custom properties apply to a given element, which previously wasn't shown.
2021-12-07WebContent: Add missing TRY on client initializationHendiadyoin1
2021-12-06LibIPC: Add IPC::take_over_accepted_client_from_system_server<Client>()Andreas Kling
This is an encapsulation of the common work done by all of our single-client IPC servers on startup: 1. Create a Core::LocalSocket, taking over an accepted fd. 2. Create an application-specific ClientConnection object, wrapping the socket. It's not a huge change in terms of lines saved, but I do feel that it improves expressiveness. :^)
2021-11-30WebContent: Remove unnecessary client mapAndreas Kling
WebContent processes only serve a single client, so we don't need to keep a map of them.
2021-11-28Everywhere: Use default execpromises argument for Core::System::pledgeBrian Gianforcaro
2021-11-24WebContent: Support inspection of DOM in nested browsing contextsVyacheslav Pukhanov
This lets user select a node from a nested browsing context in the Inspector (e.g. a node inside an `iframe` document) to highlight it on the page.
2021-11-23LibCore: Make LocalSocket takeover mechanism return ErrorOr<T>Andreas Kling
2021-11-23LibCore+LibSystem: Move syscall wrappers from LibSystem to LibCoreAndreas Kling
With this change, System::foo() becomes Core::System::foo(). Since LibCore builds on other systems than SerenityOS, we now have to make sure that wrappers work with just a standard C library underneath.
2021-11-23WebContent: Port to LibMain :^)Andreas Kling
2021-11-18LibWeb: Move BrowsingContext into HTML/Andreas Kling
Browsing contexts are defined by the HTML specification, so let's move them into the HTML directory. :^)
2021-11-08LibCore: Use ErrorOr<T> in Core::AnonymousBufferAndreas Kling
2021-11-02Services: Fix visibility of Object-derivative constructorsBen Wiederhake
Derivatives of Core::Object should be constructed through ClassName::construct(), to avoid handling ref-counted objects with refcount zero. Fixing the visibility means that misuses like this are more difficult.
2021-10-31LibWeb+WebContent: Add set_preferred_color_scheme IPC callSam Atkins
This allows the owner of a WebView to override whether to use a dark theme or not, instead of just using the system theme's IsDark property.
2021-10-31WebContent: Convert ConsoleGlobalObject functions to ThrowCompletionOrIdan Horowitz
2021-10-28LibWeb: Null-check document before doing layout in PageHost::paint()Andreas Kling
2021-10-28LibWeb: Always update layout (if needed) before paintingAndreas Kling
2021-10-24LibJS: Rename PropertyName to PropertyKeyAndreas Kling
Let's use the same name as the spec. :^)
2021-10-20LibJS: Rename define_native_function => define_old_native_functionIdan Horowitz
This method will eventually be removed once all native functions are converted to ThrowCompletionOr
2021-10-20LibJS: Add ThrowCompletionOr versions of the JS native function macrosIdan Horowitz
The old versions were renamed to JS_DECLARE_OLD_NATIVE_FUNCTION and JS_DEFINE_OLD_NATIVE_FUNCTION, and will be eventually removed once all native functions were converted to the new format.
2021-10-20LibJS: Replace usages of JS_{DECLARE, DEFINE}_NATIVE_GETTERIdan Horowitz
These macros are equivalent to JS_{DECLARE, DEFINE}_NATIVE_FUNCTION and were only sometimes used, so let's just get rid of them altogether.
2021-10-14LibWeb: Introduce simple scrollable overflow, size ICB to viewportAndreas Kling
Per spec, the initial containing block (ICB) should have the size of the viewport. We have only done this for the width until now, since we had no way to express scrollable overflow. This patch adds Layout::Box::m_overflow_data, an optional struct that can hold on to information about a box's overflow. Then we have BFC set the ICB up with some scrollable overflow instead of sizing it to fit its content vertically. This fixes a number of broken layouts where correctness depends on having the appropriate ICB height.
2021-10-13LibJS: Convert to_object() to ThrowCompletionOrLinus Groh
2021-10-03LibJS: Convert has_own_property() to ThrowCompletionOrLinus Groh
2021-10-03LibWeb: Fix that $0 was no longer accessibledavidot
We now set the realm (twice) on every console input. This can probably be avoided if we use two executing contexts one for the website the other for the console. This achieves a similar behavior but is not really nice and not really spec like.
2021-10-01Browser: Check m_console_client is non-null before dereferencing itIdan Horowitz
This added check matches CientConnection::js_console_input and makes sure the webcontent process doesn't crash if the console is opened while no page is available (like in a file not found situation)
2021-09-29LibJS: Convert internal_own_property_keys() to ThrowCompletionOrLinus Groh
2021-09-29LibJS: Convert internal_delete() to ThrowCompletionOrLinus Groh
2021-09-29LibJS: Convert internal_set() to ThrowCompletionOrLinus Groh