davidot
79caca8ca2
LibJS: Allow multiple labels on the same statement
...
Since there are only a number of statements where labels can actually be
used we now also only store labels when necessary.
Also now tracks the first continue usage of a label since this might not
be valid but that can only be determined after we have parsed the
statement.
Also ensures the correct error does not get wiped by load_state.
2021-09-30 08:16:32 +01:00
davidot
bfc1b4ba61
LibJS: Allow member expressions in binding patterns
...
Also allows literal string and numbers as property names in object
binding patterns.
2021-09-30 08:16:32 +01:00
davidot
9cb5700398
LibJS: Disallow comma after rest parameter in formal parameters
2021-09-30 08:16:32 +01:00
davidot
7081fb4eb0
LibJS: Make the default constructed reference invalid
...
Since we have the to_reference method on every expression class we must
somehow communicate it did not actually return a reference.
This (ab)uses the fact that property name is only invalid with the
default constructor and already has is_valid().
2021-09-30 08:16:32 +01:00
davidot
ce3f29a135
LibJS + test-js: Get results from the global object directly
...
This is as the spec would require you to do it and necessary for changes
to come in the following commits.
2021-09-30 08:16:32 +01:00
davidot
53cc7e8398
LibJS: Remove unused delete_variable method in VM
2021-09-30 08:16:32 +01:00
Andreas Kling
198bb322ef
LibWeb: Fix null dereference when assigning an ImageStyleValue via JS
...
When parsing a CSS value in the context of a CSSStyleDeclaration
camelCase property setter, we don't necessarily have a Document to
provide the CSS parser for context.
So the parser can't go assuming that there's always a Document in the
ParsingContext. And ImageStyleValue can't go assuming that there's
always a Document either. This will require some more work to get things
right, I'm just patching up the null dereference for now.
2021-09-30 02:18:30 +02:00
Andreas Kling
3006e15c94
LibWeb: Support Element.client{Top,Left,Width,Height}
2021-09-30 02:17:23 +02:00
Andreas Kling
9d852623f2
LibWeb: Support Element.matches(selectors)
...
This returns whether an element matches any of a set of selectors.
2021-09-30 02:16:36 +02:00
Andreas Kling
439be913cf
LibWeb: Support HTMLElement.offset{Width,Height}
2021-09-30 01:35:19 +02:00
Rodrigo Tobar
840822b8f1
LibSymbolication+SystemMonitor: Show ELF object in stack
...
This small patch allows SystemMonitor's Stack tab to show the name of
the ELF object to which the displayed address refers to. This gives a
bit more of contextual information to the viewer.
A better to show this is probably a table, but I'm not that familiar yet
with the GUI framework in general, so I'm keeping things simple.
2021-09-30 00:51:08 +02:00
Linus Groh
ee8380edea
LibJS: Convert internal_own_property_keys() to ThrowCompletionOr
2021-09-29 23:49:53 +01:00
Linus Groh
fbfb0bb908
LibJS: Convert internal_delete() to ThrowCompletionOr
2021-09-29 23:49:53 +01:00
Linus Groh
e5409c6ead
LibJS: Convert internal_set() to ThrowCompletionOr
2021-09-29 23:49:53 +01:00
Linus Groh
6c2b974db2
LibJS: Convert internal_get() to ThrowCompletionOr
2021-09-29 23:49:53 +01:00
Linus Groh
d9895ec12d
LibJS: Convert internal_has_property() to ThrowCompletionOr
2021-09-29 23:49:53 +01:00
Linus Groh
5da210125e
LibJS: Convert internal_define_own_property() to ThrowCompletionOr
2021-09-29 23:49:53 +01:00
Linus Groh
0e69a6e487
LibJS: Convert internal_get_own_property() to ThrowCompletionOr
2021-09-29 23:49:53 +01:00
Linus Groh
73bae7d779
LibJS: Convert internal_prevent_extensions() to ThrowCompletionOr
2021-09-29 23:49:53 +01:00
Linus Groh
9b4362f10a
LibJS: Convert internal_is_extensible() to ThrowCompletionOr
2021-09-29 23:49:53 +01:00
Linus Groh
8c81c84c18
LibJS: Convert internal_set_prototype_of() to ThrowCompletionOr
2021-09-29 23:49:53 +01:00
Linus Groh
5148150e1c
LibJS: Convert internal_get_prototype_of() to ThrowCompletionOr
2021-09-29 23:49:53 +01:00
Andreas Kling
c8bf7f9c41
LibWeb: Expose CSSStyleRule on the window object
2021-09-30 00:05:40 +02:00
Andreas Kling
d462a6720a
LibWeb: Reimplement the <style> element following the spec
...
We now follow the "update a style block" algorithm from the HTML spec
instead of using the ad-hoc CSSLoader mechanism.
This necessitated improving our StyleSheet and CSSStyleSheet classes as
well, so that's baked into this commit.
2021-09-30 00:00:55 +02:00
Andreas Kling
6cda24097b
LibWeb: Add the CSSStyleRule interface with some limited functionality
2021-09-30 00:00:55 +02:00
Andreas Kling
71087422f6
LibWeb: Add Node::in_a_document_tree()
...
This is "in a document tree" from the DOM spec.
2021-09-30 00:00:55 +02:00
Marcus Nilsson
d660e86d13
LibGUI: Implement automatic scrolling in AbstractView
...
This adds automatic scrolling when dragging items in TreeViews and other
widgets that inherit from AbstractView when the overloaded
accepts_drag() returns true. This is implemented in FileSystemModel to
allow directories and files to be dragged.
2021-09-29 23:58:55 +02:00
Marcus Nilsson
53cfc6ec9f
LibGUI: Account for scrollbar width when calculating autoscroll delta
2021-09-29 23:58:55 +02:00
Andreas Kling
994e33b0f7
LibWeb: Implement most of CSSStyleRule.insertRule()
2021-09-29 21:21:57 +02:00
Andreas Kling
f53d0ddba2
LibWeb: Make CSSStyleDeclaration.camelCaseProperty work :^)
...
This resolves a long-standing FIXME about exposing CSS properties to
JavaScript via "camelCase" names rather than "dash-separated" names.
2021-09-29 21:21:57 +02:00
Andreas Kling
30d710a0a2
LibWeb: Add CSSStyleSheet.{insert,delete,remove}Rule() APIs
...
Note that insertRule() is really just a big TODO right now.
2021-09-29 21:21:57 +02:00
Andreas Kling
3a4565beec
LibWeb: Make CSSRule and CSSRuleList available to JavaScript :^)
...
This patch makes both of these classes inherit from RefCounted and
Bindings::Wrappable, plus some minimal rejigging to allow us to keep
using them internally while also exposing them to web content.
2021-09-29 21:21:57 +02:00
Linus Groh
87f0059088
LibJS: Fix a typo in a comment in Object.h
2021-09-29 19:20:28 +01:00
Marcus Nilsson
578318ca0f
Browser: Use CommonActions where possible and various fixes
...
This replaces some actions with CommonActions and also adds '...' to
menu items that require user input.
2021-09-29 20:04:20 +02:00
Idan Horowitz
3b9e8ec597
LibWeb: Add the missing CustomEvent IDL constructor
2021-09-29 19:38:41 +02:00
Sam Atkins
0b23a20ad5
LibWeb: Add CSSConditionRule
...
https://www.w3.org/TR/css-conditional-3/#the-cssconditionrule-interface
This simply exposes a condition string, which is implemented differently
in each sub-class.
2021-09-29 18:57:48 +02:00
Sam Atkins
06f9395056
LibWeb: Add CSSGroupingRule
...
This is an abstract base class for CSSRules that hold a CSSRuleList.
2021-09-29 18:57:48 +02:00
Sam Atkins
eb83d2617c
LibWeb: Use a CSSRuleList inside CSSStyleSheet
...
This better matches the spec. :^)
2021-09-29 18:57:48 +02:00
Sam Atkins
97a78cdd28
LibWeb: Add CSSRuleList
...
"The CSSRuleList interface represents an ordered collection of CSS style
rules." - https://www.w3.org/TR/cssom-1/#the-cssrulelist-interface
2021-09-29 18:57:48 +02:00
Andreas Kling
2758d99bbc
LibRegex: Flatten bytecode before performing optimizations
...
This avoids doing DisjointChunks traversal for every bytecode access,
significantly reducing startup time for large regular expressions.
2021-09-29 18:45:26 +02:00
Luke Wilde
7bdf0be667
LibWeb: Implement ChildNode.remove
2021-09-29 17:56:13 +02:00
Tobias Christiansen
610f14992a
LibWeb: Flexbox: Wrap inline Nodes if their parent is display: flex
2021-09-29 17:55:57 +02:00
Luke Wilde
881e9d1341
LibWeb: Make StyleSheetList.item an IDL getter
2021-09-29 14:57:59 +01:00
Idan Horowitz
e22d9dc360
LibWeb: Add the missing EventInit property to Event constructor
2021-09-29 10:09:33 +03:00
Idan Horowitz
5ce468338e
LibJS: Drop the Temporal prefix from TemporalMissingRequiredProperty
...
This allows us to use it for other exposed JS APIs that accept options
objects.
2021-09-29 10:09:33 +03:00
Andreas Kling
63d971d33b
LibWeb: Support window.screen{X,Y,Left,Top}
...
Some sites query these properties for whatever reason, so let's support
them. (But let's always pretend the screen coordinates are (0, 0))
2021-09-29 00:22:46 +02:00
Andreas Kling
0a90d466a0
LibWeb: Expose CSSStyleDeclaration on the window object
2021-09-28 23:28:44 +02:00
Andreas Kling
82af69376b
LibJS: Avoid unnecessary HashMap copy in FunctionEnvironment
2021-09-28 22:32:40 +02:00
Andreas Kling
d294a3f54a
LibJS: Avoid unnecessary HashMap growth in Interpreter::enter_scope()
...
Don't bother pre-allocating a hash map if we're not gonna put anything
into it anyway.
2021-09-28 22:32:40 +02:00
Andreas Kling
5855b19ff3
LibJS: Avoid unnecessary HashMap copy in ECMAScriptFunctionObject
2021-09-28 22:32:40 +02:00