mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
LibWeb: Use "namespace Web::Foo {" since C++20 allows it :^)
Thanks @nico for teaching me about this!
This commit is contained in:
@@ -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_
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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&);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
namespace Web::CSS {
|
||||
|
||||
class Document;
|
||||
|
||||
namespace CSS {
|
||||
enum class ValueID {
|
||||
Invalid,
|
||||
VendorSpecificLink,
|
||||
@@ -153,6 +151,8 @@ enum class Float {
|
||||
|
||||
}
|
||||
|
||||
namespace Web {
|
||||
|
||||
class StyleValue : public RefCounted<StyleValue> {
|
||||
public:
|
||||
virtual ~StyleValue();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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\
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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&);
|
||||
|
||||
Reference in New Issue
Block a user