summaryrefslogtreecommitdiff
path: root/Meta/Lagom
AgeCommit message (Collapse)Author
2022-02-16LibCore+Everywhere: Return ErrorOr from ConfigFile factory methodsSam Atkins
I've attempted to handle the errors gracefully where it was clear how to do so, and simple, but a lot of this was just adding `release_value_but_fixme_should_propagate_errors()` in places.
2022-02-16LibWeb: Separate "event listener" from "EventListener"Andreas Kling
I can't imagine how this happened, but it seems we've managed to conflate the "event listener" and "EventListener" concepts from the DOM specification in some parts of the code. We previously had two things: - DOM::EventListener - DOM::EventTarget::EventListenerRegistration DOM::EventListener was roughly the "EventListener" IDL type, and DOM::EventTarget::EventListenerRegistration was roughly the "event listener" concept. However, they were used interchangeably (and incorrectly!) in many places. After this patch, we now have: - DOM::IDLEventListener - DOM::DOMEventListener DOM::IDLEventListener is the "EventListener" IDL type, and DOM::DOMEventListener is the "event listener" concept. This patch also updates the addEventListener() and removeEventListener() functions to follow the spec more closely, along with the "inner invoke" function in our EventDispatcher.
2022-02-16Meta: Make the WrapperGenerator generate includes based on importsAli Mohammad Pur
We no longer include all the things, so each generated IDL file only depends on the things it actually needs now. A possible downside is that all IDL files have to explicitly import their dependencies. Note that non-IDL dependencies still remain and are injected into all generated files, this can be resolved later if desired by allowing IDL files to import headers.
2022-02-16Meta: Support DOMExceptions when invoking IDL getters/settersAli Mohammad Pur
2022-02-16Meta: Add support for enumerations to the IDL compilerAli Mohammad Pur
2022-02-16LibUnicode: Use BCP 47 data to filter valid calendar namesTimothy Flynn
2022-02-16LibUnicode: Use BCP 47 data to filter valid numbering system namesTimothy Flynn
There isn't too much of an effective difference here other than that the BCP 47 data contains some aliases we would otherwise not handle.
2022-02-16LibUnicode: Use BCP 47 data to generate available calendars and numbersTimothy Flynn
BCP 47 will be the single source of truth for known calendar and number system keywords, and their aliases (e.g. "gregory" is an alias for "gregorian"). Move the generation of available keywords to where we parse the BCP 47 data, so that hard-coded aliases may be removed from other generators.
2022-02-16LibJS+LibUnicode: Parse Unicode keywords from the BCP 47 CLDR packageTimothy Flynn
We have a fair amount of hard-coded keywords / aliases that can now be replaced with real data from BCP 47. As a result, the also changes the awkward way we were previously generating keys. Before, we were more or less generating keywords as a CSV list of keys, e.g. for the "nu" key, we'd generate "latn,arab,grek" (ordered by locale preference). Then at runtime, we'd split on the comma. We now just generate spans of keywords directly.
2022-02-16LibUnicode: Extract the BCP 47 package from the CLDRTimothy Flynn
This package was originally meant to be included in CLDR version 40, but was missed in their release scripts. This has been resolved: https://unicode-org.atlassian.net/browse/CLDR-15158 Unfortunately, the CLDR was re-released with the same version number. So to bust the build's CLDR cache, change the "version" used to detect that we need to redownload the CLDR.
2022-02-15Meta+LibUnicode: Download and parse Unicode block propertiesthankyouverycool
This parses Blocks.txt for CharacterType properties and creates a global display array for use in apps.
2022-02-15LibWeb: Remove non-standard ReturnNullIfCrossOrigin IDL attributeLinus Groh
This is no longer needed as BrowsingContextContainer::content_document() now does the right thing, and HTMLIFrameElement.contentDocument is the only user of this attribute. Let's not invent our own mechanisms for things that are important to get right, like same origin comparisons.
2022-02-14LibJS: Get rid of unnecessary work from canonical_numeric_index_stringAnonymous
The spec version of canonical_numeric_index_string is absurdly complex, and ends up converting from a string to a number, and then back again which is both slow and also requires a few allocations and a string compare. Instead this patch moves away from using Values to represent canonical a canonical index. In most cases all we need to know is whether a PropertyKey is an integer between 0 and 2^^32-2, which we already compute when we construct a PropertyKey so the existing is_number() check is sufficient. The more expensive case is handling strings containing numbers that don't roundtrip through string conversion. In most cases these turn into regular string properties, but for TypedArray access these property names are not treated as normal named properties. TypedArrays treat these numeric properties as magic indexes that are ignored on read and are not stored (but are evaluated) on assignment. For that reason there's now a mode flag on canonical_numeric_index_string so that only TypedArrays take the cost of the ToString round trip test. In order to improve the performance of this path this patch includes some early returns to avoid conversion in cases where we can quickly know whether a property can round trip.
2022-02-14LibUnicode: Port the CLDR time format generator to the stream APITimothy Flynn
2022-02-14LibUnicode: Port the CLDR date format generator to the stream APITimothy Flynn
2022-02-14LibUnicode: Port the CLDR number format generator to the stream APITimothy Flynn
2022-02-14LibUnicode: Port the CLDR locale generator to the stream APITimothy Flynn
This adds a generator utility to read an entire file and parse it as a JSON value. This is heavily used by the CLDR generators. The idea here is to put the file reading details in the utility so that when we have a good story for generically reading an entire stream in LibCore, we can update the generators to use that by only touching this helper.
2022-02-14LibUnicode: Port the UCD generator to the stream APITimothy Flynn
2022-02-14LibTimeZone: Port the TZDB generator to the stream APITimothy Flynn
This also moves the open_file helper to the utility file. It's currently a lambda redefined in each TZDB/Unicode generator. It used to display the missing command line flag and other info local to each generator. After switching to LibMain, it just returns a generic error message, and is duplicated several times.
2022-02-14LibWeb: Add support for record<K, V> types as inputLuke Wilde
2022-02-13Revert "LibJS: Get rid of unnecessary work from canonical_numeric_index_string"Andreas Kling
This reverts commit 3a184f784186ad1c5a9704b05ab0902d577d5748. This broke a number of test262 tests under "TypedArrayConstructors". The issue is that the CanonicalNumericIndexString AO should not fail for inputs like "1.1", despite them not being integral indices.
2022-02-13LibJS: Get rid of unnecessary work from canonical_numeric_index_stringAnonymous
The spec version of canonical_numeric_index_string is absurdly complex, and ends up converting from a string to a number, and then back again which is both slow and also requires a few allocations and a string compare. Instead lets use the logic we already have as that is much more efficient. This improves performance of all non-numeric property names.
2022-02-12LibWeb: Implement Geometry::DOMRectListDerpyCrabs
Implement DOMRectList that is used as a return type of getClientRects functions on Element and Range.
2022-02-09LibWeb: Add initial implementation for WorkerGlobalScopeAndrew Kaster
This initial implementation stubs out the WorkerGlobalScope, WorkerLocation and WorkerNavigator classes. It doesn't take into account all the things that actually need passed into the constructors for these objects, nor the extra abstract operations that need to be performed on them by the rest of the Browser infrastructure. However, it does create bindings that compile and link :^)
2022-02-09LibWeb: Stop using MVL for sequence storage in WrapperGeneratorLinus Groh
Use MarkedVector<Value> instead.
2022-02-09LibJS: Replace uses of MarkedValueList with MarkedVector<Value>Linus Groh
This is effectively a drop-in replacement.
2022-02-09Meta: Add a CPack installation target for js(1)Timothy Flynn
This adds a CPack configuration to generate a release package for js(1). Our current CMake requirement is 3.16, which doesn't have a great story for automatically installing a binary target's library dependencies. If we eventually require CMake 3.21 or above, we can remove the helper .cmake file added here in lieu of RUNTIME_DEPENDENCIES.
2022-02-08LibWeb: Rewrite EventTarget to more closely match the specLuke Wilde
This isn't perfect (especially the global object situation in activate_event_handler), but I believe it's in a much more complete state now :^) This fixes the issue of crashing in prepare_for_ordinary_call with the `i < m_size` crash, as it now uses the IDL callback functions which requires the Environment Settings Object. The environment settings object for the callback is fetched at the time the callback is created, for example, WrapperGenerator gets the incumbent settings object for the callback at the time of wrapping. This allows us to remove passing in ScriptExecutionContext into EventTarget's constructor. With this, we can now drop ScriptExecutionContext.
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-07LibGUI: Remove GML prefix in favor of proper namespacekleines Filmröllchen
Prefixes are very much a C thing which we don't need in C++. This commit moves all GML-related classes in LibGUI into the GUI::GML namespace, a change somewhat overdue.
2022-02-07Meta: Add instructions on using Lagom in an external projectJames Puleo
2022-02-07LibWeb: Add a proper FocusEvent interface for "focus" and "blur" eventsAndreas Kling
2022-02-06Everywhere: Rename JS::PropertyKey variables from property_{name => key}Linus Groh
PropertyKey used to be called PropertyName, but got renamed. Let's update all the variables of this type as well.
2022-02-06Lagom: Exclude libraries with X86 code when building for macOS on ArmMorten Larsen
The CMakeLists.txt for Lagom contains a few libraries and executables with X86-specific code. By excluding those libraries, Lagom builds for macOS on Arm as well. The places are marked FIXME to be removed when the libraries will build for Arm.
2022-02-04LibWeb: Type-check calc() in in property_accepts_value()Sam Atkins
This means only CalculatedStyleValues that would return the desired type will be accepted.
2022-02-03LibWeb: Add barebones CanvasGradient objectAndreas Kling
Also add the CanvasRenderingContext2D APIs to go along with it. Note that it can't be used for anything yet.
2022-02-03LibTimeZone: Parse and generate time zone coordinate dataTimothy Flynn
2022-01-31LibUnicode: Download and parse {Grapheme,Word,Sentence} break propsIdan Horowitz
2022-01-31Everywhere: Update copyrights with my new serenityos.org e-mail :^)Timothy Flynn
2022-01-31LibWeb: Add initial support for passing union types into IDL functionsLuke Wilde
This currently does not accept ArrayBuffer, DataView, TypedArrays, callback functions, nullable types, dictionaries, records and frozen arrays.
2022-01-31LibWeb: Add support for passing sequences into IDL functionsLuke Wilde
2022-01-31LibTimeZone: Use new generator util to generate all time zonesTimothy Flynn
Added the call to generate_available_values(), then realized it is the exact same as the existing, manually written implementation. So let's use the new utility.
2022-01-31LibUnicode: Generate a list of available currenciesTimothy Flynn
2022-01-31LibUnicode: Generate a list of available numbering systemsTimothy Flynn
2022-01-31LibUnicode: Generate a list of available calendarsTimothy Flynn
2022-01-29LibUnicode: Fill in case-first and numeric BCP47 keywordsTimothy Flynn
Unlike other BCP47 keywords that we are parsing, these only appear in the BCP47 XML file itself within the CLDR. The values are very simple though, so just hard code them until the Unicode org re-releases the CLDR with BCP47: https://unicode-org.atlassian.net/browse/CLDR-15158
2022-01-29IPCCompiler: Don't loop endlessly on nameless parametersItamar
Previously, given a malformed IPC call declaration, where a parameter does not have a name, the IPCCompiler would spin endlessly while consuming more and more memory. This is because it parses the parameter type incorrectly (it consumes superfluous characters into the parameter type). An example for such malformed declaration is: tokens_info_result(Vector<GUI::AutocompleteProvider::TokenInfo>) =| As a temporary fix, this adds VERIFY calls that would fail if we're at EOF when parsing parameter names. A real solution would be to parse C++ parameter types correctly. LibCpp's Parser could be used for this task.
2022-01-27LibUnicode: Parse and generate relative-time format patternsTimothy Flynn
Relative-time format patterns are of one of two forms: * Tensed - refer to the past or the future, e.g. "N years ago" or "in N years". * Numbered - refer to a specific numeric value, e.g. "in 1 year" becomes "next year" and "in 0 years" becomes "this year". In ECMA-402, tensed and numbered refer to the numeric formatting options of "always" and "auto", respectively.
2022-01-27LibUnicode: Create a nearly empty generator for relative-time formattingTimothy Flynn
This sets up the generator plumbing to create the relative-time data files. This data could probably be included in the date-time generator, but that generator is large enough that I'd rather put this tangentially related data in its own file.
2022-01-27LibUnicode: Remove extraneous semi-colons at end of generator functionsTimothy Flynn