summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2021-10-01Spreadsheet: Move menu and action code to initialize_menubar()Samuel Bowman
Previously, all the code to add menus and actions was in main(). This was messy and didn't allow us to reference the actions from SpreadsheetWidget, which is needed in order to add a toolbar. This commit moves the menu and action adding code to method on SpreadsheetWidget called initialize_menubar() which is based upon applications such as TextEditor which have identically named methods doing the same thing. In additon, clipboard_action(), previouly a lambda in main(), has also been made into a method on SpreadsheetWidget since it would otherwise be destroyed when it goes out of scope. (This was previously avoided by declaring the lambda in main() so it's always in scope.)
2021-10-01LibJS: Remove transition avoidance & start caching prototype transitionsAndreas Kling
The way that transition avoidance (foo_without_transition) was implemented led to shapes being unshareable and caused shape explosion instead, precisely what we were trying to avoid. This patch removes all the attempts to avoid transitioning shapes, and instead *adds* transitions when changing an object's prototype. This makes transitions flow naturally, and as a result we end up with way fewer shape objects in real-world situations. When we run out of big problems, we can get back to avoiding transitions as an optimization, but for now, let's avoid ballooning our processes with a unique shape for every object.
2021-10-01LibWeb: Implement MediaQueryList.onchangeLuke Wilde
2021-10-01LibMarkdown: Fix typo in variable nameNico Weber
2021-10-01Userland: Fix typosNico Weber
2021-10-01LibWeb: Implement AbortSignal.onabortLuke Wilde
2021-10-01Libraries: Fix typosNico Weber
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-10-01LibWeb: Implement HTMLStyleElement.sheetLuke Wilde
2021-09-30LibWeb: Add the Web::Crypto namespace, built-in, and getRandomValuesIdan Horowitz
Since we don't support IDL typedefs or unions yet, the responsibility of verifying the type of the argument is temporarily moved from the generated Wrapper to the implementation.
2021-09-30LibJS: Fix that in Bytecode mode functions where not created anymoredavidot
This is not a proper fix as we should follow the spec here but it gets us back to a slightly more working state.
2021-09-30SpreadSheet: Fix that non first sheets could not access global functionsdavidot
Because we declare the functions in runtime.js we need the correct global object to be setup otherwise they cannot be accessed when switching to the SheetGlobalObject.
2021-09-30RequestServer: Avoid storing a strong reference to a socket in callbacksAli Mohammad Pur
Unused sockets created by EnsureConnection should not keep the socket around (storing a strong reference will create a reference cycle). This fixes a whole bunch more RS spins.
2021-09-30RequestServer: Use an OwnPtr for the connection cache vectorAli Mohammad Pur
Just as removing individual connections can cause the vector entries to change positions, adding or removing connections to the cache can also move the connections around, which would make it possible for a connection to avoid being deleted (and make the RS spin on the Notifier for that connection). This commit makes it so that no connection cache is left when it's supposed to be deleted. Fixes a few more RS spins.
2021-09-30LibHTTP: Respect the 'Connection: close' header on keep-alive jobsAli Mohammad Pur
If the server responds with this header, we _must_ close the connection, as the server is allowed to ignore the socket and not respond to anything past that response. Fixes some RequestServer spins.
2021-09-30SpreadSheet: Fix that the js integration abused global objectsdavidot
Before this commit it only allocated the global object so when it wanted to lookup 'thisSheet' it could not find it in the global environment. We now hotswap the global object everytime a cell evaluated. This also fixes that SheetGlobalObject did not have an internal_has_property meaning 'A0' could not be referenced unless it was via a member lookup (this.A0). This was already broken before the bindings refactoring. The correct behavior of realms in spreadsheet is not completely clear since what is shared between sheets is not very well defined. The reason that just setting the SheetGlobalObject as the global_this_value is not enough is because ECMAScript does not check the global_this_value for members when resolving a reference in the global environment.
2021-09-30LibJS: Fix switch skipping case evaluation when hitting the default casedavidot
When no case match we should not just execute the statements of the default case but also of any cases below the default case.
2021-09-30LibJS: Make scoping follow the specdavidot
Before this we used an ad-hoc combination of references and 'variables' stored in a hashmap. This worked in most cases but is not spec like. Additionally hoisting, dynamically naming functions and scope analysis was not done properly. This patch fixes all of that by: - Implement BindingInitialization for destructuring assignment. - Implementing a new ScopePusher which tracks the lexical and var scoped declarations. This hoists functions to the top level if no lexical declaration name overlaps. Furthermore we do checking of redeclarations in the ScopePusher now requiring less checks all over the place. - Add methods for parsing the directives and statement lists instead of having that code duplicated in multiple places. This allows declarations to pushed to the appropriate scope more easily. - Remove the non spec way of storing 'variables' in DeclarativeEnvironment and make Reference follow the spec instead of checking both the bindings and 'variables'. - Remove all scoping related things from the Interpreter. And instead use environments as specified by the spec. This also includes fixing that NativeFunctions did not produce a valid FunctionEnvironment which could cause issues with callbacks and eval. All FunctionObjects now have a valid NewFunctionEnvironment implementation. - Remove execute_statements from Interpreter and instead use ASTNode::execute everywhere this simplifies AST.cpp as you no longer need to worry about which method to call. - Make ScopeNodes setup their own environment. This uses four different methods specified by the spec {Block, Function, Eval, Global}DeclarationInstantiation with the annexB extensions. - Implement and use NamedEvaluation where specified. Additionally there are fixes to things exposed by these changes to eval, {for, for-in, for-of} loops and assignment. Finally it also fixes some tests in test-js which where passing before but not now that we have correct behavior :^).
2021-09-30LibJS: Handle escaped keywords in more cases and handle 'await' labelsdavidot
2021-09-30LibJS: Allow multiple labels on the same statementdavidot
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-30LibJS: Allow member expressions in binding patternsdavidot
Also allows literal string and numbers as property names in object binding patterns.
2021-09-30LibJS: Disallow comma after rest parameter in formal parametersdavidot
2021-09-30LibJS: Make the default constructed reference invaliddavidot
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-30LibJS + test-js: Get results from the global object directlydavidot
This is as the spec would require you to do it and necessary for changes to come in the following commits.
2021-09-30LibJS: Remove unused delete_variable method in VMdavidot
2021-09-30LibWeb: Fix null dereference when assigning an ImageStyleValue via JSAndreas Kling
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-30LibWeb: Support Element.client{Top,Left,Width,Height}Andreas Kling
2021-09-30LibWeb: Support Element.matches(selectors)Andreas Kling
This returns whether an element matches any of a set of selectors.
2021-09-30LibWeb: Support HTMLElement.offset{Width,Height}Andreas Kling
2021-09-30LibSymbolication+SystemMonitor: Show ELF object in stackRodrigo Tobar
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-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
2021-09-29LibJS: Convert internal_get() to ThrowCompletionOrLinus Groh
2021-09-29LibJS: Convert internal_has_property() to ThrowCompletionOrLinus Groh
2021-09-29LibJS: Convert internal_define_own_property() to ThrowCompletionOrLinus Groh
2021-09-29LibJS: Convert internal_get_own_property() to ThrowCompletionOrLinus Groh
2021-09-29LibJS: Convert internal_prevent_extensions() to ThrowCompletionOrLinus Groh
2021-09-29LibJS: Convert internal_is_extensible() to ThrowCompletionOrLinus Groh
2021-09-29LibJS: Convert internal_set_prototype_of() to ThrowCompletionOrLinus Groh
2021-09-29LibJS: Convert internal_get_prototype_of() to ThrowCompletionOrLinus Groh
2021-09-30LibWeb: Expose CSSStyleRule on the window objectAndreas Kling
2021-09-30LibWeb: Reimplement the <style> element following the specAndreas Kling
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-30LibWeb: Add the CSSStyleRule interface with some limited functionalityAndreas Kling
2021-09-30LibWeb: Add Node::in_a_document_tree()Andreas Kling
This is "in a document tree" from the DOM spec.
2021-09-29LibGUI: Implement automatic scrolling in AbstractViewMarcus Nilsson
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-29LibGUI: Account for scrollbar width when calculating autoscroll deltaMarcus Nilsson
2021-09-29LibWeb: Implement most of CSSStyleRule.insertRule()Andreas Kling
2021-09-29LibWeb: Make CSSStyleDeclaration.camelCaseProperty work :^)Andreas Kling
This resolves a long-standing FIXME about exposing CSS properties to JavaScript via "camelCase" names rather than "dash-separated" names.
2021-09-29LibWeb: Add CSSStyleSheet.{insert,delete,remove}Rule() APIsAndreas Kling
Note that insertRule() is really just a big TODO right now.