mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00:00
Browser+LibHTML: Change the way computed styles are queried
This commit is contained in:
parent
2ced4c4ec7
commit
2dd35916e5
Notes:
sideshowbarker
2024-07-19 10:20:20 +09:00
Author: https://github.com/Matrix89
Commit: 2dd35916e5
Pull-request: https://github.com/SerenityOS/serenity/pull/1006
Reviewed-by: https://github.com/awesomekling
4 changed files with 37 additions and 4 deletions
|
@ -10,6 +10,13 @@ class Color;
|
|||
class StyleProperties : public RefCounted<StyleProperties> {
|
||||
public:
|
||||
static NonnullRefPtr<StyleProperties> create() { return adopt(*new StyleProperties); }
|
||||
static NonnullRefPtr<StyleProperties> create(const StyleProperties& properties) {
|
||||
auto style_properties = new StyleProperties();
|
||||
properties.for_each_property([&](auto property_id, auto& property_value) {
|
||||
style_properties->set_property(property_id, property_value);
|
||||
});
|
||||
return adopt(*style_properties);
|
||||
}
|
||||
|
||||
template<typename Callback>
|
||||
inline void for_each_property(Callback callback) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue