bump
This commit is contained in:
@@ -9298,9 +9298,28 @@ func (d *Daemon) checkContrast(tabID string, selector string, timeout int) (*Con
|
||||
}
|
||||
}
|
||||
|
||||
const fgColor = style.color;
|
||||
const fontSize = style.fontSize;
|
||||
const fontWeight = style.fontWeight;
|
||||
// Get the actual text-bearing element for accurate color detection
|
||||
// If the element has child elements with text, use the first visible child's color
|
||||
let textElement = element;
|
||||
let textStyle = style;
|
||||
|
||||
// Check if element has child elements (not just text nodes)
|
||||
const childElements = Array.from(element.children).filter(child => {
|
||||
const childText = child.textContent.trim();
|
||||
if (!childText) return false;
|
||||
const childStyle = window.getComputedStyle(child);
|
||||
return childStyle.display !== 'none' && childStyle.visibility !== 'hidden';
|
||||
});
|
||||
|
||||
// If there are visible child elements with text, use the first one's color
|
||||
if (childElements.length > 0) {
|
||||
textElement = childElements[0];
|
||||
textStyle = window.getComputedStyle(textElement);
|
||||
}
|
||||
|
||||
const fgColor = textStyle.color;
|
||||
const fontSize = textStyle.fontSize;
|
||||
const fontWeight = textStyle.fontWeight;
|
||||
|
||||
// Three-tier background detection with progressive fallback
|
||||
let bgColor = null;
|
||||
|
||||
Reference in New Issue
Block a user