summaryrefslogtreecommitdiff
path: root/Libraries/LibHTML
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-03-06 10:26:05 +0100
committerAndreas Kling <kling@serenityos.org>2020-03-06 10:32:58 +0100
commit8bb361889c3c37dbaa0254bb9a76dcd94aeab115 (patch)
tree28c937882baff5050424733d729e57cc4d238b4b /Libraries/LibHTML
parentae233c1e82afd7a85741c3f7ea986f9b64dd69bd (diff)
downloadserenity-8bb361889c3c37dbaa0254bb9a76dcd94aeab115.zip
AK: Remove Optional::operator bool()
This was causing some obvious-in-hindsight but hard to spot bugs where we'd implicitly convert the bool to an integer type and carry on with the number 1 instead of the actual value().
Diffstat (limited to 'Libraries/LibHTML')
-rw-r--r--Libraries/LibHTML/DOM/Element.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibHTML/DOM/Element.cpp b/Libraries/LibHTML/DOM/Element.cpp
index c377c55f4e..5e19268593 100644
--- a/Libraries/LibHTML/DOM/Element.cpp
+++ b/Libraries/LibHTML/DOM/Element.cpp
@@ -209,7 +209,7 @@ NonnullRefPtr<StyleProperties> Element::computed_style()
};
for (CSS::PropertyID id : box_model_metrics) {
auto prop = layout_node()->style().property(id);
- if (prop)
+ if (prop.has_value())
properties->set_property(id, prop.value());
}
}