mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:47:44 +00:00
AK: Rename downcast<T> => verify_cast<T>
This makes it much clearer what this cast actually does: it will VERIFY that the thing we're casting is a T (using is<T>()).
This commit is contained in:
parent
6215a9c2cb
commit
ee3a73ddbb
61 changed files with 262 additions and 262 deletions
|
@ -290,7 +290,7 @@ String Element::inner_html() const
|
|||
Function<void(const Node&)> recurse = [&](auto& node) {
|
||||
for (auto* child = node.first_child(); child; child = child->next_sibling()) {
|
||||
if (child->is_element()) {
|
||||
auto& element = downcast<Element>(*child);
|
||||
auto& element = verify_cast<Element>(*child);
|
||||
builder.append('<');
|
||||
builder.append(element.local_name());
|
||||
element.for_each_attribute([&](auto& name, auto& value) {
|
||||
|
@ -311,7 +311,7 @@ String Element::inner_html() const
|
|||
builder.append('>');
|
||||
}
|
||||
if (child->is_text()) {
|
||||
auto& text = downcast<Text>(*child);
|
||||
auto& text = verify_cast<Text>(*child);
|
||||
builder.append(escape_string(text.data(), false));
|
||||
}
|
||||
// FIXME: Also handle Comment, ProcessingInstruction, DocumentType
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue