diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-21 16:23:08 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-21 16:23:08 +0200 |
commit | 685e006e27a24749896ed152800dc681149f16ca (patch) | |
tree | 59638845832d09943b319e4f11fb967a66b51b9f /Libraries | |
parent | 4065182811830391fc22fd443267de737c4d444e (diff) | |
download | serenity-685e006e27a24749896ed152800dc681149f16ca.zip |
LibWeb: Use "namespace Web::Foo {" since C++20 allows it :^)
Thanks @nico for teaching me about this!
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibWeb/Bindings/Wrappable.h | 4 | ||||
-rw-r--r-- | Libraries/LibWeb/Bindings/Wrapper.h | 4 | ||||
-rw-r--r-- | Libraries/LibWeb/Bindings/XMLHttpRequestConstructor.cpp | 4 | ||||
-rw-r--r-- | Libraries/LibWeb/Bindings/XMLHttpRequestConstructor.h | 4 | ||||
-rw-r--r-- | Libraries/LibWeb/Bindings/XMLHttpRequestPrototype.cpp | 4 | ||||
-rw-r--r-- | Libraries/LibWeb/Bindings/XMLHttpRequestPrototype.h | 4 | ||||
-rw-r--r-- | Libraries/LibWeb/Bindings/XMLHttpRequestWrapper.cpp | 4 | ||||
-rw-r--r-- | Libraries/LibWeb/Bindings/XMLHttpRequestWrapper.h | 4 | ||||
-rw-r--r-- | Libraries/LibWeb/CSS/StyleSheetList.cpp | 4 | ||||
-rw-r--r-- | Libraries/LibWeb/CSS/StyleSheetList.h | 4 | ||||
-rw-r--r-- | Libraries/LibWeb/CSS/StyleValue.h | 8 | ||||
-rw-r--r-- | Libraries/LibWeb/CodeGenerators/Generate_CSS_PropertyID_cpp.cpp | 4 | ||||
-rw-r--r-- | Libraries/LibWeb/CodeGenerators/Generate_CSS_PropertyID_h.cpp | 4 | ||||
-rw-r--r-- | Libraries/LibWeb/Forward.h | 6 | ||||
-rw-r--r-- | Libraries/LibWeb/Parser/CSSParser.h | 6 |
15 files changed, 22 insertions, 46 deletions
diff --git a/Libraries/LibWeb/Bindings/Wrappable.h b/Libraries/LibWeb/Bindings/Wrappable.h index f0b440145a..211fc4755a 100644 --- a/Libraries/LibWeb/Bindings/Wrappable.h +++ b/Libraries/LibWeb/Bindings/Wrappable.h @@ -31,8 +31,7 @@ #include <LibJS/Runtime/GlobalObject.h> #include <LibWeb/Forward.h> -namespace Web { -namespace Bindings { +namespace Web::Bindings { class Wrappable { public: @@ -56,4 +55,3 @@ inline Wrapper* wrap_impl(JS::GlobalObject& global_object, NativeObject& native_ } } -} diff --git a/Libraries/LibWeb/Bindings/Wrapper.h b/Libraries/LibWeb/Bindings/Wrapper.h index b24cadd02e..c83556605a 100644 --- a/Libraries/LibWeb/Bindings/Wrapper.h +++ b/Libraries/LibWeb/Bindings/Wrapper.h @@ -31,8 +31,7 @@ #include <LibJS/Runtime/Object.h> #include <LibWeb/Forward.h> -namespace Web { -namespace Bindings { +namespace Web::Bindings { class Wrapper : public JS::Object @@ -48,4 +47,3 @@ protected: }; } -} diff --git a/Libraries/LibWeb/Bindings/XMLHttpRequestConstructor.cpp b/Libraries/LibWeb/Bindings/XMLHttpRequestConstructor.cpp index e1bb113a74..6bae08e898 100644 --- a/Libraries/LibWeb/Bindings/XMLHttpRequestConstructor.cpp +++ b/Libraries/LibWeb/Bindings/XMLHttpRequestConstructor.cpp @@ -33,8 +33,7 @@ #include <LibWeb/Bindings/XMLHttpRequestWrapper.h> #include <LibWeb/DOM/XMLHttpRequest.h> -namespace Web { -namespace Bindings { +namespace Web::Bindings { XMLHttpRequestConstructor::XMLHttpRequestConstructor(JS::GlobalObject& global_object) : NativeFunction(*global_object.function_prototype()) @@ -69,4 +68,3 @@ JS::Value XMLHttpRequestConstructor::construct(JS::Interpreter& interpreter, Fun } } -} diff --git a/Libraries/LibWeb/Bindings/XMLHttpRequestConstructor.h b/Libraries/LibWeb/Bindings/XMLHttpRequestConstructor.h index 5c9b733e73..bff68c6728 100644 --- a/Libraries/LibWeb/Bindings/XMLHttpRequestConstructor.h +++ b/Libraries/LibWeb/Bindings/XMLHttpRequestConstructor.h @@ -28,8 +28,7 @@ #include <LibJS/Runtime/NativeFunction.h> -namespace Web { -namespace Bindings { +namespace Web::Bindings { class XMLHttpRequestConstructor final : public JS::NativeFunction { public: @@ -46,4 +45,3 @@ private: }; } -} diff --git a/Libraries/LibWeb/Bindings/XMLHttpRequestPrototype.cpp b/Libraries/LibWeb/Bindings/XMLHttpRequestPrototype.cpp index 32dee9d033..1469a9e9d6 100644 --- a/Libraries/LibWeb/Bindings/XMLHttpRequestPrototype.cpp +++ b/Libraries/LibWeb/Bindings/XMLHttpRequestPrototype.cpp @@ -32,8 +32,7 @@ #include <LibWeb/Bindings/XMLHttpRequestWrapper.h> #include <LibWeb/DOM/XMLHttpRequest.h> -namespace Web { -namespace Bindings { +namespace Web::Bindings { XMLHttpRequestPrototype::XMLHttpRequestPrototype(JS::GlobalObject& global_object) : Object(*global_object.object_prototype()) @@ -112,4 +111,3 @@ JS_DEFINE_NATIVE_GETTER(XMLHttpRequestPrototype::response_text_getter) } } -} diff --git a/Libraries/LibWeb/Bindings/XMLHttpRequestPrototype.h b/Libraries/LibWeb/Bindings/XMLHttpRequestPrototype.h index 8667825a50..a8742f1ca9 100644 --- a/Libraries/LibWeb/Bindings/XMLHttpRequestPrototype.h +++ b/Libraries/LibWeb/Bindings/XMLHttpRequestPrototype.h @@ -28,8 +28,7 @@ #include <LibJS/Runtime/Object.h> -namespace Web { -namespace Bindings { +namespace Web::Bindings { class XMLHttpRequestPrototype final : public JS::Object { JS_OBJECT(XMLHttpRequestPrototype, JS::Object); @@ -48,4 +47,3 @@ private: }; } -} diff --git a/Libraries/LibWeb/Bindings/XMLHttpRequestWrapper.cpp b/Libraries/LibWeb/Bindings/XMLHttpRequestWrapper.cpp index 98ae528e95..dedd97313a 100644 --- a/Libraries/LibWeb/Bindings/XMLHttpRequestWrapper.cpp +++ b/Libraries/LibWeb/Bindings/XMLHttpRequestWrapper.cpp @@ -32,8 +32,7 @@ #include <LibWeb/Bindings/XMLHttpRequestWrapper.h> #include <LibWeb/DOM/XMLHttpRequest.h> -namespace Web { -namespace Bindings { +namespace Web::Bindings { XMLHttpRequestWrapper* wrap(JS::GlobalObject& global_object, XMLHttpRequest& impl) { @@ -61,4 +60,3 @@ const XMLHttpRequest& XMLHttpRequestWrapper::impl() const } } -} diff --git a/Libraries/LibWeb/Bindings/XMLHttpRequestWrapper.h b/Libraries/LibWeb/Bindings/XMLHttpRequestWrapper.h index cf23e15fce..a961564b60 100644 --- a/Libraries/LibWeb/Bindings/XMLHttpRequestWrapper.h +++ b/Libraries/LibWeb/Bindings/XMLHttpRequestWrapper.h @@ -28,8 +28,7 @@ #include <LibWeb/Bindings/EventTargetWrapper.h> -namespace Web { -namespace Bindings { +namespace Web::Bindings { class XMLHttpRequestWrapper final : public EventTargetWrapper { public: @@ -46,4 +45,3 @@ private: XMLHttpRequestWrapper* wrap(JS::GlobalObject&, XMLHttpRequest&); } -} diff --git a/Libraries/LibWeb/CSS/StyleSheetList.cpp b/Libraries/LibWeb/CSS/StyleSheetList.cpp index bbda79757c..ec7bea2c23 100644 --- a/Libraries/LibWeb/CSS/StyleSheetList.cpp +++ b/Libraries/LibWeb/CSS/StyleSheetList.cpp @@ -26,8 +26,7 @@ #include <LibWeb/CSS/StyleSheetList.h> -namespace Web { -namespace CSS { +namespace Web::CSS { void StyleSheetList::add_sheet(NonnullRefPtr<StyleSheet> sheet) { @@ -40,4 +39,3 @@ StyleSheetList::StyleSheetList(Document& document) } } -} diff --git a/Libraries/LibWeb/CSS/StyleSheetList.h b/Libraries/LibWeb/CSS/StyleSheetList.h index ebccf4dccb..47fc2ff4ea 100644 --- a/Libraries/LibWeb/CSS/StyleSheetList.h +++ b/Libraries/LibWeb/CSS/StyleSheetList.h @@ -29,8 +29,7 @@ #include <AK/RefCounted.h> #include <LibWeb/CSS/StyleSheet.h> -namespace Web { -namespace CSS { +namespace Web::CSS { class StyleSheetList : public RefCounted<StyleSheetList> { public: @@ -51,4 +50,3 @@ private: }; } -} diff --git a/Libraries/LibWeb/CSS/StyleValue.h b/Libraries/LibWeb/CSS/StyleValue.h index 584962eca9..18b2acdead 100644 --- a/Libraries/LibWeb/CSS/StyleValue.h +++ b/Libraries/LibWeb/CSS/StyleValue.h @@ -36,13 +36,11 @@ #include <LibGfx/Color.h> #include <LibWeb/CSS/Length.h> #include <LibWeb/CSS/PropertyID.h> +#include <LibWeb/Forward.h> #include <LibWeb/Loader/ImageResource.h> -namespace Web { - -class Document; +namespace Web::CSS { -namespace CSS { enum class ValueID { Invalid, VendorSpecificLink, @@ -153,6 +151,8 @@ enum class Float { } +namespace Web { + class StyleValue : public RefCounted<StyleValue> { public: virtual ~StyleValue(); diff --git a/Libraries/LibWeb/CodeGenerators/Generate_CSS_PropertyID_cpp.cpp b/Libraries/LibWeb/CodeGenerators/Generate_CSS_PropertyID_cpp.cpp index 7fab48f81d..4f813fd25c 100644 --- a/Libraries/LibWeb/CodeGenerators/Generate_CSS_PropertyID_cpp.cpp +++ b/Libraries/LibWeb/CodeGenerators/Generate_CSS_PropertyID_cpp.cpp @@ -61,8 +61,7 @@ int main(int argc, char** argv) out() << "#include <AK/Assertions.h>"; out() << "#include <LibWeb/CSS/PropertyID.h>"; - out() << "namespace Web {"; - out() << "namespace CSS {"; + out() << "namespace Web::CSS {"; out() << "PropertyID property_id_from_string(const StringView& string) {"; @@ -88,7 +87,6 @@ int main(int argc, char** argv) out() << " }"; out() << "}"; out() << "}"; - out() << "}"; return 0; } diff --git a/Libraries/LibWeb/CodeGenerators/Generate_CSS_PropertyID_h.cpp b/Libraries/LibWeb/CodeGenerators/Generate_CSS_PropertyID_h.cpp index 1dbf80d9a3..30ad4d9be2 100644 --- a/Libraries/LibWeb/CodeGenerators/Generate_CSS_PropertyID_h.cpp +++ b/Libraries/LibWeb/CodeGenerators/Generate_CSS_PropertyID_h.cpp @@ -63,8 +63,7 @@ int main(int argc, char** argv) out() << "#include <AK/StringView.h>"; out() << "#include <AK/Traits.h>"; - out() << "namespace Web {"; - out() << "namespace CSS {"; + out() << "namespace Web::CSS {"; out() << "enum class PropertyID {"; out() << " Invalid,"; @@ -77,7 +76,6 @@ int main(int argc, char** argv) PropertyID property_id_from_string(const StringView&);\n\ const char* string_from_property_id(PropertyID);\n\ }\n\ -}\n\ \n\ namespace AK {\n\ template<>\n\ diff --git a/Libraries/LibWeb/Forward.h b/Libraries/LibWeb/Forward.h index 41ad85d60d..f4adf32456 100644 --- a/Libraries/LibWeb/Forward.h +++ b/Libraries/LibWeb/Forward.h @@ -75,7 +75,9 @@ class Window; class XMLHttpRequest; enum class QuirksMode; -namespace Bindings { +} + +namespace Web::Bindings { class CanvasRenderingContext2DWrapper; class DocumentWrapper; @@ -99,5 +101,3 @@ class XMLHttpRequestPrototype; class XMLHttpRequestWrapper; } - -} diff --git a/Libraries/LibWeb/Parser/CSSParser.h b/Libraries/LibWeb/Parser/CSSParser.h index 25f478c16f..dc38bb7c74 100644 --- a/Libraries/LibWeb/Parser/CSSParser.h +++ b/Libraries/LibWeb/Parser/CSSParser.h @@ -29,9 +29,7 @@ #include <AK/NonnullRefPtr.h> #include <LibWeb/CSS/StyleSheet.h> -namespace Web { - -namespace CSS { +namespace Web::CSS { class ParsingContext { public: ParsingContext(); @@ -44,6 +42,8 @@ private: }; } +namespace Web { + RefPtr<StyleSheet> parse_css(const CSS::ParsingContext&, const StringView&); RefPtr<StyleDeclaration> parse_css_declaration(const CSS::ParsingContext&, const StringView&); RefPtr<StyleValue> parse_css_value(const CSS::ParsingContext&, const StringView&); |