mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-08-24 20:52:11 +00:00
Fixed code to correctly iterate over ancestor nodes
This commit is contained in:
parent
aec8555b9a
commit
7a11edefda
@ -310,7 +310,7 @@ public sealed partial class VisualBriefingArtifactService
|
|||||||
/// <returns><see langword="true"/> when the asset is hidden in the template.</returns>
|
/// <returns><see langword="true"/> when the asset is hidden in the template.</returns>
|
||||||
private static bool IsHiddenInTemplate(HtmlNode node, HtmlNode root, string css)
|
private static bool IsHiddenInTemplate(HtmlNode node, HtmlNode root, string css)
|
||||||
{
|
{
|
||||||
for (var candidate = node; candidate is not null && candidate != root; candidate = candidate.ParentNode)
|
foreach (var candidate in node.AncestorsAndSelf().TakeWhile(candidate => candidate != root))
|
||||||
if (FindAttribute(candidate, "hidden") is not null || string.Equals(candidate.GetAttributeValue("aria-hidden", string.Empty), "true", StringComparison.OrdinalIgnoreCase) || IsHiddenByCss(candidate, css))
|
if (FindAttribute(candidate, "hidden") is not null || string.Equals(candidate.GetAttributeValue("aria-hidden", string.Empty), "true", StringComparison.OrdinalIgnoreCase) || IsHiddenByCss(candidate, css))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user