mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:48:14 +00:00
LibWeb: Add spec comment for HTMLParser::adjusted_current_node
I've found myself looking at this function a bunch while debugging.
This commit is contained in:
parent
0a8eb59a05
commit
907be5a96e
1 changed files with 5 additions and 0 deletions
|
@ -579,8 +579,13 @@ DOM::Element& HTMLParser::current_node()
|
||||||
return m_stack_of_open_elements.current_node();
|
return m_stack_of_open_elements.current_node();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/parsing.html#adjusted-current-node
|
||||||
DOM::Element& HTMLParser::adjusted_current_node()
|
DOM::Element& HTMLParser::adjusted_current_node()
|
||||||
{
|
{
|
||||||
|
// The adjusted current node is the context element if the parser was created as part of the
|
||||||
|
// HTML fragment parsing algorithm and the stack of open elements has only one element in it
|
||||||
|
// (fragment case); otherwise, the adjusted current node is the current node.
|
||||||
|
|
||||||
if (m_parsing_fragment && m_stack_of_open_elements.elements().size() == 1)
|
if (m_parsing_fragment && m_stack_of_open_elements.elements().size() == 1)
|
||||||
return *m_context_element;
|
return *m_context_element;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue