瀏覽代碼

LibWeb: Add spec link and comment to HTMLTableElement::caption()

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

+ 3 - 0
Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp

@@ -54,8 +54,11 @@ void HTMLTableElement::apply_presentational_hints(CSS::StyleProperties& style) c
     });
     });
 }
 }
 
 
+// https://html.spec.whatwg.org/multipage/tables.html#dom-table-caption
 JS::GCPtr<HTMLTableCaptionElement> HTMLTableElement::caption()
 JS::GCPtr<HTMLTableCaptionElement> HTMLTableElement::caption()
 {
 {
+    // The caption IDL attribute must return, on getting, the first caption element child of the table element,
+    // if any, or null otherwise.
     return first_child_of_type<HTMLTableCaptionElement>();
     return first_child_of_type<HTMLTableCaptionElement>();
 }
 }