mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:17:44 +00:00
LibHTML: Replace StyleProperties::create(StyleProperties) with clone()
This commit is contained in:
parent
2dd35916e5
commit
c2e1dd67c9
3 changed files with 26 additions and 8 deletions
|
@ -9,14 +9,13 @@ class Color;
|
|||
|
||||
class StyleProperties : public RefCounted<StyleProperties> {
|
||||
public:
|
||||
StyleProperties();
|
||||
|
||||
explicit StyleProperties(const StyleProperties&);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
NonnullRefPtr<StyleProperties> clone() const;
|
||||
|
||||
template<typename Callback>
|
||||
inline void for_each_property(Callback callback) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue