From b865e66e2af09195e00eb46dabb3a0de8cde347a Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 18 Jan 2024 17:53:00 -0500 Subject: [PATCH] Documentation for `Element::Matches` (#25) --- pages/cpp_manual/elements.md | 1 + pages/lua_manual/api_reference.md | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pages/cpp_manual/elements.md b/pages/cpp_manual/elements.md index f02ab51..7fa98cb 100644 --- a/pages/cpp_manual/elements.md +++ b/pages/cpp_manual/elements.md @@ -147,6 +147,7 @@ Supported methods have simply had their initial letter capitalised to match the | `InsertBefore()` | Inserts the first node before the second, child, node in the DOM. The newly parented node must first be detached from its existing parent. | insertBefore() | `QuerySelector()` | Retrieve the first descendant element matching the provided RCSS selector(s). | querySelector() | `QuerySelectorAll()` | Retrieve a set of all descendant elements matching the provided RCSS selector(s). | querySelectorAll() +| `Matches()` | Check if the current element matches the given RCSS selector(s). | matches() | `RemoveAttribute()` | Remove the named attribute from the current node. | removeAttribute() | `RemoveChild()` | Removes a child node from the current element, returning it as a unique pointer. | removeChild() | `RemoveEventListener()` | Removes an event listener from the element. | removeEventListener() diff --git a/pages/lua_manual/api_reference.md b/pages/lua_manual/api_reference.md index c381131..3f87281 100644 --- a/pages/lua_manual/api_reference.md +++ b/pages/lua_manual/api_reference.md @@ -550,8 +550,9 @@ The Element class has no constructor; it must be instantiated through a [Documen | [HasChildNodes](#Element-HasChildNodes){: .lua-function }() | `boolean`{: .lua-type }
| | [InsertBefore](#Element-InsertBefore){: .lua-function }(`ElementPtr`{: .lua-type } element, `Element`{: .lua-type } adjacent_element) | `nil, Element`{: .lua-type } | | [IsClassSet](#Element-IsClassSet){: .lua-function }(`string`{: .lua-type } name) | `boolean`{: .lua-type }
| -| [QuerySelector](#Element-QuerySelector){: .lua-function }(`string`{: .lua-type } name) | `Element`{: .lua-type }
| -| [QuerySelectorAll](#Element-QuerySelectorAll){: .lua-function }(`string`{: .lua-type } name) | `table`{: .lua-type }
| +| [QuerySelector](#Element-QuerySelector){: .lua-function }(`string`{: .lua-type } selectors) | `Element`{: .lua-type }
| +| [QuerySelectorAll](#Element-QuerySelectorAll){: .lua-function }(`string`{: .lua-type } selectors) | `table`{: .lua-type }
| +| [Matches](#Element-Matches){: .lua-function }(`string`{: .lua-type } selectors) | `boolean`{: .lua-type }
| | [RemoveAttribute](#Element-RemoveAttribute){: .lua-function }(`string`{: .lua-type } name) | `nil`{: .lua-type } | | [RemoveChild](#Element-RemoveChild){: .lua-function }(`Element`{: .lua-type } element) | `boolean`{: .lua-type }
| | [ReplaceChild](#Element-ReplaceChild){: .lua-function }(`ElementPtr`{: .lua-type } inserted_element, `Element`{: .lua-type } replaced_element) | `boolean`{: .lua-type }
| @@ -686,12 +687,15 @@ The Element class has no constructor; it must be instantiated through a [Documen IsClassSet{: .lua-function }(`string`{: .lua-type } name) → `boolean`{: .lua-type } : Returns true if the class name is set on the element, false if not. -QuerySelector{: .lua-function }(`string`{: .lua-type } id) → `Element`{: .lua-type } +QuerySelector{: .lua-function }(`string`{: .lua-type } selectors) → `Element`{: .lua-type } : Returns the first descendant element matching the provided RCSS selector(s). -QuerySelectorAll{: .lua-function }(`string`{: .lua-type } tag_name) → `table`{: .lua-type } +QuerySelectorAll{: .lua-function }(`string`{: .lua-type } selectors) → `table`{: .lua-type } : Returns a set of all descendant elements matching the provided RCSS selector(s). Returned table is indexable with integers. +Matches{: .lua-function }(`string`{: .lua-type } selectors) → `boolean`{: .lua-type } +: Returns true if the element matches the provided RCSS selector(s), false if not. + RemoveAttribute{: .lua-function }(`string`{: .lua-type } name) → `nil`{: .lua-type} : Removes the attribute named name from the element.