diff options
65 files changed, 296 insertions, 272 deletions
diff --git a/Libraries/LibGUI/TextEditor.cpp b/Libraries/LibGUI/TextEditor.cpp index f0f61c5f3a..f67d04cf72 100644 --- a/Libraries/LibGUI/TextEditor.cpp +++ b/Libraries/LibGUI/TextEditor.cpp @@ -72,7 +72,6 @@ TextEditor::TextEditor(Type type) }); m_automatic_selection_scroll_timer->stop(); create_actions(); - } TextEditor::~TextEditor() diff --git a/Libraries/LibJS/Forward.h b/Libraries/LibJS/Forward.h index ad26ba6b08..178dafc6a2 100644 --- a/Libraries/LibJS/Forward.h +++ b/Libraries/LibJS/Forward.h @@ -58,38 +58,38 @@ __JS_ENUMERATE(StringObject, string, StringPrototype, StringConstructor) \ __JS_ENUMERATE(SymbolObject, symbol, SymbolPrototype, SymbolConstructor) -#define JS_ENUMERATE_ERROR_SUBCLASSES \ - __JS_ENUMERATE(EvalError, eval_error, EvalErrorPrototype, EvalErrorConstructor) \ - __JS_ENUMERATE(InternalError, internal_error, InternalErrorPrototype, InternalErrorConstructor) \ - __JS_ENUMERATE(InvalidCharacterError, invalid_character_error, InvalidCharacterErrorPrototype, InvalidCharacterErrorConstructor) \ - __JS_ENUMERATE(RangeError, range_error, RangeErrorPrototype, RangeErrorConstructor) \ - __JS_ENUMERATE(ReferenceError, reference_error, ReferenceErrorPrototype, ReferenceErrorConstructor) \ - __JS_ENUMERATE(SyntaxError, syntax_error, SyntaxErrorPrototype, SyntaxErrorConstructor) \ - __JS_ENUMERATE(TypeError, type_error, TypeErrorPrototype, TypeErrorConstructor) \ +#define JS_ENUMERATE_ERROR_SUBCLASSES \ + __JS_ENUMERATE(EvalError, eval_error, EvalErrorPrototype, EvalErrorConstructor) \ + __JS_ENUMERATE(InternalError, internal_error, InternalErrorPrototype, InternalErrorConstructor) \ + __JS_ENUMERATE(InvalidCharacterError, invalid_character_error, InvalidCharacterErrorPrototype, InvalidCharacterErrorConstructor) \ + __JS_ENUMERATE(RangeError, range_error, RangeErrorPrototype, RangeErrorConstructor) \ + __JS_ENUMERATE(ReferenceError, reference_error, ReferenceErrorPrototype, ReferenceErrorConstructor) \ + __JS_ENUMERATE(SyntaxError, syntax_error, SyntaxErrorPrototype, SyntaxErrorConstructor) \ + __JS_ENUMERATE(TypeError, type_error, TypeErrorPrototype, TypeErrorConstructor) \ __JS_ENUMERATE(URIError, uri_error, URIErrorPrototype, URIErrorConstructor) -#define JS_ENUMERATE_ITERATOR_PROTOTYPES \ - __JS_ENUMERATE(Iterator, iterator) \ - __JS_ENUMERATE(ArrayIterator, array_iterator) \ +#define JS_ENUMERATE_ITERATOR_PROTOTYPES \ + __JS_ENUMERATE(Iterator, iterator) \ + __JS_ENUMERATE(ArrayIterator, array_iterator) \ __JS_ENUMERATE(StringIterator, string_iterator) #define JS_ENUMERATE_BUILTIN_TYPES \ JS_ENUMERATE_NATIVE_OBJECTS \ JS_ENUMERATE_ERROR_SUBCLASSES -#define JS_ENUMERATE_WELL_KNOWN_SYMBOLS \ - __JS_ENUMERATE(iterator, iterator) \ - __JS_ENUMERATE(asyncIterator, async_iterator) \ - __JS_ENUMERATE(match, match) \ - __JS_ENUMERATE(matchAll, match_all) \ - __JS_ENUMERATE(replace, replace) \ - __JS_ENUMERATE(search, search) \ - __JS_ENUMERATE(split, split) \ - __JS_ENUMERATE(hasInstance, has_instance) \ - __JS_ENUMERATE(isConcatSpreadable, is_concat_spreadable) \ - __JS_ENUMERATE(unscopables, unscopables) \ - __JS_ENUMERATE(species, species) \ - __JS_ENUMERATE(toPrimitive, to_primitive) \ +#define JS_ENUMERATE_WELL_KNOWN_SYMBOLS \ + __JS_ENUMERATE(iterator, iterator) \ + __JS_ENUMERATE(asyncIterator, async_iterator) \ + __JS_ENUMERATE(match, match) \ + __JS_ENUMERATE(matchAll, match_all) \ + __JS_ENUMERATE(replace, replace) \ + __JS_ENUMERATE(search, search) \ + __JS_ENUMERATE(split, split) \ + __JS_ENUMERATE(hasInstance, has_instance) \ + __JS_ENUMERATE(isConcatSpreadable, is_concat_spreadable) \ + __JS_ENUMERATE(unscopables, unscopables) \ + __JS_ENUMERATE(species, species) \ + __JS_ENUMERATE(toPrimitive, to_primitive) \ __JS_ENUMERATE(toStringTag, to_string_tag) namespace JS { diff --git a/Libraries/LibJS/Heap/Handle.h b/Libraries/LibJS/Heap/Handle.h index a4400fcd16..e2686395fc 100644 --- a/Libraries/LibJS/Heap/Handle.h +++ b/Libraries/LibJS/Heap/Handle.h @@ -55,7 +55,7 @@ private: template<class T> class Handle { public: - Handle() {} + Handle() { } static Handle create(T* cell) { diff --git a/Libraries/LibJS/Runtime/ArrayIterator.cpp b/Libraries/LibJS/Runtime/ArrayIterator.cpp index 926495ef44..6257ac1235 100644 --- a/Libraries/LibJS/Runtime/ArrayIterator.cpp +++ b/Libraries/LibJS/Runtime/ArrayIterator.cpp @@ -45,7 +45,7 @@ ArrayIterator::~ArrayIterator() { } -void ArrayIterator::visit_children(Cell::Visitor & visitor) +void ArrayIterator::visit_children(Cell::Visitor& visitor) { Base::visit_children(visitor); visitor.visit(m_array); diff --git a/Libraries/LibJS/Runtime/DateConstructor.cpp b/Libraries/LibJS/Runtime/DateConstructor.cpp index 1f614ef626..c17e84c47e 100644 --- a/Libraries/LibJS/Runtime/DateConstructor.cpp +++ b/Libraries/LibJS/Runtime/DateConstructor.cpp @@ -37,7 +37,8 @@ namespace JS { -static Value parse_simplified_iso8601(const String& iso_8601) { +static Value parse_simplified_iso8601(const String& iso_8601) +{ // Date.parse() is allowed to accept many formats. We strictly only accept things matching // http://www.ecma-international.org/ecma-262/#sec-date-time-string-format GenericLexer lexer(iso_8601); diff --git a/Libraries/LibJS/Runtime/DatePrototype.h b/Libraries/LibJS/Runtime/DatePrototype.h index d43404c467..5c8c8bebd4 100644 --- a/Libraries/LibJS/Runtime/DatePrototype.h +++ b/Libraries/LibJS/Runtime/DatePrototype.h @@ -32,6 +32,7 @@ namespace JS { class DatePrototype final : public Object { JS_OBJECT(DatePrototype, Object); + public: explicit DatePrototype(GlobalObject&); virtual void initialize(GlobalObject&) override; diff --git a/Libraries/LibJS/Runtime/Error.cpp b/Libraries/LibJS/Runtime/Error.cpp index 200f0055e1..1a6123aee5 100644 --- a/Libraries/LibJS/Runtime/Error.cpp +++ b/Libraries/LibJS/Runtime/Error.cpp @@ -56,7 +56,7 @@ Error::~Error() : Error(#ClassName, message, prototype) \ { \ } \ - ClassName::~ClassName() { } \ + ClassName::~ClassName() { } JS_ENUMERATE_ERROR_SUBCLASSES #undef __JS_ENUMERATE diff --git a/Libraries/LibJS/Runtime/ErrorConstructor.cpp b/Libraries/LibJS/Runtime/ErrorConstructor.cpp index 01fe8ccc34..f87b201dfe 100644 --- a/Libraries/LibJS/Runtime/ErrorConstructor.cpp +++ b/Libraries/LibJS/Runtime/ErrorConstructor.cpp @@ -68,16 +68,16 @@ Value ErrorConstructor::construct(Interpreter& interpreter, Function&) : NativeFunction(*global_object.function_prototype()) \ { \ } \ - void ConstructorName::initialize(GlobalObject& global_object) \ + void ConstructorName::initialize(GlobalObject& global_object) \ { \ - NativeFunction::initialize(global_object); \ + NativeFunction::initialize(global_object); \ define_property("prototype", global_object.snake_name##_prototype(), 0); \ define_property("length", Value(1), Attribute::Configurable); \ } \ ConstructorName::~ConstructorName() { } \ Value ConstructorName::call(Interpreter& interpreter) \ { \ - return construct(interpreter, *this); \ + return construct(interpreter, *this); \ } \ Value ConstructorName::construct(Interpreter& interpreter, Function&) \ { \ diff --git a/Libraries/LibJS/Runtime/ErrorConstructor.h b/Libraries/LibJS/Runtime/ErrorConstructor.h index 4991b6b60c..f413025704 100644 --- a/Libraries/LibJS/Runtime/ErrorConstructor.h +++ b/Libraries/LibJS/Runtime/ErrorConstructor.h @@ -52,7 +52,7 @@ private: \ public: \ explicit ConstructorName(GlobalObject&); \ - virtual void initialize(GlobalObject&) override; \ + virtual void initialize(GlobalObject&) override; \ virtual ~ConstructorName() override; \ virtual Value call(Interpreter&) override; \ virtual Value construct(Interpreter&, Function& new_target) override; \ diff --git a/Libraries/LibJS/Runtime/ErrorPrototype.cpp b/Libraries/LibJS/Runtime/ErrorPrototype.cpp index 5f70f0d36d..867dee8774 100644 --- a/Libraries/LibJS/Runtime/ErrorPrototype.cpp +++ b/Libraries/LibJS/Runtime/ErrorPrototype.cpp @@ -132,7 +132,7 @@ JS_DEFINE_NATIVE_FUNCTION(ErrorPrototype::to_string) : Object(*global_object.error_prototype()) \ { \ } \ - PrototypeName::~PrototypeName() {} + PrototypeName::~PrototypeName() { } JS_ENUMERATE_ERROR_SUBCLASSES #undef __JS_ENUMERATE diff --git a/Libraries/LibJS/Runtime/ErrorPrototype.h b/Libraries/LibJS/Runtime/ErrorPrototype.h index 1686e6572b..0e3423b26d 100644 --- a/Libraries/LibJS/Runtime/ErrorPrototype.h +++ b/Libraries/LibJS/Runtime/ErrorPrototype.h @@ -53,7 +53,7 @@ private: \ public: \ explicit PrototypeName(GlobalObject&); \ - virtual void initialize(GlobalObject&) override { } \ + virtual void initialize(GlobalObject&) override { } \ virtual ~PrototypeName() override; \ }; diff --git a/Libraries/LibJS/Runtime/ErrorTypes.cpp b/Libraries/LibJS/Runtime/ErrorTypes.cpp index ac73e7b05e..f71172b68a 100644 --- a/Libraries/LibJS/Runtime/ErrorTypes.cpp +++ b/Libraries/LibJS/Runtime/ErrorTypes.cpp @@ -29,8 +29,8 @@ namespace JS { #define __ENUMERATE_JS_ERROR(name, message) \ -const ErrorType ErrorType::name = ErrorType(message); - JS_ENUMERATE_ERROR_TYPES(__ENUMERATE_JS_ERROR) + const ErrorType ErrorType::name = ErrorType(message); +JS_ENUMERATE_ERROR_TYPES(__ENUMERATE_JS_ERROR) #undef __ENUMERATE_JS_ERROR } diff --git a/Libraries/LibJS/Runtime/ErrorTypes.h b/Libraries/LibJS/Runtime/ErrorTypes.h index 9851a5f091..493ffc216c 100644 --- a/Libraries/LibJS/Runtime/ErrorTypes.h +++ b/Libraries/LibJS/Runtime/ErrorTypes.h @@ -26,138 +26,137 @@ #pragma once -#define JS_ENUMERATE_ERROR_TYPES(M) \ - M(ArrayInvalidLength, "Invalid array length") \ - M(ArrayMaxSize, "Maximum array size exceeded") \ - M(ArrayPrototypeOneArg, "Array.prototype.%s() requires at least one argument") \ - M(AccessorBadField, "Accessor descriptor's '%s' field must be a function or undefined") \ - M(AccessorValueOrWritable, "Accessor property descriptor cannot specify a value or writable key") \ - M(BigIntBadOperator, "Cannot use %s operator with BigInt") \ - M(BigIntBadOperatorOtherType, "Cannot use %s operator with BigInt and other type") \ - M(BigIntIntArgument, "BigInt argument must be an integer") \ - M(BigIntInvalidValue, "Invalid value for BigInt: %s") \ - M(ClassDoesNotExtendAConstructorOrNull, "Class extends value %s is not a constructor or null") \ - M(Convert, "Cannot convert %s to %s") \ - M(ConvertUndefinedToObject, "Cannot convert undefined to object") \ - M(DescChangeNonConfigurable, "Cannot change attributes of non-configurable property '%s'") \ - M(FunctionArgsNotObject, "Argument array must be an object") \ - M(InOperatorWithObject, "'in' operator must be used on an object") \ - M(InstanceOfOperatorBadPrototype, "'prototype' property of %s is not an object") \ - M(InvalidAssignToConst, "Invalid assignment to const variable") \ - M(InvalidLeftHandAssignment, "Invalid left-hand side in assignment") \ - M(InvalidRadix, "Radix must be an integer no less than 2, and no greater than 36") \ - M(IsNotA, "%s is not a %s") \ - M(IsNotAEvaluatedFrom, "%s is not a %s (evaluated from '%s')") \ - M(IterableNextBadReturn, "iterator.next() returned a non-object value") \ - M(IterableNextNotAFunction, "'next' property on returned object from Symbol.iterator method is " \ - "not a function") \ - M(JsonBigInt, "Cannot serialize BigInt value to JSON") \ - M(JsonCircular, "Cannot stringify circular object") \ - M(JsonMalformed, "Malformed JSON string") \ - M(NotA, "Not a %s object") \ - M(NotAConstructor, "%s is not a constructor") \ - M(NotAFunction, "%s is not a function") \ - M(NotAFunctionNoParam, "Not a function") \ - M(NotAn, "Not an %s object") \ - M(NotAnObject, "%s is not an object") \ - M(NotASymbol, "%s is not a symbol") \ - M(NotIterable, "%s is not iterable") \ - M(NonExtensibleDefine, "Cannot define property %s on non-extensible object") \ - M(NumberIncompatibleThis, "Number.prototype.%s method called with incompatible this target") \ - M(ObjectDefinePropertyReturnedFalse, "Object's [[DefineProperty]] method returned false") \ - M(ObjectSetPrototypeOfReturnedFalse, "Object's [[SetPrototypeOf]] method returned false") \ - M(ObjectSetPrototypeOfTwoArgs, "Object.setPrototypeOf requires at least two arguments") \ - M(ObjectPreventExtensionsReturnedFalse, "Object's [[PreventExtensions]] method returned false") \ - M(ObjectPrototypeNullOrUndefinedOnSuperPropertyAccess, \ - "Object prototype must not be %s on a super property access") \ - M(ObjectPrototypeWrongType, "Prototype must be an object or null") \ - M(ProxyCallWithNew, "Proxy must be called with the 'new' operator") \ - M(ProxyConstructBadReturnType, "Proxy handler's construct trap violates invariant: must return " \ - "an object") \ - M(ProxyConstructorBadType, "Expected %s argument of Proxy constructor to be object, got %s") \ - M(ProxyDefinePropExistingConfigurable, "Proxy handler's defineProperty trap violates " \ - "invariant: a property cannot be defined as non-configurable if it already exists on the " \ - "target object as a configurable property") \ - M(ProxyDefinePropIncompatibleDescriptor, "Proxy handler's defineProperty trap violates " \ - "invariant: the new descriptor is not compatible with the existing descriptor of the " \ - "property on the target") \ - M(ProxyDefinePropNonConfigurableNonExisting, "Proxy handler's defineProperty trap " \ - "violates invariant: a property cannot be defined as non-configurable if it does not " \ - "already exist on the target object") \ - M(ProxyDefinePropNonExtensible, "Proxy handler's defineProperty trap violates invariant: " \ - "a property cannot be reported as being defined if the property does not exist on " \ - "the target and the target is non-extensible") \ - M(ProxyDeleteNonConfigurable, "Proxy handler's deleteProperty trap violates invariant: " \ - "cannot report a non-configurable own property of the target as deleted") \ - M(ProxyGetImmutableDataProperty, "Proxy handler's get trap violates invariant: the " \ - "returned value must match the value on the target if the property exists on the " \ - "target as a non-writable, non-configurable own data property") \ - M(ProxyGetNonConfigurableAccessor, "Proxy handler's get trap violates invariant: the " \ - "returned value must be undefined if the property exists on the target as a " \ - "non-configurable accessor property with an undefined get attribute") \ - M(ProxyGetOwnDescriptorExistingConfigurable, "Proxy handler's getOwnPropertyDescriptor " \ - "trap violates invariant: a property cannot be defined as non-configurable if it " \ - "already exists on the target object as a configurable property") \ - M(ProxyGetOwnDescriptorInvalidDescriptor, "Proxy handler's getOwnPropertyDescriptor trap " \ - "violates invariant: invalid property descriptor for existing property on the target") \ - M(ProxyGetOwnDescriptorInvalidNonConfig, "Proxy handler's getOwnPropertyDescriptor trap " \ - "violates invariant: cannot report target's property as non-configurable if the " \ - "property does not exist, or if it is configurable") \ - M(ProxyGetOwnDescriptorNonConfigurable, "Proxy handler's getOwnPropertyDescriptor trap " \ - "violates invariant: cannot return undefined for a property on the target which is " \ - "a non-configurable property") \ - M(ProxyGetOwnDescriptorReturn, "Proxy handler's getOwnPropertyDescriptor trap violates " \ - "invariant: must return an object or undefined") \ - M(ProxyGetOwnDescriptorUndefReturn, "Proxy handler's getOwnPropertyDescriptor trap " \ - "violates invariant: cannot report a property as being undefined if it exists as an " \ - "own property of the target and the target is non-extensible") \ - M(ProxyGetPrototypeOfNonExtensible, "Proxy handler's getPrototypeOf trap violates " \ - "invariant: cannot return a different prototype object for a non-extensible target") \ - M(ProxyGetPrototypeOfReturn, "Proxy handler's getPrototypeOf trap violates invariant: " \ - "must return an object or null") \ - M(ProxyHasExistingNonConfigurable, "Proxy handler's has trap violates invariant: a " \ - "property cannot be reported as non-existent if it exists on the target as a " \ - "non-configurable property") \ - M(ProxyHasExistingNonExtensible, "Proxy handler's has trap violates invariant: a property " \ - "cannot be reported as non-existent if it exists on the target and the target is " \ - "non-extensible") \ - M(ProxyInvalidTrap, "Proxy handler's %s trap wasn't undefined, null, or callable") \ - M(ProxyIsExtensibleReturn, "Proxy handler's isExtensible trap violates invariant: " \ - "return value must match the target's extensibility") \ - M(ProxyPreventExtensionsReturn, "Proxy handler's preventExtensions trap violates " \ - "invariant: cannot return true if the target object is extensible") \ - M(ProxyRevoked, "An operation was performed on a revoked Proxy object") \ - M(ProxySetImmutableDataProperty, "Proxy handler's set trap violates invariant: cannot " \ - "return true for a property on the target which is a non-configurable, non-writable " \ - "own data property") \ - M(ProxySetNonConfigurableAccessor, "Proxy handler's set trap violates invariant: cannot " \ - "return true for a property on the target which is a non-configurable own accessor " \ - "property with an undefined set attribute") \ - M(ProxySetPrototypeOfNonExtensible, "Proxy handler's setPrototypeOf trap violates " \ - "invariant: the argument must match the prototype of the target if the " \ - "target is non-extensible") \ - M(ProxyTwoArguments, "Proxy constructor requires at least two arguments") \ - M(ReduceNoInitial, "Reduce of empty array with no initial value") \ - M(ReferencePrimitiveAssignment, "Cannot assign property %s to primitive value") \ - M(ReferenceUnresolvable, "Unresolvable reference") \ - M(ReflectArgumentMustBeAFunction, "First argument of Reflect.%s() must be a function") \ - M(ReflectArgumentMustBeAnObject, "First argument of Reflect.%s() must be an object") \ - M(ReflectBadArgumentsList, "Arguments list must be an object") \ - M(ReflectBadNewTarget, "Optional third argument of Reflect.construct() must be a constructor") \ - M(ReflectBadDescriptorArgument, "Descriptor argument is not an object") \ - M(StringRawCannotConvert, "Cannot convert property 'raw' to object from %s") \ - M(StringRepeatCountMustBe, "repeat count must be a %s number") \ - M(ThisHasNotBeenInitialized, "|this| has not been initialized") \ - M(ThisIsAlreadyInitialized, "|this| is already initialized") \ - M(ToObjectNullOrUndef, "ToObject on null or undefined") \ - M(UnknownIdentifier, "'%s' is not defined") \ - /* LibWeb bindings */ \ - M(NotAByteString, "Argument to %s() must be a byte string") \ - M(BadArgCountOne, "%s() needs one argument") \ - M(BadArgCountAtLeastOne, "%s() needs at least one argument") \ +#define JS_ENUMERATE_ERROR_TYPES(M) \ + M(ArrayInvalidLength, "Invalid array length") \ + M(ArrayMaxSize, "Maximum array size exceeded") \ + M(ArrayPrototypeOneArg, "Array.prototype.%s() requires at least one argument") \ + M(AccessorBadField, "Accessor descriptor's '%s' field must be a function or undefined") \ + M(AccessorValueOrWritable, "Accessor property descriptor cannot specify a value or writable key") \ + M(BigIntBadOperator, "Cannot use %s operator with BigInt") \ + M(BigIntBadOperatorOtherType, "Cannot use %s operator with BigInt and other type") \ + M(BigIntIntArgument, "BigInt argument must be an integer") \ + M(BigIntInvalidValue, "Invalid value for BigInt: %s") \ + M(ClassDoesNotExtendAConstructorOrNull, "Class extends value %s is not a constructor or null") \ + M(Convert, "Cannot convert %s to %s") \ + M(ConvertUndefinedToObject, "Cannot convert undefined to object") \ + M(DescChangeNonConfigurable, "Cannot change attributes of non-configurable property '%s'") \ + M(FunctionArgsNotObject, "Argument array must be an object") \ + M(InOperatorWithObject, "'in' operator must be used on an object") \ + M(InstanceOfOperatorBadPrototype, "'prototype' property of %s is not an object") \ + M(InvalidAssignToConst, "Invalid assignment to const variable") \ + M(InvalidLeftHandAssignment, "Invalid left-hand side in assignment") \ + M(InvalidRadix, "Radix must be an integer no less than 2, and no greater than 36") \ + M(IsNotA, "%s is not a %s") \ + M(IsNotAEvaluatedFrom, "%s is not a %s (evaluated from '%s')") \ + M(IterableNextBadReturn, "iterator.next() returned a non-object value") \ + M(IterableNextNotAFunction, "'next' property on returned object from Symbol.iterator method is " \ + "not a function") \ + M(JsonBigInt, "Cannot serialize BigInt value to JSON") \ + M(JsonCircular, "Cannot stringify circular object") \ + M(JsonMalformed, "Malformed JSON string") \ + M(NotA, "Not a %s object") \ + M(NotAConstructor, "%s is not a constructor") \ + M(NotAFunction, "%s is not a function") \ + M(NotAFunctionNoParam, "Not a function") \ + M(NotAn, "Not an %s object") \ + M(NotAnObject, "%s is not an object") \ + M(NotASymbol, "%s is not a symbol") \ + M(NotIterable, "%s is not iterable") \ + M(NonExtensibleDefine, "Cannot define property %s on non-extensible object") \ + M(NumberIncompatibleThis, "Number.prototype.%s method called with incompatible this target") \ + M(ObjectDefinePropertyReturnedFalse, "Object's [[DefineProperty]] method returned false") \ + M(ObjectSetPrototypeOfReturnedFalse, "Object's [[SetPrototypeOf]] method returned false") \ + M(ObjectSetPrototypeOfTwoArgs, "Object.setPrototypeOf requires at least two arguments") \ + M(ObjectPreventExtensionsReturnedFalse, "Object's [[PreventExtensions]] method returned false") \ + M(ObjectPrototypeNullOrUndefinedOnSuperPropertyAccess, \ + "Object prototype must not be %s on a super property access") \ + M(ObjectPrototypeWrongType, "Prototype must be an object or null") \ + M(ProxyCallWithNew, "Proxy must be called with the 'new' operator") \ + M(ProxyConstructBadReturnType, "Proxy handler's construct trap violates invariant: must return " \ + "an object") \ + M(ProxyConstructorBadType, "Expected %s argument of Proxy constructor to be object, got %s") \ + M(ProxyDefinePropExistingConfigurable, "Proxy handler's defineProperty trap violates " \ + "invariant: a property cannot be defined as non-configurable if it already exists on the " \ + "target object as a configurable property") \ + M(ProxyDefinePropIncompatibleDescriptor, "Proxy handler's defineProperty trap violates " \ + "invariant: the new descriptor is not compatible with the existing descriptor of the " \ + "property on the target") \ + M(ProxyDefinePropNonConfigurableNonExisting, "Proxy handler's defineProperty trap " \ + "violates invariant: a property cannot be defined as non-configurable if it does not " \ + "already exist on the target object") \ + M(ProxyDefinePropNonExtensible, "Proxy handler's defineProperty trap violates invariant: " \ + "a property cannot be reported as being defined if the property does not exist on " \ + "the target and the target is non-extensible") \ + M(ProxyDeleteNonConfigurable, "Proxy handler's deleteProperty trap violates invariant: " \ + "cannot report a non-configurable own property of the target as deleted") \ + M(ProxyGetImmutableDataProperty, "Proxy handler's get trap violates invariant: the " \ + "returned value must match the value on the target if the property exists on the " \ + "target as a non-writable, non-configurable own data property") \ + M(ProxyGetNonConfigurableAccessor, "Proxy handler's get trap violates invariant: the " \ + "returned value must be undefined if the property exists on the target as a " \ + "non-configurable accessor property with an undefined get attribute") \ + M(ProxyGetOwnDescriptorExistingConfigurable, "Proxy handler's getOwnPropertyDescriptor " \ + "trap violates invariant: a property cannot be defined as non-configurable if it " \ + "already exists on the target object as a configurable property") \ + M(ProxyGetOwnDescriptorInvalidDescriptor, "Proxy handler's getOwnPropertyDescriptor trap " \ + "violates invariant: invalid property descriptor for existing property on the target") \ + M(ProxyGetOwnDescriptorInvalidNonConfig, "Proxy handler's getOwnPropertyDescriptor trap " \ + "violates invariant: cannot report target's property as non-configurable if the " \ + "property does not exist, or if it is configurable") \ + M(ProxyGetOwnDescriptorNonConfigurable, "Proxy handler's getOwnPropertyDescriptor trap " \ + "violates invariant: cannot return undefined for a property on the target which is " \ + "a non-configurable property") \ + M(ProxyGetOwnDescriptorReturn, "Proxy handler's getOwnPropertyDescriptor trap violates " \ + "invariant: must return an object or undefined") \ + M(ProxyGetOwnDescriptorUndefReturn, "Proxy handler's getOwnPropertyDescriptor trap " \ + "violates invariant: cannot report a property as being undefined if it exists as an " \ + "own property of the target and the target is non-extensible") \ + M(ProxyGetPrototypeOfNonExtensible, "Proxy handler's getPrototypeOf trap violates " \ + "invariant: cannot return a different prototype object for a non-extensible target") \ + M(ProxyGetPrototypeOfReturn, "Proxy handler's getPrototypeOf trap violates invariant: " \ + "must return an object or null") \ + M(ProxyHasExistingNonConfigurable, "Proxy handler's has trap violates invariant: a " \ + "property cannot be reported as non-existent if it exists on the target as a " \ + "non-configurable property") \ + M(ProxyHasExistingNonExtensible, "Proxy handler's has trap violates invariant: a property " \ + "cannot be reported as non-existent if it exists on the target and the target is " \ + "non-extensible") \ + M(ProxyInvalidTrap, "Proxy handler's %s trap wasn't undefined, null, or callable") \ + M(ProxyIsExtensibleReturn, "Proxy handler's isExtensible trap violates invariant: " \ + "return value must match the target's extensibility") \ + M(ProxyPreventExtensionsReturn, "Proxy handler's preventExtensions trap violates " \ + "invariant: cannot return true if the target object is extensible") \ + M(ProxyRevoked, "An operation was performed on a revoked Proxy object") \ + M(ProxySetImmutableDataProperty, "Proxy handler's set trap violates invariant: cannot " \ + "return true for a property on the target which is a non-configurable, non-writable " \ + "own data property") \ + M(ProxySetNonConfigurableAccessor, "Proxy handler's set trap violates invariant: cannot " \ + "return true for a property on the target which is a non-configurable own accessor " \ + "property with an undefined set attribute") \ + M(ProxySetPrototypeOfNonExtensible, "Proxy handler's setPrototypeOf trap violates " \ + "invariant: the argument must match the prototype of the target if the " \ + "target is non-extensible") \ + M(ProxyTwoArguments, "Proxy constructor requires at least two arguments") \ + M(ReduceNoInitial, "Reduce of empty array with no initial value") \ + M(ReferencePrimitiveAssignment, "Cannot assign property %s to primitive value") \ + M(ReferenceUnresolvable, "Unresolvable reference") \ + M(ReflectArgumentMustBeAFunction, "First argument of Reflect.%s() must be a function") \ + M(ReflectArgumentMustBeAnObject, "First argument of Reflect.%s() must be an object") \ + M(ReflectBadArgumentsList, "Arguments list must be an object") \ + M(ReflectBadNewTarget, "Optional third argument of Reflect.construct() must be a constructor") \ + M(ReflectBadDescriptorArgument, "Descriptor argument is not an object") \ + M(StringRawCannotConvert, "Cannot convert property 'raw' to object from %s") \ + M(StringRepeatCountMustBe, "repeat count must be a %s number") \ + M(ThisHasNotBeenInitialized, "|this| has not been initialized") \ + M(ThisIsAlreadyInitialized, "|this| is already initialized") \ + M(ToObjectNullOrUndef, "ToObject on null or undefined") \ + M(UnknownIdentifier, "'%s' is not defined") \ + /* LibWeb bindings */ \ + M(NotAByteString, "Argument to %s() must be a byte string") \ + M(BadArgCountOne, "%s() needs one argument") \ + M(BadArgCountAtLeastOne, "%s() needs at least one argument") \ M(BadArgCountMany, "%s() needs %s arguments") - namespace JS { class ErrorType { @@ -167,7 +166,10 @@ public: JS_ENUMERATE_ERROR_TYPES(__ENUMERATE_JS_ERROR) #undef __ENUMERATE_JS_ERROR - const char* message() const { return m_message; }; + const char* message() const + { + return m_message; + } private: explicit ErrorType(const char* message) @@ -179,4 +181,3 @@ private: }; } - diff --git a/Libraries/LibJS/Runtime/GlobalObject.h b/Libraries/LibJS/Runtime/GlobalObject.h index 7b39ef9b9a..ac989a2f6f 100644 --- a/Libraries/LibJS/Runtime/GlobalObject.h +++ b/Libraries/LibJS/Runtime/GlobalObject.h @@ -78,7 +78,6 @@ private: Object* m_##snake_name##_prototype { nullptr }; JS_ENUMERATE_ITERATOR_PROTOTYPES #undef __JS_ENUMERATE - }; template<typename ConstructorType> diff --git a/Libraries/LibJS/Runtime/NumberPrototype.cpp b/Libraries/LibJS/Runtime/NumberPrototype.cpp index 0f7b0c8e3b..5f2d92e8df 100644 --- a/Libraries/LibJS/Runtime/NumberPrototype.cpp +++ b/Libraries/LibJS/Runtime/NumberPrototype.cpp @@ -33,10 +33,12 @@ namespace JS { static const u8 max_precision_for_radix[37] = { + // clang-format off 0, 0, 52, 32, 26, 22, 20, 18, 17, 16, 15, 15, 14, 14, 13, 13, 13, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + // clang-format on }; static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; diff --git a/Libraries/LibJS/Runtime/ObjectPrototype.cpp b/Libraries/LibJS/Runtime/ObjectPrototype.cpp index 1d94f69a91..7885561c61 100644 --- a/Libraries/LibJS/Runtime/ObjectPrototype.cpp +++ b/Libraries/LibJS/Runtime/ObjectPrototype.cpp @@ -81,7 +81,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectPrototype::to_string) String tag; auto to_string_tag = this_object->get(global_object.vm().well_known_symbol_to_string_tag()); - + if (to_string_tag.is_string()) { tag = to_string_tag.as_string().string(); } else if (this_object->is_array()) { diff --git a/Libraries/LibJS/Runtime/PropertyAttributes.h b/Libraries/LibJS/Runtime/PropertyAttributes.h index d99f074eac..d2fbe50ad7 100644 --- a/Libraries/LibJS/Runtime/PropertyAttributes.h +++ b/Libraries/LibJS/Runtime/PropertyAttributes.h @@ -26,8 +26,8 @@ #pragma once -#include <AK/Types.h> #include <AK/LogStream.h> +#include <AK/Types.h> namespace JS { diff --git a/Libraries/LibJS/Runtime/RegExpObject.cpp b/Libraries/LibJS/Runtime/RegExpObject.cpp index c9bd9da6b1..34637e398b 100644 --- a/Libraries/LibJS/Runtime/RegExpObject.cpp +++ b/Libraries/LibJS/Runtime/RegExpObject.cpp @@ -32,7 +32,6 @@ #include <LibJS/Runtime/RegExpObject.h> #include <LibJS/Runtime/Value.h> - namespace JS { RegExpObject* RegExpObject::create(GlobalObject& global_object, String content, String flags) diff --git a/Libraries/LibJS/Runtime/StringIterator.cpp b/Libraries/LibJS/Runtime/StringIterator.cpp index 44df424217..4c0b9a3355 100644 --- a/Libraries/LibJS/Runtime/StringIterator.cpp +++ b/Libraries/LibJS/Runtime/StringIterator.cpp @@ -25,8 +25,8 @@ */ #include <AK/Utf8View.h> -#include <LibJS/Runtime/StringIterator.h> #include <LibJS/Runtime/GlobalObject.h> +#include <LibJS/Runtime/StringIterator.h> namespace JS { diff --git a/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp b/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp index 7d3dd45755..05f10c88df 100644 --- a/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp +++ b/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp @@ -25,11 +25,11 @@ */ #include <AK/StringBuilder.h> -#include <LibJS/Runtime/StringIterator.h> -#include <LibJS/Runtime/StringIteratorPrototype.h> #include <LibJS/Runtime/Error.h> #include <LibJS/Runtime/GlobalObject.h> #include <LibJS/Runtime/IteratorOperations.h> +#include <LibJS/Runtime/StringIterator.h> +#include <LibJS/Runtime/StringIteratorPrototype.h> namespace JS { diff --git a/Libraries/LibJS/Runtime/StringPrototype.cpp b/Libraries/LibJS/Runtime/StringPrototype.cpp index 6944ec9a61..10a2e2ff71 100644 --- a/Libraries/LibJS/Runtime/StringPrototype.cpp +++ b/Libraries/LibJS/Runtime/StringPrototype.cpp @@ -32,8 +32,8 @@ #include <LibJS/Runtime/Error.h> #include <LibJS/Runtime/GlobalObject.h> #include <LibJS/Runtime/PrimitiveString.h> -#include <LibJS/Runtime/StringObject.h> #include <LibJS/Runtime/StringIterator.h> +#include <LibJS/Runtime/StringObject.h> #include <LibJS/Runtime/StringPrototype.h> #include <LibJS/Runtime/Value.h> #include <string.h> diff --git a/Libraries/LibJS/Runtime/SymbolObject.cpp b/Libraries/LibJS/Runtime/SymbolObject.cpp index f04f1fdee6..1a58d75eac 100644 --- a/Libraries/LibJS/Runtime/SymbolObject.cpp +++ b/Libraries/LibJS/Runtime/SymbolObject.cpp @@ -34,7 +34,6 @@ namespace JS { - SymbolObject* SymbolObject::create(GlobalObject& global_object, Symbol& primitive_symbol) { return global_object.heap().allocate<SymbolObject>(global_object, primitive_symbol, *global_object.symbol_prototype()); diff --git a/Libraries/LibM/TestMath.cpp b/Libraries/LibM/TestMath.cpp index e512163b93..1a5ce4e87a 100644 --- a/Libraries/LibM/TestMath.cpp +++ b/Libraries/LibM/TestMath.cpp @@ -25,10 +25,13 @@ */ #include <AK/TestSuite.h> - + #include <math.h> -#define EXPECT_CLOSE(a, b) { EXPECT(fabs(a - b) < 0.000001); } +#define EXPECT_CLOSE(a, b) \ + { \ + EXPECT(fabs(a - b) < 0.000001); \ + } TEST_CASE(trig) { @@ -77,14 +80,14 @@ TEST_CASE(exponents) }; values values[8] { - { 1.500000, 4.481626, 2.129246, 2.352379, 0.905148}, - { 20.990000, 1304956710.432035, 652478355.216017, 652478355.216017, 1.000000}, - { 20.010000, 490041186.687082, 245020593.343541, 245020593.343541, 1.000000}, - { 0.000000, 1.000000, 0.000000, 1.000000, 0.000000}, - { 0.010000, 1.010050, 0.010000, 1.000050, 0.010000}, - { -0.010000, 0.990050, -0.010000, 1.000050, -0.010000}, - { -1.000000, 0.367879, -1.175201, 1.543081, -0.761594}, - { -17.000000, 0.000000, -12077476.376788, 12077476.376788, -1.000000}, + { 1.500000, 4.481626, 2.129246, 2.352379, 0.905148 }, + { 20.990000, 1304956710.432035, 652478355.216017, 652478355.216017, 1.000000 }, + { 20.010000, 490041186.687082, 245020593.343541, 245020593.343541, 1.000000 }, + { 0.000000, 1.000000, 0.000000, 1.000000, 0.000000 }, + { 0.010000, 1.010050, 0.010000, 1.000050, 0.010000 }, + { -0.010000, 0.990050, -0.010000, 1.000050, -0.010000 }, + { -1.000000, 0.367879, -1.175201, 1.543081, -0.761594 }, + { -17.000000, 0.000000, -12077476.376788, 12077476.376788, -1.000000 }, }; for (auto& v : values) { EXPECT_CLOSE(exp(v.x), v.exp); diff --git a/Libraries/LibM/math.h b/Libraries/LibM/math.h index 0efe69e9cd..6486b842d7 100644 --- a/Libraries/LibM/math.h +++ b/Libraries/LibM/math.h @@ -29,9 +29,9 @@ #include <sys/cdefs.h> #if __cplusplus >= 201103L -#define NOEXCEPT noexcept +# define NOEXCEPT noexcept #else -#define NOEXCEPT +# define NOEXCEPT #endif __BEGIN_DECLS diff --git a/Libraries/LibMarkdown/Block.h b/Libraries/LibMarkdown/Block.h index 4a8416ad43..b1d96146c4 100644 --- a/Libraries/LibMarkdown/Block.h +++ b/Libraries/LibMarkdown/Block.h @@ -33,7 +33,7 @@ namespace Markdown { class Block { public: - virtual ~Block() {} + virtual ~Block() { } virtual String render_to_html() const = 0; virtual String render_for_terminal() const = 0; diff --git a/Libraries/LibMarkdown/List.h b/Libraries/LibMarkdown/List.h index e4fc98f54b..50ac609ef6 100644 --- a/Libraries/LibMarkdown/List.h +++ b/Libraries/LibMarkdown/List.h @@ -40,7 +40,7 @@ public: , m_is_ordered(is_ordered) { } - virtual ~List() override {} + virtual ~List() override { } virtual String render_to_html() const override; virtual String render_for_terminal() const override; diff --git a/Libraries/LibMarkdown/Paragraph.h b/Libraries/LibMarkdown/Paragraph.h index e66b5c18c9..39c86624cb 100644 --- a/Libraries/LibMarkdown/Paragraph.h +++ b/Libraries/LibMarkdown/Paragraph.h @@ -34,8 +34,11 @@ namespace Markdown { class Paragraph final : public Block { public: - explicit Paragraph(Text&& text) : m_text(move(text)) {} - virtual ~Paragraph() override {} + explicit Paragraph(Text&& text) + : m_text(move(text)) + { + } + virtual ~Paragraph() override { } virtual String render_to_html() const override; virtual String render_for_terminal() const override; diff --git a/Libraries/LibMarkdown/Text.h b/Libraries/LibMarkdown/Text.h index 74dd59ee26..00542c4e3b 100644 --- a/Libraries/LibMarkdown/Text.h +++ b/Libraries/LibMarkdown/Text.h @@ -34,6 +34,7 @@ namespace Markdown { class Text final { AK_MAKE_NONCOPYABLE(Text); + public: struct Style { bool emph { false }; diff --git a/Libraries/LibPthread/pthread.cpp b/Libraries/LibPthread/pthread.cpp index 218c175039..4c69f7b6aa 100644 --- a/Libraries/LibPthread/pthread.cpp +++ b/Libraries/LibPthread/pthread.cpp @@ -83,8 +83,7 @@ static int create_thread(void* (*entry)(void*), void* argument, PthreadAttrImpl* return syscall(SC_create_thread, pthread_create_helper, thread_params); } -[[noreturn]] -static void exit_thread(void* code) +[[noreturn]] static void exit_thread(void* code) { syscall(SC_exit_thread, code); ASSERT_NOT_REACHED(); diff --git a/Libraries/LibPthread/pthread.h b/Libraries/LibPthread/pthread.h index 1f71b911b8..c282f83073 100644 --- a/Libraries/LibPthread/pthread.h +++ b/Libraries/LibPthread/pthread.h @@ -35,7 +35,7 @@ __BEGIN_DECLS int pthread_create(pthread_t*, pthread_attr_t*, void* (*)(void*), void*); -void pthread_exit(void*) __attribute__ ((noreturn)); +void pthread_exit(void*) __attribute__((noreturn)); int pthread_kill(pthread_t, int); void pthread_cleanup_push(void (*)(void*), void*); void pthread_cleanup_pop(int); @@ -78,8 +78,14 @@ int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param #define PTHREAD_MUTEX_NORMAL 0 #define PTHREAD_MUTEX_RECURSIVE 1 #define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL -#define PTHREAD_MUTEX_INITIALIZER { 0, 0, 0, PTHREAD_MUTEX_DEFAULT } -#define PTHREAD_COND_INITIALIZER { 0, 0, CLOCK_MONOTONIC } +#define PTHREAD_MUTEX_INITIALIZER \ + { \ + 0, 0, 0, PTHREAD_MUTEX_DEFAULT \ + } +#define PTHREAD_COND_INITIALIZER \ + { \ + 0, 0, CLOCK_MONOTONIC \ + } int pthread_key_create(pthread_key_t* key, void (*destructor)(void*)); int pthread_key_delete(pthread_key_t key); diff --git a/Libraries/LibThread/BackgroundAction.cpp b/Libraries/LibThread/BackgroundAction.cpp index f2545d0a5d..a2880dfb3f 100644 --- a/Libraries/LibThread/BackgroundAction.cpp +++ b/Libraries/LibThread/BackgroundAction.cpp @@ -24,10 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <AK/Queue.h> #include <LibThread/BackgroundAction.h> -#include <LibThread/Thread.h> #include <LibThread/Lock.h> -#include <AK/Queue.h> +#include <LibThread/Thread.h> static LibThread::Lockable<Queue<Function<void()>>>* s_all_actions; static LibThread::Thread* s_background_thread; diff --git a/Libraries/LibThread/BackgroundAction.h b/Libraries/LibThread/BackgroundAction.h index b7b5b0810c..76de180cd7 100644 --- a/Libraries/LibThread/BackgroundAction.h +++ b/Libraries/LibThread/BackgroundAction.h @@ -46,7 +46,7 @@ class BackgroundActionBase { friend class BackgroundAction; private: - BackgroundActionBase() {} + BackgroundActionBase() { } static Lockable<Queue<Function<void()>>>& all_actions(); static Thread& background_thread(); @@ -65,7 +65,7 @@ public: return adopt(*new BackgroundAction(move(action), move(on_complete))); } - virtual ~BackgroundAction() {} + virtual ~BackgroundAction() { } private: BackgroundAction(Function<Result()> action, Function<void(Result)> on_complete) diff --git a/Libraries/LibThread/Thread.cpp b/Libraries/LibThread/Thread.cpp index 7828627d30..58db14bbed 100644 --- a/Libraries/LibThread/Thread.cpp +++ b/Libraries/LibThread/Thread.cpp @@ -51,7 +51,7 @@ void LibThread::Thread::start() [](void* arg) -> void* { Thread* self = static_cast<Thread*>(arg); size_t exit_code = self->m_action(); - self->m_tid = 0; + self->m_tid = 0; return (void*)exit_code; }, static_cast<void*>(this)); @@ -64,7 +64,7 @@ void LibThread::Thread::start() dbg() << "Started a thread, tid = " << m_tid; } -void LibThread::Thread::quit(void *code) +void LibThread::Thread::quit(void* code) { ASSERT(m_tid == pthread_self()); diff --git a/Libraries/LibThread/Thread.h b/Libraries/LibThread/Thread.h index 56a8bc5eb0..cac79380e7 100644 --- a/Libraries/LibThread/Thread.h +++ b/Libraries/LibThread/Thread.h @@ -41,7 +41,7 @@ public: virtual ~Thread(); void start(); - void quit(void *code = 0); + void quit(void* code = 0); private: Function<int()> m_action; diff --git a/Libraries/LibVT/Position.h b/Libraries/LibVT/Position.h index 8982797479..d042ac68e3 100644 --- a/Libraries/LibVT/Position.h +++ b/Libraries/LibVT/Position.h @@ -30,7 +30,7 @@ namespace VT { class Position { public: - Position() {} + Position() { } Position(int row, int column) : m_row(row) , m_column(column) diff --git a/Libraries/LibVT/Terminal.h b/Libraries/LibVT/Terminal.h index fb1cea884c..615ec78be9 100644 --- a/Libraries/LibVT/Terminal.h +++ b/Libraries/LibVT/Terminal.h @@ -38,7 +38,7 @@ namespace VT { class TerminalClient { public: - virtual ~TerminalClient() {} + virtual ~TerminalClient() { } virtual void beep() = 0; virtual void set_window_title(const StringView&) = 0; diff --git a/Libraries/LibWeb/Bindings/NodeWrapperFactory.cpp b/Libraries/LibWeb/Bindings/NodeWrapperFactory.cpp index adebbc6515..38d4ad9265 100644 --- a/Libraries/LibWeb/Bindings/NodeWrapperFactory.cpp +++ b/Libraries/LibWeb/Bindings/NodeWrapperFactory.cpp @@ -27,9 +27,9 @@ #include <LibWeb/Bindings/CharacterDataWrapper.h> #include <LibWeb/Bindings/CommentWrapper.h> -#include <LibWeb/Bindings/DocumentWrapper.h> #include <LibWeb/Bindings/DocumentFragmentWrapper.h> #include <LibWeb/Bindings/DocumentTypeWrapper.h> +#include <LibWeb/Bindings/DocumentWrapper.h> #include <LibWeb/Bindings/HTMLAnchorElementWrapper.h> #include <LibWeb/Bindings/HTMLAreaElementWrapper.h> #include <LibWeb/Bindings/HTMLAudioElementWrapper.h> diff --git a/Libraries/LibWeb/CSS/StyleValue.cpp b/Libraries/LibWeb/CSS/StyleValue.cpp index 952bb8b68e..164670ab39 100644 --- a/Libraries/LibWeb/CSS/StyleValue.cpp +++ b/Libraries/LibWeb/CSS/StyleValue.cpp @@ -29,10 +29,10 @@ #include <LibGfx/Palette.h> #include <LibWeb/CSS/StyleValue.h> #include <LibWeb/DOM/Document.h> +#include <LibWeb/InProcessWebView.h> #include <LibWeb/Loader/LoadRequest.h> #include <LibWeb/Loader/ResourceLoader.h> #include <LibWeb/Page/Frame.h> -#include <LibWeb/InProcessWebView.h> namespace Web::CSS { diff --git a/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp b/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp index 4d0365b109..fa5e73d09d 100644 --- a/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp +++ b/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp @@ -593,7 +593,7 @@ void generate_implementation(const IDL::Interface& interface) out() << " return JS::Value(retval);"; } else if (return_type.name == "Uint8ClampedArray") { out() << " return retval;"; - } else if (return_type.name == "boolean") { + } else if (return_type.name == "boolean") { out() << " return JS::Value(retval);"; } else { out() << " return wrap(global_object, const_cast<" << return_type.name << "&>(*retval));"; diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index d4ebfed6de..97aa172646 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -51,11 +51,11 @@ #include <LibWeb/HTML/HTMLHtmlElement.h> #include <LibWeb/HTML/HTMLScriptElement.h> #include <LibWeb/HTML/HTMLTitleElement.h> +#include <LibWeb/InProcessWebView.h> #include <LibWeb/Layout/LayoutDocument.h> #include <LibWeb/Layout/LayoutTreeBuilder.h> #include <LibWeb/Origin.h> #include <LibWeb/Page/Frame.h> -#include <LibWeb/InProcessWebView.h> #include <LibWeb/SVG/TagNames.h> #include <stdio.h> diff --git a/Libraries/LibWeb/DOM/DocumentFragment.h b/Libraries/LibWeb/DOM/DocumentFragment.h index b067b7e429..cc55f2c168 100644 --- a/Libraries/LibWeb/DOM/DocumentFragment.h +++ b/Libraries/LibWeb/DOM/DocumentFragment.h @@ -27,9 +27,9 @@ #pragma once #include <AK/FlyString.h> +#include <LibWeb/DOM/Element.h> #include <LibWeb/DOM/NonElementParentNode.h> #include <LibWeb/DOM/ParentNode.h> -#include <LibWeb/DOM/Element.h> namespace Web::DOM { diff --git a/Libraries/LibWeb/DOM/ElementFactory.cpp b/Libraries/LibWeb/DOM/ElementFactory.cpp index a8081cf88d..12d0cfe696 100644 --- a/Libraries/LibWeb/DOM/ElementFactory.cpp +++ b/Libraries/LibWeb/DOM/ElementFactory.cpp @@ -29,18 +29,18 @@ #include <LibWeb/HTML/HTMLAnchorElement.h> #include <LibWeb/HTML/HTMLAreaElement.h> #include <LibWeb/HTML/HTMLAudioElement.h> +#include <LibWeb/HTML/HTMLBRElement.h> #include <LibWeb/HTML/HTMLBaseElement.h> #include <LibWeb/HTML/HTMLBlinkElement.h> #include <LibWeb/HTML/HTMLBodyElement.h> -#include <LibWeb/HTML/HTMLBRElement.h> #include <LibWeb/HTML/HTMLButtonElement.h> #include <LibWeb/HTML/HTMLCanvasElement.h> +#include <LibWeb/HTML/HTMLDListElement.h> #include <LibWeb/HTML/HTMLDataElement.h> #include <LibWeb/HTML/HTMLDataListElement.h> #include <LibWeb/HTML/HTMLDetailsElement.h> #include <LibWeb/HTML/HTMLDialogElement.h> #include <LibWeb/HTML/HTMLDivElement.h> -#include <LibWeb/HTML/HTMLDListElement.h> #include <LibWeb/HTML/HTMLEmbedElement.h> #include <LibWeb/HTML/HTMLFieldSetElement.h> #include <LibWeb/HTML/HTMLFontElement.h> @@ -54,9 +54,9 @@ #include <LibWeb/HTML/HTMLIFrameElement.h> #include <LibWeb/HTML/HTMLImageElement.h> #include <LibWeb/HTML/HTMLInputElement.h> +#include <LibWeb/HTML/HTMLLIElement.h> #include <LibWeb/HTML/HTMLLabelElement.h> #include <LibWeb/HTML/HTMLLegendElement.h> -#include <LibWeb/HTML/HTMLLIElement.h> #include <LibWeb/HTML/HTMLLinkElement.h> #include <LibWeb/HTML/HTMLMapElement.h> #include <LibWeb/HTML/HTMLMarqueeElement.h> @@ -64,8 +64,8 @@ #include <LibWeb/HTML/HTMLMetaElement.h> #include <LibWeb/HTML/HTMLMeterElement.h> #include <LibWeb/HTML/HTMLModElement.h> -#include <LibWeb/HTML/HTMLObjectElement.h> #include <LibWeb/HTML/HTMLOListElement.h> +#include <LibWeb/HTML/HTMLObjectElement.h> #include <LibWeb/HTML/HTMLOptGroupElement.h> #include <LibWeb/HTML/HTMLOptionElement.h> #include <LibWeb/HTML/HTMLOutputElement.h> @@ -87,11 +87,11 @@ #include <LibWeb/HTML/HTMLTableElement.h> #include <LibWeb/HTML/HTMLTableRowElement.h> #include <LibWeb/HTML/HTMLTableSectionElement.h> -#include <LibWeb/HTML/HTMLTextAreaElement.h> #include <LibWeb/HTML/HTMLTemplateElement.h> +#include <LibWeb/HTML/HTMLTextAreaElement.h> #include <LibWeb/HTML/HTMLTimeElement.h> -#include <LibWeb/HTML/HTMLTrackElement.h> #include <LibWeb/HTML/HTMLTitleElement.h> +#include <LibWeb/HTML/HTMLTrackElement.h> #include <LibWeb/HTML/HTMLUListElement.h> #include <LibWeb/HTML/HTMLUnknownElement.h> #include <LibWeb/HTML/HTMLVideoElement.h> @@ -242,10 +242,9 @@ NonnullRefPtr<Element> create_element(Document& document, const FlyString& tag_n if (lowercase_tag_name == HTML::TagNames::video) return adopt(*new HTML::HTMLVideoElement(document, lowercase_tag_name)); if (lowercase_tag_name.is_one_of( - HTML::TagNames::article, HTML::TagNames::section, HTML::TagNames::nav, HTML::TagNames::aside, HTML::TagNames::hgroup, HTML::TagNames::header, HTML::TagNames::footer, HTML::TagNames::address, HTML::TagNames::dt, HTML::TagNames::dd, HTML::TagNames::figure, HTML::TagNames::figcaption, HTML::TagNames::main, HTML::TagNames::em, HTML::TagNames::strong, HTML::TagNames::small, HTML::TagNames::s, HTML::TagNames::cite, HTML::TagNames::dfn, HTML::TagNames::abbr, HTML::TagNames::ruby, HTML::TagNames::rt, HTML::TagNames::rp, HTML::TagNames::code, HTML::TagNames::var, HTML::TagNames::samp, HTML::TagNames::kbd, HTML::TagNames::sub, HTML::TagNames::sup, HTML::TagNames::i, HTML::TagNames::b, HTML::TagNames::u, HTML::TagNames::mark, HTML::TagNames::bdi, HTML::TagNames::bdo, HTML::TagNames::wbr, HTML::TagNames::summary, HTML::TagNames::noscript, - // Obsolete - HTML::TagNames::acronym, HTML::TagNames::basefont, HTML::TagNames::big, HTML::TagNames::center, HTML::TagNames::nobr, HTML::TagNames::noembed, HTML::TagNames::noframes, HTML::TagNames::plaintext, HTML::TagNames::rb, HTML::TagNames::rtc, HTML::TagNames::strike, HTML::TagNames::tt) - ) + HTML::TagNames::article, HTML::TagNames::section, HTML::TagNames::nav, HTML::TagNames::aside, HTML::TagNames::hgroup, HTML::TagNames::header, HTML::TagNames::footer, HTML::TagNames::address, HTML::TagNames::dt, HTML::TagNames::dd, HTML::TagNames::figure, HTML::TagNames::figcaption, HTML::TagNames::main, HTML::TagNames::em, HTML::TagNames::strong, HTML::TagNames::small, HTML::TagNames::s, HTML::TagNames::cite, HTML::TagNames::dfn, HTML::TagNames::abbr, HTML::TagNames::ruby, HTML::TagNames::rt, HTML::TagNames::rp, HTML::TagNames::code, HTML::TagNames::var, HTML::TagNames::samp, HTML::TagNames::kbd, HTML::TagNames::sub, HTML::TagNames::sup, HTML::TagNames::i, HTML::TagNames::b, HTML::TagNames::u, HTML::TagNames::mark, HTML::TagNames::bdi, HTML::TagNames::bdo, HTML::TagNames::wbr, HTML::TagNames::summary, HTML::TagNames::noscript, + // Obsolete + HTML::TagNames::acronym, HTML::TagNames::basefont, HTML::TagNames::big, HTML::TagNames::center, HTML::TagNames::nobr, HTML::TagNames::noembed, HTML::TagNames::noframes, HTML::TagNames::plaintext, HTML::TagNames::rb, HTML::TagNames::rtc, HTML::TagNames::strike, HTML::TagNames::tt)) return adopt(*new HTML::HTMLElement(document, lowercase_tag_name)); if (lowercase_tag_name == SVG::TagNames::svg) return adopt(*new SVG::SVGSVGElement(document, lowercase_tag_name)); diff --git a/Libraries/LibWeb/DOM/ParentNode.h b/Libraries/LibWeb/DOM/ParentNode.h index 23f0999795..f7648063f2 100644 --- a/Libraries/LibWeb/DOM/ParentNode.h +++ b/Libraries/LibWeb/DOM/ParentNode.h @@ -32,8 +32,10 @@ namespace Web::DOM { class ParentNode : public Node { public: - template<typename F> void for_each_child(F) const; - template<typename F> void for_each_child(F); + template<typename F> + void for_each_child(F) const; + template<typename F> + void for_each_child(F); RefPtr<Element> query_selector(const StringView&); NonnullRefPtrVector<Element> query_selector_all(const StringView&); diff --git a/Libraries/LibWeb/DOM/TagNames.cpp b/Libraries/LibWeb/DOM/TagNames.cpp index 7415a0fa33..13ecc52147 100644 --- a/Libraries/LibWeb/DOM/TagNames.cpp +++ b/Libraries/LibWeb/DOM/TagNames.cpp @@ -34,7 +34,10 @@ namespace TagNames { ENUMERATE_HTML_TAGS #undef __ENUMERATE_HTML_TAG + // clang-format off +// FIXME: clang-format gets confused here. Why? [[gnu::constructor]] static void initialize() +// clang-format off { static bool s_initialized = false; if (s_initialized) diff --git a/Libraries/LibWeb/HTML/AttributeNames.cpp b/Libraries/LibWeb/HTML/AttributeNames.cpp index 8fcdd7d944..575b92e789 100644 --- a/Libraries/LibWeb/HTML/AttributeNames.cpp +++ b/Libraries/LibWeb/HTML/AttributeNames.cpp @@ -34,7 +34,10 @@ namespace AttributeNames { ENUMERATE_HTML_ATTRIBUTES #undef __ENUMERATE_HTML_ATTRIBUTE + // clang-format off +// FIXME: clang-format gets confused here. Why? [[gnu::constructor]] static void initialize() +// clang-format off { static bool s_initialized = false; if (s_initialized) diff --git a/Libraries/LibWeb/HTML/HTMLFieldSetElement.h b/Libraries/LibWeb/HTML/HTMLFieldSetElement.h index e5ac667d5c..6224c604e1 100644 --- a/Libraries/LibWeb/HTML/HTMLFieldSetElement.h +++ b/Libraries/LibWeb/HTML/HTMLFieldSetElement.h @@ -37,7 +37,8 @@ public: HTMLFieldSetElement(DOM::Document&, const FlyString& local_name); virtual ~HTMLFieldSetElement() override; - const String& type() const { + const String& type() const + { static String fieldset = "fieldset"; return fieldset; } diff --git a/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Libraries/LibWeb/HTML/HTMLFormElement.cpp index 22ebc7a546..566c82022c 100644 --- a/Libraries/LibWeb/HTML/HTMLFormElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLFormElement.cpp @@ -27,8 +27,8 @@ #include <AK/StringBuilder.h> #include <LibWeb/HTML/HTMLFormElement.h> #include <LibWeb/HTML/HTMLInputElement.h> -#include <LibWeb/Page/Frame.h> #include <LibWeb/InProcessWebView.h> +#include <LibWeb/Page/Frame.h> #include <LibWeb/URLEncoder.h> namespace Web::HTML { diff --git a/Libraries/LibWeb/HTML/HTMLOutputElement.h b/Libraries/LibWeb/HTML/HTMLOutputElement.h index 139d1f028b..792711ba57 100644 --- a/Libraries/LibWeb/HTML/HTMLOutputElement.h +++ b/Libraries/LibWeb/HTML/HTMLOutputElement.h @@ -37,7 +37,8 @@ public: HTMLOutputElement(DOM::Document&, const FlyString& local_name); virtual ~HTMLOutputElement() override; - const String& type() const { + const String& type() const + { static String output = "output"; return output; } diff --git a/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Libraries/LibWeb/HTML/HTMLScriptElement.cpp index 4dc71914dc..21d5ff1124 100644 --- a/Libraries/LibWeb/HTML/HTMLScriptElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLScriptElement.cpp @@ -28,8 +28,8 @@ #include <LibJS/Interpreter.h> #include <LibJS/Parser.h> #include <LibWeb/DOM/Document.h> -#include <LibWeb/HTML/HTMLScriptElement.h> #include <LibWeb/DOM/Text.h> +#include <LibWeb/HTML/HTMLScriptElement.h> #include <LibWeb/Loader/ResourceLoader.h> namespace Web::HTML { diff --git a/Libraries/LibWeb/HTML/HTMLTextAreaElement.h b/Libraries/LibWeb/HTML/HTMLTextAreaElement.h index d1c4629570..7dddf76a1b 100644 --- a/Libraries/LibWeb/HTML/HTMLTextAreaElement.h +++ b/Libraries/LibWeb/HTML/HTMLTextAreaElement.h @@ -37,7 +37,8 @@ public: HTMLTextAreaElement(DOM::Document&, const FlyString& local_name); virtual ~HTMLTextAreaElement() override; - const String& type() const { + const String& type() const + { static String textarea = "textarea"; return textarea; } diff --git a/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp b/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp index ddab59c5c1..a05e198037 100644 --- a/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp +++ b/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp @@ -87,24 +87,24 @@ namespace Web::HTML { } while (0) #define EMIT_CHARACTER_AND_RECONSUME_IN(code_point, new_state) \ - do { \ + do { \ m_queued_tokens.enqueue(HTMLToken::make_character(code_point)); \ - will_reconsume_in(State::new_state); \ - m_state = State::new_state; \ - goto new_state; \ + will_reconsume_in(State::new_state); \ + m_state = State::new_state; \ + goto new_state; \ } while (0) -#define FLUSH_CODEPOINTS_CONSUMED_AS_A_CHARACTER_REFERENCE \ - do { \ - for (auto code_point : m_temporary_buffer) { \ - if (consumed_as_part_of_an_attribute()) { \ +#define FLUSH_CODEPOINTS_CONSUMED_AS_A_CHARACTER_REFERENCE \ + do { \ + for (auto code_point : m_temporary_buffer) { \ + if (consumed_as_part_of_an_attribute()) { \ m_current_token.m_tag.attributes.last().value_builder.append_code_point(code_point); \ - } else { \ - create_new_token(HTMLToken::Type::Character); \ + } else { \ + create_new_token(HTMLToken::Type::Character); \ m_current_token.m_comment_or_character.data.append_code_point(code_point); \ - m_queued_tokens.enqueue(m_current_token); \ - } \ - } \ + m_queued_tokens.enqueue(m_current_token); \ + } \ + } \ } while (0) #define DONT_CONSUME_NEXT_INPUT_CHARACTER \ @@ -159,21 +159,21 @@ namespace Web::HTML { return m_queued_tokens.dequeue(); \ } while (0) -#define EMIT_CHARACTER(code_point) \ - do { \ - create_new_token(HTMLToken::Type::Character); \ +#define EMIT_CHARACTER(code_point) \ + do { \ + create_new_token(HTMLToken::Type::Character); \ m_current_token.m_comment_or_character.data.append_code_point(code_point); \ - m_queued_tokens.enqueue(m_current_token); \ - return m_queued_tokens.dequeue(); \ + m_queued_tokens.enqueue(m_current_token); \ + return m_queued_tokens.dequeue(); \ } while (0) #define EMIT_CURRENT_CHARACTER \ EMIT_CHARACTER(current_input_character.value()); #define SWITCH_TO_AND_EMIT_CHARACTER(code_point, new_state) \ - do { \ - will_switch_to(State::new_state); \ - m_state = State::new_state; \ + do { \ + will_switch_to(State::new_state); \ + m_state = State::new_state; \ EMIT_CHARACTER(code_point); \ } while (0) diff --git a/Libraries/LibWeb/Layout/LayoutDocument.cpp b/Libraries/LibWeb/Layout/LayoutDocument.cpp index c93792b7f9..772ca83df9 100644 --- a/Libraries/LibWeb/Layout/LayoutDocument.cpp +++ b/Libraries/LibWeb/Layout/LayoutDocument.cpp @@ -146,7 +146,7 @@ void LayoutDocument::recompute_selection_states() }); } -void LayoutDocument::set_selection(const LayoutRange & selection) +void LayoutDocument::set_selection(const LayoutRange& selection) { m_selection = selection; recompute_selection_states(); diff --git a/Libraries/LibWeb/Layout/LayoutFrame.cpp b/Libraries/LibWeb/Layout/LayoutFrame.cpp index 7108065460..59dec1ea02 100644 --- a/Libraries/LibWeb/Layout/LayoutFrame.cpp +++ b/Libraries/LibWeb/Layout/LayoutFrame.cpp @@ -30,10 +30,10 @@ #include <LibGfx/Font.h> #include <LibGfx/StylePainter.h> #include <LibWeb/DOM/Document.h> +#include <LibWeb/InProcessWebView.h> #include <LibWeb/Layout/LayoutDocument.h> #include <LibWeb/Layout/LayoutFrame.h> #include <LibWeb/Page/Frame.h> -#include <LibWeb/InProcessWebView.h> //#define DEBUG_HIGHLIGHT_FOCUSED_FRAME diff --git a/Libraries/LibWeb/Layout/LayoutFrame.h b/Libraries/LibWeb/Layout/LayoutFrame.h index 9fdad0f680..09a1e0e332 100644 --- a/Libraries/LibWeb/Layout/LayoutFrame.h +++ b/Libraries/LibWeb/Layout/LayoutFrame.h @@ -26,8 +26,8 @@ #pragma once -#include <LibWeb/Layout/LayoutReplaced.h> #include <LibWeb/HTML/HTMLIFrameElement.h> +#include <LibWeb/Layout/LayoutReplaced.h> namespace Web { diff --git a/Libraries/LibWeb/Layout/LayoutPosition.h b/Libraries/LibWeb/Layout/LayoutPosition.h index 7eaf47ec78..fc5fb86e5d 100644 --- a/Libraries/LibWeb/Layout/LayoutPosition.h +++ b/Libraries/LibWeb/Layout/LayoutPosition.h @@ -39,7 +39,7 @@ struct LayoutPosition { class LayoutRange { public: - LayoutRange() {} + LayoutRange() { } LayoutRange(const LayoutPosition& start, const LayoutPosition& end) : m_start(start) , m_end(end) diff --git a/Libraries/LibWeb/Layout/LayoutWidget.cpp b/Libraries/LibWeb/Layout/LayoutWidget.cpp index b4a8d5def5..fe79e0aa67 100644 --- a/Libraries/LibWeb/Layout/LayoutWidget.cpp +++ b/Libraries/LibWeb/Layout/LayoutWidget.cpp @@ -30,9 +30,9 @@ #include <LibGfx/Font.h> #include <LibGfx/StylePainter.h> #include <LibWeb/DOM/Document.h> +#include <LibWeb/InProcessWebView.h> #include <LibWeb/Layout/LayoutWidget.h> #include <LibWeb/Page/Frame.h> -#include <LibWeb/InProcessWebView.h> namespace Web { diff --git a/Libraries/LibWeb/Layout/LineBox.cpp b/Libraries/LibWeb/Layout/LineBox.cpp index 5ecaa93d01..bf2840faf8 100644 --- a/Libraries/LibWeb/Layout/LineBox.cpp +++ b/Libraries/LibWeb/Layout/LineBox.cpp @@ -25,9 +25,9 @@ */ #include <AK/Utf8View.h> +#include <LibWeb/Layout/LayoutBox.h> #include <LibWeb/Layout/LayoutNode.h> #include <LibWeb/Layout/LayoutText.h> -#include <LibWeb/Layout/LayoutBox.h> #include <LibWeb/Layout/LineBox.h> #include <ctype.h> diff --git a/Libraries/LibWeb/Layout/LineBoxFragment.h b/Libraries/LibWeb/Layout/LineBoxFragment.h index c7ce9a1903..f2c71b4ff9 100644 --- a/Libraries/LibWeb/Layout/LineBoxFragment.h +++ b/Libraries/LibWeb/Layout/LineBoxFragment.h @@ -27,8 +27,8 @@ #pragma once #include <AK/Weakable.h> -#include <LibGfx/Rect.h> #include <LibGfx/Forward.h> +#include <LibGfx/Rect.h> #include <LibWeb/Forward.h> namespace Web { diff --git a/Libraries/LibWeb/Page/Page.cpp b/Libraries/LibWeb/Page/Page.cpp index e986dd45ba..36e56d50b2 100644 --- a/Libraries/LibWeb/Page/Page.cpp +++ b/Libraries/LibWeb/Page/Page.cpp @@ -24,9 +24,9 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <LibWeb/InProcessWebView.h> #include <LibWeb/Page/Frame.h> #include <LibWeb/Page/Page.h> -#include <LibWeb/InProcessWebView.h> namespace Web { diff --git a/Libraries/LibWeb/SVG/SVGPathElement.cpp b/Libraries/LibWeb/SVG/SVGPathElement.cpp index a1a5ab8385..0bcbc218a0 100644 --- a/Libraries/LibWeb/SVG/SVGPathElement.cpp +++ b/Libraries/LibWeb/SVG/SVGPathElement.cpp @@ -112,7 +112,8 @@ Vector<PathInstruction> PathDataParser::parse() return m_instructions; } -void PathDataParser::parse_drawto() { +void PathDataParser::parse_drawto() +{ if (match('M') || match('m')) { parse_moveto(); } else if (match('Z') || match('z')) { @@ -611,14 +612,13 @@ void SVGPathElement::paint(Gfx::Painter& painter, const SVGPaintingContext& cont auto dx_end_control = last_point.dx_relative_to(m_previous_control_point); auto dy_end_control = last_point.dy_relative_to(m_previous_control_point); - auto control_point = Gfx::FloatPoint {last_point.x() + dx_end_control, last_point.y() + dy_end_control}; + auto control_point = Gfx::FloatPoint { last_point.x() + dx_end_control, last_point.y() + dy_end_control }; - Gfx::FloatPoint end_point = {data[0], data[1]}; + Gfx::FloatPoint end_point = { data[0], data[1] }; if (absolute) { path.quadratic_bezier_curve_to(control_point, end_point); - } - else { + } else { path.quadratic_bezier_curve_to(control_point, end_point + last_point); } diff --git a/Libraries/LibWeb/SVG/SVGPathElement.h b/Libraries/LibWeb/SVG/SVGPathElement.h index c793cccc58..4091c8e53f 100644 --- a/Libraries/LibWeb/SVG/SVGPathElement.h +++ b/Libraries/LibWeb/SVG/SVGPathElement.h @@ -113,7 +113,6 @@ public: private: Vector<PathInstruction> m_instructions; Gfx::FloatPoint m_previous_control_point = {}; - }; } diff --git a/Libraries/LibWeb/SVG/SVGSVGElement.cpp b/Libraries/LibWeb/SVG/SVGSVGElement.cpp index 36898d4bc3..a7391b889e 100644 --- a/Libraries/LibWeb/SVG/SVGSVGElement.cpp +++ b/Libraries/LibWeb/SVG/SVGSVGElement.cpp @@ -28,9 +28,9 @@ #include <LibWeb/CSS/StyleResolver.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Event.h> +#include <LibWeb/Layout/LayoutSVG.h> #include <LibWeb/SVG/SVGPathElement.h> #include <LibWeb/SVG/SVGSVGElement.h> -#include <LibWeb/Layout/LayoutSVG.h> #include <ctype.h> namespace Web::SVG { diff --git a/Libraries/LibWeb/SVG/TagNames.cpp b/Libraries/LibWeb/SVG/TagNames.cpp index 56935e35ea..00577803ee 100644 --- a/Libraries/LibWeb/SVG/TagNames.cpp +++ b/Libraries/LibWeb/SVG/TagNames.cpp @@ -29,10 +29,13 @@ namespace Web::SVG::TagNames { #define __ENUMERATE_SVG_TAG(name) FlyString name; - ENUMERATE_SVG_TAGS +ENUMERATE_SVG_TAGS #undef __ENUMERATE_SVG_TAG + // clang-format off +// FIXME: clang-format gets confused here. Why? [[gnu::constructor]] static void initialize() +// clang-format off { static bool s_initialized = false; if (s_initialized) diff --git a/Libraries/LibWeb/SVG/TagNames.h b/Libraries/LibWeb/SVG/TagNames.h index 9ec972ccba..682d678a4e 100644 --- a/Libraries/LibWeb/SVG/TagNames.h +++ b/Libraries/LibWeb/SVG/TagNames.h @@ -30,11 +30,11 @@ namespace Web::SVG::TagNames { -#define ENUMERATE_SVG_GRAPHICS_TAGS \ - __ENUMERATE_SVG_TAG(svg) \ - __ENUMERATE_SVG_TAG(path) \ +#define ENUMERATE_SVG_GRAPHICS_TAGS \ + __ENUMERATE_SVG_TAG(svg) \ + __ENUMERATE_SVG_TAG(path) -#define ENUMERATE_SVG_TAGS \ +#define ENUMERATE_SVG_TAGS \ ENUMERATE_SVG_GRAPHICS_TAGS #define __ENUMERATE_SVG_TAG(name) extern FlyString name; diff --git a/Libraries/LibWeb/URLEncoder.h b/Libraries/LibWeb/URLEncoder.h index b12cf2e29d..ad8d3d14aa 100644 --- a/Libraries/LibWeb/URLEncoder.h +++ b/Libraries/LibWeb/URLEncoder.h @@ -39,4 +39,3 @@ struct URLQueryParam { String urlencode(const Vector<URLQueryParam>&); } - |