diff options
author | Andreas Kling <kling@serenityos.org> | 2022-02-07 02:09:17 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-07 02:17:45 +0100 |
commit | a05c07fdcddd40529d4877f3cc5004326de7a0db (patch) | |
tree | 282357f2187d2a5ecdee777a73fbbfc33c82427e /Userland/Libraries/LibWeb/HTML/HTMLElement.cpp | |
parent | 1ea2467a7a9746863dd3bac80ed3bc74d067b638 (diff) | |
download | serenity-a05c07fdcddd40529d4877f3cc5004326de7a0db.zip |
LibWeb: Use NonnullRefPtrVector<DOM::Node> for focus chains
Let's just use reference-counting pointers for this, even if it seems
safe not to.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/HTMLElement.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/HTMLElement.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp index 351828ef4c..a652d6acf5 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp @@ -182,15 +182,15 @@ void HTMLElement::parse_attribute(const FlyString& name, const String& value) } // https://html.spec.whatwg.org/multipage/interaction.html#focus-update-steps -static void run_focus_update_steps(Vector<DOM::Node&> old_chain, Vector<DOM::Node&> new_chain, DOM::Node& new_focus_target) +static void run_focus_update_steps(NonnullRefPtrVector<DOM::Node> old_chain, NonnullRefPtrVector<DOM::Node> new_chain, DOM::Node& new_focus_target) { // 1. If the last entry in old chain and the last entry in new chain are the same, // pop the last entry from old chain and the last entry from new chain and redo this step. while (!old_chain.is_empty() && !new_chain.is_empty() && &old_chain.last() == &new_chain.last()) { - old_chain.take_last(); - new_chain.take_last(); + (void)old_chain.take_last(); + (void)new_chain.take_last(); } // 2. For each entry entry in old chain, in order, run these substeps: @@ -277,14 +277,14 @@ static void run_focus_update_steps(Vector<DOM::Node&> old_chain, Vector<DOM::Nod } } // https://html.spec.whatwg.org/multipage/interaction.html#focus-chain -static Vector<DOM::Node&> focus_chain(DOM::Node* subject) +static NonnullRefPtrVector<DOM::Node> focus_chain(DOM::Node* subject) { // FIXME: Move this somewhere more spec-friendly. if (!subject) return {}; // 1. Let output be an empty list. - Vector<DOM::Node&> output; + NonnullRefPtrVector<DOM::Node> output; // 2. Let currentObject be subject. auto* current_object = subject; |