bump
This commit is contained in:
@@ -9224,6 +9224,22 @@ func (d *Daemon) checkContrast(tabID string, selector string, timeout int) (*Con
|
||||
const text = element.textContent.trim();
|
||||
if (!text || text.length === 0) return;
|
||||
|
||||
// Skip container elements that don't have direct text nodes
|
||||
// This prevents checking parent DIVs when we should check the actual text elements (H2, P, etc.)
|
||||
const hasDirectTextContent = Array.from(element.childNodes).some(node =>
|
||||
node.nodeType === Node.TEXT_NODE && node.textContent.trim().length > 0
|
||||
);
|
||||
|
||||
// For container elements (div, span), only check if they have direct text
|
||||
// For semantic text elements (h1-h6, p, a, button, etc.), always check
|
||||
const isSemanticTextElement = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'P', 'A', 'BUTTON', 'LABEL', 'LI', 'TD', 'TH'].includes(element.tagName);
|
||||
const isContainerElement = ['DIV', 'SPAN'].includes(element.tagName);
|
||||
|
||||
if (isContainerElement && !hasDirectTextContent) {
|
||||
// Skip this container - its children will be checked separately
|
||||
return;
|
||||
}
|
||||
|
||||
// Get computed styles
|
||||
const style = window.getComputedStyle(element);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user