Skip to content

Commit

Permalink
LibWeb: Use reverse iterator for reverse loop into NonnullRefPtrVector
Browse files Browse the repository at this point in the history
  • Loading branch information
guerinoni authored and awesomekling committed Mar 9, 2022
1 parent 0aed2f0 commit 43d5257
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/

#include "AK/ReverseIterator.h"
#include <AK/StringBuilder.h>
#include <LibJS/Interpreter.h>
#include <LibJS/Parser.h>
Expand Down Expand Up @@ -242,9 +243,7 @@ static void run_focus_update_steps(NonnullRefPtrVector<DOM::Node> old_chain, Non
(void)new_focus_target;

// 4. For each entry entry in new chain, in reverse order, run these substeps:
for (ssize_t i = new_chain.size() - 1; i >= 0; --i) {
auto& entry = new_chain[i];

for (auto& entry : new_chain.in_reverse()) {
// 1. If entry is a focusable area: designate entry as the focused area of the document.
// FIXME: This isn't entirely right.
if (is<DOM::Element>(entry))
Expand Down

0 comments on commit 43d5257

Please sign in to comment.