diff options
author | Matrix89 <Matrix89@protonmail.ch> | 2020-01-04 03:09:22 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2020-01-05 17:13:22 +0100 |
commit | 2dd35916e5b5307d85c74d7341379b3c0050ffdd (patch) | |
tree | 541585a38349651ef033fa3ac69432e47e469810 /Libraries/LibHTML/CSS/StyleProperties.h | |
parent | 2ced4c4ec745d1387be0e3a320596fd7b1597185 (diff) | |
download | serenity-2dd35916e5b5307d85c74d7341379b3c0050ffdd.zip |
Browser+LibHTML: Change the way computed styles are queried
Diffstat (limited to 'Libraries/LibHTML/CSS/StyleProperties.h')
-rw-r--r-- | Libraries/LibHTML/CSS/StyleProperties.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Libraries/LibHTML/CSS/StyleProperties.h b/Libraries/LibHTML/CSS/StyleProperties.h index 5475d0dce2..79ef18226f 100644 --- a/Libraries/LibHTML/CSS/StyleProperties.h +++ b/Libraries/LibHTML/CSS/StyleProperties.h @@ -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 |