mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-05 07:39:16 +00:00
LibWeb/CSS: Implement CSSStyleRule.styleMap
StylePropertyMap is just a stub, so this doesn't yet accomplish much.
This commit is contained in:
parent
3bb54ffd59
commit
215d8b8076
Notes:
github-actions[bot]
2025-08-13 09:15:50 +00:00
Author: https://github.com/AtkinsSJ
Commit: 215d8b8076
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5823
Reviewed-by: https://github.com/trflynn89
12 changed files with 48 additions and 24 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
|
||||
* Copyright (c) 2021-2024, Sam Atkins <sam@ladybird.org>
|
||||
* Copyright (c) 2021-2025, Sam Atkins <sam@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -12,6 +12,7 @@
|
|||
#include <LibWeb/CSS/CSSStyleSheet.h>
|
||||
#include <LibWeb/CSS/Parser/Parser.h>
|
||||
#include <LibWeb/CSS/StyleComputer.h>
|
||||
#include <LibWeb/CSS/StylePropertyMap.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
|
@ -40,6 +41,7 @@ void CSSStyleRule::visit_edges(Cell::Visitor& visitor)
|
|||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_declaration);
|
||||
visitor.visit(m_style_map);
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom-1/#dom-cssstylerule-style
|
||||
|
@ -48,6 +50,14 @@ GC::Ref<CSSStyleProperties> CSSStyleRule::style()
|
|||
return m_declaration;
|
||||
}
|
||||
|
||||
// https://drafts.css-houdini.org/css-typed-om-1/#dom-cssstylerule-stylemap
|
||||
GC::Ref<StylePropertyMap> CSSStyleRule::style_map()
|
||||
{
|
||||
if (!m_style_map)
|
||||
m_style_map = StylePropertyMap::create(realm(), m_declaration);
|
||||
return *m_style_map;
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom-1/#serialize-a-css-rule
|
||||
String CSSStyleRule::serialized() const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue