ladybird/Libraries/LibWeb/CSS/CSS.h

39 lines
1.1 KiB
C
Raw Normal View History

2023-03-15 10:55:53 -04:00
/*
* Copyright (c) 2021-2025, Sam Atkins <sam@ladybird.org>
2023-03-15 10:55:53 -04:00
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/String.h>
#include <AK/StringView.h>
#include <LibJS/Forward.h>
#include <LibWeb/CSS/GeneratedCSSNumericFactoryMethods.h>
2025-07-19 19:35:33 -07:00
#include <LibWeb/Export.h>
2023-03-15 10:55:53 -04:00
#include <LibWeb/WebIDL/ExceptionOr.h>
#include <LibWeb/WebIDL/Types.h>
2023-03-15 10:55:53 -04:00
// https://www.w3.org/TR/cssom-1/#namespacedef-css
namespace Web::CSS {
struct PropertyDefinition {
String name;
String syntax;
bool inherits;
Optional<String> initial_value;
};
2025-07-19 19:35:33 -07:00
WEB_API WebIDL::ExceptionOr<String> escape(JS::VM&, StringView identifier);
2023-03-15 10:55:53 -04:00
WEB_API bool supports(JS::VM&, FlyString const& property, StringView value);
2025-07-19 19:35:33 -07:00
WEB_API WebIDL::ExceptionOr<bool> supports(JS::VM&, StringView condition_text);
2023-03-15 10:55:53 -04:00
2025-07-19 19:35:33 -07:00
WEB_API WebIDL::ExceptionOr<void> register_property(JS::VM&, PropertyDefinition definition);
// NB: Numeric factory functions (https://drafts.css-houdini.org/css-typed-om-1/#numeric-factory) are generated,
// see GenerateCSSNumericFactoryMethods.cpp
2023-03-15 10:55:53 -04:00
}