瀏覽代碼

LibWeb: Add spec comments to the StackOfOpenElements class

Andreas Kling 3 年之前
父節點
當前提交
1347c5032b
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h

+ 6 - 0
Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h

@@ -12,8 +12,14 @@
 
 namespace Web::HTML {
 
+// https://html.spec.whatwg.org/multipage/parsing.html#stack-of-open-elements
 class StackOfOpenElements {
 public:
+    // Initially, the stack of open elements is empty.
+    // The stack grows downwards; the topmost node on the stack is the first one added to the stack,
+    // and the bottommost node of the stack is the most recently added node in the stack
+    // (notwithstanding when the stack is manipulated in a random access fashion as part of the handling for misnested tags).
+
     StackOfOpenElements() { }
     ~StackOfOpenElements();