mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-04 07:09:41 +00:00
This adds an *almost* complete implementation of `CSS.registerProperty` method enabling further progress on the `@property` feature.
32 lines
792 B
C++
32 lines
792 B
C++
/*
|
|
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
|
|
* 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/WebIDL/ExceptionOr.h>
|
|
|
|
// https://www.w3.org/TR/cssom-1/#namespacedef-css
|
|
namespace Web::CSS {
|
|
|
|
struct PropertyDefinition {
|
|
String name;
|
|
String syntax;
|
|
bool inherits;
|
|
Optional<String> initial_value;
|
|
};
|
|
|
|
WebIDL::ExceptionOr<String> escape(JS::VM&, StringView identifier);
|
|
|
|
bool supports(JS::VM&, StringView property, StringView value);
|
|
WebIDL::ExceptionOr<bool> supports(JS::VM&, StringView condition_text);
|
|
|
|
WebIDL::ExceptionOr<void> register_property(JS::VM&, PropertyDefinition definition);
|
|
|
|
}
|