summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-02-14 22:24:10 +0100
committerAndreas Kling <kling@serenityos.org>2022-02-15 02:05:53 +0100
commit5cdbea4ae0e70862f2cfab789374ba6c37c5d71b (patch)
treedf2cf06aad2e17956d7f1d1e6f9d5e5c2543309b
parent6fe333607d9dbb802ce2f9b612192863a8d234f1 (diff)
downloadserenity-5cdbea4ae0e70862f2cfab789374ba6c37c5d71b.zip
LibWeb: Rename element_before() => element_immediately_above()
This matches the spec terminology around the "stack of open elements".
-rw-r--r--Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp2
-rw-r--r--Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp2
-rw-r--r--Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp
index a5a45076b0..b38af2245d 100644
--- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp
@@ -551,7 +551,7 @@ HTMLParser::AdjustedInsertionLocation HTMLParser::find_appropriate_place_for_ins
adjusted_insertion_location = { last_table.element->parent_node(), last_table.element };
} else {
// 6. Let previous element be the element immediately above last table in the stack of open elements.
- auto previous_element = m_stack_of_open_elements.element_before(*last_table.element);
+ auto previous_element = m_stack_of_open_elements.element_immediately_above(*last_table.element);
// 7. Let adjusted insertion location be inside previous element, after its last child (if any).
adjusted_insertion_location = { previous_element, nullptr };
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp b/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp
index 1b833e9a74..97fd3d6463 100644
--- a/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp
@@ -123,7 +123,7 @@ StackOfOpenElements::LastElementResult StackOfOpenElements::last_element_with_ta
return { nullptr, -1 };
}
-DOM::Element* StackOfOpenElements::element_before(const DOM::Element& target)
+DOM::Element* StackOfOpenElements::element_immediately_above(DOM::Element const& target)
{
bool found_target = false;
for (ssize_t i = m_elements.size() - 1; i >= 0; --i) {
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h b/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h
index acbaf2dce8..7885157bd6 100644
--- a/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h
+++ b/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h
@@ -50,7 +50,7 @@ public:
ssize_t index;
};
LastElementResult last_element_with_tag_name(const FlyString&);
- DOM::Element* element_before(const DOM::Element&);
+ DOM::Element* element_immediately_above(DOM::Element const&);
private:
bool has_in_scope_impl(const FlyString& tag_name, const Vector<FlyString>&) const;