summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2021-10-15LibWeb: Use W3C urls for CSSOM spec linksSam Atkins
https://www.w3.org/TR/cssom/ is the more permanent home of the CSSOM specification's latest version, and is up to date with the draft spec. Also, https://drafts.csswg.org/ has been down multiple times recently which made looking things up a pain.
2021-10-15LibWeb: Implement CSSStyleRule::set_selector_text()Sam Atkins
2021-10-15LibWeb: Add serialization code for CSS{Media,Supports}RuleSam Atkins
The `CSSMediaRule::serialized()` code is to spec. The `CSSSupportsRule::serialized()` code has no spec right now, but I'm fairly confident it will be almost identical to media's, so I copied that for now.
2021-10-15LibWeb: Move media-query-list serialization code to MediaQuery.{h,cpp}Sam Atkins
It's not a complicated algorithm, but having it in one place instead of 2, and with spec comments, is nice. :^)
2021-10-15LibWeb: Accept a Block token as the body of a CSS At-RuleSam Atkins
I previously fixed this for `consume_a_qualified_rule()` and didn't notice the same comment in `consume_an_at_rule()` until now.
2021-10-15LibJS: Add comment clarifying the order of function propertiesdavidot
2021-10-15LibJS: Fix that proxy always said that it had a [[Construct]] slotdavidot
2021-10-15LibJS: Define length and name in function in correct orderdavidot
2021-10-15LibJS: Do not save state for peeking at the next token from the lexerdavidot
This saves having to save and load the parser state. This could give an incorrect token in some cases where the parser communicates to the lexer. However this is not applicable in any of the current usages and this would require one to parse the current token as normal which is exactly what you don't want to do in that scenario.
2021-10-15LibJS: Remove ErrorType::FixmeAddAnErrorStringWithMessagedavidot
2021-10-15LibJS: Fix null deref in ObjectProperty::dump()davidot
2021-10-15LibJS: Enable now working tests for duplicated variable declarationsdavidot
2021-10-15LibGUI: Make Ctrl-Right at the end of a span workBen Wiederhake
There used to be the silly bug that when the cursor was already at the end of a span (e.g. because the user just pressed Ctrl-Right), then Ctrl-Right had no effect. This bug does not appear with Ctrl-Left because due to the order in which the spans are iterated, the effective result is always correct. This patch also makes it more apparent that the algorithm is unnecessarily inefficient.
2021-10-15LibGUI: Don't update selection twice after Ctrl-RightBen Wiederhake
2021-10-15LibGUI: Make Ctrl-Shift-Home/-End work againBen Wiederhake
Previously, the initial call to update_selection() was missing, so if no text was already selected, then Ctrl-Shift-End would only move the cursor to the document end, but not select any text.
2021-10-15LibGUI: Convert always-valid pointer to referenceBen Wiederhake
The pointer is always assumed to be non-null, so let's change it to a reference.
2021-10-15LibJS: Implement ShadowRealm.prototype.importValue()Linus Groh
Well... sort of. This adds the function itself and all the scaffolding from the ShadowRealm API (and basically completes its implementation). However, we do not nearly have enough support for modules and imports, so we currently pretend whatever was attempted to be imported failed - once we have HostImportModuleDynamically it should be relatively easy to complete the implementation.
2021-10-15LibJS: Don't return empty value from PromiseReactionJob::call(), for nowLinus Groh
2021-10-15LibJS/Tests: Test ShadowRealm.prototype.evaluate() this value type checkLinus Groh
2021-10-15LibJS: Fix typo in LHS Object and RHS BigInt loosely equals checkLuke Wilde
Step 12 was using `lhs.is_bigint()` instead of `rhs.is_bigint()`, meaning you got: ```js 1n == Object(1n); // true Object(1n) == 1n; // false ``` This also adds spec comments to is_loosely_equal.
2021-10-15LibWeb: Compute horizontal overflow for the initial containing blockAndreas Kling
This finally allows LibWeb to scroll pages horizontally instead of just clipping things at the right edge.
2021-10-14LibJS: Use GlobalObject::associated_realm() for function object realmsLinus Groh
As outlined in the previous commit, this should be more reliable than Interpreter::realm(), as we don't always have access to an Interpreter.
2021-10-14LibJS: Add a way to get from a GlobalObject to its associated RealmLinus Groh
This is just another workaround, but it should be much more reliable than Interpreter::realm(), especially when allocating NativeFunctions and ECMAScriptFunctionObjects: we're guaranteed to have a GlobalObject at that point, and it likely was set as the GlobalObject of a Realm and can lead us back to it. We're however not guaranteed that the VM can give us an Interpreter, which is why functions in LibWeb can be a bit crashy at the moment. We use a WeakPtr<Realm> to properly handle the unlikely case where the Realm goes away after associating a GlobalObject to it. We'll always need _something_ of this sort if we want to support OrdinaryFunctionCreate and CreateBuiltinFunction without the explicit realm argument while no JS is running, because they want to use the current Realm Record (always in the first and as fallback in the second case).
2021-10-14LibWeb: Implement position:fixed painting at the stacking context levelAndreas Kling
This makes everything within the stacking context stick show up in the correct position.
2021-10-14LibWeb: Cleanup + spec comments in replaced element height computationAndreas Kling
2021-10-14LibWeb: Cleanup + spec comments in replaced element width computationAndreas Kling
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-14LibWeb: Make ReplacedBox intrinsic size setters take Optional<float>Andreas Kling
This allows callers to unset the respective intrinsic sizes by passing an empty Optional.
2021-10-14LibWeb: Use Box::has_intrinsic_aspect_ratio() check in FFC step 3Andreas Kling
Now that we can ask any Box about its intrinsic aspect ratio, let's fix a FIXME in FlexFormattingContext.
2021-10-14LibWeb: Rename "intrinsic ratio" => "intrinsic aspect ratio"Andreas Kling
2021-10-14LibWeb: Make intrinsic width/height/ratio a Box concept and simplify itAndreas Kling
Apparently it's not only replaced elements that can have intrinsic sizes, so let's move this concept from ReplacedBox to Box. To avoid bloating Box, we make the accessors virtual.
2021-10-14LibJS: Change normal_completion() parameter to Optional<Value>Linus Groh
The Completion constructor `VERIFY()`s that the passed argument is not an empty Value, so normal_completion({}) would crash (although it's currently not being used anywhere). We want to pass an empty Optional<Value> instead.
2021-10-14LibWeb: Stub out a basic IntersectionObserver interfaceTimothy Flynn
Note there are a couple of type differences between the spec and the IDL file added in this commit. For example, we will need to support a type of Variant to handle spec types such as "(double or sequence<double>)". But for now, this allows web pages to construct an IntersectionObserver with any valid type.
2021-10-14LibJS: Implement ShadowRealm.prototype.evaluate()Linus Groh
2021-10-14LibJS: Implement ShadowRealm.prototype[@@toStringTag]Linus Groh
2021-10-14LibJS: Start implementing ShadowRealmLinus Groh
This commit adds the ShadowRealm object itself, its constructor, and prototype (currently empty).
2021-10-14LibJS: Implement Wrapped Function Exotic ObjectsLinus Groh
This is a new concept from the ShadowRealm API stage 3 proposal: https://tc39.es/proposal-shadowrealm/#sec-wrapped-function-exotic-objects
2021-10-13LibWeb: Add spec comments to FFC layout algorithm step 2Andreas Kling
2021-10-13LibWeb: Add spec comments to FFC layout algorithm step 5Andreas Kling
2021-10-13LibWeb: Tidy up and add spec comments to FFC layout algorithm step 3Andreas Kling
2021-10-13LibWeb: Add CSS::FlexBasisData::is_definite()Andreas Kling
This will allow some more expressive code in FlexFormattingContext.
2021-10-13LibWeb: Add FFC::flex_container() and use throughoutAndreas Kling
Since FFC is only ever run() on the flex container, we can assume (but verify) that the run box is the flex container and use an accessor throughout. The end result: less parameter passing.
2021-10-13LibWeb: Make FFC line and item vectors members instead of localsAndreas Kling
This gives all member functions access to these vectors without having to pass them as arguments.
2021-10-13LibWeb: Make various function parameters const in FlexFormattingContextAndreas Kling
This is mainly to validate that inputs are treated as inputs only and don't get written to.
2021-10-13LibWeb: Move FFC layout algorithm step 16 to a separate functionAndreas Kling
2021-10-13LibWeb: Move FFC layout algorithm step 15 to a separate functionAndreas Kling
2021-10-13LibWeb: Move FFC layout algorithm step 14 to a separate functionAndreas Kling
2021-10-13LibWeb: Move FFC layout algorithm step 12 to a separate functionAndreas Kling
2021-10-13LibWeb: Move FFC layout algorithm step 11 to a separate functionAndreas Kling
2021-10-13LibWeb: Move FFC layout algorithm step 8 to a separate functionAndreas Kling