From f87041bf3a8c76dce547dbd1f64d32b119f5468c Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Fri, 15 Nov 2024 04:01:23 +1300 Subject: [PATCH] LibGC+Everywhere: Factor out a LibGC from LibJS Resulting in a massive rename across almost everywhere! Alongside the namespace change, we now have the following names: * JS::NonnullGCPtr -> GC::Ref * JS::GCPtr -> GC::Ptr * JS::HeapFunction -> GC::Function * JS::CellImpl -> GC::Cell * JS::Handle -> GC::Root --- Documentation/LibWebPatterns.md | 6 +- .../{LibJS/Heap => LibGC}/BlockAllocator.cpp | 6 +- .../{LibJS/Heap => LibGC}/BlockAllocator.h | 4 +- Libraries/LibGC/CMakeLists.txt | 14 + .../Heap/CellImpl.cpp => LibGC/Cell.cpp} | 8 +- .../{LibJS/Heap/CellImpl.h => LibGC/Cell.h} | 44 +- .../{LibJS/Heap => LibGC}/CellAllocator.cpp | 12 +- .../{LibJS/Heap => LibGC}/CellAllocator.h | 18 +- .../Heap => LibGC}/ConservativeVector.cpp | 6 +- .../Heap => LibGC}/ConservativeVector.h | 8 +- Libraries/{LibJS/Heap => LibGC}/DeferGC.h | 4 +- Libraries/LibGC/Forward.h | 32 ++ Libraries/LibGC/Function.h | 50 ++ Libraries/{LibJS/Heap => LibGC}/Heap.cpp | 68 +-- Libraries/{LibJS/Heap => LibGC}/Heap.h | 58 +- Libraries/{LibJS/Heap => LibGC}/HeapBlock.cpp | 14 +- Libraries/{LibJS/Heap => LibGC}/HeapBlock.h | 34 +- Libraries/{LibJS/Heap => LibGC}/HeapRoot.h | 4 +- Libraries/{LibJS/Heap => LibGC}/Internals.h | 6 +- .../{LibJS/Heap => LibGC}/MarkedVector.cpp | 6 +- .../{LibJS/Heap => LibGC}/MarkedVector.h | 14 +- .../{LibJS/Heap => LibGC}/NanBoxedValue.h | 13 +- Libraries/{LibJS/Heap/GCPtr.h => LibGC/Ptr.h} | 74 +-- Libraries/LibGC/Root.cpp | 25 + Libraries/LibGC/Root.h | 169 ++++++ .../{LibJS/Heap => LibGC}/WeakContainer.cpp | 6 +- .../{LibJS/Heap => LibGC}/WeakContainer.h | 4 +- Libraries/LibJS/AST.cpp | 24 +- Libraries/LibJS/AST.h | 8 +- Libraries/LibJS/Bytecode/BasicBlock.h | 6 +- Libraries/LibJS/Bytecode/Executable.cpp | 2 +- Libraries/LibJS/Bytecode/Executable.h | 6 +- Libraries/LibJS/Bytecode/Generator.cpp | 8 +- Libraries/LibJS/Bytecode/Generator.h | 12 +- Libraries/LibJS/Bytecode/Instruction.h | 2 +- Libraries/LibJS/Bytecode/Interpreter.cpp | 46 +- Libraries/LibJS/Bytecode/Interpreter.h | 14 +- Libraries/LibJS/CMakeLists.txt | 11 +- Libraries/LibJS/Console.cpp | 46 +- Libraries/LibJS/Console.h | 28 +- Libraries/LibJS/Contrib/Test262/262Object.cpp | 4 +- Libraries/LibJS/Contrib/Test262/262Object.h | 6 +- .../LibJS/Contrib/Test262/AgentObject.cpp | 2 +- Libraries/LibJS/Contrib/Test262/AgentObject.h | 2 +- .../LibJS/Contrib/Test262/GlobalObject.cpp | 2 +- .../LibJS/Contrib/Test262/GlobalObject.h | 4 +- Libraries/LibJS/Contrib/Test262/IsHTMLDDA.cpp | 2 +- Libraries/LibJS/Contrib/Test262/IsHTMLDDA.h | 2 +- Libraries/LibJS/CyclicModule.cpp | 18 +- Libraries/LibJS/CyclicModule.h | 38 +- Libraries/LibJS/Forward.h | 20 - Libraries/LibJS/Heap/Cell.h | 7 +- Libraries/LibJS/Heap/Handle.cpp | 25 - Libraries/LibJS/Heap/Handle.h | 169 ------ Libraries/LibJS/Heap/HeapFunction.h | 50 -- Libraries/LibJS/Module.cpp | 20 +- Libraries/LibJS/Module.h | 36 +- Libraries/LibJS/ModuleLoading.h | 6 +- Libraries/LibJS/Parser.h | 2 +- .../LibJS/Runtime/AbstractOperations.cpp | 32 +- Libraries/LibJS/Runtime/AbstractOperations.h | 38 +- Libraries/LibJS/Runtime/Accessor.cpp | 2 +- Libraries/LibJS/Runtime/Accessor.h | 10 +- Libraries/LibJS/Runtime/AggregateError.cpp | 4 +- Libraries/LibJS/Runtime/AggregateError.h | 4 +- .../Runtime/AggregateErrorConstructor.cpp | 4 +- .../LibJS/Runtime/AggregateErrorConstructor.h | 4 +- .../LibJS/Runtime/AggregateErrorPrototype.cpp | 2 +- .../LibJS/Runtime/AggregateErrorPrototype.h | 2 +- Libraries/LibJS/Runtime/ArgumentsObject.cpp | 2 +- Libraries/LibJS/Runtime/ArgumentsObject.h | 6 +- Libraries/LibJS/Runtime/Array.cpp | 12 +- Libraries/LibJS/Runtime/Array.h | 16 +- Libraries/LibJS/Runtime/ArrayBuffer.cpp | 10 +- Libraries/LibJS/Runtime/ArrayBuffer.h | 10 +- .../LibJS/Runtime/ArrayBufferConstructor.cpp | 4 +- .../LibJS/Runtime/ArrayBufferConstructor.h | 4 +- .../LibJS/Runtime/ArrayBufferPrototype.cpp | 2 +- .../LibJS/Runtime/ArrayBufferPrototype.h | 2 +- Libraries/LibJS/Runtime/ArrayConstructor.cpp | 22 +- Libraries/LibJS/Runtime/ArrayConstructor.h | 4 +- Libraries/LibJS/Runtime/ArrayIterator.cpp | 4 +- Libraries/LibJS/Runtime/ArrayIterator.h | 4 +- .../LibJS/Runtime/ArrayIteratorPrototype.cpp | 2 +- .../LibJS/Runtime/ArrayIteratorPrototype.h | 2 +- Libraries/LibJS/Runtime/ArrayPrototype.cpp | 10 +- Libraries/LibJS/Runtime/ArrayPrototype.h | 4 +- .../LibJS/Runtime/AsyncFromSyncIterator.cpp | 6 +- .../LibJS/Runtime/AsyncFromSyncIterator.h | 8 +- .../AsyncFromSyncIteratorPrototype.cpp | 4 +- .../Runtime/AsyncFromSyncIteratorPrototype.h | 4 +- .../Runtime/AsyncFunctionConstructor.cpp | 4 +- .../LibJS/Runtime/AsyncFunctionConstructor.h | 4 +- .../Runtime/AsyncFunctionDriverWrapper.cpp | 6 +- .../Runtime/AsyncFunctionDriverWrapper.h | 12 +- .../LibJS/Runtime/AsyncFunctionPrototype.cpp | 2 +- .../LibJS/Runtime/AsyncFunctionPrototype.h | 2 +- Libraries/LibJS/Runtime/AsyncGenerator.cpp | 8 +- Libraries/LibJS/Runtime/AsyncGenerator.h | 10 +- .../AsyncGeneratorFunctionConstructor.cpp | 4 +- .../AsyncGeneratorFunctionConstructor.h | 4 +- .../AsyncGeneratorFunctionPrototype.cpp | 2 +- .../Runtime/AsyncGeneratorFunctionPrototype.h | 2 +- .../LibJS/Runtime/AsyncGeneratorPrototype.cpp | 4 +- .../LibJS/Runtime/AsyncGeneratorPrototype.h | 2 +- .../LibJS/Runtime/AsyncGeneratorRequest.h | 4 +- .../LibJS/Runtime/AsyncIteratorPrototype.cpp | 2 +- .../LibJS/Runtime/AsyncIteratorPrototype.h | 2 +- Libraries/LibJS/Runtime/AtomicsObject.cpp | 2 +- Libraries/LibJS/Runtime/AtomicsObject.h | 2 +- Libraries/LibJS/Runtime/BigInt.cpp | 6 +- Libraries/LibJS/Runtime/BigInt.h | 8 +- Libraries/LibJS/Runtime/BigIntConstructor.cpp | 4 +- Libraries/LibJS/Runtime/BigIntConstructor.h | 4 +- Libraries/LibJS/Runtime/BigIntObject.cpp | 4 +- Libraries/LibJS/Runtime/BigIntObject.h | 6 +- Libraries/LibJS/Runtime/BigIntPrototype.cpp | 4 +- Libraries/LibJS/Runtime/BigIntPrototype.h | 2 +- .../LibJS/Runtime/BooleanConstructor.cpp | 4 +- Libraries/LibJS/Runtime/BooleanConstructor.h | 4 +- Libraries/LibJS/Runtime/BooleanObject.cpp | 4 +- Libraries/LibJS/Runtime/BooleanObject.h | 4 +- Libraries/LibJS/Runtime/BooleanPrototype.cpp | 2 +- Libraries/LibJS/Runtime/BooleanPrototype.h | 2 +- Libraries/LibJS/Runtime/BoundFunction.cpp | 8 +- Libraries/LibJS/Runtime/BoundFunction.h | 12 +- .../LibJS/Runtime/ClassFieldDefinition.h | 6 +- Libraries/LibJS/Runtime/Completion.cpp | 2 +- Libraries/LibJS/Runtime/ConsoleObject.cpp | 4 +- Libraries/LibJS/Runtime/ConsoleObject.h | 4 +- .../LibJS/Runtime/ConsoleObjectPrototype.cpp | 2 +- .../LibJS/Runtime/ConsoleObjectPrototype.h | 2 +- Libraries/LibJS/Runtime/DataView.cpp | 4 +- Libraries/LibJS/Runtime/DataView.h | 8 +- .../LibJS/Runtime/DataViewConstructor.cpp | 4 +- Libraries/LibJS/Runtime/DataViewConstructor.h | 4 +- Libraries/LibJS/Runtime/DataViewPrototype.cpp | 2 +- Libraries/LibJS/Runtime/DataViewPrototype.h | 2 +- Libraries/LibJS/Runtime/Date.cpp | 4 +- Libraries/LibJS/Runtime/Date.h | 4 +- Libraries/LibJS/Runtime/DateConstructor.cpp | 4 +- Libraries/LibJS/Runtime/DateConstructor.h | 4 +- Libraries/LibJS/Runtime/DatePrototype.cpp | 2 +- Libraries/LibJS/Runtime/DatePrototype.h | 2 +- .../LibJS/Runtime/DeclarativeEnvironment.cpp | 2 +- .../LibJS/Runtime/DeclarativeEnvironment.h | 4 +- Libraries/LibJS/Runtime/DisposableStack.cpp | 2 +- Libraries/LibJS/Runtime/DisposableStack.h | 2 +- .../Runtime/DisposableStackConstructor.cpp | 4 +- .../Runtime/DisposableStackConstructor.h | 4 +- .../Runtime/DisposableStackPrototype.cpp | 4 +- .../LibJS/Runtime/DisposableStackPrototype.h | 2 +- .../Runtime/ECMAScriptFunctionObject.cpp | 16 +- .../LibJS/Runtime/ECMAScriptFunctionObject.h | 20 +- Libraries/LibJS/Runtime/Environment.h | 6 +- Libraries/LibJS/Runtime/Error.cpp | 16 +- Libraries/LibJS/Runtime/Error.h | 16 +- Libraries/LibJS/Runtime/ErrorConstructor.cpp | 8 +- Libraries/LibJS/Runtime/ErrorConstructor.h | 40 +- Libraries/LibJS/Runtime/ErrorPrototype.cpp | 4 +- Libraries/LibJS/Runtime/ErrorPrototype.h | 4 +- Libraries/LibJS/Runtime/ExecutionContext.cpp | 2 +- Libraries/LibJS/Runtime/ExecutionContext.h | 22 +- .../LibJS/Runtime/FinalizationRegistry.cpp | 10 +- .../LibJS/Runtime/FinalizationRegistry.h | 22 +- .../FinalizationRegistryConstructor.cpp | 4 +- .../Runtime/FinalizationRegistryConstructor.h | 4 +- .../Runtime/FinalizationRegistryPrototype.cpp | 4 +- .../Runtime/FinalizationRegistryPrototype.h | 2 +- .../LibJS/Runtime/FunctionConstructor.cpp | 8 +- Libraries/LibJS/Runtime/FunctionConstructor.h | 6 +- .../LibJS/Runtime/FunctionEnvironment.cpp | 2 +- Libraries/LibJS/Runtime/FunctionEnvironment.h | 4 +- Libraries/LibJS/Runtime/FunctionObject.h | 2 +- Libraries/LibJS/Runtime/FunctionPrototype.cpp | 4 +- Libraries/LibJS/Runtime/FunctionPrototype.h | 2 +- .../Runtime/GeneratorFunctionConstructor.cpp | 4 +- .../Runtime/GeneratorFunctionConstructor.h | 4 +- .../Runtime/GeneratorFunctionPrototype.cpp | 2 +- .../Runtime/GeneratorFunctionPrototype.h | 2 +- Libraries/LibJS/Runtime/GeneratorObject.cpp | 4 +- Libraries/LibJS/Runtime/GeneratorObject.h | 6 +- .../LibJS/Runtime/GeneratorPrototype.cpp | 2 +- Libraries/LibJS/Runtime/GeneratorPrototype.h | 2 +- Libraries/LibJS/Runtime/GlobalEnvironment.cpp | 2 +- Libraries/LibJS/Runtime/GlobalEnvironment.h | 10 +- Libraries/LibJS/Runtime/GlobalObject.cpp | 4 +- Libraries/LibJS/Runtime/GlobalObject.h | 8 +- Libraries/LibJS/Runtime/Intl/Collator.cpp | 2 +- Libraries/LibJS/Runtime/Intl/Collator.h | 4 +- .../Runtime/Intl/CollatorCompareFunction.cpp | 4 +- .../Runtime/Intl/CollatorCompareFunction.h | 6 +- .../Runtime/Intl/CollatorConstructor.cpp | 4 +- .../LibJS/Runtime/Intl/CollatorConstructor.h | 4 +- .../LibJS/Runtime/Intl/CollatorPrototype.cpp | 2 +- .../LibJS/Runtime/Intl/CollatorPrototype.h | 2 +- .../LibJS/Runtime/Intl/DateTimeFormat.cpp | 6 +- Libraries/LibJS/Runtime/Intl/DateTimeFormat.h | 8 +- .../Intl/DateTimeFormatConstructor.cpp | 6 +- .../Runtime/Intl/DateTimeFormatConstructor.h | 6 +- .../Runtime/Intl/DateTimeFormatFunction.cpp | 4 +- .../Runtime/Intl/DateTimeFormatFunction.h | 6 +- .../Runtime/Intl/DateTimeFormatPrototype.cpp | 2 +- .../Runtime/Intl/DateTimeFormatPrototype.h | 2 +- Libraries/LibJS/Runtime/Intl/DisplayNames.cpp | 2 +- Libraries/LibJS/Runtime/Intl/DisplayNames.h | 2 +- .../Runtime/Intl/DisplayNamesConstructor.cpp | 4 +- .../Runtime/Intl/DisplayNamesConstructor.h | 4 +- .../Runtime/Intl/DisplayNamesPrototype.cpp | 2 +- .../Runtime/Intl/DisplayNamesPrototype.h | 2 +- .../LibJS/Runtime/Intl/DurationFormat.cpp | 6 +- Libraries/LibJS/Runtime/Intl/DurationFormat.h | 2 +- .../Intl/DurationFormatConstructor.cpp | 4 +- .../Runtime/Intl/DurationFormatConstructor.h | 4 +- .../Runtime/Intl/DurationFormatPrototype.cpp | 2 +- .../Runtime/Intl/DurationFormatPrototype.h | 2 +- Libraries/LibJS/Runtime/Intl/Intl.cpp | 4 +- Libraries/LibJS/Runtime/Intl/Intl.h | 2 +- Libraries/LibJS/Runtime/Intl/ListFormat.cpp | 4 +- Libraries/LibJS/Runtime/Intl/ListFormat.h | 4 +- .../Runtime/Intl/ListFormatConstructor.cpp | 4 +- .../Runtime/Intl/ListFormatConstructor.h | 4 +- .../Runtime/Intl/ListFormatPrototype.cpp | 2 +- .../LibJS/Runtime/Intl/ListFormatPrototype.h | 2 +- Libraries/LibJS/Runtime/Intl/Locale.cpp | 16 +- Libraries/LibJS/Runtime/Intl/Locale.h | 16 +- .../LibJS/Runtime/Intl/LocaleConstructor.cpp | 4 +- .../LibJS/Runtime/Intl/LocaleConstructor.h | 4 +- .../LibJS/Runtime/Intl/LocalePrototype.cpp | 2 +- .../LibJS/Runtime/Intl/LocalePrototype.h | 2 +- Libraries/LibJS/Runtime/Intl/NumberFormat.cpp | 8 +- Libraries/LibJS/Runtime/Intl/NumberFormat.h | 10 +- .../Runtime/Intl/NumberFormatConstructor.cpp | 4 +- .../Runtime/Intl/NumberFormatConstructor.h | 4 +- .../Runtime/Intl/NumberFormatFunction.cpp | 4 +- .../LibJS/Runtime/Intl/NumberFormatFunction.h | 6 +- .../Runtime/Intl/NumberFormatPrototype.cpp | 2 +- .../Runtime/Intl/NumberFormatPrototype.h | 2 +- Libraries/LibJS/Runtime/Intl/PluralRules.cpp | 2 +- Libraries/LibJS/Runtime/Intl/PluralRules.h | 2 +- .../Runtime/Intl/PluralRulesConstructor.cpp | 4 +- .../Runtime/Intl/PluralRulesConstructor.h | 4 +- .../Runtime/Intl/PluralRulesPrototype.cpp | 4 +- .../LibJS/Runtime/Intl/PluralRulesPrototype.h | 2 +- .../LibJS/Runtime/Intl/RelativeTimeFormat.cpp | 4 +- .../LibJS/Runtime/Intl/RelativeTimeFormat.h | 4 +- .../Intl/RelativeTimeFormatConstructor.cpp | 4 +- .../Intl/RelativeTimeFormatConstructor.h | 4 +- .../Intl/RelativeTimeFormatPrototype.cpp | 2 +- .../Intl/RelativeTimeFormatPrototype.h | 2 +- .../LibJS/Runtime/Intl/SegmentIterator.cpp | 4 +- .../LibJS/Runtime/Intl/SegmentIterator.h | 6 +- .../Runtime/Intl/SegmentIteratorPrototype.cpp | 2 +- .../Runtime/Intl/SegmentIteratorPrototype.h | 2 +- Libraries/LibJS/Runtime/Intl/Segmenter.cpp | 4 +- Libraries/LibJS/Runtime/Intl/Segmenter.h | 4 +- .../Runtime/Intl/SegmenterConstructor.cpp | 4 +- .../LibJS/Runtime/Intl/SegmenterConstructor.h | 4 +- .../LibJS/Runtime/Intl/SegmenterPrototype.cpp | 2 +- .../LibJS/Runtime/Intl/SegmenterPrototype.h | 2 +- Libraries/LibJS/Runtime/Intl/Segments.cpp | 4 +- Libraries/LibJS/Runtime/Intl/Segments.h | 4 +- .../LibJS/Runtime/Intl/SegmentsPrototype.cpp | 2 +- .../LibJS/Runtime/Intl/SegmentsPrototype.h | 2 +- Libraries/LibJS/Runtime/Intrinsics.cpp | 10 +- Libraries/LibJS/Runtime/Intrinsics.h | 156 +++--- Libraries/LibJS/Runtime/Iterator.cpp | 28 +- Libraries/LibJS/Runtime/Iterator.h | 34 +- .../LibJS/Runtime/IteratorConstructor.cpp | 4 +- Libraries/LibJS/Runtime/IteratorConstructor.h | 4 +- Libraries/LibJS/Runtime/IteratorHelper.cpp | 6 +- Libraries/LibJS/Runtime/IteratorHelper.h | 18 +- .../LibJS/Runtime/IteratorHelperPrototype.cpp | 2 +- .../LibJS/Runtime/IteratorHelperPrototype.h | 2 +- Libraries/LibJS/Runtime/IteratorPrototype.cpp | 24 +- Libraries/LibJS/Runtime/IteratorPrototype.h | 2 +- Libraries/LibJS/Runtime/JSONObject.cpp | 2 +- Libraries/LibJS/Runtime/JSONObject.h | 6 +- Libraries/LibJS/Runtime/JobCallback.cpp | 8 +- Libraries/LibJS/Runtime/JobCallback.h | 14 +- Libraries/LibJS/Runtime/Map.cpp | 4 +- Libraries/LibJS/Runtime/Map.h | 6 +- Libraries/LibJS/Runtime/MapConstructor.cpp | 12 +- Libraries/LibJS/Runtime/MapConstructor.h | 4 +- Libraries/LibJS/Runtime/MapIterator.cpp | 4 +- Libraries/LibJS/Runtime/MapIterator.h | 6 +- .../LibJS/Runtime/MapIteratorPrototype.cpp | 2 +- .../LibJS/Runtime/MapIteratorPrototype.h | 2 +- Libraries/LibJS/Runtime/MapPrototype.cpp | 2 +- Libraries/LibJS/Runtime/MapPrototype.h | 2 +- Libraries/LibJS/Runtime/MathObject.cpp | 2 +- Libraries/LibJS/Runtime/MathObject.h | 2 +- Libraries/LibJS/Runtime/ModuleEnvironment.cpp | 2 +- Libraries/LibJS/Runtime/ModuleEnvironment.h | 4 +- .../LibJS/Runtime/ModuleNamespaceObject.cpp | 6 +- .../LibJS/Runtime/ModuleNamespaceObject.h | 6 +- Libraries/LibJS/Runtime/ModuleRequest.h | 4 +- Libraries/LibJS/Runtime/NativeFunction.cpp | 18 +- Libraries/LibJS/Runtime/NativeFunction.h | 22 +- Libraries/LibJS/Runtime/NumberConstructor.cpp | 4 +- Libraries/LibJS/Runtime/NumberConstructor.h | 4 +- Libraries/LibJS/Runtime/NumberObject.cpp | 4 +- Libraries/LibJS/Runtime/NumberObject.h | 4 +- Libraries/LibJS/Runtime/NumberPrototype.cpp | 2 +- Libraries/LibJS/Runtime/NumberPrototype.h | 2 +- Libraries/LibJS/Runtime/Object.cpp | 20 +- Libraries/LibJS/Runtime/Object.h | 26 +- Libraries/LibJS/Runtime/ObjectConstructor.cpp | 10 +- Libraries/LibJS/Runtime/ObjectConstructor.h | 4 +- Libraries/LibJS/Runtime/ObjectEnvironment.cpp | 2 +- Libraries/LibJS/Runtime/ObjectEnvironment.h | 4 +- Libraries/LibJS/Runtime/ObjectPrototype.cpp | 6 +- Libraries/LibJS/Runtime/ObjectPrototype.h | 2 +- Libraries/LibJS/Runtime/PrimitiveString.cpp | 16 +- Libraries/LibJS/Runtime/PrimitiveString.h | 24 +- .../LibJS/Runtime/PrivateEnvironment.cpp | 2 +- Libraries/LibJS/Runtime/PrivateEnvironment.h | 10 +- Libraries/LibJS/Runtime/Promise.cpp | 10 +- Libraries/LibJS/Runtime/Promise.h | 20 +- Libraries/LibJS/Runtime/PromiseCapability.cpp | 14 +- Libraries/LibJS/Runtime/PromiseCapability.h | 22 +- .../LibJS/Runtime/PromiseConstructor.cpp | 4 +- Libraries/LibJS/Runtime/PromiseConstructor.h | 4 +- Libraries/LibJS/Runtime/PromiseJobs.cpp | 6 +- Libraries/LibJS/Runtime/PromiseJobs.h | 6 +- Libraries/LibJS/Runtime/PromisePrototype.cpp | 2 +- Libraries/LibJS/Runtime/PromisePrototype.h | 2 +- Libraries/LibJS/Runtime/PromiseReaction.cpp | 6 +- Libraries/LibJS/Runtime/PromiseReaction.h | 18 +- .../PromiseResolvingElementFunctions.cpp | 32 +- .../PromiseResolvingElementFunctions.h | 42 +- .../Runtime/PromiseResolvingFunction.cpp | 6 +- .../LibJS/Runtime/PromiseResolvingFunction.h | 12 +- Libraries/LibJS/Runtime/PropertyDescriptor.h | 4 +- Libraries/LibJS/Runtime/PropertyKey.h | 6 +- Libraries/LibJS/Runtime/PrototypeObject.h | 6 +- Libraries/LibJS/Runtime/ProxyConstructor.cpp | 6 +- Libraries/LibJS/Runtime/ProxyConstructor.h | 4 +- Libraries/LibJS/Runtime/ProxyObject.cpp | 14 +- Libraries/LibJS/Runtime/ProxyObject.h | 12 +- Libraries/LibJS/Runtime/Realm.cpp | 6 +- Libraries/LibJS/Runtime/Realm.h | 28 +- Libraries/LibJS/Runtime/Reference.cpp | 2 +- Libraries/LibJS/Runtime/ReflectObject.cpp | 2 +- Libraries/LibJS/Runtime/ReflectObject.h | 2 +- Libraries/LibJS/Runtime/RegExpConstructor.cpp | 4 +- Libraries/LibJS/Runtime/RegExpConstructor.h | 4 +- Libraries/LibJS/Runtime/RegExpObject.cpp | 14 +- Libraries/LibJS/Runtime/RegExpObject.h | 14 +- Libraries/LibJS/Runtime/RegExpPrototype.cpp | 10 +- Libraries/LibJS/Runtime/RegExpPrototype.h | 2 +- .../LibJS/Runtime/RegExpStringIterator.cpp | 4 +- .../LibJS/Runtime/RegExpStringIterator.h | 6 +- .../Runtime/RegExpStringIteratorPrototype.cpp | 2 +- .../Runtime/RegExpStringIteratorPrototype.h | 2 +- Libraries/LibJS/Runtime/Set.cpp | 8 +- Libraries/LibJS/Runtime/Set.h | 18 +- Libraries/LibJS/Runtime/SetConstructor.cpp | 4 +- Libraries/LibJS/Runtime/SetConstructor.h | 4 +- Libraries/LibJS/Runtime/SetIterator.cpp | 4 +- Libraries/LibJS/Runtime/SetIterator.h | 6 +- .../LibJS/Runtime/SetIteratorPrototype.cpp | 2 +- .../LibJS/Runtime/SetIteratorPrototype.h | 2 +- Libraries/LibJS/Runtime/SetPrototype.cpp | 2 +- Libraries/LibJS/Runtime/SetPrototype.h | 2 +- Libraries/LibJS/Runtime/ShadowRealm.cpp | 4 +- Libraries/LibJS/Runtime/ShadowRealm.h | 6 +- .../LibJS/Runtime/ShadowRealmConstructor.cpp | 4 +- .../LibJS/Runtime/ShadowRealmConstructor.h | 4 +- .../LibJS/Runtime/ShadowRealmPrototype.cpp | 2 +- .../LibJS/Runtime/ShadowRealmPrototype.h | 2 +- Libraries/LibJS/Runtime/Shape.cpp | 34 +- Libraries/LibJS/Runtime/Shape.h | 44 +- .../Runtime/SharedArrayBufferConstructor.cpp | 4 +- .../Runtime/SharedArrayBufferConstructor.h | 4 +- .../Runtime/SharedArrayBufferPrototype.cpp | 2 +- .../Runtime/SharedArrayBufferPrototype.h | 2 +- Libraries/LibJS/Runtime/StringConstructor.cpp | 4 +- Libraries/LibJS/Runtime/StringConstructor.h | 4 +- Libraries/LibJS/Runtime/StringIterator.cpp | 4 +- Libraries/LibJS/Runtime/StringIterator.h | 4 +- .../LibJS/Runtime/StringIteratorPrototype.cpp | 2 +- .../LibJS/Runtime/StringIteratorPrototype.h | 2 +- Libraries/LibJS/Runtime/StringObject.cpp | 8 +- Libraries/LibJS/Runtime/StringObject.h | 8 +- Libraries/LibJS/Runtime/StringPrototype.cpp | 6 +- Libraries/LibJS/Runtime/StringPrototype.h | 2 +- Libraries/LibJS/Runtime/SuppressedError.cpp | 4 +- Libraries/LibJS/Runtime/SuppressedError.h | 4 +- .../Runtime/SuppressedErrorConstructor.cpp | 4 +- .../Runtime/SuppressedErrorConstructor.h | 4 +- .../Runtime/SuppressedErrorPrototype.cpp | 2 +- .../LibJS/Runtime/SuppressedErrorPrototype.h | 2 +- Libraries/LibJS/Runtime/Symbol.cpp | 6 +- Libraries/LibJS/Runtime/Symbol.h | 6 +- Libraries/LibJS/Runtime/SymbolConstructor.cpp | 4 +- Libraries/LibJS/Runtime/SymbolConstructor.h | 4 +- Libraries/LibJS/Runtime/SymbolObject.cpp | 4 +- Libraries/LibJS/Runtime/SymbolObject.h | 6 +- Libraries/LibJS/Runtime/SymbolPrototype.cpp | 4 +- Libraries/LibJS/Runtime/SymbolPrototype.h | 2 +- .../Runtime/Temporal/AbstractOperations.cpp | 8 +- .../Runtime/Temporal/AbstractOperations.h | 8 +- Libraries/LibJS/Runtime/Temporal/Calendar.cpp | 20 +- Libraries/LibJS/Runtime/Temporal/Calendar.h | 26 +- .../Runtime/Temporal/CalendarConstructor.cpp | 4 +- .../Runtime/Temporal/CalendarConstructor.h | 4 +- .../Runtime/Temporal/CalendarPrototype.cpp | 4 +- .../Runtime/Temporal/CalendarPrototype.h | 2 +- Libraries/LibJS/Runtime/Temporal/Duration.cpp | 20 +- Libraries/LibJS/Runtime/Temporal/Duration.h | 14 +- .../Runtime/Temporal/DurationConstructor.cpp | 4 +- .../Runtime/Temporal/DurationConstructor.h | 4 +- .../Runtime/Temporal/DurationPrototype.cpp | 2 +- .../Runtime/Temporal/DurationPrototype.h | 2 +- Libraries/LibJS/Runtime/Temporal/Instant.cpp | 6 +- Libraries/LibJS/Runtime/Temporal/Instant.h | 6 +- .../Runtime/Temporal/InstantConstructor.cpp | 4 +- .../Runtime/Temporal/InstantConstructor.h | 4 +- .../Runtime/Temporal/InstantPrototype.cpp | 2 +- .../LibJS/Runtime/Temporal/InstantPrototype.h | 2 +- Libraries/LibJS/Runtime/Temporal/Now.cpp | 2 +- Libraries/LibJS/Runtime/Temporal/Now.h | 2 +- .../LibJS/Runtime/Temporal/PlainDate.cpp | 8 +- Libraries/LibJS/Runtime/Temporal/PlainDate.h | 14 +- .../Runtime/Temporal/PlainDateConstructor.cpp | 4 +- .../Runtime/Temporal/PlainDateConstructor.h | 4 +- .../Runtime/Temporal/PlainDatePrototype.cpp | 2 +- .../Runtime/Temporal/PlainDatePrototype.h | 2 +- .../LibJS/Runtime/Temporal/PlainDateTime.cpp | 8 +- .../LibJS/Runtime/Temporal/PlainDateTime.h | 24 +- .../Temporal/PlainDateTimeConstructor.cpp | 4 +- .../Temporal/PlainDateTimeConstructor.h | 4 +- .../Temporal/PlainDateTimePrototype.cpp | 2 +- .../Runtime/Temporal/PlainDateTimePrototype.h | 2 +- .../LibJS/Runtime/Temporal/PlainMonthDay.cpp | 2 +- .../LibJS/Runtime/Temporal/PlainMonthDay.h | 10 +- .../Temporal/PlainMonthDayConstructor.cpp | 4 +- .../Temporal/PlainMonthDayConstructor.h | 4 +- .../Temporal/PlainMonthDayPrototype.cpp | 2 +- .../Runtime/Temporal/PlainMonthDayPrototype.h | 2 +- .../LibJS/Runtime/Temporal/PlainTime.cpp | 4 +- Libraries/LibJS/Runtime/Temporal/PlainTime.h | 18 +- .../Runtime/Temporal/PlainTimeConstructor.cpp | 4 +- .../Runtime/Temporal/PlainTimeConstructor.h | 4 +- .../Runtime/Temporal/PlainTimePrototype.cpp | 2 +- .../Runtime/Temporal/PlainTimePrototype.h | 2 +- .../LibJS/Runtime/Temporal/PlainYearMonth.cpp | 6 +- .../LibJS/Runtime/Temporal/PlainYearMonth.h | 12 +- .../Temporal/PlainYearMonthConstructor.cpp | 4 +- .../Temporal/PlainYearMonthConstructor.h | 4 +- .../Temporal/PlainYearMonthPrototype.cpp | 2 +- .../Temporal/PlainYearMonthPrototype.h | 2 +- Libraries/LibJS/Runtime/Temporal/Temporal.cpp | 2 +- Libraries/LibJS/Runtime/Temporal/Temporal.h | 2 +- Libraries/LibJS/Runtime/Temporal/TimeZone.cpp | 18 +- Libraries/LibJS/Runtime/Temporal/TimeZone.h | 10 +- .../Runtime/Temporal/TimeZoneConstructor.cpp | 4 +- .../Runtime/Temporal/TimeZoneConstructor.h | 4 +- .../Runtime/Temporal/TimeZoneMethods.cpp | 8 +- .../LibJS/Runtime/Temporal/TimeZoneMethods.h | 10 +- .../Runtime/Temporal/TimeZonePrototype.cpp | 4 +- .../Runtime/Temporal/TimeZonePrototype.h | 2 +- .../LibJS/Runtime/Temporal/ZonedDateTime.cpp | 10 +- .../LibJS/Runtime/Temporal/ZonedDateTime.h | 10 +- .../Temporal/ZonedDateTimeConstructor.cpp | 4 +- .../Temporal/ZonedDateTimeConstructor.h | 4 +- .../Temporal/ZonedDateTimePrototype.cpp | 6 +- .../Runtime/Temporal/ZonedDateTimePrototype.h | 2 +- Libraries/LibJS/Runtime/TypedArray.cpp | 20 +- Libraries/LibJS/Runtime/TypedArray.h | 102 ++-- .../LibJS/Runtime/TypedArrayConstructor.cpp | 12 +- .../LibJS/Runtime/TypedArrayConstructor.h | 4 +- .../LibJS/Runtime/TypedArrayPrototype.cpp | 22 +- Libraries/LibJS/Runtime/TypedArrayPrototype.h | 2 +- Libraries/LibJS/Runtime/Uint8Array.cpp | 2 +- Libraries/LibJS/Runtime/Uint8Array.h | 4 +- Libraries/LibJS/Runtime/VM.cpp | 56 +- Libraries/LibJS/Runtime/VM.h | 79 +-- Libraries/LibJS/Runtime/Value.cpp | 14 +- Libraries/LibJS/Runtime/Value.h | 122 ++-- Libraries/LibJS/Runtime/WeakMap.cpp | 6 +- Libraries/LibJS/Runtime/WeakMap.h | 16 +- .../LibJS/Runtime/WeakMapConstructor.cpp | 4 +- Libraries/LibJS/Runtime/WeakMapConstructor.h | 4 +- Libraries/LibJS/Runtime/WeakMapPrototype.cpp | 2 +- Libraries/LibJS/Runtime/WeakMapPrototype.h | 2 +- Libraries/LibJS/Runtime/WeakRef.cpp | 8 +- Libraries/LibJS/Runtime/WeakRef.h | 14 +- .../LibJS/Runtime/WeakRefConstructor.cpp | 4 +- Libraries/LibJS/Runtime/WeakRefConstructor.h | 4 +- Libraries/LibJS/Runtime/WeakRefPrototype.cpp | 2 +- Libraries/LibJS/Runtime/WeakRefPrototype.h | 2 +- Libraries/LibJS/Runtime/WeakSet.cpp | 6 +- Libraries/LibJS/Runtime/WeakSet.h | 16 +- .../LibJS/Runtime/WeakSetConstructor.cpp | 4 +- Libraries/LibJS/Runtime/WeakSetConstructor.h | 4 +- Libraries/LibJS/Runtime/WeakSetPrototype.cpp | 2 +- Libraries/LibJS/Runtime/WeakSetPrototype.h | 2 +- .../Runtime/WrapForValidIteratorPrototype.cpp | 2 +- .../Runtime/WrapForValidIteratorPrototype.h | 2 +- Libraries/LibJS/Runtime/WrappedFunction.cpp | 6 +- Libraries/LibJS/Runtime/WrappedFunction.h | 8 +- Libraries/LibJS/Script.cpp | 4 +- Libraries/LibJS/Script.h | 12 +- Libraries/LibJS/SourceTextModule.cpp | 10 +- Libraries/LibJS/SourceTextModule.h | 10 +- Libraries/LibJS/SyntheticModule.cpp | 12 +- Libraries/LibJS/SyntheticModule.h | 10 +- Libraries/LibTest/JavaScriptTestRunner.h | 8 +- Libraries/LibWasm/CMakeLists.txt | 2 +- Libraries/LibWeb/Animations/Animatable.cpp | 32 +- Libraries/LibWeb/Animations/Animatable.h | 38 +- Libraries/LibWeb/Animations/Animation.cpp | 34 +- Libraries/LibWeb/Animations/Animation.h | 52 +- .../LibWeb/Animations/AnimationEffect.cpp | 4 +- Libraries/LibWeb/Animations/AnimationEffect.h | 8 +- .../Animations/AnimationPlaybackEvent.cpp | 6 +- .../Animations/AnimationPlaybackEvent.h | 6 +- .../LibWeb/Animations/AnimationTimeline.cpp | 4 +- .../LibWeb/Animations/AnimationTimeline.h | 16 +- .../LibWeb/Animations/DocumentTimeline.cpp | 8 +- .../LibWeb/Animations/DocumentTimeline.h | 6 +- .../LibWeb/Animations/KeyframeEffect.cpp | 24 +- Libraries/LibWeb/Animations/KeyframeEffect.h | 22 +- .../LibWeb/Bindings/AudioConstructor.cpp | 4 +- Libraries/LibWeb/Bindings/AudioConstructor.h | 4 +- Libraries/LibWeb/Bindings/ExceptionOrUtils.h | 2 +- Libraries/LibWeb/Bindings/HostDefined.h | 6 +- .../LibWeb/Bindings/ImageConstructor.cpp | 4 +- Libraries/LibWeb/Bindings/ImageConstructor.h | 4 +- Libraries/LibWeb/Bindings/Intrinsics.cpp | 2 +- Libraries/LibWeb/Bindings/Intrinsics.h | 14 +- Libraries/LibWeb/Bindings/MainThreadVM.cpp | 52 +- Libraries/LibWeb/Bindings/MainThreadVM.h | 20 +- .../LibWeb/Bindings/OptionConstructor.cpp | 6 +- Libraries/LibWeb/Bindings/OptionConstructor.h | 4 +- Libraries/LibWeb/Bindings/PlatformObject.cpp | 4 +- Libraries/LibWeb/Bindings/PlatformObject.h | 2 +- .../LibWeb/Bindings/PrincipalHostDefined.h | 8 +- .../LibWeb/Bindings/SyntheticHostDefined.h | 2 +- Libraries/LibWeb/CMakeLists.txt | 2 +- Libraries/LibWeb/CSS/AnimationEvent.cpp | 6 +- Libraries/LibWeb/CSS/AnimationEvent.h | 6 +- Libraries/LibWeb/CSS/CSSAnimation.cpp | 8 +- Libraries/LibWeb/CSS/CSSAnimation.h | 6 +- Libraries/LibWeb/CSS/CSSFontFaceRule.cpp | 4 +- Libraries/LibWeb/CSS/CSSFontFaceRule.h | 4 +- Libraries/LibWeb/CSS/CSSGroupingRule.h | 2 +- Libraries/LibWeb/CSS/CSSImportRule.cpp | 4 +- Libraries/LibWeb/CSS/CSSImportRule.h | 8 +- Libraries/LibWeb/CSS/CSSKeyframeRule.cpp | 4 +- Libraries/LibWeb/CSS/CSSKeyframeRule.h | 10 +- Libraries/LibWeb/CSS/CSSKeyframesRule.cpp | 6 +- Libraries/LibWeb/CSS/CSSKeyframesRule.h | 10 +- Libraries/LibWeb/CSS/CSSLayerBlockRule.cpp | 4 +- Libraries/LibWeb/CSS/CSSLayerBlockRule.h | 4 +- .../LibWeb/CSS/CSSLayerStatementRule.cpp | 4 +- Libraries/LibWeb/CSS/CSSLayerStatementRule.h | 4 +- Libraries/LibWeb/CSS/CSSMediaRule.cpp | 4 +- Libraries/LibWeb/CSS/CSSMediaRule.h | 6 +- Libraries/LibWeb/CSS/CSSNamespaceRule.cpp | 6 +- Libraries/LibWeb/CSS/CSSNamespaceRule.h | 4 +- .../LibWeb/CSS/CSSNestedDeclarations.cpp | 4 +- Libraries/LibWeb/CSS/CSSNestedDeclarations.h | 8 +- Libraries/LibWeb/CSS/CSSPropertyRule.cpp | 4 +- Libraries/LibWeb/CSS/CSSPropertyRule.h | 4 +- Libraries/LibWeb/CSS/CSSRule.h | 6 +- Libraries/LibWeb/CSS/CSSRuleList.cpp | 6 +- Libraries/LibWeb/CSS/CSSRuleList.h | 10 +- Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp | 16 +- Libraries/LibWeb/CSS/CSSStyleDeclaration.h | 20 +- Libraries/LibWeb/CSS/CSSStyleRule.cpp | 4 +- Libraries/LibWeb/CSS/CSSStyleRule.h | 6 +- Libraries/LibWeb/CSS/CSSStyleSheet.cpp | 18 +- Libraries/LibWeb/CSS/CSSStyleSheet.h | 38 +- Libraries/LibWeb/CSS/CSSSupportsRule.cpp | 4 +- Libraries/LibWeb/CSS/CSSSupportsRule.h | 4 +- Libraries/LibWeb/CSS/CSSTransition.cpp | 8 +- Libraries/LibWeb/CSS/CSSTransition.h | 10 +- Libraries/LibWeb/CSS/FontFace.cpp | 32 +- Libraries/LibWeb/CSS/FontFace.h | 20 +- Libraries/LibWeb/CSS/FontFaceSet.cpp | 34 +- Libraries/LibWeb/CSS/FontFaceSet.h | 28 +- Libraries/LibWeb/CSS/MediaList.cpp | 4 +- Libraries/LibWeb/CSS/MediaList.h | 4 +- Libraries/LibWeb/CSS/MediaQueryList.cpp | 8 +- Libraries/LibWeb/CSS/MediaQueryList.h | 10 +- Libraries/LibWeb/CSS/MediaQueryListEvent.cpp | 4 +- Libraries/LibWeb/CSS/MediaQueryListEvent.h | 4 +- Libraries/LibWeb/CSS/Parser/MediaParsing.cpp | 4 +- Libraries/LibWeb/CSS/Parser/Parser.cpp | 2 +- Libraries/LibWeb/CSS/Parser/Parser.h | 20 +- Libraries/LibWeb/CSS/Parser/ParsingContext.h | 4 +- Libraries/LibWeb/CSS/Parser/RuleParsing.cpp | 30 +- .../CSS/ResolvedCSSStyleDeclaration.cpp | 4 +- .../LibWeb/CSS/ResolvedCSSStyleDeclaration.h | 6 +- Libraries/LibWeb/CSS/Screen.cpp | 10 +- Libraries/LibWeb/CSS/Screen.h | 14 +- Libraries/LibWeb/CSS/ScreenOrientation.cpp | 10 +- Libraries/LibWeb/CSS/ScreenOrientation.h | 10 +- Libraries/LibWeb/CSS/SelectorEngine.cpp | 26 +- Libraries/LibWeb/CSS/SelectorEngine.h | 4 +- Libraries/LibWeb/CSS/StyleComputer.cpp | 26 +- Libraries/LibWeb/CSS/StyleComputer.h | 12 +- Libraries/LibWeb/CSS/StyleProperties.h | 14 +- Libraries/LibWeb/CSS/StyleSheet.h | 6 +- Libraries/LibWeb/CSS/StyleSheetList.cpp | 6 +- Libraries/LibWeb/CSS/StyleSheetList.h | 14 +- .../CSS/StyleValues/ImageStyleValue.cpp | 4 +- .../LibWeb/CSS/StyleValues/ImageStyleValue.h | 8 +- Libraries/LibWeb/CSS/VisualViewport.cpp | 4 +- Libraries/LibWeb/CSS/VisualViewport.h | 6 +- Libraries/LibWeb/Clipboard/Clipboard.cpp | 16 +- Libraries/LibWeb/Clipboard/Clipboard.h | 8 +- Libraries/LibWeb/Clipboard/ClipboardEvent.cpp | 4 +- Libraries/LibWeb/Clipboard/ClipboardEvent.h | 12 +- Libraries/LibWeb/Crypto/Crypto.cpp | 10 +- Libraries/LibWeb/Crypto/Crypto.h | 10 +- Libraries/LibWeb/Crypto/CryptoAlgorithms.cpp | 130 ++--- Libraries/LibWeb/Crypto/CryptoAlgorithms.h | 110 ++-- Libraries/LibWeb/Crypto/CryptoBindings.cpp | 2 +- Libraries/LibWeb/Crypto/CryptoBindings.h | 2 +- Libraries/LibWeb/Crypto/CryptoKey.cpp | 12 +- Libraries/LibWeb/Crypto/CryptoKey.h | 28 +- Libraries/LibWeb/Crypto/KeyAlgorithms.cpp | 26 +- Libraries/LibWeb/Crypto/KeyAlgorithms.h | 38 +- Libraries/LibWeb/Crypto/SubtleCrypto.cpp | 56 +- Libraries/LibWeb/Crypto/SubtleCrypto.h | 24 +- Libraries/LibWeb/DOM/AbortController.cpp | 6 +- Libraries/LibWeb/DOM/AbortController.h | 10 +- Libraries/LibWeb/DOM/AbortSignal.cpp | 18 +- Libraries/LibWeb/DOM/AbortSignal.h | 26 +- Libraries/LibWeb/DOM/AbstractRange.h | 4 +- .../LibWeb/DOM/AccessibilityTreeNode.cpp | 6 +- Libraries/LibWeb/DOM/AccessibilityTreeNode.h | 20 +- Libraries/LibWeb/DOM/AdoptedStyleSheets.cpp | 2 +- Libraries/LibWeb/DOM/AdoptedStyleSheets.h | 2 +- Libraries/LibWeb/DOM/Attr.cpp | 10 +- Libraries/LibWeb/DOM/Attr.h | 10 +- Libraries/LibWeb/DOM/CDATASection.cpp | 2 +- Libraries/LibWeb/DOM/CDATASection.h | 2 +- Libraries/LibWeb/DOM/CharacterData.cpp | 2 +- Libraries/LibWeb/DOM/CharacterData.h | 2 +- Libraries/LibWeb/DOM/ChildNode.h | 18 +- Libraries/LibWeb/DOM/Comment.cpp | 4 +- Libraries/LibWeb/DOM/Comment.h | 4 +- Libraries/LibWeb/DOM/CustomEvent.cpp | 6 +- Libraries/LibWeb/DOM/CustomEvent.h | 6 +- Libraries/LibWeb/DOM/DOMEventListener.cpp | 2 +- Libraries/LibWeb/DOM/DOMEventListener.h | 10 +- Libraries/LibWeb/DOM/DOMImplementation.cpp | 12 +- Libraries/LibWeb/DOM/DOMImplementation.h | 14 +- Libraries/LibWeb/DOM/DOMTokenList.cpp | 8 +- Libraries/LibWeb/DOM/DOMTokenList.h | 6 +- Libraries/LibWeb/DOM/Document.cpp | 284 +++++----- Libraries/LibWeb/DOM/Document.h | 312 +++++------ Libraries/LibWeb/DOM/DocumentFragment.cpp | 4 +- Libraries/LibWeb/DOM/DocumentFragment.h | 6 +- .../LibWeb/DOM/DocumentLoadEventDelayer.cpp | 2 +- .../LibWeb/DOM/DocumentLoadEventDelayer.h | 4 +- Libraries/LibWeb/DOM/DocumentLoading.cpp | 38 +- Libraries/LibWeb/DOM/DocumentLoading.h | 4 +- Libraries/LibWeb/DOM/DocumentObserver.cpp | 12 +- Libraries/LibWeb/DOM/DocumentObserver.h | 26 +- Libraries/LibWeb/DOM/DocumentType.cpp | 4 +- Libraries/LibWeb/DOM/DocumentType.h | 4 +- Libraries/LibWeb/DOM/EditingHostManager.cpp | 10 +- Libraries/LibWeb/DOM/EditingHostManager.h | 20 +- Libraries/LibWeb/DOM/Element.cpp | 82 +-- Libraries/LibWeb/DOM/Element.h | 74 +-- Libraries/LibWeb/DOM/ElementFactory.cpp | 14 +- Libraries/LibWeb/DOM/ElementFactory.h | 2 +- Libraries/LibWeb/DOM/Event.cpp | 12 +- Libraries/LibWeb/DOM/Event.h | 32 +- Libraries/LibWeb/DOM/EventDispatcher.cpp | 12 +- Libraries/LibWeb/DOM/EventDispatcher.h | 4 +- Libraries/LibWeb/DOM/EventTarget.cpp | 30 +- Libraries/LibWeb/DOM/EventTarget.h | 10 +- Libraries/LibWeb/DOM/HTMLCollection.cpp | 10 +- Libraries/LibWeb/DOM/HTMLCollection.h | 18 +- Libraries/LibWeb/DOM/IDLEventListener.cpp | 8 +- Libraries/LibWeb/DOM/IDLEventListener.h | 12 +- Libraries/LibWeb/DOM/InputEventsTarget.h | 4 +- Libraries/LibWeb/DOM/LiveNodeList.cpp | 10 +- Libraries/LibWeb/DOM/LiveNodeList.h | 8 +- Libraries/LibWeb/DOM/MutationObserver.cpp | 16 +- Libraries/LibWeb/DOM/MutationObserver.h | 34 +- Libraries/LibWeb/DOM/MutationRecord.cpp | 10 +- Libraries/LibWeb/DOM/MutationRecord.h | 14 +- Libraries/LibWeb/DOM/NamedNodeMap.cpp | 14 +- Libraries/LibWeb/DOM/NamedNodeMap.h | 16 +- Libraries/LibWeb/DOM/Node.cpp | 104 ++-- Libraries/LibWeb/DOM/Node.h | 68 +-- Libraries/LibWeb/DOM/NodeFilter.cpp | 4 +- Libraries/LibWeb/DOM/NodeFilter.h | 6 +- Libraries/LibWeb/DOM/NodeIterator.cpp | 12 +- Libraries/LibWeb/DOM/NodeIterator.h | 20 +- Libraries/LibWeb/DOM/NodeOperations.cpp | 8 +- Libraries/LibWeb/DOM/NodeOperations.h | 6 +- Libraries/LibWeb/DOM/NonElementParentNode.h | 6 +- Libraries/LibWeb/DOM/ParentNode.cpp | 34 +- Libraries/LibWeb/DOM/ParentNode.h | 26 +- Libraries/LibWeb/DOM/Position.cpp | 4 +- Libraries/LibWeb/DOM/Position.h | 18 +- .../LibWeb/DOM/ProcessingInstruction.cpp | 2 +- Libraries/LibWeb/DOM/ProcessingInstruction.h | 2 +- Libraries/LibWeb/DOM/Range.cpp | 96 ++-- Libraries/LibWeb/DOM/Range.h | 42 +- .../DOM/SelectionchangeEventDispatching.h | 2 +- Libraries/LibWeb/DOM/ShadowRoot.cpp | 8 +- Libraries/LibWeb/DOM/ShadowRoot.h | 10 +- Libraries/LibWeb/DOM/Slottable.cpp | 20 +- Libraries/LibWeb/DOM/Slottable.h | 32 +- Libraries/LibWeb/DOM/StaticNodeList.cpp | 8 +- Libraries/LibWeb/DOM/StaticNodeList.h | 8 +- Libraries/LibWeb/DOM/StaticRange.cpp | 4 +- Libraries/LibWeb/DOM/StaticRange.h | 8 +- Libraries/LibWeb/DOM/StyleElementUtils.h | 8 +- Libraries/LibWeb/DOM/Text.cpp | 8 +- Libraries/LibWeb/DOM/Text.h | 8 +- Libraries/LibWeb/DOM/TreeWalker.cpp | 48 +- Libraries/LibWeb/DOM/TreeWalker.h | 32 +- Libraries/LibWeb/DOM/XMLDocument.cpp | 4 +- Libraries/LibWeb/DOM/XMLDocument.h | 4 +- Libraries/LibWeb/DOMParsing/XMLSerializer.cpp | 12 +- Libraries/LibWeb/DOMParsing/XMLSerializer.h | 8 +- Libraries/LibWeb/DOMURL/DOMURL.cpp | 16 +- Libraries/LibWeb/DOMURL/DOMURL.h | 18 +- Libraries/LibWeb/DOMURL/URLSearchParams.cpp | 8 +- Libraries/LibWeb/DOMURL/URLSearchParams.h | 10 +- .../LibWeb/DOMURL/URLSearchParamsIterator.cpp | 4 +- .../LibWeb/DOMURL/URLSearchParamsIterator.h | 6 +- Libraries/LibWeb/Encoding/TextDecoder.cpp | 6 +- Libraries/LibWeb/Encoding/TextDecoder.h | 6 +- Libraries/LibWeb/Encoding/TextEncoder.cpp | 8 +- Libraries/LibWeb/Encoding/TextEncoder.h | 8 +- .../LibWeb/EntriesAPI/FileSystemEntry.cpp | 4 +- Libraries/LibWeb/EntriesAPI/FileSystemEntry.h | 4 +- .../EventTiming/PerformanceEventTiming.cpp | 4 +- .../EventTiming/PerformanceEventTiming.h | 8 +- Libraries/LibWeb/Fetch/Body.cpp | 26 +- Libraries/LibWeb/Fetch/Body.h | 22 +- Libraries/LibWeb/Fetch/BodyInit.cpp | 20 +- Libraries/LibWeb/Fetch/BodyInit.h | 4 +- Libraries/LibWeb/Fetch/FetchMethod.cpp | 12 +- Libraries/LibWeb/Fetch/FetchMethod.h | 6 +- .../Fetch/Fetching/FetchedDataReceiver.cpp | 12 +- .../Fetch/Fetching/FetchedDataReceiver.h | 16 +- Libraries/LibWeb/Fetch/Fetching/Fetching.cpp | 164 +++--- Libraries/LibWeb/Fetch/Fetching/Fetching.h | 18 +- .../LibWeb/Fetch/Fetching/PendingResponse.cpp | 16 +- .../LibWeb/Fetch/Fetching/PendingResponse.h | 22 +- Libraries/LibWeb/Fetch/Headers.cpp | 6 +- Libraries/LibWeb/Fetch/Headers.h | 14 +- Libraries/LibWeb/Fetch/HeadersIterator.cpp | 6 +- Libraries/LibWeb/Fetch/HeadersIterator.h | 10 +- .../Infrastructure/ConnectionTimingInfo.cpp | 6 +- .../Infrastructure/ConnectionTimingInfo.h | 8 +- .../Fetch/Infrastructure/FetchAlgorithms.cpp | 18 +- .../Fetch/Infrastructure/FetchAlgorithms.h | 30 +- .../Fetch/Infrastructure/FetchController.cpp | 12 +- .../Fetch/Infrastructure/FetchController.h | 24 +- .../Fetch/Infrastructure/FetchParams.cpp | 16 +- .../LibWeb/Fetch/Infrastructure/FetchParams.h | 30 +- .../Fetch/Infrastructure/FetchRecord.cpp | 10 +- .../LibWeb/Fetch/Infrastructure/FetchRecord.h | 24 +- .../Fetch/Infrastructure/FetchTimingInfo.cpp | 8 +- .../Fetch/Infrastructure/FetchTimingInfo.h | 16 +- .../Fetch/Infrastructure/HTTP/Bodies.cpp | 30 +- .../LibWeb/Fetch/Infrastructure/HTTP/Bodies.h | 40 +- .../Fetch/Infrastructure/HTTP/Headers.cpp | 6 +- .../Fetch/Infrastructure/HTTP/Headers.h | 10 +- .../Fetch/Infrastructure/HTTP/Requests.cpp | 16 +- .../Fetch/Infrastructure/HTTP/Requests.h | 36 +- .../Fetch/Infrastructure/HTTP/Responses.cpp | 44 +- .../Fetch/Infrastructure/HTTP/Responses.h | 108 ++-- .../IncrementalReadLoopReadRequest.cpp | 14 +- .../IncrementalReadLoopReadRequest.h | 12 +- .../LibWeb/Fetch/Infrastructure/Task.cpp | 6 +- Libraries/LibWeb/Fetch/Infrastructure/Task.h | 8 +- Libraries/LibWeb/Fetch/Request.cpp | 60 +- Libraries/LibWeb/Fetch/Request.h | 32 +- Libraries/LibWeb/Fetch/Response.cpp | 22 +- Libraries/LibWeb/Fetch/Response.h | 30 +- Libraries/LibWeb/FileAPI/Blob.cpp | 34 +- Libraries/LibWeb/FileAPI/Blob.h | 24 +- Libraries/LibWeb/FileAPI/BlobURLStore.cpp | 4 +- Libraries/LibWeb/FileAPI/BlobURLStore.h | 12 +- Libraries/LibWeb/FileAPI/File.cpp | 8 +- Libraries/LibWeb/FileAPI/File.h | 8 +- Libraries/LibWeb/FileAPI/FileList.cpp | 4 +- Libraries/LibWeb/FileAPI/FileList.h | 10 +- Libraries/LibWeb/FileAPI/FileReader.cpp | 22 +- Libraries/LibWeb/FileAPI/FileReader.h | 12 +- Libraries/LibWeb/Geometry/DOMMatrix.cpp | 48 +- Libraries/LibWeb/Geometry/DOMMatrix.h | 42 +- .../LibWeb/Geometry/DOMMatrixReadOnly.cpp | 50 +- Libraries/LibWeb/Geometry/DOMMatrixReadOnly.h | 50 +- Libraries/LibWeb/Geometry/DOMPoint.cpp | 8 +- Libraries/LibWeb/Geometry/DOMPoint.h | 8 +- .../LibWeb/Geometry/DOMPointReadOnly.cpp | 10 +- Libraries/LibWeb/Geometry/DOMPointReadOnly.h | 10 +- Libraries/LibWeb/Geometry/DOMQuad.cpp | 12 +- Libraries/LibWeb/Geometry/DOMQuad.h | 28 +- Libraries/LibWeb/Geometry/DOMRect.cpp | 10 +- Libraries/LibWeb/Geometry/DOMRect.h | 10 +- Libraries/LibWeb/Geometry/DOMRectList.cpp | 10 +- Libraries/LibWeb/Geometry/DOMRectList.h | 8 +- Libraries/LibWeb/Geometry/DOMRectReadOnly.cpp | 8 +- Libraries/LibWeb/Geometry/DOMRectReadOnly.h | 8 +- .../HTML/AnimatedBitmapDecodedImageData.cpp | 6 +- .../HTML/AnimatedBitmapDecodedImageData.h | 6 +- .../HTML/AnimationFrameCallbackDriver.cpp | 2 +- .../HTML/AnimationFrameCallbackDriver.h | 10 +- Libraries/LibWeb/HTML/AudioTrack.cpp | 4 +- Libraries/LibWeb/HTML/AudioTrack.h | 10 +- Libraries/LibWeb/HTML/AudioTrackList.cpp | 6 +- Libraries/LibWeb/HTML/AudioTrackList.h | 10 +- Libraries/LibWeb/HTML/BeforeUnloadEvent.cpp | 4 +- Libraries/LibWeb/HTML/BeforeUnloadEvent.h | 4 +- Libraries/LibWeb/HTML/BroadcastChannel.cpp | 4 +- Libraries/LibWeb/HTML/BroadcastChannel.h | 4 +- Libraries/LibWeb/HTML/BrowsingContext.cpp | 28 +- Libraries/LibWeb/HTML/BrowsingContext.h | 46 +- .../LibWeb/HTML/BrowsingContextGroup.cpp | 10 +- Libraries/LibWeb/HTML/BrowsingContextGroup.h | 16 +- .../LibWeb/HTML/Canvas/CanvasDrawImage.cpp | 8 +- .../LibWeb/HTML/Canvas/CanvasDrawImage.h | 2 +- .../HTML/Canvas/CanvasFillStrokeStyles.h | 10 +- .../LibWeb/HTML/Canvas/CanvasImageData.h | 6 +- Libraries/LibWeb/HTML/Canvas/CanvasPath.h | 2 +- Libraries/LibWeb/HTML/Canvas/CanvasState.h | 8 +- Libraries/LibWeb/HTML/Canvas/CanvasText.h | 2 +- .../LibWeb/HTML/Canvas/CanvasTransform.h | 2 +- Libraries/LibWeb/HTML/CanvasGradient.cpp | 8 +- Libraries/LibWeb/HTML/CanvasGradient.h | 8 +- Libraries/LibWeb/HTML/CanvasPattern.cpp | 16 +- Libraries/LibWeb/HTML/CanvasPattern.h | 4 +- .../LibWeb/HTML/CanvasRenderingContext2D.cpp | 42 +- .../LibWeb/HTML/CanvasRenderingContext2D.h | 16 +- Libraries/LibWeb/HTML/CloseEvent.cpp | 6 +- Libraries/LibWeb/HTML/CloseEvent.h | 6 +- Libraries/LibWeb/HTML/CloseWatcher.cpp | 6 +- Libraries/LibWeb/HTML/CloseWatcher.h | 8 +- Libraries/LibWeb/HTML/CloseWatcherManager.cpp | 12 +- Libraries/LibWeb/HTML/CloseWatcherManager.h | 8 +- .../HTML/CrossOrigin/AbstractOperations.cpp | 14 +- .../HTML/CrossOrigin/AbstractOperations.h | 2 +- .../CustomElements/CustomElementDefinition.h | 12 +- .../CustomElements/CustomElementRegistry.cpp | 38 +- .../CustomElements/CustomElementRegistry.h | 18 +- Libraries/LibWeb/HTML/DOMParser.cpp | 8 +- Libraries/LibWeb/HTML/DOMParser.h | 8 +- Libraries/LibWeb/HTML/DOMStringList.cpp | 4 +- Libraries/LibWeb/HTML/DOMStringList.h | 4 +- Libraries/LibWeb/HTML/DOMStringMap.cpp | 4 +- Libraries/LibWeb/HTML/DOMStringMap.h | 6 +- Libraries/LibWeb/HTML/DataTransfer.cpp | 16 +- Libraries/LibWeb/HTML/DataTransfer.h | 18 +- Libraries/LibWeb/HTML/DataTransferItem.cpp | 18 +- Libraries/LibWeb/HTML/DataTransferItem.h | 14 +- .../LibWeb/HTML/DataTransferItemList.cpp | 10 +- Libraries/LibWeb/HTML/DataTransferItemList.h | 12 +- Libraries/LibWeb/HTML/Dates.cpp | 4 +- Libraries/LibWeb/HTML/Dates.h | 4 +- Libraries/LibWeb/HTML/DecodedImageData.h | 2 +- .../HTML/DedicatedWorkerGlobalScope.cpp | 6 +- .../LibWeb/HTML/DedicatedWorkerGlobalScope.h | 6 +- Libraries/LibWeb/HTML/DocumentState.cpp | 6 +- Libraries/LibWeb/HTML/DocumentState.h | 14 +- Libraries/LibWeb/HTML/DragEvent.cpp | 6 +- Libraries/LibWeb/HTML/DragEvent.h | 12 +- Libraries/LibWeb/HTML/ElementInternals.cpp | 6 +- Libraries/LibWeb/HTML/ElementInternals.h | 10 +- Libraries/LibWeb/HTML/ErrorEvent.cpp | 6 +- Libraries/LibWeb/HTML/ErrorEvent.h | 6 +- Libraries/LibWeb/HTML/EventHandler.cpp | 4 +- Libraries/LibWeb/HTML/EventHandler.h | 10 +- Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp | 34 +- Libraries/LibWeb/HTML/EventLoop/EventLoop.h | 36 +- Libraries/LibWeb/HTML/EventLoop/Task.cpp | 6 +- Libraries/LibWeb/HTML/EventLoop/Task.h | 14 +- Libraries/LibWeb/HTML/EventLoop/TaskQueue.cpp | 12 +- Libraries/LibWeb/HTML/EventLoop/TaskQueue.h | 18 +- Libraries/LibWeb/HTML/EventSource.cpp | 32 +- Libraries/LibWeb/HTML/EventSource.h | 12 +- Libraries/LibWeb/HTML/Focus.cpp | 20 +- .../LibWeb/HTML/FormAssociatedElement.cpp | 6 +- Libraries/LibWeb/HTML/FormAssociatedElement.h | 10 +- .../LibWeb/HTML/FormControlInfrastructure.cpp | 22 +- .../LibWeb/HTML/FormControlInfrastructure.h | 4 +- Libraries/LibWeb/HTML/FormDataEvent.cpp | 4 +- Libraries/LibWeb/HTML/FormDataEvent.h | 10 +- Libraries/LibWeb/HTML/GlobalEventHandlers.h | 2 +- Libraries/LibWeb/HTML/HTMLAllCollection.cpp | 20 +- Libraries/LibWeb/HTML/HTMLAllCollection.h | 20 +- Libraries/LibWeb/HTML/HTMLAnchorElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLAnchorElement.h | 6 +- Libraries/LibWeb/HTML/HTMLAreaElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLAreaElement.h | 6 +- Libraries/LibWeb/HTML/HTMLAudioElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLAudioElement.h | 4 +- Libraries/LibWeb/HTML/HTMLBRElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLBRElement.h | 4 +- Libraries/LibWeb/HTML/HTMLBaseElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLBaseElement.h | 2 +- Libraries/LibWeb/HTML/HTMLBodyElement.cpp | 6 +- Libraries/LibWeb/HTML/HTMLBodyElement.h | 6 +- Libraries/LibWeb/HTML/HTMLButtonElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLButtonElement.h | 2 +- Libraries/LibWeb/HTML/HTMLCanvasElement.cpp | 32 +- Libraries/LibWeb/HTML/HTMLCanvasElement.h | 10 +- Libraries/LibWeb/HTML/HTMLDListElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLDListElement.h | 2 +- Libraries/LibWeb/HTML/HTMLDataElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLDataElement.h | 2 +- Libraries/LibWeb/HTML/HTMLDataListElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLDataListElement.h | 6 +- Libraries/LibWeb/HTML/HTMLDetailsElement.cpp | 6 +- Libraries/LibWeb/HTML/HTMLDetailsElement.h | 6 +- Libraries/LibWeb/HTML/HTMLDialogElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLDialogElement.h | 4 +- .../LibWeb/HTML/HTMLDirectoryElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLDirectoryElement.h | 2 +- Libraries/LibWeb/HTML/HTMLDivElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLDivElement.h | 2 +- Libraries/LibWeb/HTML/HTMLDocument.cpp | 6 +- Libraries/LibWeb/HTML/HTMLDocument.h | 6 +- Libraries/LibWeb/HTML/HTMLElement.cpp | 10 +- Libraries/LibWeb/HTML/HTMLElement.h | 16 +- Libraries/LibWeb/HTML/HTMLEmbedElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLEmbedElement.h | 2 +- Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLFieldSetElement.h | 6 +- Libraries/LibWeb/HTML/HTMLFontElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLFontElement.h | 2 +- .../HTML/HTMLFormControlsCollection.cpp | 8 +- .../LibWeb/HTML/HTMLFormControlsCollection.h | 6 +- Libraries/LibWeb/HTML/HTMLFormElement.cpp | 42 +- Libraries/LibWeb/HTML/HTMLFormElement.h | 40 +- Libraries/LibWeb/HTML/HTMLFrameElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLFrameElement.h | 2 +- Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp | 6 +- Libraries/LibWeb/HTML/HTMLFrameSetElement.h | 6 +- Libraries/LibWeb/HTML/HTMLHRElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLHRElement.h | 2 +- Libraries/LibWeb/HTML/HTMLHeadElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLHeadElement.h | 2 +- Libraries/LibWeb/HTML/HTMLHeadingElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLHeadingElement.h | 2 +- Libraries/LibWeb/HTML/HTMLHtmlElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLHtmlElement.h | 2 +- Libraries/LibWeb/HTML/HTMLIFrameElement.cpp | 6 +- Libraries/LibWeb/HTML/HTMLIFrameElement.h | 4 +- Libraries/LibWeb/HTML/HTMLImageElement.cpp | 30 +- Libraries/LibWeb/HTML/HTMLImageElement.h | 16 +- Libraries/LibWeb/HTML/HTMLInputElement.cpp | 24 +- Libraries/LibWeb/HTML/HTMLInputElement.h | 54 +- Libraries/LibWeb/HTML/HTMLLIElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLLIElement.h | 2 +- Libraries/LibWeb/HTML/HTMLLabelElement.cpp | 10 +- Libraries/LibWeb/HTML/HTMLLabelElement.h | 8 +- Libraries/LibWeb/HTML/HTMLLegendElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLLegendElement.h | 2 +- Libraries/LibWeb/HTML/HTMLLinkElement.cpp | 20 +- Libraries/LibWeb/HTML/HTMLLinkElement.h | 18 +- Libraries/LibWeb/HTML/HTMLMapElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLMapElement.h | 6 +- Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLMarqueeElement.h | 2 +- Libraries/LibWeb/HTML/HTMLMediaElement.cpp | 62 +-- Libraries/LibWeb/HTML/HTMLMediaElement.h | 46 +- Libraries/LibWeb/HTML/HTMLMenuElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLMenuElement.h | 2 +- Libraries/LibWeb/HTML/HTMLMetaElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLMetaElement.h | 2 +- Libraries/LibWeb/HTML/HTMLMeterElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLMeterElement.h | 4 +- Libraries/LibWeb/HTML/HTMLModElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLModElement.h | 2 +- Libraries/LibWeb/HTML/HTMLOListElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLOListElement.h | 2 +- Libraries/LibWeb/HTML/HTMLObjectElement.cpp | 6 +- Libraries/LibWeb/HTML/HTMLObjectElement.h | 10 +- Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLOptGroupElement.h | 2 +- Libraries/LibWeb/HTML/HTMLOptionElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLOptionElement.h | 4 +- .../LibWeb/HTML/HTMLOptionsCollection.cpp | 16 +- Libraries/LibWeb/HTML/HTMLOptionsCollection.h | 8 +- Libraries/LibWeb/HTML/HTMLOrSVGElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLOrSVGElement.h | 6 +- Libraries/LibWeb/HTML/HTMLOutputElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLOutputElement.h | 6 +- .../LibWeb/HTML/HTMLParagraphElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLParagraphElement.h | 2 +- Libraries/LibWeb/HTML/HTMLParamElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLParamElement.h | 2 +- Libraries/LibWeb/HTML/HTMLPictureElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLPictureElement.h | 2 +- Libraries/LibWeb/HTML/HTMLPreElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLPreElement.h | 2 +- Libraries/LibWeb/HTML/HTMLProgressElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLProgressElement.h | 4 +- Libraries/LibWeb/HTML/HTMLQuoteElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLQuoteElement.h | 2 +- Libraries/LibWeb/HTML/HTMLScriptElement.cpp | 16 +- Libraries/LibWeb/HTML/HTMLScriptElement.h | 8 +- Libraries/LibWeb/HTML/HTMLSelectElement.cpp | 16 +- Libraries/LibWeb/HTML/HTMLSelectElement.h | 16 +- Libraries/LibWeb/HTML/HTMLSlotElement.cpp | 12 +- Libraries/LibWeb/HTML/HTMLSlotElement.h | 10 +- Libraries/LibWeb/HTML/HTMLSourceElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLSourceElement.h | 2 +- Libraries/LibWeb/HTML/HTMLSpanElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLSpanElement.h | 2 +- Libraries/LibWeb/HTML/HTMLStyleElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLStyleElement.h | 2 +- Libraries/LibWeb/HTML/HTMLSummaryElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLSummaryElement.h | 2 +- .../LibWeb/HTML/HTMLTableCaptionElement.cpp | 2 +- .../LibWeb/HTML/HTMLTableCaptionElement.h | 2 +- .../LibWeb/HTML/HTMLTableCellElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLTableCellElement.h | 2 +- Libraries/LibWeb/HTML/HTMLTableColElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLTableColElement.h | 2 +- Libraries/LibWeb/HTML/HTMLTableElement.cpp | 24 +- Libraries/LibWeb/HTML/HTMLTableElement.h | 26 +- Libraries/LibWeb/HTML/HTMLTableRowElement.cpp | 12 +- Libraries/LibWeb/HTML/HTMLTableRowElement.h | 8 +- .../LibWeb/HTML/HTMLTableSectionElement.cpp | 8 +- .../LibWeb/HTML/HTMLTableSectionElement.h | 8 +- Libraries/LibWeb/HTML/HTMLTemplateElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLTemplateElement.h | 10 +- Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLTextAreaElement.h | 12 +- Libraries/LibWeb/HTML/HTMLTimeElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLTimeElement.h | 2 +- Libraries/LibWeb/HTML/HTMLTitleElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLTitleElement.h | 2 +- Libraries/LibWeb/HTML/HTMLTrackElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLTrackElement.h | 6 +- Libraries/LibWeb/HTML/HTMLUListElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLUListElement.h | 2 +- Libraries/LibWeb/HTML/HTMLUnknownElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLUnknownElement.h | 2 +- Libraries/LibWeb/HTML/HTMLVideoElement.cpp | 14 +- Libraries/LibWeb/HTML/HTMLVideoElement.h | 10 +- Libraries/LibWeb/HTML/HashChangeEvent.cpp | 8 +- Libraries/LibWeb/HTML/HashChangeEvent.h | 6 +- Libraries/LibWeb/HTML/History.cpp | 4 +- Libraries/LibWeb/HTML/History.h | 6 +- Libraries/LibWeb/HTML/ImageBitmap.cpp | 4 +- Libraries/LibWeb/HTML/ImageBitmap.h | 6 +- Libraries/LibWeb/HTML/ImageData.cpp | 12 +- Libraries/LibWeb/HTML/ImageData.h | 14 +- Libraries/LibWeb/HTML/ImageRequest.cpp | 12 +- Libraries/LibWeb/HTML/ImageRequest.h | 24 +- Libraries/LibWeb/HTML/LazyLoadingElement.h | 20 +- .../LibWeb/HTML/ListOfAvailableImages.cpp | 4 +- Libraries/LibWeb/HTML/ListOfAvailableImages.h | 10 +- Libraries/LibWeb/HTML/Location.cpp | 8 +- Libraries/LibWeb/HTML/Location.h | 6 +- Libraries/LibWeb/HTML/MediaError.cpp | 2 +- Libraries/LibWeb/HTML/MediaError.h | 2 +- Libraries/LibWeb/HTML/MessageChannel.cpp | 4 +- Libraries/LibWeb/HTML/MessageChannel.h | 8 +- Libraries/LibWeb/HTML/MessageEvent.cpp | 16 +- Libraries/LibWeb/HTML/MessageEvent.h | 20 +- Libraries/LibWeb/HTML/MessagePort.cpp | 30 +- Libraries/LibWeb/HTML/MessagePort.h | 14 +- Libraries/LibWeb/HTML/MimeType.cpp | 4 +- Libraries/LibWeb/HTML/MimeType.h | 4 +- Libraries/LibWeb/HTML/MimeTypeArray.cpp | 6 +- Libraries/LibWeb/HTML/MimeTypeArray.h | 6 +- Libraries/LibWeb/HTML/Navigable.cpp | 138 ++--- Libraries/LibWeb/HTML/Navigable.h | 74 +-- Libraries/LibWeb/HTML/NavigableContainer.cpp | 14 +- Libraries/LibWeb/HTML/NavigableContainer.h | 10 +- Libraries/LibWeb/HTML/NavigateEvent.cpp | 8 +- Libraries/LibWeb/HTML/NavigateEvent.h | 32 +- Libraries/LibWeb/HTML/Navigation.cpp | 58 +- Libraries/LibWeb/HTML/Navigation.h | 70 +-- .../NavigationCurrentEntryChangeEvent.cpp | 6 +- .../HTML/NavigationCurrentEntryChangeEvent.h | 10 +- .../LibWeb/HTML/NavigationDestination.cpp | 6 +- Libraries/LibWeb/HTML/NavigationDestination.h | 10 +- .../LibWeb/HTML/NavigationHistoryEntry.cpp | 8 +- .../LibWeb/HTML/NavigationHistoryEntry.h | 8 +- Libraries/LibWeb/HTML/NavigationObserver.cpp | 4 +- Libraries/LibWeb/HTML/NavigationObserver.h | 12 +- Libraries/LibWeb/HTML/NavigationParams.cpp | 4 +- Libraries/LibWeb/HTML/NavigationParams.h | 22 +- .../LibWeb/HTML/NavigationTransition.cpp | 8 +- Libraries/LibWeb/HTML/NavigationTransition.h | 14 +- Libraries/LibWeb/HTML/Navigator.cpp | 18 +- Libraries/LibWeb/HTML/Navigator.h | 28 +- Libraries/LibWeb/HTML/NavigatorBeacon.cpp | 10 +- Libraries/LibWeb/HTML/PageSwapEvent.idl | 11 + Libraries/LibWeb/HTML/PageTransitionEvent.cpp | 6 +- Libraries/LibWeb/HTML/PageTransitionEvent.h | 6 +- .../HTML/Parser/HTMLEncodingDetection.cpp | 2 +- .../HTML/Parser/HTMLEncodingDetection.h | 4 +- Libraries/LibWeb/HTML/Parser/HTMLParser.cpp | 66 +-- Libraries/LibWeb/HTML/Parser/HTMLParser.h | 46 +- Libraries/LibWeb/HTML/Parser/HTMLTokenizer.h | 4 +- .../Parser/ListOfActiveFormattingElements.cpp | 2 +- .../Parser/ListOfActiveFormattingElements.h | 2 +- .../HTML/Parser/StackOfOpenElements.cpp | 10 +- .../LibWeb/HTML/Parser/StackOfOpenElements.h | 16 +- Libraries/LibWeb/HTML/Path2D.cpp | 12 +- Libraries/LibWeb/HTML/Path2D.h | 8 +- Libraries/LibWeb/HTML/Plugin.cpp | 6 +- Libraries/LibWeb/HTML/Plugin.h | 6 +- Libraries/LibWeb/HTML/PluginArray.cpp | 6 +- Libraries/LibWeb/HTML/PluginArray.h | 6 +- Libraries/LibWeb/HTML/PopStateEvent.cpp | 8 +- Libraries/LibWeb/HTML/PopStateEvent.h | 6 +- .../LibWeb/HTML/PotentialCORSRequest.cpp | 2 +- Libraries/LibWeb/HTML/PotentialCORSRequest.h | 4 +- .../LibWeb/HTML/PromiseRejectionEvent.cpp | 6 +- Libraries/LibWeb/HTML/PromiseRejectionEvent.h | 12 +- Libraries/LibWeb/HTML/RadioNodeList.cpp | 4 +- Libraries/LibWeb/HTML/RadioNodeList.h | 4 +- .../LibWeb/HTML/Scripting/ClassicScript.cpp | 6 +- .../LibWeb/HTML/Scripting/ClassicScript.h | 10 +- .../Scripting/EnvironmentSettingsSnapshot.cpp | 2 +- .../Scripting/EnvironmentSettingsSnapshot.h | 6 +- .../LibWeb/HTML/Scripting/Environments.cpp | 2 +- .../LibWeb/HTML/Scripting/Environments.h | 20 +- Libraries/LibWeb/HTML/Scripting/Fetching.cpp | 32 +- Libraries/LibWeb/HTML/Scripting/Fetching.h | 24 +- .../HTML/Scripting/ImportMapParseResult.cpp | 6 +- .../HTML/Scripting/ImportMapParseResult.h | 6 +- Libraries/LibWeb/HTML/Scripting/ModuleMap.cpp | 6 +- Libraries/LibWeb/HTML/Scripting/ModuleMap.h | 12 +- .../LibWeb/HTML/Scripting/ModuleScript.cpp | 6 +- .../LibWeb/HTML/Scripting/ModuleScript.h | 10 +- Libraries/LibWeb/HTML/Scripting/Script.cpp | 2 +- Libraries/LibWeb/HTML/Scripting/Script.h | 6 +- .../HTML/Scripting/SyntheticRealmSettings.h | 8 +- .../Scripting/TemporaryExecutionContext.h | 4 +- .../WindowEnvironmentSettingsObject.cpp | 6 +- .../WindowEnvironmentSettingsObject.h | 10 +- .../WorkerEnvironmentSettingsObject.cpp | 4 +- .../WorkerEnvironmentSettingsObject.h | 12 +- Libraries/LibWeb/HTML/SelectItem.h | 2 +- Libraries/LibWeb/HTML/ServiceWorker.cpp | 4 +- Libraries/LibWeb/HTML/ServiceWorker.h | 2 +- .../LibWeb/HTML/ServiceWorkerContainer.cpp | 8 +- .../LibWeb/HTML/ServiceWorkerContainer.h | 10 +- .../LibWeb/HTML/ServiceWorkerRegistration.cpp | 4 +- .../LibWeb/HTML/ServiceWorkerRegistration.h | 4 +- Libraries/LibWeb/HTML/SessionHistoryEntry.cpp | 8 +- Libraries/LibWeb/HTML/SessionHistoryEntry.h | 22 +- .../HTML/SessionHistoryTraversalQueue.cpp | 12 +- .../HTML/SessionHistoryTraversalQueue.h | 32 +- .../LibWeb/HTML/ShadowRealmGlobalScope.cpp | 4 +- .../LibWeb/HTML/ShadowRealmGlobalScope.h | 6 +- .../LibWeb/HTML/SharedResourceRequest.cpp | 30 +- Libraries/LibWeb/HTML/SharedResourceRequest.h | 32 +- Libraries/LibWeb/HTML/SourceSnapshotParams.h | 2 +- Libraries/LibWeb/HTML/Storage.cpp | 4 +- Libraries/LibWeb/HTML/Storage.h | 4 +- Libraries/LibWeb/HTML/StructuredSerialize.cpp | 34 +- Libraries/LibWeb/HTML/StructuredSerialize.h | 24 +- .../LibWeb/HTML/StructuredSerializeOptions.h | 2 +- Libraries/LibWeb/HTML/SubmitEvent.cpp | 6 +- Libraries/LibWeb/HTML/SubmitEvent.h | 12 +- Libraries/LibWeb/HTML/TextMetrics.cpp | 4 +- Libraries/LibWeb/HTML/TextMetrics.h | 4 +- Libraries/LibWeb/HTML/TextTrack.cpp | 4 +- Libraries/LibWeb/HTML/TextTrack.h | 6 +- Libraries/LibWeb/HTML/TextTrackCue.cpp | 4 +- Libraries/LibWeb/HTML/TextTrackCue.h | 10 +- Libraries/LibWeb/HTML/TextTrackCueList.cpp | 4 +- Libraries/LibWeb/HTML/TextTrackCueList.h | 8 +- Libraries/LibWeb/HTML/TextTrackList.cpp | 4 +- Libraries/LibWeb/HTML/TextTrackList.h | 8 +- Libraries/LibWeb/HTML/TimeRanges.cpp | 2 +- Libraries/LibWeb/HTML/TimeRanges.h | 2 +- Libraries/LibWeb/HTML/Timer.cpp | 8 +- Libraries/LibWeb/HTML/Timer.h | 16 +- Libraries/LibWeb/HTML/ToggleEvent.cpp | 6 +- Libraries/LibWeb/HTML/ToggleEvent.h | 6 +- Libraries/LibWeb/HTML/TrackEvent.cpp | 8 +- Libraries/LibWeb/HTML/TrackEvent.h | 12 +- .../LibWeb/HTML/TraversableNavigable.cpp | 128 ++--- Libraries/LibWeb/HTML/TraversableNavigable.h | 48 +- .../LibWeb/HTML/UniversalGlobalScope.cpp | 6 +- Libraries/LibWeb/HTML/UserActivation.cpp | 4 +- Libraries/LibWeb/HTML/UserActivation.h | 4 +- Libraries/LibWeb/HTML/ValidityState.cpp | 2 +- Libraries/LibWeb/HTML/ValidityState.h | 2 +- Libraries/LibWeb/HTML/VideoTrack.cpp | 4 +- Libraries/LibWeb/HTML/VideoTrack.h | 10 +- Libraries/LibWeb/HTML/VideoTrackList.cpp | 6 +- Libraries/LibWeb/HTML/VideoTrackList.h | 12 +- Libraries/LibWeb/HTML/Window.cpp | 132 ++--- Libraries/LibWeb/HTML/Window.h | 106 ++-- Libraries/LibWeb/HTML/WindowEventHandlers.h | 2 +- .../LibWeb/HTML/WindowOrWorkerGlobalScope.cpp | 80 +-- .../LibWeb/HTML/WindowOrWorkerGlobalScope.h | 60 +- Libraries/LibWeb/HTML/WindowProxy.cpp | 12 +- Libraries/LibWeb/HTML/WindowProxy.h | 14 +- Libraries/LibWeb/HTML/Worker.cpp | 8 +- Libraries/LibWeb/HTML/Worker.h | 18 +- Libraries/LibWeb/HTML/WorkerAgent.cpp | 4 +- Libraries/LibWeb/HTML/WorkerAgent.h | 12 +- .../LibWeb/HTML/WorkerDebugConsoleClient.cpp | 6 +- .../LibWeb/HTML/WorkerDebugConsoleClient.h | 4 +- Libraries/LibWeb/HTML/WorkerGlobalScope.cpp | 12 +- Libraries/LibWeb/HTML/WorkerGlobalScope.h | 26 +- Libraries/LibWeb/HTML/WorkerLocation.cpp | 2 +- Libraries/LibWeb/HTML/WorkerLocation.h | 4 +- Libraries/LibWeb/HTML/WorkerNavigator.cpp | 10 +- Libraries/LibWeb/HTML/WorkerNavigator.h | 12 +- .../LibWeb/HighResolutionTime/Performance.cpp | 18 +- .../LibWeb/HighResolutionTime/Performance.h | 20 +- Libraries/LibWeb/IndexedDB/IDBDatabase.cpp | 4 +- Libraries/LibWeb/IndexedDB/IDBDatabase.h | 14 +- Libraries/LibWeb/IndexedDB/IDBFactory.cpp | 10 +- Libraries/LibWeb/IndexedDB/IDBFactory.h | 4 +- .../LibWeb/IndexedDB/IDBOpenDBRequest.cpp | 4 +- Libraries/LibWeb/IndexedDB/IDBOpenDBRequest.h | 4 +- Libraries/LibWeb/IndexedDB/IDBRequest.cpp | 2 +- Libraries/LibWeb/IndexedDB/IDBRequest.h | 8 +- .../IndexedDB/IDBVersionChangeEvent.cpp | 4 +- .../LibWeb/IndexedDB/IDBVersionChangeEvent.h | 6 +- .../LibWeb/IndexedDB/Internal/Algorithms.cpp | 14 +- .../LibWeb/IndexedDB/Internal/Algorithms.h | 4 +- .../Internal/ConnectionQueueHandler.h | 6 +- .../LibWeb/IndexedDB/Internal/Database.cpp | 14 +- .../LibWeb/IndexedDB/Internal/Database.h | 20 +- Libraries/LibWeb/Internals/Inspector.cpp | 6 +- Libraries/LibWeb/Internals/Inspector.h | 6 +- .../Internals/InternalAnimationTimeline.cpp | 2 +- .../Internals/InternalAnimationTimeline.h | 2 +- Libraries/LibWeb/Internals/Internals.cpp | 4 +- Libraries/LibWeb/Internals/Internals.h | 4 +- .../IntersectionObserver.cpp | 40 +- .../IntersectionObserver.h | 30 +- .../IntersectionObserverEntry.cpp | 8 +- .../IntersectionObserverEntry.h | 24 +- Libraries/LibWeb/Layout/AudioBox.cpp | 4 +- Libraries/LibWeb/Layout/AudioBox.h | 6 +- Libraries/LibWeb/Layout/BlockContainer.cpp | 2 +- Libraries/LibWeb/Layout/BlockContainer.h | 4 +- .../LibWeb/Layout/BlockFormattingContext.h | 2 +- Libraries/LibWeb/Layout/Box.cpp | 2 +- Libraries/LibWeb/Layout/Box.h | 10 +- Libraries/LibWeb/Layout/BreakNode.cpp | 2 +- Libraries/LibWeb/Layout/BreakNode.h | 4 +- Libraries/LibWeb/Layout/CanvasBox.cpp | 4 +- Libraries/LibWeb/Layout/CanvasBox.h | 6 +- Libraries/LibWeb/Layout/CheckBox.cpp | 4 +- Libraries/LibWeb/Layout/CheckBox.h | 6 +- .../LibWeb/Layout/FlexFormattingContext.h | 2 +- .../Layout/FormAssociatedLabelableNode.h | 2 +- Libraries/LibWeb/Layout/FormattingContext.h | 4 +- Libraries/LibWeb/Layout/FrameBox.cpp | 4 +- Libraries/LibWeb/Layout/FrameBox.h | 6 +- .../LibWeb/Layout/GridFormattingContext.cpp | 2 +- .../LibWeb/Layout/GridFormattingContext.h | 2 +- Libraries/LibWeb/Layout/ImageBox.cpp | 4 +- Libraries/LibWeb/Layout/ImageBox.h | 6 +- Libraries/LibWeb/Layout/ImageProvider.h | 2 +- Libraries/LibWeb/Layout/InlineLevelIterator.h | 10 +- Libraries/LibWeb/Layout/InlineNode.cpp | 4 +- Libraries/LibWeb/Layout/InlineNode.h | 6 +- Libraries/LibWeb/Layout/Label.cpp | 2 +- Libraries/LibWeb/Layout/Label.h | 4 +- Libraries/LibWeb/Layout/LabelableNode.h | 2 +- Libraries/LibWeb/Layout/LayoutState.h | 8 +- Libraries/LibWeb/Layout/LineBoxFragment.h | 4 +- Libraries/LibWeb/Layout/ListItemBox.cpp | 4 +- Libraries/LibWeb/Layout/ListItemBox.h | 8 +- Libraries/LibWeb/Layout/ListItemMarkerBox.cpp | 4 +- Libraries/LibWeb/Layout/ListItemMarkerBox.h | 6 +- Libraries/LibWeb/Layout/Node.cpp | 10 +- Libraries/LibWeb/Layout/Node.h | 20 +- Libraries/LibWeb/Layout/RadioButton.cpp | 4 +- Libraries/LibWeb/Layout/RadioButton.h | 6 +- Libraries/LibWeb/Layout/ReplacedBox.h | 2 +- Libraries/LibWeb/Layout/SVGBox.h | 2 +- Libraries/LibWeb/Layout/SVGClipBox.cpp | 4 +- Libraries/LibWeb/Layout/SVGClipBox.h | 6 +- .../LibWeb/Layout/SVGForeignObjectBox.cpp | 4 +- Libraries/LibWeb/Layout/SVGForeignObjectBox.h | 6 +- Libraries/LibWeb/Layout/SVGGeometryBox.cpp | 4 +- Libraries/LibWeb/Layout/SVGGeometryBox.h | 6 +- Libraries/LibWeb/Layout/SVGGraphicsBox.cpp | 2 +- Libraries/LibWeb/Layout/SVGGraphicsBox.h | 4 +- Libraries/LibWeb/Layout/SVGImageBox.cpp | 2 +- Libraries/LibWeb/Layout/SVGImageBox.h | 6 +- Libraries/LibWeb/Layout/SVGMaskBox.cpp | 4 +- Libraries/LibWeb/Layout/SVGMaskBox.h | 6 +- Libraries/LibWeb/Layout/SVGSVGBox.cpp | 4 +- Libraries/LibWeb/Layout/SVGSVGBox.h | 6 +- Libraries/LibWeb/Layout/SVGTextBox.cpp | 4 +- Libraries/LibWeb/Layout/SVGTextBox.h | 6 +- Libraries/LibWeb/Layout/SVGTextPathBox.cpp | 4 +- Libraries/LibWeb/Layout/SVGTextPathBox.h | 6 +- .../LibWeb/Layout/TableFormattingContext.h | 8 +- Libraries/LibWeb/Layout/TableGrid.h | 4 +- Libraries/LibWeb/Layout/TableWrapper.cpp | 2 +- Libraries/LibWeb/Layout/TableWrapper.h | 4 +- Libraries/LibWeb/Layout/TextNode.cpp | 4 +- Libraries/LibWeb/Layout/TextNode.h | 6 +- Libraries/LibWeb/Layout/TreeBuilder.cpp | 26 +- Libraries/LibWeb/Layout/TreeBuilder.h | 12 +- Libraries/LibWeb/Layout/VideoBox.cpp | 4 +- Libraries/LibWeb/Layout/VideoBox.h | 6 +- Libraries/LibWeb/Layout/Viewport.cpp | 4 +- Libraries/LibWeb/Layout/Viewport.h | 8 +- Libraries/LibWeb/Loader/LoadRequest.h | 4 +- Libraries/LibWeb/Loader/Resource.cpp | 2 +- Libraries/LibWeb/Loader/ResourceLoader.cpp | 20 +- Libraries/LibWeb/Loader/ResourceLoader.h | 26 +- Libraries/LibWeb/MathML/MathMLElement.cpp | 2 +- Libraries/LibWeb/MathML/MathMLElement.h | 4 +- .../MediaCapabilities.cpp | 4 +- .../MediaCapabilitiesAPI/MediaCapabilities.h | 4 +- .../BufferedChangeEvent.cpp | 4 +- .../BufferedChangeEvent.h | 8 +- .../ManagedMediaSource.cpp | 4 +- .../ManagedMediaSource.h | 4 +- .../ManagedSourceBuffer.cpp | 2 +- .../ManagedSourceBuffer.h | 2 +- .../MediaSourceExtensions/MediaSource.cpp | 4 +- .../MediaSourceExtensions/MediaSource.h | 4 +- .../MediaSourceHandle.cpp | 2 +- .../MediaSourceExtensions/MediaSourceHandle.h | 2 +- .../MediaSourceExtensions/SourceBuffer.cpp | 2 +- .../MediaSourceExtensions/SourceBuffer.h | 2 +- .../SourceBufferList.cpp | 2 +- .../MediaSourceExtensions/SourceBufferList.h | 2 +- .../MixedContent/AbstractOperations.cpp | 4 +- .../LibWeb/MixedContent/AbstractOperations.h | 6 +- .../PerformanceNavigation.cpp | 2 +- .../NavigationTiming/PerformanceNavigation.h | 2 +- .../NavigationTiming/PerformanceTiming.cpp | 2 +- .../NavigationTiming/PerformanceTiming.h | 2 +- .../LibWeb/Page/DragAndDropEventHandler.cpp | 22 +- .../LibWeb/Page/DragAndDropEventHandler.h | 18 +- Libraries/LibWeb/Page/EventHandler.cpp | 36 +- Libraries/LibWeb/Page/EventHandler.h | 8 +- Libraries/LibWeb/Page/Page.cpp | 24 +- Libraries/LibWeb/Page/Page.h | 44 +- Libraries/LibWeb/Painting/AudioPaintable.cpp | 4 +- Libraries/LibWeb/Painting/AudioPaintable.h | 6 +- Libraries/LibWeb/Painting/CanvasPaintable.cpp | 4 +- Libraries/LibWeb/Painting/CanvasPaintable.h | 6 +- .../LibWeb/Painting/CheckBoxPaintable.cpp | 4 +- Libraries/LibWeb/Painting/CheckBoxPaintable.h | 6 +- Libraries/LibWeb/Painting/ImagePaintable.cpp | 6 +- Libraries/LibWeb/Painting/ImagePaintable.h | 8 +- .../LibWeb/Painting/LabelablePaintable.h | 2 +- Libraries/LibWeb/Painting/MarkerPaintable.cpp | 6 +- Libraries/LibWeb/Painting/MarkerPaintable.h | 6 +- Libraries/LibWeb/Painting/MediaPaintable.h | 2 +- .../NestedBrowsingContextPaintable.cpp | 4 +- .../Painting/NestedBrowsingContextPaintable.h | 6 +- Libraries/LibWeb/Painting/Paintable.cpp | 8 +- Libraries/LibWeb/Painting/Paintable.h | 20 +- Libraries/LibWeb/Painting/PaintableBox.cpp | 10 +- Libraries/LibWeb/Painting/PaintableBox.h | 14 +- Libraries/LibWeb/Painting/PaintableFragment.h | 2 +- .../LibWeb/Painting/RadioButtonPaintable.cpp | 4 +- .../LibWeb/Painting/RadioButtonPaintable.h | 6 +- .../LibWeb/Painting/SVGClipPaintable.cpp | 4 +- Libraries/LibWeb/Painting/SVGClipPaintable.h | 6 +- .../Painting/SVGForeignObjectPaintable.cpp | 4 +- .../Painting/SVGForeignObjectPaintable.h | 8 +- .../LibWeb/Painting/SVGGraphicsPaintable.cpp | 2 +- .../LibWeb/Painting/SVGGraphicsPaintable.h | 6 +- .../LibWeb/Painting/SVGMaskPaintable.cpp | 4 +- Libraries/LibWeb/Painting/SVGMaskPaintable.h | 6 +- Libraries/LibWeb/Painting/SVGMaskable.h | 2 +- Libraries/LibWeb/Painting/SVGPaintable.h | 2 +- .../LibWeb/Painting/SVGPathPaintable.cpp | 4 +- Libraries/LibWeb/Painting/SVGPathPaintable.h | 6 +- Libraries/LibWeb/Painting/SVGSVGPaintable.cpp | 4 +- Libraries/LibWeb/Painting/SVGSVGPaintable.h | 6 +- Libraries/LibWeb/Painting/StackingContext.h | 6 +- Libraries/LibWeb/Painting/TextPaintable.cpp | 4 +- Libraries/LibWeb/Painting/TextPaintable.h | 6 +- Libraries/LibWeb/Painting/VideoPaintable.cpp | 4 +- Libraries/LibWeb/Painting/VideoPaintable.h | 6 +- .../LibWeb/Painting/ViewportPaintable.cpp | 6 +- Libraries/LibWeb/Painting/ViewportPaintable.h | 10 +- .../PerformanceEntryTuple.h | 2 +- .../PerformanceObserver.cpp | 14 +- .../PerformanceTimeline/PerformanceObserver.h | 16 +- .../PerformanceObserverEntryList.cpp | 14 +- .../PerformanceObserverEntryList.h | 14 +- Libraries/LibWeb/Platform/EventLoopPlugin.h | 10 +- .../Platform/EventLoopPluginSerenity.cpp | 6 +- .../LibWeb/Platform/EventLoopPluginSerenity.h | 6 +- Libraries/LibWeb/Platform/Timer.cpp | 8 +- Libraries/LibWeb/Platform/Timer.h | 10 +- Libraries/LibWeb/Platform/TimerSerenity.cpp | 6 +- Libraries/LibWeb/Platform/TimerSerenity.h | 4 +- .../RequestIdleCallback/IdleDeadline.cpp | 4 +- .../LibWeb/RequestIdleCallback/IdleDeadline.h | 4 +- .../ResizeObserver/ResizeObservation.cpp | 6 +- .../LibWeb/ResizeObserver/ResizeObservation.h | 16 +- .../LibWeb/ResizeObserver/ResizeObserver.cpp | 6 +- .../LibWeb/ResizeObserver/ResizeObserver.h | 20 +- .../ResizeObserver/ResizeObserverEntry.cpp | 16 +- .../ResizeObserver/ResizeObserverEntry.h | 30 +- .../ResizeObserver/ResizeObserverSize.cpp | 6 +- .../ResizeObserver/ResizeObserverSize.h | 4 +- Libraries/LibWeb/SVG/SVGAElement.cpp | 6 +- Libraries/LibWeb/SVG/SVGAElement.h | 8 +- Libraries/LibWeb/SVG/SVGAnimatedLength.cpp | 6 +- Libraries/LibWeb/SVG/SVGAnimatedLength.h | 14 +- Libraries/LibWeb/SVG/SVGAnimatedNumber.cpp | 4 +- Libraries/LibWeb/SVG/SVGAnimatedNumber.h | 4 +- Libraries/LibWeb/SVG/SVGAnimatedRect.cpp | 6 +- Libraries/LibWeb/SVG/SVGAnimatedRect.h | 10 +- Libraries/LibWeb/SVG/SVGAnimatedString.cpp | 8 +- Libraries/LibWeb/SVG/SVGAnimatedString.h | 8 +- .../LibWeb/SVG/SVGAnimatedTransformList.cpp | 6 +- .../LibWeb/SVG/SVGAnimatedTransformList.h | 14 +- Libraries/LibWeb/SVG/SVGCircleElement.cpp | 8 +- Libraries/LibWeb/SVG/SVGCircleElement.h | 8 +- Libraries/LibWeb/SVG/SVGClipPathElement.cpp | 4 +- Libraries/LibWeb/SVG/SVGClipPathElement.h | 4 +- Libraries/LibWeb/SVG/SVGDecodedImageData.cpp | 10 +- Libraries/LibWeb/SVG/SVGDecodedImageData.h | 26 +- Libraries/LibWeb/SVG/SVGDefsElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGDefsElement.h | 4 +- Libraries/LibWeb/SVG/SVGDescElement.cpp | 4 +- Libraries/LibWeb/SVG/SVGDescElement.h | 4 +- Libraries/LibWeb/SVG/SVGElement.cpp | 6 +- Libraries/LibWeb/SVG/SVGElement.h | 10 +- Libraries/LibWeb/SVG/SVGEllipseElement.cpp | 10 +- Libraries/LibWeb/SVG/SVGEllipseElement.h | 10 +- .../LibWeb/SVG/SVGForeignObjectElement.cpp | 12 +- .../LibWeb/SVG/SVGForeignObjectElement.h | 20 +- Libraries/LibWeb/SVG/SVGGElement.cpp | 4 +- Libraries/LibWeb/SVG/SVGGElement.h | 4 +- Libraries/LibWeb/SVG/SVGGeometryElement.cpp | 4 +- Libraries/LibWeb/SVG/SVGGeometryElement.h | 4 +- Libraries/LibWeb/SVG/SVGGradientElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGGradientElement.h | 2 +- Libraries/LibWeb/SVG/SVGGraphicsElement.cpp | 10 +- Libraries/LibWeb/SVG/SVGGraphicsElement.h | 12 +- Libraries/LibWeb/SVG/SVGImageElement.cpp | 12 +- Libraries/LibWeb/SVG/SVGImageElement.h | 24 +- Libraries/LibWeb/SVG/SVGLength.cpp | 6 +- Libraries/LibWeb/SVG/SVGLength.h | 6 +- Libraries/LibWeb/SVG/SVGLineElement.cpp | 10 +- Libraries/LibWeb/SVG/SVGLineElement.h | 10 +- .../LibWeb/SVG/SVGLinearGradientElement.cpp | 10 +- .../LibWeb/SVG/SVGLinearGradientElement.h | 12 +- Libraries/LibWeb/SVG/SVGMaskElement.cpp | 4 +- Libraries/LibWeb/SVG/SVGMaskElement.h | 4 +- Libraries/LibWeb/SVG/SVGMetadataElement.cpp | 4 +- Libraries/LibWeb/SVG/SVGMetadataElement.h | 4 +- Libraries/LibWeb/SVG/SVGPathElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGPathElement.h | 2 +- Libraries/LibWeb/SVG/SVGPolygonElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGPolygonElement.h | 2 +- Libraries/LibWeb/SVG/SVGPolylineElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGPolylineElement.h | 2 +- .../LibWeb/SVG/SVGRadialGradientElement.cpp | 14 +- .../LibWeb/SVG/SVGRadialGradientElement.h | 16 +- Libraries/LibWeb/SVG/SVGRectElement.cpp | 14 +- Libraries/LibWeb/SVG/SVGRectElement.h | 14 +- Libraries/LibWeb/SVG/SVGSVGElement.cpp | 32 +- Libraries/LibWeb/SVG/SVGSVGElement.h | 36 +- Libraries/LibWeb/SVG/SVGScriptElement.cpp | 4 +- Libraries/LibWeb/SVG/SVGScriptElement.h | 4 +- Libraries/LibWeb/SVG/SVGStopElement.cpp | 4 +- Libraries/LibWeb/SVG/SVGStopElement.h | 4 +- Libraries/LibWeb/SVG/SVGStyleElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGStyleElement.h | 2 +- Libraries/LibWeb/SVG/SVGSymbolElement.cpp | 4 +- Libraries/LibWeb/SVG/SVGSymbolElement.h | 8 +- Libraries/LibWeb/SVG/SVGTSpanElement.cpp | 4 +- Libraries/LibWeb/SVG/SVGTSpanElement.h | 4 +- .../LibWeb/SVG/SVGTextContentElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGTextContentElement.h | 2 +- Libraries/LibWeb/SVG/SVGTextElement.cpp | 4 +- Libraries/LibWeb/SVG/SVGTextElement.h | 4 +- Libraries/LibWeb/SVG/SVGTextPathElement.cpp | 6 +- Libraries/LibWeb/SVG/SVGTextPathElement.h | 6 +- .../LibWeb/SVG/SVGTextPositioningElement.h | 8 +- Libraries/LibWeb/SVG/SVGTitleElement.cpp | 4 +- Libraries/LibWeb/SVG/SVGTitleElement.h | 4 +- Libraries/LibWeb/SVG/SVGTransform.cpp | 4 +- Libraries/LibWeb/SVG/SVGTransform.h | 4 +- Libraries/LibWeb/SVG/SVGTransformList.cpp | 8 +- Libraries/LibWeb/SVG/SVGTransformList.h | 10 +- Libraries/LibWeb/SVG/SVGURIReference.h | 4 +- Libraries/LibWeb/SVG/SVGUseElement.cpp | 18 +- Libraries/LibWeb/SVG/SVGUseElement.h | 22 +- Libraries/LibWeb/Selection/Selection.cpp | 36 +- Libraries/LibWeb/Selection/Selection.h | 40 +- Libraries/LibWeb/ServiceWorker/Job.cpp | 60 +- Libraries/LibWeb/ServiceWorker/Job.h | 18 +- .../LibWeb/StorageAPI/NavigatorStorage.cpp | 2 +- .../LibWeb/StorageAPI/NavigatorStorage.h | 4 +- .../LibWeb/StorageAPI/StorageManager.cpp | 4 +- Libraries/LibWeb/StorageAPI/StorageManager.h | 4 +- .../LibWeb/Streams/AbstractOperations.cpp | 526 +++++++++--------- Libraries/LibWeb/Streams/AbstractOperations.h | 100 ++-- .../Streams/ByteLengthQueuingStrategy.cpp | 6 +- .../Streams/ByteLengthQueuingStrategy.h | 6 +- .../LibWeb/Streams/CountQueuingStrategy.cpp | 6 +- .../LibWeb/Streams/CountQueuingStrategy.h | 6 +- Libraries/LibWeb/Streams/QueuingStrategy.h | 4 +- .../Streams/ReadableByteStreamController.cpp | 10 +- .../Streams/ReadableByteStreamController.h | 44 +- Libraries/LibWeb/Streams/ReadableStream.cpp | 22 +- Libraries/LibWeb/Streams/ReadableStream.h | 28 +- .../Streams/ReadableStreamBYOBReader.cpp | 18 +- .../LibWeb/Streams/ReadableStreamBYOBReader.h | 12 +- .../Streams/ReadableStreamBYOBRequest.cpp | 6 +- .../Streams/ReadableStreamBYOBRequest.h | 14 +- .../ReadableStreamDefaultController.cpp | 4 +- .../Streams/ReadableStreamDefaultController.h | 28 +- .../Streams/ReadableStreamDefaultReader.cpp | 32 +- .../Streams/ReadableStreamDefaultReader.h | 40 +- .../Streams/ReadableStreamGenericReader.cpp | 4 +- .../Streams/ReadableStreamGenericReader.h | 18 +- Libraries/LibWeb/Streams/TransformStream.cpp | 4 +- Libraries/LibWeb/Streams/TransformStream.h | 24 +- .../TransformStreamDefaultController.cpp | 6 +- .../TransformStreamDefaultController.h | 32 +- Libraries/LibWeb/Streams/Transformer.h | 10 +- Libraries/LibWeb/Streams/UnderlyingSink.h | 8 +- Libraries/LibWeb/Streams/UnderlyingSource.h | 6 +- Libraries/LibWeb/Streams/WritableStream.cpp | 10 +- Libraries/LibWeb/Streams/WritableStream.h | 52 +- .../WritableStreamDefaultController.cpp | 4 +- .../Streams/WritableStreamDefaultController.h | 40 +- .../Streams/WritableStreamDefaultWriter.cpp | 14 +- .../Streams/WritableStreamDefaultWriter.h | 34 +- Libraries/LibWeb/TreeNode.h | 18 +- .../LibWeb/UIEvents/CompositionEvent.cpp | 6 +- Libraries/LibWeb/UIEvents/CompositionEvent.h | 6 +- Libraries/LibWeb/UIEvents/FocusEvent.cpp | 6 +- Libraries/LibWeb/UIEvents/FocusEvent.h | 8 +- Libraries/LibWeb/UIEvents/InputEvent.cpp | 6 +- Libraries/LibWeb/UIEvents/InputEvent.h | 6 +- Libraries/LibWeb/UIEvents/KeyboardEvent.cpp | 8 +- Libraries/LibWeb/UIEvents/KeyboardEvent.h | 8 +- Libraries/LibWeb/UIEvents/MouseEvent.cpp | 8 +- Libraries/LibWeb/UIEvents/MouseEvent.h | 14 +- Libraries/LibWeb/UIEvents/PointerEvent.cpp | 6 +- Libraries/LibWeb/UIEvents/PointerEvent.h | 18 +- Libraries/LibWeb/UIEvents/TextEvent.cpp | 4 +- Libraries/LibWeb/UIEvents/TextEvent.h | 4 +- Libraries/LibWeb/UIEvents/UIEvent.cpp | 6 +- Libraries/LibWeb/UIEvents/UIEvent.h | 10 +- Libraries/LibWeb/UIEvents/WheelEvent.cpp | 8 +- Libraries/LibWeb/UIEvents/WheelEvent.h | 8 +- .../LibWeb/UserTiming/PerformanceMark.cpp | 4 +- Libraries/LibWeb/UserTiming/PerformanceMark.h | 4 +- .../LibWeb/UserTiming/PerformanceMeasure.cpp | 4 +- .../LibWeb/UserTiming/PerformanceMeasure.h | 4 +- Libraries/LibWeb/WebAssembly/Instance.cpp | 12 +- Libraries/LibWeb/WebAssembly/Instance.h | 16 +- Libraries/LibWeb/WebAssembly/Memory.cpp | 12 +- Libraries/LibWeb/WebAssembly/Memory.h | 12 +- Libraries/LibWeb/WebAssembly/Module.cpp | 4 +- Libraries/LibWeb/WebAssembly/Module.h | 8 +- Libraries/LibWeb/WebAssembly/Table.cpp | 4 +- Libraries/LibWeb/WebAssembly/Table.h | 6 +- Libraries/LibWeb/WebAssembly/WebAssembly.cpp | 70 +-- Libraries/LibWeb/WebAssembly/WebAssembly.h | 32 +- Libraries/LibWeb/WebAudio/AudioBuffer.cpp | 12 +- Libraries/LibWeb/WebAudio/AudioBuffer.h | 14 +- .../LibWeb/WebAudio/AudioBufferSourceNode.cpp | 16 +- .../LibWeb/WebAudio/AudioBufferSourceNode.h | 24 +- Libraries/LibWeb/WebAudio/AudioContext.cpp | 24 +- Libraries/LibWeb/WebAudio/AudioContext.h | 12 +- .../LibWeb/WebAudio/AudioDestinationNode.cpp | 6 +- .../LibWeb/WebAudio/AudioDestinationNode.h | 6 +- Libraries/LibWeb/WebAudio/AudioListener.cpp | 6 +- Libraries/LibWeb/WebAudio/AudioListener.h | 40 +- Libraries/LibWeb/WebAudio/AudioNode.cpp | 18 +- Libraries/LibWeb/WebAudio/AudioNode.h | 22 +- Libraries/LibWeb/WebAudio/AudioParam.cpp | 20 +- Libraries/LibWeb/WebAudio/AudioParam.h | 18 +- .../WebAudio/AudioScheduledSourceNode.cpp | 8 +- .../WebAudio/AudioScheduledSourceNode.h | 8 +- .../LibWeb/WebAudio/BaseAudioContext.cpp | 22 +- Libraries/LibWeb/WebAudio/BaseAudioContext.h | 28 +- .../LibWeb/WebAudio/BiquadFilterNode.cpp | 18 +- Libraries/LibWeb/WebAudio/BiquadFilterNode.h | 26 +- .../WebAudio/DynamicsCompressorNode.cpp | 8 +- .../LibWeb/WebAudio/DynamicsCompressorNode.h | 28 +- Libraries/LibWeb/WebAudio/GainNode.cpp | 8 +- Libraries/LibWeb/WebAudio/GainNode.h | 12 +- .../LibWeb/WebAudio/OfflineAudioContext.cpp | 16 +- .../LibWeb/WebAudio/OfflineAudioContext.h | 16 +- Libraries/LibWeb/WebAudio/OscillatorNode.cpp | 8 +- Libraries/LibWeb/WebAudio/OscillatorNode.h | 14 +- Libraries/LibWeb/WebAudio/PeriodicWave.cpp | 4 +- Libraries/LibWeb/WebAudio/PeriodicWave.h | 4 +- Libraries/LibWeb/WebDriver/Actions.cpp | 20 +- Libraries/LibWeb/WebDriver/Actions.h | 14 +- Libraries/LibWeb/WebDriver/Contexts.cpp | 6 +- Libraries/LibWeb/WebDriver/Contexts.h | 4 +- .../WebDriver/ElementLocationStrategies.cpp | 18 +- .../WebDriver/ElementLocationStrategies.h | 4 +- .../LibWeb/WebDriver/ElementReference.cpp | 34 +- Libraries/LibWeb/WebDriver/ElementReference.h | 24 +- Libraries/LibWeb/WebDriver/ExecuteScript.cpp | 22 +- Libraries/LibWeb/WebDriver/ExecuteScript.h | 8 +- Libraries/LibWeb/WebDriver/HeapTimer.cpp | 4 +- Libraries/LibWeb/WebDriver/HeapTimer.h | 12 +- Libraries/LibWeb/WebDriver/InputState.cpp | 2 +- Libraries/LibWeb/WebDriver/JSON.cpp | 6 +- Libraries/LibWeb/WebDriver/Screenshot.cpp | 2 +- Libraries/LibWeb/WebDriver/Screenshot.h | 4 +- Libraries/LibWeb/WebGL/WebGLActiveInfo.cpp | 2 +- Libraries/LibWeb/WebGL/WebGLActiveInfo.h | 2 +- Libraries/LibWeb/WebGL/WebGLBuffer.cpp | 2 +- Libraries/LibWeb/WebGL/WebGLBuffer.h | 2 +- Libraries/LibWeb/WebGL/WebGLContextEvent.cpp | 6 +- Libraries/LibWeb/WebGL/WebGLContextEvent.h | 6 +- Libraries/LibWeb/WebGL/WebGLFramebuffer.cpp | 2 +- Libraries/LibWeb/WebGL/WebGLFramebuffer.h | 2 +- Libraries/LibWeb/WebGL/WebGLProgram.cpp | 2 +- Libraries/LibWeb/WebGL/WebGLProgram.h | 2 +- Libraries/LibWeb/WebGL/WebGLRenderbuffer.cpp | 2 +- Libraries/LibWeb/WebGL/WebGLRenderbuffer.h | 2 +- .../LibWeb/WebGL/WebGLRenderingContext.cpp | 8 +- .../LibWeb/WebGL/WebGLRenderingContext.h | 6 +- .../WebGL/WebGLRenderingContextBase.cpp | 2 +- .../LibWeb/WebGL/WebGLRenderingContextBase.h | 6 +- Libraries/LibWeb/WebGL/WebGLShader.cpp | 2 +- Libraries/LibWeb/WebGL/WebGLShader.h | 2 +- .../WebGL/WebGLShaderPrecisionFormat.cpp | 2 +- .../LibWeb/WebGL/WebGLShaderPrecisionFormat.h | 2 +- Libraries/LibWeb/WebGL/WebGLTexture.cpp | 2 +- Libraries/LibWeb/WebGL/WebGLTexture.h | 2 +- .../LibWeb/WebGL/WebGLUniformLocation.cpp | 2 +- Libraries/LibWeb/WebGL/WebGLUniformLocation.h | 2 +- .../LibWeb/WebIDL/AbstractOperations.cpp | 6 +- Libraries/LibWeb/WebIDL/AbstractOperations.h | 12 +- Libraries/LibWeb/WebIDL/Buffers.cpp | 40 +- Libraries/LibWeb/WebIDL/Buffers.h | 30 +- Libraries/LibWeb/WebIDL/CallbackType.cpp | 2 +- Libraries/LibWeb/WebIDL/CallbackType.h | 10 +- Libraries/LibWeb/WebIDL/DOMException.cpp | 6 +- Libraries/LibWeb/WebIDL/DOMException.h | 22 +- Libraries/LibWeb/WebIDL/ExceptionOr.h | 8 +- Libraries/LibWeb/WebIDL/ObservableArray.cpp | 8 +- Libraries/LibWeb/WebIDL/ObservableArray.h | 12 +- Libraries/LibWeb/WebIDL/Promise.cpp | 34 +- Libraries/LibWeb/WebIDL/Promise.h | 18 +- Libraries/LibWeb/WebSockets/WebSocket.cpp | 10 +- Libraries/LibWeb/WebSockets/WebSocket.h | 6 +- Libraries/LibWeb/WebVTT/VTTCue.cpp | 6 +- Libraries/LibWeb/WebVTT/VTTCue.h | 12 +- Libraries/LibWeb/WebVTT/VTTRegion.cpp | 4 +- Libraries/LibWeb/WebVTT/VTTRegion.h | 4 +- Libraries/LibWeb/XHR/FormData.cpp | 18 +- Libraries/LibWeb/XHR/FormData.h | 18 +- Libraries/LibWeb/XHR/FormDataEntry.h | 4 +- Libraries/LibWeb/XHR/FormDataIterator.cpp | 6 +- Libraries/LibWeb/XHR/FormDataIterator.h | 6 +- Libraries/LibWeb/XHR/ProgressEvent.cpp | 6 +- Libraries/LibWeb/XHR/ProgressEvent.h | 6 +- Libraries/LibWeb/XHR/XMLHttpRequest.cpp | 68 +-- Libraries/LibWeb/XHR/XMLHttpRequest.h | 24 +- Libraries/LibWeb/XHR/XMLHttpRequestUpload.cpp | 2 +- Libraries/LibWeb/XHR/XMLHttpRequestUpload.h | 2 +- Libraries/LibWeb/XML/XMLDocumentBuilder.cpp | 14 +- Libraries/LibWeb/XML/XMLDocumentBuilder.h | 4 +- Meta/Lagom/CMakeLists.txt | 9 +- .../ClangPlugins/LibJSGCPluginAction.cpp | 70 +-- Meta/Lagom/ClangPlugins/LibJSGCPluginAction.h | 2 +- Meta/Lagom/Fuzzers/CMakeLists.txt | 2 +- Meta/Lagom/Fuzzers/fuzzers.cmake | 2 +- .../BindingsGenerator/IDLGenerators.cpp | 124 ++--- .../GenerateWindowOrWorkerInterfaces.cpp | 2 +- Services/WebContent/CMakeLists.txt | 2 +- Services/WebContent/ConnectionFromClient.cpp | 8 +- Services/WebContent/ConnectionFromClient.h | 8 +- .../ConsoleGlobalEnvironmentExtensions.cpp | 2 +- .../ConsoleGlobalEnvironmentExtensions.h | 4 +- Services/WebContent/PageClient.cpp | 10 +- Services/WebContent/PageClient.h | 14 +- Services/WebContent/PageHost.h | 4 +- .../WebContent/WebContentConsoleClient.cpp | 6 +- Services/WebContent/WebContentConsoleClient.h | 8 +- Services/WebContent/WebDriverConnection.cpp | 114 ++-- Services/WebContent/WebDriverConnection.h | 38 +- Services/WebContent/main.cpp | 4 +- Services/WebWorker/CMakeLists.txt | 2 +- Services/WebWorker/ConnectionFromClient.h | 4 +- Services/WebWorker/DedicatedWorkerHost.cpp | 12 +- Services/WebWorker/DedicatedWorkerHost.h | 4 +- Services/WebWorker/PageHost.cpp | 4 +- Services/WebWorker/PageHost.h | 8 +- Services/WebWorker/main.cpp | 4 +- .../classes_are_missing_expected_macros.cpp | 2 +- .../Macros/classes_have_expected_macros.cpp | 8 +- .../classes_have_incorrect_macro_types.cpp | 14 +- .../LibJSGCTests/Macros/nested_macros.cpp | 4 +- .../Macros/wrong_basename_arg.cpp | 8 +- .../Macros/wrong_classname_arg.cpp | 8 +- .../LibJSGCTests/cell_member_not_wrapped.cpp | 20 +- .../gc_allocated_member_is_accessed.cpp | 2 +- .../gc_allocated_member_is_visited.cpp | 2 +- .../missing_member_in_visit_edges.cpp | 2 +- .../missing_visit_edges_method.cpp | 4 +- .../LibJSGCTests/non_cell_class.cpp | 2 +- .../LibJSGCTests/not_visiting_rawgcptr.cpp | 3 +- ...rong_root_fields_in_gc_allocated_types.cpp | 8 +- .../LibJSGCTests/wrapping_non_cell_member.cpp | 16 +- Tests/LibJS/test-value-js.cpp | 36 +- Tests/LibJS/test262-runner.cpp | 10 +- Utilities/js.cpp | 8 +- 1722 files changed, 9939 insertions(+), 9906 deletions(-) rename Libraries/{LibJS/Heap => LibGC}/BlockAllocator.cpp (96%) rename Libraries/{LibJS/Heap => LibGC}/BlockAllocator.h (89%) create mode 100644 Libraries/LibGC/CMakeLists.txt rename Libraries/{LibJS/Heap/CellImpl.cpp => LibGC/Cell.cpp} (55%) rename Libraries/{LibJS/Heap/CellImpl.h => LibGC/Cell.h} (85%) rename Libraries/{LibJS/Heap => LibGC}/CellAllocator.cpp (87%) rename Libraries/{LibJS/Heap => LibGC}/CellAllocator.h (84%) rename Libraries/{LibJS/Heap => LibGC}/ConservativeVector.cpp (80%) rename Libraries/{LibJS/Heap => LibGC}/ConservativeVector.h (94%) rename Libraries/{LibJS/Heap => LibGC}/DeferGC.h (88%) create mode 100644 Libraries/LibGC/Forward.h create mode 100644 Libraries/LibGC/Function.h rename Libraries/{LibJS/Heap => LibGC}/Heap.cpp (89%) rename Libraries/{LibJS/Heap => LibGC}/Heap.h (79%) rename Libraries/{LibJS/Heap => LibGC}/HeapBlock.cpp (89%) rename Libraries/{LibJS/Heap => LibGC}/HeapBlock.h (79%) rename Libraries/{LibJS/Heap => LibGC}/HeapRoot.h (93%) rename Libraries/{LibJS/Heap => LibGC}/Internals.h (89%) rename Libraries/{LibJS/Heap => LibGC}/MarkedVector.cpp (89%) rename Libraries/{LibJS/Heap => LibGC}/MarkedVector.h (84%) rename Libraries/{LibJS/Heap => LibGC}/NanBoxedValue.h (96%) rename Libraries/{LibJS/Heap/GCPtr.h => LibGC/Ptr.h} (68%) create mode 100644 Libraries/LibGC/Root.cpp create mode 100644 Libraries/LibGC/Root.h rename Libraries/{LibJS/Heap => LibGC}/WeakContainer.cpp (84%) rename Libraries/{LibJS/Heap => LibGC}/WeakContainer.h (92%) delete mode 100644 Libraries/LibJS/Heap/Handle.cpp delete mode 100644 Libraries/LibJS/Heap/Handle.h delete mode 100644 Libraries/LibJS/Heap/HeapFunction.h create mode 100644 Libraries/LibWeb/HTML/PageSwapEvent.idl diff --git a/Documentation/LibWebPatterns.md b/Documentation/LibWebPatterns.md index 673b4a60df8..b0734684817 100644 --- a/Documentation/LibWebPatterns.md +++ b/Documentation/LibWebPatterns.md @@ -36,7 +36,7 @@ This is the most common and at the same time most broad error type in LibWeb. In variant of supported errors: - `SimpleException` -- `JS::NonnullGCPtr` +- `GC::Ref` - `JS::Completion` (from `JS::ThrowCompletionOr`, assumed to be of `Type::Throw`) Use this error type for anything that needs to interact with the JS bindings, which will generally @@ -86,7 +86,7 @@ must have: ```cpp // https://fetch.spec.whatwg.org/#concept-fetch - WebIDL::ExceptionOr> fetch(JS::Realm& realm, Infrastructure::Request& request, Infrastructure::FetchAlgorithms const& algorithms, UseParallelQueue use_parallel_queue) + WebIDL::ExceptionOr> fetch(JS::Realm& realm, Infrastructure::Request& request, Infrastructure::FetchAlgorithms const& algorithms, UseParallelQueue use_parallel_queue) { // ... } @@ -99,7 +99,7 @@ must have: VERIFY(request.mode() == Infrastructure::Request::Mode::Navigate || !algorithms.process_early_hints_response().has_value()); // 2. Let taskDestination be null. - JS::GCPtr task_destination; + GC::Ptr task_destination; // ... ``` diff --git a/Libraries/LibJS/Heap/BlockAllocator.cpp b/Libraries/LibGC/BlockAllocator.cpp similarity index 96% rename from Libraries/LibJS/Heap/BlockAllocator.cpp rename to Libraries/LibGC/BlockAllocator.cpp index af0a0d27938..0c890619eae 100644 --- a/Libraries/LibJS/Heap/BlockAllocator.cpp +++ b/Libraries/LibGC/BlockAllocator.cpp @@ -7,8 +7,8 @@ #include #include #include -#include -#include +#include +#include #include #ifdef HAS_ADDRESS_SANITIZER @@ -20,7 +20,7 @@ # define USE_FALLBACK_BLOCK_DEALLOCATION #endif -namespace JS { +namespace GC { BlockAllocator::~BlockAllocator() { diff --git a/Libraries/LibJS/Heap/BlockAllocator.h b/Libraries/LibGC/BlockAllocator.h similarity index 89% rename from Libraries/LibJS/Heap/BlockAllocator.h rename to Libraries/LibGC/BlockAllocator.h index 7d4ab54700f..e3a5dfa28fb 100644 --- a/Libraries/LibJS/Heap/BlockAllocator.h +++ b/Libraries/LibGC/BlockAllocator.h @@ -7,9 +7,9 @@ #pragma once #include -#include +#include -namespace JS { +namespace GC { class BlockAllocator { public: diff --git a/Libraries/LibGC/CMakeLists.txt b/Libraries/LibGC/CMakeLists.txt new file mode 100644 index 00000000000..be7c1d07aa7 --- /dev/null +++ b/Libraries/LibGC/CMakeLists.txt @@ -0,0 +1,14 @@ +set(SOURCES + BlockAllocator.cpp + Cell.cpp + CellAllocator.cpp + ConservativeVector.cpp + Root.cpp + Heap.cpp + HeapBlock.cpp + MarkedVector.cpp + WeakContainer.cpp +) + +serenity_lib(LibGC gc) +target_link_libraries(LibGC PRIVATE LibCore) diff --git a/Libraries/LibJS/Heap/CellImpl.cpp b/Libraries/LibGC/Cell.cpp similarity index 55% rename from Libraries/LibJS/Heap/CellImpl.cpp rename to Libraries/LibGC/Cell.cpp index 13673de8f57..328200f5c80 100644 --- a/Libraries/LibJS/Heap/CellImpl.cpp +++ b/Libraries/LibGC/Cell.cpp @@ -4,12 +4,12 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include -#include +#include +#include -namespace JS { +namespace GC { -void JS::CellImpl::Visitor::visit(NanBoxedValue const& value) +void GC::Cell::Visitor::visit(NanBoxedValue const& value) { if (value.is_cell()) visit_impl(value.as_cell()); diff --git a/Libraries/LibJS/Heap/CellImpl.h b/Libraries/LibGC/Cell.h similarity index 85% rename from Libraries/LibJS/Heap/CellImpl.h rename to Libraries/LibGC/Cell.h index 14c42add160..85eadf0459e 100644 --- a/Libraries/LibJS/Heap/CellImpl.h +++ b/Libraries/LibGC/Cell.h @@ -13,11 +13,11 @@ #include #include #include -#include -#include -#include +#include +#include +#include -namespace JS { +namespace GC { // This instrumentation tells analysis tooling to ignore a potentially mis-wrapped GC-allocated member variable // It should only be used when the lifetime of the GC-allocated member is always longer than the object @@ -27,21 +27,21 @@ namespace JS { # define IGNORE_GC #endif -#define JS_CELL(class_, base_class) \ +#define GC_CELL(class_, base_class) \ public: \ using Base = base_class; \ virtual StringView class_name() const override \ { \ return #class_##sv; \ } \ - friend class JS::Heap; + friend class GC::Heap; -class CellImpl : public Weakable { - AK_MAKE_NONCOPYABLE(CellImpl); - AK_MAKE_NONMOVABLE(CellImpl); +class Cell : public Weakable { + AK_MAKE_NONCOPYABLE(Cell); + AK_MAKE_NONMOVABLE(Cell); public: - virtual ~CellImpl() = default; + virtual ~Cell() = default; bool is_marked() const { return m_mark; } void set_marked(bool b) { m_mark = b; } @@ -58,36 +58,36 @@ public: class Visitor { public: - void visit(CellImpl* cell) + void visit(Cell* cell) { if (cell) visit_impl(*cell); } - void visit(CellImpl& cell) + void visit(Cell& cell) { visit_impl(cell); } - void visit(CellImpl const* cell) + void visit(Cell const* cell) { - visit(const_cast(cell)); + visit(const_cast(cell)); } - void visit(CellImpl const& cell) + void visit(Cell const& cell) { - visit(const_cast(cell)); + visit(const_cast(cell)); } template - void visit(GCPtr cell) + void visit(Ptr cell) { if (cell) visit_impl(const_cast&>(*cell.ptr())); } template - void visit(NonnullGCPtr cell) + void visit(Ref cell) { visit_impl(const_cast&>(*cell.ptr())); } @@ -161,7 +161,7 @@ public: virtual void visit_possible_values(ReadonlyBytes) = 0; protected: - virtual void visit_impl(CellImpl&) = 0; + virtual void visit_impl(Cell&) = 0; virtual ~Visitor() = default; }; @@ -180,7 +180,7 @@ public: ALWAYS_INLINE Heap& heap() const { return HeapBlockBase::from_cell(this)->heap(); } protected: - CellImpl() = default; + Cell() = default; ALWAYS_INLINE void* private_data() const { return bit_cast(&heap())->private_data(); } @@ -195,8 +195,8 @@ private: } template<> -struct AK::Formatter : AK::Formatter { - ErrorOr format(FormatBuilder& builder, JS::CellImpl const* cell) +struct AK::Formatter : AK::Formatter { + ErrorOr format(FormatBuilder& builder, GC::Cell const* cell) { if (!cell) return builder.put_string("Cell{nullptr}"sv); diff --git a/Libraries/LibJS/Heap/CellAllocator.cpp b/Libraries/LibGC/CellAllocator.cpp similarity index 87% rename from Libraries/LibJS/Heap/CellAllocator.cpp rename to Libraries/LibGC/CellAllocator.cpp index fe8d00578dc..78433a2cc86 100644 --- a/Libraries/LibJS/Heap/CellAllocator.cpp +++ b/Libraries/LibGC/CellAllocator.cpp @@ -5,12 +5,12 @@ */ #include -#include -#include -#include -#include +#include +#include +#include +#include -namespace JS { +namespace GC { CellAllocator::CellAllocator(size_t cell_size, char const* class_name) : m_class_name(class_name) @@ -18,7 +18,7 @@ CellAllocator::CellAllocator(size_t cell_size, char const* class_name) { } -CellImpl* CellAllocator::allocate_cell(Heap& heap) +Cell* CellAllocator::allocate_cell(Heap& heap) { if (!m_list_node.is_in_list()) heap.register_cell_allocator({}, *this); diff --git a/Libraries/LibJS/Heap/CellAllocator.h b/Libraries/LibGC/CellAllocator.h similarity index 84% rename from Libraries/LibJS/Heap/CellAllocator.h rename to Libraries/LibGC/CellAllocator.h index beece07829f..8a73436901e 100644 --- a/Libraries/LibJS/Heap/CellAllocator.h +++ b/Libraries/LibGC/CellAllocator.h @@ -9,17 +9,17 @@ #include #include #include -#include -#include -#include +#include +#include +#include -#define JS_DECLARE_ALLOCATOR(ClassName) \ - static JS::TypeIsolatingCellAllocator cell_allocator +#define GC_DECLARE_ALLOCATOR(ClassName) \ + static GC::TypeIsolatingCellAllocator cell_allocator -#define JS_DEFINE_ALLOCATOR(ClassName) \ - JS::TypeIsolatingCellAllocator ClassName::cell_allocator { #ClassName } +#define GC_DEFINE_ALLOCATOR(ClassName) \ + GC::TypeIsolatingCellAllocator ClassName::cell_allocator { #ClassName } -namespace JS { +namespace GC { class CellAllocator { public: @@ -28,7 +28,7 @@ public: size_t cell_size() const { return m_cell_size; } - CellImpl* allocate_cell(Heap&); + Cell* allocate_cell(Heap&); template IterationDecision for_each_block(Callback callback) diff --git a/Libraries/LibJS/Heap/ConservativeVector.cpp b/Libraries/LibGC/ConservativeVector.cpp similarity index 80% rename from Libraries/LibJS/Heap/ConservativeVector.cpp rename to Libraries/LibGC/ConservativeVector.cpp index b9ef2f26b97..33e6f1a3aaa 100644 --- a/Libraries/LibJS/Heap/ConservativeVector.cpp +++ b/Libraries/LibGC/ConservativeVector.cpp @@ -4,10 +4,10 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include -#include +#include +#include -namespace JS { +namespace GC { ConservativeVectorBase::ConservativeVectorBase(Heap& heap) : m_heap(&heap) diff --git a/Libraries/LibJS/Heap/ConservativeVector.h b/Libraries/LibGC/ConservativeVector.h similarity index 94% rename from Libraries/LibJS/Heap/ConservativeVector.h rename to Libraries/LibGC/ConservativeVector.h index 066dcf37edd..150525a7cea 100644 --- a/Libraries/LibJS/Heap/ConservativeVector.h +++ b/Libraries/LibGC/ConservativeVector.h @@ -9,11 +9,11 @@ #include #include #include -#include -#include -#include +#include +#include +#include -namespace JS { +namespace GC { class ConservativeVectorBase { public: diff --git a/Libraries/LibJS/Heap/DeferGC.h b/Libraries/LibGC/DeferGC.h similarity index 88% rename from Libraries/LibJS/Heap/DeferGC.h rename to Libraries/LibGC/DeferGC.h index 3c2ab1ea11a..addeed7a53a 100644 --- a/Libraries/LibJS/Heap/DeferGC.h +++ b/Libraries/LibGC/DeferGC.h @@ -6,9 +6,9 @@ #pragma once -#include +#include -namespace JS { +namespace GC { class DeferGC { public: diff --git a/Libraries/LibGC/Forward.h b/Libraries/LibGC/Forward.h new file mode 100644 index 00000000000..98cf257c9cf --- /dev/null +++ b/Libraries/LibGC/Forward.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024, Shannon Booth + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +namespace GC { + +class Cell; +class CellAllocator; +class DeferGC; +class RootImpl; +class Heap; +class HeapBlock; +class NanBoxedValue; +class WeakContainer; + +template +class Function; + +template +class Root; + +template +class ConservativeVector; + +template +class MarkedVector; + +} diff --git a/Libraries/LibGC/Function.h b/Libraries/LibGC/Function.h new file mode 100644 index 00000000000..047ea765cc5 --- /dev/null +++ b/Libraries/LibGC/Function.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2023, Andreas Kling + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include +#include +#include + +namespace GC { + +template +class Function final : public Cell { + GC_CELL(Function, Cell); + +public: + static Ref create(Heap& heap, AK::Function function) + { + return heap.allocate(move(function)); + } + + virtual ~Function() override = default; + + [[nodiscard]] AK::Function const& function() const { return m_function; } + +private: + Function(AK::Function function) + : m_function(move(function)) + { + } + + virtual void visit_edges(Visitor& visitor) override + { + Base::visit_edges(visitor); + visitor.visit_possible_values(m_function.raw_capture_range()); + } + + AK::Function m_function; +}; + +template> +static Ref> create_function(Heap& heap, Callable&& function) +{ + return Function::create(heap, AK::Function { forward(function) }); +} + +} diff --git a/Libraries/LibJS/Heap/Heap.cpp b/Libraries/LibGC/Heap.cpp similarity index 89% rename from Libraries/LibJS/Heap/Heap.cpp rename to Libraries/LibGC/Heap.cpp index e7d2698267e..f6be03c1bd3 100644 --- a/Libraries/LibJS/Heap/Heap.cpp +++ b/Libraries/LibGC/Heap.cpp @@ -15,20 +15,20 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #ifdef HAS_ADDRESS_SANITIZER # include #endif -namespace JS { +namespace GC { -Heap::Heap(void* private_data, Function&)> gather_embedder_roots) +Heap::Heap(void* private_data, AK::Function&)> gather_embedder_roots) : HeapBase(private_data) , m_gather_embedder_roots(move(gather_embedder_roots)) { @@ -100,7 +100,7 @@ static void for_each_cell_among_possible_pointers(HashTable const& a for (auto possible_pointer : possible_pointers.keys()) { if (!possible_pointer) continue; - auto* possible_heap_block = HeapBlock::from_cell(reinterpret_cast(possible_pointer)); + auto* possible_heap_block = HeapBlock::from_cell(reinterpret_cast(possible_pointer)); if (!all_live_heap_blocks.contains(possible_heap_block)) continue; if (auto* cell = possible_heap_block->cell_from_possible_pointer(possible_pointer)) { @@ -109,9 +109,9 @@ static void for_each_cell_among_possible_pointers(HashTable const& a } } -class GraphConstructorVisitor final : public CellImpl::Visitor { +class GraphConstructorVisitor final : public Cell::Visitor { public: - explicit GraphConstructorVisitor(Heap& heap, HashMap const& roots) + explicit GraphConstructorVisitor(Heap& heap, HashMap const& roots) : m_heap(heap) { m_heap.find_min_and_max_block_addresses(m_min_block_address, m_max_block_address); @@ -129,7 +129,7 @@ public: } } - virtual void visit_impl(CellImpl& cell) override + virtual void visit_impl(Cell& cell) override { if (m_node_being_visited) m_node_being_visited->edges.set(reinterpret_cast(&cell)); @@ -148,7 +148,7 @@ public: for (size_t i = 0; i < (bytes.size() / sizeof(FlatPtr)); ++i) add_possible_value(possible_pointers, raw_pointer_sized_values[i], HeapRoot { .type = HeapRoot::Type::HeapFunctionCapturedPointer }, m_min_block_address, m_max_block_address); - for_each_cell_among_possible_pointers(m_all_live_heap_blocks, possible_pointers, [&](CellImpl* cell, FlatPtr) { + for_each_cell_among_possible_pointers(m_all_live_heap_blocks, possible_pointers, [&](Cell* cell, FlatPtr) { if (m_node_being_visited) m_node_being_visited->edges.set(reinterpret_cast(cell)); @@ -183,8 +183,8 @@ public: auto type = it.value.root_origin->type; auto location = it.value.root_origin->location; switch (type) { - case HeapRoot::Type::Handle: - node.set("root"sv, ByteString::formatted("Handle {} {}:{}", location->function_name(), location->filename(), location->line_number())); + case HeapRoot::Type::Root: + node.set("root"sv, ByteString::formatted("Root {} {}:{}", location->function_name(), location->filename(), location->line_number())); break; case HeapRoot::Type::MarkedVector: node.set("root"sv, "MarkedVector"); @@ -218,7 +218,7 @@ private: }; GraphNode* m_node_being_visited { nullptr }; - Vector> m_work_queue; + Vector> m_work_queue; HashMap m_graph; Heap& m_heap; @@ -229,7 +229,7 @@ private: AK::JsonObject Heap::dump_graph() { - HashMap roots; + HashMap roots; gather_roots(roots); GraphConstructorVisitor visitor(*this, roots); visitor.visit_all_cells(); @@ -250,7 +250,7 @@ void Heap::collect_garbage(CollectionType collection_type, bool print_report) m_should_gc_when_deferral_ends = true; return; } - HashMap roots; + HashMap roots; gather_roots(roots); mark_live_cells(roots); } @@ -258,13 +258,13 @@ void Heap::collect_garbage(CollectionType collection_type, bool print_report) sweep_dead_cells(print_report, collection_measurement_timer); } -void Heap::gather_roots(HashMap& roots) +void Heap::gather_roots(HashMap& roots) { m_gather_embedder_roots(roots); gather_conservative_roots(roots); - for (auto& handle : m_handles) - roots.set(handle.cell(), HeapRoot { .type = HeapRoot::Type::Handle, .location = &handle.source_location() }); + for (auto& root : m_roots) + roots.set(root.cell(), HeapRoot { .type = HeapRoot::Type::Root, .location = &root.source_location() }); for (auto& vector : m_marked_vectors) vector.gather_roots(roots); @@ -298,7 +298,7 @@ void Heap::gather_asan_fake_stack_roots(HashMap&, FlatPtr, Fl } #endif -NO_SANITIZE_ADDRESS void Heap::gather_conservative_roots(HashMap& roots) +NO_SANITIZE_ADDRESS void Heap::gather_conservative_roots(HashMap& roots) { FlatPtr dummy; @@ -337,8 +337,8 @@ NO_SANITIZE_ADDRESS void Heap::gather_conservative_roots(HashMapstate() == CellImpl::State::Live) { + for_each_cell_among_possible_pointers(all_live_heap_blocks, possible_pointers, [&](Cell* cell, FlatPtr possible_pointer) { + if (cell->state() == Cell::State::Live) { dbgln_if(HEAP_DEBUG, " ?-> {}", (void const*)cell); roots.set(cell, *possible_pointers.get(possible_pointer)); } else { @@ -347,9 +347,9 @@ NO_SANITIZE_ADDRESS void Heap::gather_conservative_roots(HashMap const& roots) + explicit MarkingVisitor(Heap& heap, HashMap const& roots) : m_heap(heap) { m_heap.find_min_and_max_block_addresses(m_min_block_address, m_max_block_address); @@ -363,7 +363,7 @@ public: } } - virtual void visit_impl(CellImpl& cell) override + virtual void visit_impl(Cell& cell) override { if (cell.is_marked()) return; @@ -381,10 +381,10 @@ public: for (size_t i = 0; i < (bytes.size() / sizeof(FlatPtr)); ++i) add_possible_value(possible_pointers, raw_pointer_sized_values[i], HeapRoot { .type = HeapRoot::Type::HeapFunctionCapturedPointer }, m_min_block_address, m_max_block_address); - for_each_cell_among_possible_pointers(m_all_live_heap_blocks, possible_pointers, [&](CellImpl* cell, FlatPtr) { + for_each_cell_among_possible_pointers(m_all_live_heap_blocks, possible_pointers, [&](Cell* cell, FlatPtr) { if (cell->is_marked()) return; - if (cell->state() != CellImpl::State::Live) + if (cell->state() != Cell::State::Live) return; cell->set_marked(true); m_work_queue.append(*cell); @@ -400,13 +400,13 @@ public: private: Heap& m_heap; - Vector> m_work_queue; + Vector> m_work_queue; HashTable m_all_live_heap_blocks; FlatPtr m_min_block_address; FlatPtr m_max_block_address; }; -void Heap::mark_live_cells(HashMap const& roots) +void Heap::mark_live_cells(HashMap const& roots) { dbgln_if(HEAP_DEBUG, "mark_live_cells:"); @@ -420,7 +420,7 @@ void Heap::mark_live_cells(HashMap const& roots) m_uprooted_cells.clear(); } -bool Heap::cell_must_survive_garbage_collection(CellImpl const& cell) +bool Heap::cell_must_survive_garbage_collection(Cell const& cell) { if (!cell.overrides_must_survive_garbage_collection({})) return false; @@ -430,7 +430,7 @@ bool Heap::cell_must_survive_garbage_collection(CellImpl const& cell) void Heap::finalize_unmarked_cells() { for_each_block([&](auto& block) { - block.template for_each_cell_in_state([](CellImpl* cell) { + block.template for_each_cell_in_state([](Cell* cell) { if (!cell->is_marked() && !cell_must_survive_garbage_collection(*cell)) cell->finalize(); }); @@ -452,7 +452,7 @@ void Heap::sweep_dead_cells(bool print_report, Core::ElapsedTimer const& measure for_each_block([&](auto& block) { bool block_has_live_cells = false; bool block_was_full = block.is_full(); - block.template for_each_cell_in_state([&](CellImpl* cell) { + block.template for_each_cell_in_state([&](Cell* cell) { if (!cell->is_marked() && !cell_must_survive_garbage_collection(*cell)) { dbgln_if(HEAP_DEBUG, " ~ {}", cell); block.deallocate(cell); @@ -530,7 +530,7 @@ void Heap::undefer_gc() } } -void Heap::uproot_cell(CellImpl* cell) +void Heap::uproot_cell(Cell* cell) { m_uprooted_cells.append(cell); } diff --git a/Libraries/LibJS/Heap/Heap.h b/Libraries/LibGC/Heap.h similarity index 79% rename from Libraries/LibJS/Heap/Heap.h rename to Libraries/LibGC/Heap.h index 79851307c45..89e31d998d2 100644 --- a/Libraries/LibJS/Heap/Heap.h +++ b/Libraries/LibGC/Heap.h @@ -16,28 +16,28 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -namespace JS { +namespace GC { class Heap : public HeapBase { AK_MAKE_NONCOPYABLE(Heap); AK_MAKE_NONMOVABLE(Heap); public: - explicit Heap(void* private_data, Function&)> gather_embedder_roots); + explicit Heap(void* private_data, AK::Function&)> gather_embedder_roots); ~Heap(); template - NonnullGCPtr allocate(Args&&... args) + Ref allocate(Args&&... args) { auto* memory = allocate_cell(); defer_gc(); @@ -57,8 +57,8 @@ public: bool should_collect_on_every_allocation() const { return m_should_collect_on_every_allocation; } void set_should_collect_on_every_allocation(bool b) { m_should_collect_on_every_allocation = b; } - void did_create_handle(Badge, HandleImpl&); - void did_destroy_handle(Badge, HandleImpl&); + void did_create_root(Badge, RootImpl&); + void did_destroy_root(Badge, RootImpl&); void did_create_marked_vector(Badge, MarkedVectorBase&); void did_destroy_marked_vector(Badge, MarkedVectorBase&); @@ -71,7 +71,7 @@ public: void register_cell_allocator(Badge, CellAllocator&); - void uproot_cell(CellImpl* cell); + void uproot_cell(Cell* cell); private: friend class MarkingVisitor; @@ -81,10 +81,10 @@ private: void defer_gc(); void undefer_gc(); - static bool cell_must_survive_garbage_collection(CellImpl const&); + static bool cell_must_survive_garbage_collection(Cell const&); template - CellImpl* allocate_cell() + Cell* allocate_cell() { will_allocate(sizeof(T)); if constexpr (requires { T::cell_allocator.allocator.get().allocate_cell(*this); }) { @@ -98,10 +98,10 @@ private: void will_allocate(size_t); void find_min_and_max_block_addresses(FlatPtr& min_address, FlatPtr& max_address); - void gather_roots(HashMap&); - void gather_conservative_roots(HashMap&); + void gather_roots(HashMap&); + void gather_conservative_roots(HashMap&); void gather_asan_fake_stack_roots(HashMap&, FlatPtr, FlatPtr min_block_address, FlatPtr max_block_address); - void mark_live_cells(HashMap const& live_cells); + void mark_live_cells(HashMap const& live_cells); void finalize_unmarked_cells(); void sweep_dead_cells(bool print_report, Core::ElapsedTimer const&); @@ -134,31 +134,31 @@ private: Vector> m_size_based_cell_allocators; CellAllocator::List m_all_cell_allocators; - HandleImpl::List m_handles; + RootImpl::List m_roots; MarkedVectorBase::List m_marked_vectors; ConservativeVectorBase::List m_conservative_vectors; WeakContainer::List m_weak_containers; - Vector> m_uprooted_cells; + Vector> m_uprooted_cells; size_t m_gc_deferrals { 0 }; bool m_should_gc_when_deferral_ends { false }; bool m_collecting_garbage { false }; StackInfo m_stack_info; - Function&)> m_gather_embedder_roots; + AK::Function&)> m_gather_embedder_roots; }; -inline void Heap::did_create_handle(Badge, HandleImpl& impl) +inline void Heap::did_create_root(Badge, RootImpl& impl) { - VERIFY(!m_handles.contains(impl)); - m_handles.append(impl); + VERIFY(!m_roots.contains(impl)); + m_roots.append(impl); } -inline void Heap::did_destroy_handle(Badge, HandleImpl& impl) +inline void Heap::did_destroy_root(Badge, RootImpl& impl) { - VERIFY(m_handles.contains(impl)); - m_handles.remove(impl); + VERIFY(m_roots.contains(impl)); + m_roots.remove(impl); } inline void Heap::did_create_marked_vector(Badge, MarkedVectorBase& vector) diff --git a/Libraries/LibJS/Heap/HeapBlock.cpp b/Libraries/LibGC/HeapBlock.cpp similarity index 89% rename from Libraries/LibJS/Heap/HeapBlock.cpp rename to Libraries/LibGC/HeapBlock.cpp index f7587cc04ea..61373dc48ea 100644 --- a/Libraries/LibJS/Heap/HeapBlock.cpp +++ b/Libraries/LibGC/HeapBlock.cpp @@ -7,8 +7,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -16,7 +16,7 @@ # include #endif -namespace JS { +namespace GC { size_t HeapBlockBase::block_size = PAGE_SIZE; @@ -37,16 +37,16 @@ HeapBlock::HeapBlock(Heap& heap, CellAllocator& cell_allocator, size_t cell_size ASAN_POISON_MEMORY_REGION(m_storage, block_size - sizeof(HeapBlock)); } -void HeapBlock::deallocate(CellImpl* cell) +void HeapBlock::deallocate(Cell* cell) { VERIFY(is_valid_cell_pointer(cell)); VERIFY(!m_freelist || is_valid_cell_pointer(m_freelist)); - VERIFY(cell->state() == CellImpl::State::Live); + VERIFY(cell->state() == Cell::State::Live); VERIFY(!cell->is_marked()); - cell->~CellImpl(); + cell->~Cell(); auto* freelist_entry = new (cell) FreelistEntry(); - freelist_entry->set_state(CellImpl::State::Dead); + freelist_entry->set_state(Cell::State::Dead); freelist_entry->next = m_freelist; m_freelist = freelist_entry; diff --git a/Libraries/LibJS/Heap/HeapBlock.h b/Libraries/LibGC/HeapBlock.h similarity index 79% rename from Libraries/LibJS/Heap/HeapBlock.h rename to Libraries/LibGC/HeapBlock.h index 44d1c89e682..17afadeb73b 100644 --- a/Libraries/LibJS/Heap/HeapBlock.h +++ b/Libraries/LibGC/HeapBlock.h @@ -10,15 +10,15 @@ #include #include #include -#include -#include -#include +#include +#include +#include #ifdef HAS_ADDRESS_SANITIZER # include #endif -namespace JS { +namespace GC { class HeapBlock : public HeapBlockBase { AK_MAKE_NONCOPYABLE(HeapBlock); @@ -32,9 +32,9 @@ public: size_t cell_count() const { return (block_size - sizeof(HeapBlock)) / m_cell_size; } bool is_full() const { return !has_lazy_freelist() && !m_freelist; } - ALWAYS_INLINE CellImpl* allocate() + ALWAYS_INLINE Cell* allocate() { - CellImpl* allocated_cell = nullptr; + Cell* allocated_cell = nullptr; if (m_freelist) { VERIFY(is_valid_cell_pointer(m_freelist)); allocated_cell = exchange(m_freelist, m_freelist->next); @@ -48,7 +48,7 @@ public: return allocated_cell; } - void deallocate(CellImpl*); + void deallocate(Cell*); template void for_each_cell(Callback callback) @@ -58,7 +58,7 @@ public: callback(cell(i)); } - template + template void for_each_cell_in_state(Callback callback) { for_each_cell([&](auto* cell) { @@ -67,12 +67,12 @@ public: }); } - static HeapBlock* from_cell(CellImpl const* cell) + static HeapBlock* from_cell(Cell const* cell) { return static_cast(HeapBlockBase::from_cell(cell)); } - CellImpl* cell_from_possible_pointer(FlatPtr pointer) + Cell* cell_from_possible_pointer(FlatPtr pointer) { if (pointer < reinterpret_cast(m_storage)) return nullptr; @@ -83,7 +83,7 @@ public: return cell(cell_index); } - bool is_valid_cell_pointer(CellImpl const* cell) + bool is_valid_cell_pointer(Cell const* cell) { return cell_from_possible_pointer((FlatPtr)cell); } @@ -97,21 +97,21 @@ private: bool has_lazy_freelist() const { return m_next_lazy_freelist_index < cell_count(); } - struct FreelistEntry final : public CellImpl { - JS_CELL(FreelistEntry, CellImpl); + struct FreelistEntry final : public Cell { + GC_CELL(FreelistEntry, Cell); - RawGCPtr next; + RawPtr next; }; - CellImpl* cell(size_t index) + Cell* cell(size_t index) { - return reinterpret_cast(&m_storage[index * cell_size()]); + return reinterpret_cast(&m_storage[index * cell_size()]); } CellAllocator& m_cell_allocator; size_t m_cell_size { 0 }; size_t m_next_lazy_freelist_index { 0 }; - GCPtr m_freelist; + Ptr m_freelist; alignas(__BIGGEST_ALIGNMENT__) u8 m_storage[]; public: diff --git a/Libraries/LibJS/Heap/HeapRoot.h b/Libraries/LibGC/HeapRoot.h similarity index 93% rename from Libraries/LibJS/Heap/HeapRoot.h rename to Libraries/LibGC/HeapRoot.h index 0309062bdbc..f4205185ab5 100644 --- a/Libraries/LibJS/Heap/HeapRoot.h +++ b/Libraries/LibGC/HeapRoot.h @@ -8,12 +8,12 @@ #include -namespace JS { +namespace GC { struct HeapRoot { enum class Type { HeapFunctionCapturedPointer, - Handle, + Root, MarkedVector, ConservativeVector, RegisterPointer, diff --git a/Libraries/LibJS/Heap/Internals.h b/Libraries/LibGC/Internals.h similarity index 89% rename from Libraries/LibJS/Heap/Internals.h rename to Libraries/LibGC/Internals.h index f3ec8a8ee55..234c33baf40 100644 --- a/Libraries/LibJS/Heap/Internals.h +++ b/Libraries/LibGC/Internals.h @@ -8,9 +8,9 @@ #pragma once #include -#include +#include -namespace JS { +namespace GC { class HeapBase { AK_MAKE_NONCOPYABLE(HeapBase); @@ -34,7 +34,7 @@ class HeapBlockBase { public: static size_t block_size; - static HeapBlockBase* from_cell(CellImpl const* cell) + static HeapBlockBase* from_cell(Cell const* cell) { return reinterpret_cast(bit_cast(cell) & ~(HeapBlockBase::block_size - 1)); } diff --git a/Libraries/LibJS/Heap/MarkedVector.cpp b/Libraries/LibGC/MarkedVector.cpp similarity index 89% rename from Libraries/LibJS/Heap/MarkedVector.cpp rename to Libraries/LibGC/MarkedVector.cpp index fe269181b32..e03960d3108 100644 --- a/Libraries/LibJS/Heap/MarkedVector.cpp +++ b/Libraries/LibGC/MarkedVector.cpp @@ -5,10 +5,10 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include -#include +#include +#include -namespace JS { +namespace GC { MarkedVectorBase::MarkedVectorBase(Heap& heap) : m_heap(&heap) diff --git a/Libraries/LibJS/Heap/MarkedVector.h b/Libraries/LibGC/MarkedVector.h similarity index 84% rename from Libraries/LibJS/Heap/MarkedVector.h rename to Libraries/LibGC/MarkedVector.h index 4be1bdeafe3..b1e191a28a1 100644 --- a/Libraries/LibJS/Heap/MarkedVector.h +++ b/Libraries/LibGC/MarkedVector.h @@ -10,15 +10,15 @@ #include #include #include -#include -#include -#include +#include +#include +#include -namespace JS { +namespace GC { class MarkedVectorBase { public: - virtual void gather_roots(HashMap&) const = 0; + virtual void gather_roots(HashMap&) const = 0; protected: explicit MarkedVectorBase(Heap&); @@ -65,10 +65,10 @@ public: return *this; } - virtual void gather_roots(HashMap& roots) const override + virtual void gather_roots(HashMap& roots) const override { for (auto& value : *this) { - if constexpr (IsSame) { + if constexpr (IsBaseOf) { if (value.is_cell()) roots.set(&const_cast(value).as_cell(), HeapRoot { .type = HeapRoot::Type::MarkedVector }); } else { diff --git a/Libraries/LibJS/Heap/NanBoxedValue.h b/Libraries/LibGC/NanBoxedValue.h similarity index 96% rename from Libraries/LibJS/Heap/NanBoxedValue.h rename to Libraries/LibGC/NanBoxedValue.h index 3bf95351158..989a87efbda 100644 --- a/Libraries/LibJS/Heap/NanBoxedValue.h +++ b/Libraries/LibGC/NanBoxedValue.h @@ -8,8 +8,9 @@ #include #include +#include -namespace JS { +namespace GC { static_assert(sizeof(double) == 8); static_assert(sizeof(void*) == sizeof(double) || sizeof(void*) == sizeof(u32)); @@ -72,7 +73,7 @@ public: // For AArch64 the top 16 bits of the pointer should be zero. // For PPC64: all 64 bits can be used for pointers, however on Linux only // the lower 43 bits are used for user-space addresses, so - // masking off the top 16 bits should match the rest of LibJS. + // masking off the top 16 bits should match the rest of LibGC. return static_cast(encoded & 0xffff'ffff'ffffULL); #else # error "Unknown architecture. Don't know whether pointers need to be sign-extended." @@ -86,16 +87,16 @@ public: return reinterpret_cast(extract_pointer_bits(m_value.encoded)); } - CellImpl& as_cell() + Cell& as_cell() { VERIFY(is_cell()); - return *extract_pointer(); + return *extract_pointer(); } - CellImpl& as_cell() const + Cell& as_cell() const { VERIFY(is_cell()); - return *extract_pointer(); + return *extract_pointer(); } bool is_nan() const diff --git a/Libraries/LibJS/Heap/GCPtr.h b/Libraries/LibGC/Ptr.h similarity index 68% rename from Libraries/LibJS/Heap/GCPtr.h rename to Libraries/LibGC/Ptr.h index ebe8753f096..fcbbb4b7586 100644 --- a/Libraries/LibJS/Heap/GCPtr.h +++ b/Libraries/LibGC/Ptr.h @@ -9,51 +9,51 @@ #include #include -namespace JS { +namespace GC { template -class GCPtr; +class Ptr; template -class NonnullGCPtr { +class Ref { public: - NonnullGCPtr() = delete; + Ref() = delete; - NonnullGCPtr(T& ptr) + Ref(T& ptr) : m_ptr(&ptr) { } template - NonnullGCPtr(U& ptr) + Ref(U& ptr) requires(IsConvertible) : m_ptr(&static_cast(ptr)) { } template - NonnullGCPtr(NonnullGCPtr const& other) + Ref(Ref const& other) requires(IsConvertible) : m_ptr(other.ptr()) { } template - NonnullGCPtr& operator=(NonnullGCPtr const& other) + Ref& operator=(Ref const& other) requires(IsConvertible) { m_ptr = static_cast(other.ptr()); return *this; } - NonnullGCPtr& operator=(T& other) + Ref& operator=(T& other) { m_ptr = &other; return *this; } template - NonnullGCPtr& operator=(U& other) + Ref& operator=(U& other) requires(IsConvertible) { m_ptr = &static_cast(other); @@ -75,88 +75,88 @@ private: }; template -class GCPtr { +class Ptr { public: - constexpr GCPtr() = default; + constexpr Ptr() = default; - GCPtr(T& ptr) + Ptr(T& ptr) : m_ptr(&ptr) { } - GCPtr(T* ptr) + Ptr(T* ptr) : m_ptr(ptr) { } template - GCPtr(GCPtr const& other) + Ptr(Ptr const& other) requires(IsConvertible) : m_ptr(other.ptr()) { } - GCPtr(NonnullGCPtr const& other) + Ptr(Ref const& other) : m_ptr(other.ptr()) { } template - GCPtr(NonnullGCPtr const& other) + Ptr(Ref const& other) requires(IsConvertible) : m_ptr(other.ptr()) { } - GCPtr(nullptr_t) + Ptr(nullptr_t) : m_ptr(nullptr) { } template - GCPtr& operator=(GCPtr const& other) + Ptr& operator=(Ptr const& other) requires(IsConvertible) { m_ptr = static_cast(other.ptr()); return *this; } - GCPtr& operator=(NonnullGCPtr const& other) + Ptr& operator=(Ref const& other) { m_ptr = other.ptr(); return *this; } template - GCPtr& operator=(NonnullGCPtr const& other) + Ptr& operator=(Ref const& other) requires(IsConvertible) { m_ptr = static_cast(other.ptr()); return *this; } - GCPtr& operator=(T& other) + Ptr& operator=(T& other) { m_ptr = &other; return *this; } template - GCPtr& operator=(U& other) + Ptr& operator=(U& other) requires(IsConvertible) { m_ptr = &static_cast(other); return *this; } - GCPtr& operator=(T* other) + Ptr& operator=(T* other) { m_ptr = other; return *this; } template - GCPtr& operator=(U* other) + Ptr& operator=(U* other) requires(IsConvertible) { m_ptr = static_cast(other); @@ -186,34 +186,34 @@ private: T* m_ptr { nullptr }; }; -// Non-Owning GCPtr +// Non-Owning GC::Ptr template -using RawGCPtr = GCPtr; +using RawPtr = Ptr; -// Non-Owning NonnullGCPtr +// Non-Owning Ref template -using RawNonnullGCPtr = NonnullGCPtr; +using RawRef = Ref; template -inline bool operator==(GCPtr const& a, GCPtr const& b) +inline bool operator==(Ptr const& a, Ptr const& b) { return a.ptr() == b.ptr(); } template -inline bool operator==(GCPtr const& a, NonnullGCPtr const& b) +inline bool operator==(Ptr const& a, Ref const& b) { return a.ptr() == b.ptr(); } template -inline bool operator==(NonnullGCPtr const& a, NonnullGCPtr const& b) +inline bool operator==(Ref const& a, Ref const& b) { return a.ptr() == b.ptr(); } template -inline bool operator==(NonnullGCPtr const& a, GCPtr const& b) +inline bool operator==(Ref const& a, Ptr const& b) { return a.ptr() == b.ptr(); } @@ -223,16 +223,16 @@ inline bool operator==(NonnullGCPtr const& a, GCPtr const& b) namespace AK { template -struct Traits> : public DefaultTraits> { - static unsigned hash(JS::GCPtr const& value) +struct Traits> : public DefaultTraits> { + static unsigned hash(GC::Ptr const& value) { return Traits::hash(value.ptr()); } }; template -struct Traits> : public DefaultTraits> { - static unsigned hash(JS::NonnullGCPtr const& value) +struct Traits> : public DefaultTraits> { + static unsigned hash(GC::Ref const& value) { return Traits::hash(value.ptr()); } diff --git a/Libraries/LibGC/Root.cpp b/Libraries/LibGC/Root.cpp new file mode 100644 index 00000000000..48890e80edb --- /dev/null +++ b/Libraries/LibGC/Root.cpp @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2020, Andreas Kling + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include +#include + +namespace GC { + +RootImpl::RootImpl(Cell* cell, SourceLocation location) + : m_cell(cell) + , m_location(location) +{ + m_cell->heap().did_create_root({}, *this); +} + +RootImpl::~RootImpl() +{ + m_cell->heap().did_destroy_root({}, *this); +} + +} diff --git a/Libraries/LibGC/Root.h b/Libraries/LibGC/Root.h new file mode 100644 index 00000000000..e814ffe2910 --- /dev/null +++ b/Libraries/LibGC/Root.h @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2020, Andreas Kling + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace GC { + +class RootImpl : public RefCounted { + AK_MAKE_NONCOPYABLE(RootImpl); + AK_MAKE_NONMOVABLE(RootImpl); + +public: + ~RootImpl(); + + Cell* cell() { return m_cell; } + Cell const* cell() const { return m_cell; } + + SourceLocation const& source_location() const { return m_location; } + +private: + template + friend class Root; + + explicit RootImpl(Cell*, SourceLocation location); + Ptr m_cell; + SourceLocation m_location; + + IntrusiveListNode m_list_node; + +public: + using List = IntrusiveList<&RootImpl::m_list_node>; +}; + +template +class Root { +public: + Root() = default; + + static Root create(T* cell, SourceLocation location = SourceLocation::current()) + { + return Root(adopt_ref(*new RootImpl(const_cast*>(cell), location))); + } + + Root(T* cell, SourceLocation location = SourceLocation::current()) + { + if (cell) + m_impl = adopt_ref(*new RootImpl(cell, location)); + } + + Root(T& cell, SourceLocation location = SourceLocation::current()) + : m_impl(adopt_ref(*new RootImpl(&cell, location))) + { + } + + Root(Ptr cell, SourceLocation location = SourceLocation::current()) + : Root(cell.ptr(), location) + { + } + + Root(Ref cell, SourceLocation location = SourceLocation::current()) + : Root(*cell, location) + { + } + + T* cell() const + { + if (!m_impl) + return nullptr; + return static_cast(m_impl->cell()); + } + + T* ptr() const + { + return cell(); + } + + bool is_null() const + { + return m_impl.is_null(); + } + + T* operator->() const + { + return cell(); + } + + [[nodiscard]] T& operator*() const + { + return *cell(); + } + + bool operator!() const + { + return !cell(); + } + operator bool() const + { + return cell(); + } + + operator T*() const { return cell(); } + +private: + explicit Root(NonnullRefPtr impl) + : m_impl(move(impl)) + { + } + + RefPtr m_impl; +}; + +template +inline Root make_root(T* cell, SourceLocation location = SourceLocation::current()) +{ + if (!cell) + return Root {}; + return Root::create(cell, location); +} + +template +inline Root make_root(T& cell, SourceLocation location = SourceLocation::current()) +{ + return Root::create(&cell, location); +} + +template +inline Root make_root(Ptr cell, SourceLocation location = SourceLocation::current()) +{ + if (!cell) + return Root {}; + return Root::create(cell.ptr(), location); +} + +template +inline Root make_root(Ref cell, SourceLocation location = SourceLocation::current()) +{ + return Root::create(cell.ptr(), location); +} + +} + +namespace AK { + +template +struct Traits> : public DefaultTraits> { + static unsigned hash(GC::Root const& handle) { return Traits::hash(handle); } +}; + +namespace Detail { +template +inline constexpr bool IsHashCompatible, T> = true; + +template +inline constexpr bool IsHashCompatible> = true; + +} +} diff --git a/Libraries/LibJS/Heap/WeakContainer.cpp b/Libraries/LibGC/WeakContainer.cpp similarity index 84% rename from Libraries/LibJS/Heap/WeakContainer.cpp rename to Libraries/LibGC/WeakContainer.cpp index b84cdf39713..86f74ba8fe1 100644 --- a/Libraries/LibJS/Heap/WeakContainer.cpp +++ b/Libraries/LibGC/WeakContainer.cpp @@ -4,10 +4,10 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include -#include +#include +#include -namespace JS { +namespace GC { WeakContainer::WeakContainer(Heap& heap) : m_heap(heap) diff --git a/Libraries/LibJS/Heap/WeakContainer.h b/Libraries/LibGC/WeakContainer.h similarity index 92% rename from Libraries/LibJS/Heap/WeakContainer.h rename to Libraries/LibGC/WeakContainer.h index 81169984dc9..e2b47d50ec2 100644 --- a/Libraries/LibJS/Heap/WeakContainer.h +++ b/Libraries/LibGC/WeakContainer.h @@ -7,9 +7,9 @@ #pragma once #include -#include +#include -namespace JS { +namespace GC { class WeakContainer { public: diff --git a/Libraries/LibJS/AST.cpp b/Libraries/LibJS/AST.cpp index 9ed24d38bc4..6764b1ac872 100644 --- a/Libraries/LibJS/AST.cpp +++ b/Libraries/LibJS/AST.cpp @@ -14,9 +14,9 @@ #include #include #include +#include +#include #include -#include -#include #include #include #include @@ -97,7 +97,7 @@ Value FunctionExpression::instantiate_ordinary_function_expression(VM& vm, Depre auto has_own_name = !name().is_empty(); auto const used_name = has_own_name ? name() : given_name.view(); - auto environment = NonnullGCPtr { *vm.running_execution_context().lexical_environment }; + auto environment = GC::Ref { *vm.running_execution_context().lexical_environment }; if (has_own_name) { VERIFY(environment); environment = new_declarative_environment(*environment); @@ -227,7 +227,7 @@ ThrowCompletionOr ClassField::class_element_evaluation auto& realm = *vm.current_realm(); auto property_key_or_private_name = TRY(class_key_to_property_name(vm, *m_key, property_key)); - GCPtr initializer; + GC::Ptr initializer; if (m_initializer) { auto copy_initializer = m_initializer; auto name = property_key_or_private_name.visit( @@ -310,7 +310,7 @@ ThrowCompletionOr ClassExpression::create_class_const vm.running_execution_context().lexical_environment = class_environment; - auto proto_parent = GCPtr { realm.intrinsics().object_prototype() }; + auto proto_parent = GC::Ptr { realm.intrinsics().object_prototype() }; auto constructor_parent = realm.intrinsics().function_prototype(); if (!m_super_class.is_null()) { @@ -366,12 +366,12 @@ ThrowCompletionOr ClassExpression::create_class_const prototype->define_direct_property(vm.names.constructor, class_constructor, Attribute::Writable | Attribute::Configurable); - using StaticElement = Variant>; + using StaticElement = Variant>; - ConservativeVector static_private_methods(vm.heap()); - ConservativeVector instance_private_methods(vm.heap()); - ConservativeVector instance_fields(vm.heap()); - ConservativeVector static_elements(vm.heap()); + GC::ConservativeVector static_private_methods(vm.heap()); + GC::ConservativeVector instance_private_methods(vm.heap()); + GC::ConservativeVector instance_fields(vm.heap()); + GC::ConservativeVector static_elements(vm.heap()); for (size_t element_index = 0; element_index < m_elements.size(); element_index++) { auto const& element = m_elements[element_index]; @@ -411,7 +411,7 @@ ThrowCompletionOr ClassExpression::create_class_const VERIFY(element_value.has() && element_value.get().value().has_value()); auto& element_object = element_value.get().value()->as_object(); VERIFY(is(element_object)); - static_elements.append(NonnullGCPtr { static_cast(element_object) }); + static_elements.append(GC::Ref { static_cast(element_object) }); } } @@ -435,7 +435,7 @@ ThrowCompletionOr ClassExpression::create_class_const [&](ClassFieldDefinition& field) -> ThrowCompletionOr { return TRY(class_constructor->define_field(field)); }, - [&](Handle static_block_function) -> ThrowCompletionOr { + [&](GC::Root static_block_function) -> ThrowCompletionOr { VERIFY(!static_block_function.is_null()); // We discard any value returned here. TRY(call(vm, *static_block_function.cell(), class_constructor)); diff --git a/Libraries/LibJS/AST.h b/Libraries/LibJS/AST.h index 3c59145c922..dec69d2ec59 100644 --- a/Libraries/LibJS/AST.h +++ b/Libraries/LibJS/AST.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -22,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -160,10 +160,10 @@ public: } Bytecode::Executable* bytecode_executable() const { return m_bytecode_executable; } - void set_bytecode_executable(Bytecode::Executable* bytecode_executable) { m_bytecode_executable = make_handle(bytecode_executable); } + void set_bytecode_executable(Bytecode::Executable* bytecode_executable) { m_bytecode_executable = make_root(bytecode_executable); } private: - Handle m_bytecode_executable; + GC::Root m_bytecode_executable; }; // 14.13 Labelled Statements, https://tc39.es/ecma262/#sec-labelled-statements @@ -690,7 +690,7 @@ struct FunctionParameter { Variant, NonnullRefPtr> binding; RefPtr default_value; bool is_rest { false }; - Handle bytecode_executable {}; + GC::Root bytecode_executable {}; }; struct FunctionParsingInsights { diff --git a/Libraries/LibJS/Bytecode/BasicBlock.h b/Libraries/LibJS/Bytecode/BasicBlock.h index d28f112aaa7..d9e0ff4bf87 100644 --- a/Libraries/LibJS/Bytecode/BasicBlock.h +++ b/Libraries/LibJS/Bytecode/BasicBlock.h @@ -8,16 +8,16 @@ #include #include +#include #include #include #include -#include namespace JS::Bytecode { struct UnwindInfo { - JS::GCPtr executable; - JS::GCPtr lexical_environment; + GC::Ptr executable; + GC::Ptr lexical_environment; bool handler_called { false }; }; diff --git a/Libraries/LibJS/Bytecode/Executable.cpp b/Libraries/LibJS/Bytecode/Executable.cpp index 959a5ffe240..e012256418f 100644 --- a/Libraries/LibJS/Bytecode/Executable.cpp +++ b/Libraries/LibJS/Bytecode/Executable.cpp @@ -13,7 +13,7 @@ namespace JS::Bytecode { -JS_DEFINE_ALLOCATOR(Executable); +GC_DEFINE_ALLOCATOR(Executable); Executable::Executable( Vector bytecode, diff --git a/Libraries/LibJS/Bytecode/Executable.h b/Libraries/LibJS/Bytecode/Executable.h index 7eb1b168bc4..499506809d8 100644 --- a/Libraries/LibJS/Bytecode/Executable.h +++ b/Libraries/LibJS/Bytecode/Executable.h @@ -11,12 +11,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include @@ -40,8 +40,8 @@ struct SourceRecord { }; class Executable final : public Cell { - JS_CELL(Executable, Cell); - JS_DECLARE_ALLOCATOR(Executable); + GC_CELL(Executable, Cell); + GC_DECLARE_ALLOCATOR(Executable); public: Executable( diff --git a/Libraries/LibJS/Bytecode/Generator.cpp b/Libraries/LibJS/Bytecode/Generator.cpp index 7ae318c1e1d..f4c99673a1c 100644 --- a/Libraries/LibJS/Bytecode/Generator.cpp +++ b/Libraries/LibJS/Bytecode/Generator.cpp @@ -17,7 +17,7 @@ namespace JS::Bytecode { -Generator::Generator(VM& vm, GCPtr function, MustPropagateCompletion must_propagate_completion) +Generator::Generator(VM& vm, GC::Ptr function, MustPropagateCompletion must_propagate_completion) : m_vm(vm) , m_string_table(make()) , m_identifier_table(make()) @@ -199,7 +199,7 @@ CodeGenerationErrorOr Generator::emit_function_declaration_instantiation(E return {}; } -CodeGenerationErrorOr> Generator::compile(VM& vm, ASTNode const& node, FunctionKind enclosing_function_kind, GCPtr function, MustPropagateCompletion must_propagate_completion, Vector local_variable_names) +CodeGenerationErrorOr> Generator::compile(VM& vm, ASTNode const& node, FunctionKind enclosing_function_kind, GC::Ptr function, MustPropagateCompletion must_propagate_completion, Vector local_variable_names) { Generator generator(vm, function, must_propagate_completion); @@ -460,7 +460,7 @@ CodeGenerationErrorOr> Generator::compile(VM& vm, ASTNo return executable; } -CodeGenerationErrorOr> Generator::generate_from_ast_node(VM& vm, ASTNode const& node, FunctionKind enclosing_function_kind) +CodeGenerationErrorOr> Generator::generate_from_ast_node(VM& vm, ASTNode const& node, FunctionKind enclosing_function_kind) { Vector local_variable_names; if (is(node)) @@ -468,7 +468,7 @@ CodeGenerationErrorOr> Generator::generate_from_ast_nod return compile(vm, node, enclosing_function_kind, {}, MustPropagateCompletion::Yes, move(local_variable_names)); } -CodeGenerationErrorOr> Generator::generate_from_function(VM& vm, ECMAScriptFunctionObject const& function) +CodeGenerationErrorOr> Generator::generate_from_function(VM& vm, ECMAScriptFunctionObject const& function) { return compile(vm, function.ecmascript_code(), function.kind(), &function, MustPropagateCompletion::No, function.local_variables_names()); } diff --git a/Libraries/LibJS/Bytecode/Generator.h b/Libraries/LibJS/Bytecode/Generator.h index c934a42d364..bb496898914 100644 --- a/Libraries/LibJS/Bytecode/Generator.h +++ b/Libraries/LibJS/Bytecode/Generator.h @@ -38,8 +38,8 @@ public: Yes, }; - static CodeGenerationErrorOr> generate_from_ast_node(VM&, ASTNode const&, FunctionKind = FunctionKind::Normal); - static CodeGenerationErrorOr> generate_from_function(VM&, ECMAScriptFunctionObject const& function); + static CodeGenerationErrorOr> generate_from_ast_node(VM&, ASTNode const&, FunctionKind = FunctionKind::Normal); + static CodeGenerationErrorOr> generate_from_function(VM&, ECMAScriptFunctionObject const& function); CodeGenerationErrorOr emit_function_declaration_instantiation(ECMAScriptFunctionObject const& function); @@ -343,7 +343,7 @@ public: private: VM& m_vm; - static CodeGenerationErrorOr> compile(VM&, ASTNode const&, FunctionKind, GCPtr, MustPropagateCompletion, Vector local_variable_names); + static CodeGenerationErrorOr> compile(VM&, ASTNode const&, FunctionKind, GC::Ptr, MustPropagateCompletion, Vector local_variable_names); enum class JumpType { Continue, @@ -352,7 +352,7 @@ private: void generate_scoped_jump(JumpType); void generate_labelled_jump(JumpType, DeprecatedFlyString const& label); - Generator(VM&, GCPtr, MustPropagateCompletion); + Generator(VM&, GC::Ptr, MustPropagateCompletion); ~Generator() = default; void grow(size_t); @@ -373,7 +373,7 @@ private: NonnullOwnPtr m_string_table; NonnullOwnPtr m_identifier_table; NonnullOwnPtr m_regex_table; - MarkedVector m_constants; + GC::MarkedVector m_constants; mutable Optional m_true_constant; mutable Optional m_false_constant; @@ -401,7 +401,7 @@ private: bool m_finished { false }; bool m_must_propagate_completion { true }; - GCPtr m_function; + GC::Ptr m_function; Optional m_length_identifier; }; diff --git a/Libraries/LibJS/Bytecode/Instruction.h b/Libraries/LibJS/Bytecode/Instruction.h index 26a55d75247..2a557064d1f 100644 --- a/Libraries/LibJS/Bytecode/Instruction.h +++ b/Libraries/LibJS/Bytecode/Instruction.h @@ -213,7 +213,7 @@ private: u8 const* m_begin { nullptr }; u8 const* m_end { nullptr }; u8 const* m_ptr { nullptr }; - GCPtr m_executable; + GC::Ptr m_executable; }; } diff --git a/Libraries/LibJS/Bytecode/Interpreter.cpp b/Libraries/LibJS/Bytecode/Interpreter.cpp index ff3d2304f5e..b93a73dd387 100644 --- a/Libraries/LibJS/Bytecode/Interpreter.cpp +++ b/Libraries/LibJS/Bytecode/Interpreter.cpp @@ -182,7 +182,7 @@ ALWAYS_INLINE Value Interpreter::do_yield(Value value, Optional