summaryrefslogtreecommitdiff
path: root/Libraries/LibHTML/CSS/StyleProperties.h
diff options
context:
space:
mode:
authorMatrix89 <Matrix89@protonmail.ch>2020-01-04 03:09:22 +0100
committerAndreas Kling <awesomekling@gmail.com>2020-01-05 17:13:22 +0100
commit2dd35916e5b5307d85c74d7341379b3c0050ffdd (patch)
tree541585a38349651ef033fa3ac69432e47e469810 /Libraries/LibHTML/CSS/StyleProperties.h
parent2ced4c4ec745d1387be0e3a320596fd7b1597185 (diff)
downloadserenity-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.h7
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