mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:18:12 +00:00
LibWeb: Add namespace qualifier to type names equal to a C++ namespace
For example, Document.getSelection returns Selection, which is in the Selection namespace. Namespaces.h has Linus' copyright since he changed the "is_one_of" list to an Array.
This commit is contained in:
parent
34c130b336
commit
565dc0f296
3 changed files with 53 additions and 27 deletions
|
@ -7,6 +7,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "Namespaces.h"
|
||||
#include <AK/Debug.h>
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <LibCore/ArgsParser.h>
|
||||
|
@ -74,32 +75,7 @@ int main(int argc, char** argv)
|
|||
IDL::Parser parser(path, data, import_base_path);
|
||||
auto& interface = parser.parse();
|
||||
|
||||
static constexpr Array libweb_interface_namespaces = {
|
||||
"CSS"sv,
|
||||
"Crypto"sv,
|
||||
"DOM"sv,
|
||||
"DOMParsing"sv,
|
||||
"Encoding"sv,
|
||||
"Fetch"sv,
|
||||
"FileAPI"sv,
|
||||
"Geometry"sv,
|
||||
"HTML"sv,
|
||||
"HighResolutionTime"sv,
|
||||
"IntersectionObserver"sv,
|
||||
"NavigationTiming"sv,
|
||||
"RequestIdleCallback"sv,
|
||||
"ResizeObserver"sv,
|
||||
"SVG"sv,
|
||||
"Selection"sv,
|
||||
"UIEvents"sv,
|
||||
"URL"sv,
|
||||
"WebGL"sv,
|
||||
"WebIDL"sv,
|
||||
"WebSockets"sv,
|
||||
"XHR"sv,
|
||||
};
|
||||
|
||||
if (libweb_interface_namespaces.span().contains_slow(namespace_)) {
|
||||
if (IDL::libweb_interface_namespaces.span().contains_slow(namespace_)) {
|
||||
StringBuilder builder;
|
||||
builder.append(namespace_);
|
||||
builder.append("::"sv);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue