mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:07:47 +00:00
LibHTML: Get rid of the style tree
We now create a layout tree directly from the DOM tree. This way we don't actually lose text nodes ^)
This commit is contained in:
parent
a9ebd676e5
commit
fd0aa5dd43
22 changed files with 126 additions and 261 deletions
23
Libraries/LibHTML/CSS/StyleProperties.h
Normal file
23
Libraries/LibHTML/CSS/StyleProperties.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <LibHTML/CSS/StyleValue.h>
|
||||
|
||||
class StyleProperties {
|
||||
public:
|
||||
template<typename Callback>
|
||||
inline void for_each_property(Callback callback) const
|
||||
{
|
||||
for (auto& it : m_property_values)
|
||||
callback(it.key, *it.value);
|
||||
}
|
||||
|
||||
void set_property(const String& name, NonnullRefPtr<StyleValue> value);
|
||||
Optional<NonnullRefPtr<StyleValue>> property(const String& name) const;
|
||||
|
||||
Length length_or_fallback(const StringView& property_name, const Length& fallback) const;
|
||||
|
||||
private:
|
||||
HashMap<String, NonnullRefPtr<StyleValue>> m_property_values;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue