diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleProperties.cpp | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h index ea9904de49..3c701ae228 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h @@ -36,9 +36,9 @@ public: { for (auto& rule : m_rules) if (rule.type() == CSSRule::Type::Style) { - callback(downcast<CSSStyleRule>(rule)); + callback(verify_cast<CSSStyleRule>(rule)); } else if (rule.type() == CSSRule::Type::Import) { - const auto& import_rule = downcast<CSSImportRule>(rule); + const auto& import_rule = verify_cast<CSSImportRule>(rule); if (import_rule.has_import_result()) import_rule.loaded_style_sheet()->for_each_effective_style_rule(callback); } @@ -49,7 +49,7 @@ public: { for (auto& rule : m_rules) if (rule.type() == CSSRule::Type::Import) { - auto& import_rule = downcast<CSSImportRule>(rule); + auto& import_rule = verify_cast<CSSImportRule>(rule); if (!import_rule.has_import_result()) { callback(import_rule); return true; diff --git a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp index bd7e24ae60..7669a57f6f 100644 --- a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp +++ b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp @@ -212,7 +212,7 @@ static bool matches(const CSS::Selector& selector, int component_list_index, con for (auto* ancestor = element.parent(); ancestor; ancestor = ancestor->parent()) { if (!is<DOM::Element>(*ancestor)) continue; - if (matches(selector, component_list_index - 1, downcast<DOM::Element>(*ancestor))) + if (matches(selector, component_list_index - 1, verify_cast<DOM::Element>(*ancestor))) return true; } return false; @@ -220,7 +220,7 @@ static bool matches(const CSS::Selector& selector, int component_list_index, con VERIFY(component_list_index != 0); if (!element.parent() || !is<DOM::Element>(*element.parent())) return false; - return matches(selector, component_list_index - 1, downcast<DOM::Element>(*element.parent())); + return matches(selector, component_list_index - 1, verify_cast<DOM::Element>(*element.parent())); case CSS::Selector::ComplexSelector::Relation::AdjacentSibling: VERIFY(component_list_index != 0); if (auto* sibling = element.previous_element_sibling()) diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp index 0140059dcf..be62c097f0 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp @@ -278,11 +278,11 @@ Optional<float> StyleProperties::flex_grow_factor() const auto value = property(CSS::PropertyID::FlexGrow); if (!value.has_value()) return {}; - if (value.value()->is_length() && downcast<CSS::LengthStyleValue>(value.value().ptr())->to_length().raw_value() == 0) + if (value.value()->is_length() && verify_cast<CSS::LengthStyleValue>(value.value().ptr())->to_length().raw_value() == 0) return { 0 }; if (!value.value()->is_numeric()) return {}; - auto numeric = downcast<CSS::NumericStyleValue>(value.value().ptr()); + auto numeric = verify_cast<CSS::NumericStyleValue>(value.value().ptr()); return numeric->value(); } @@ -291,11 +291,11 @@ Optional<float> StyleProperties::flex_shrink_factor() const auto value = property(CSS::PropertyID::FlexShrink); if (!value.has_value()) return {}; - if (value.value()->is_length() && downcast<CSS::LengthStyleValue>(value.value().ptr())->to_length().raw_value() == 0) + if (value.value()->is_length() && verify_cast<CSS::LengthStyleValue>(value.value().ptr())->to_length().raw_value() == 0) return { 0 }; if (!value.value()->is_numeric()) return {}; - auto numeric = downcast<CSS::NumericStyleValue>(value.value().ptr()); + auto numeric = verify_cast<CSS::NumericStyleValue>(value.value().ptr()); return numeric->value(); } |