mirror of
https://github.com/moodle/moodle.git
synced 2025-03-20 07:30:01 +01:00
MDL-75982 tiny_accessibilitychecker: Fall back to opaque white as top background
This commit is contained in:
parent
4024127ee0
commit
e82229eea6
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -456,8 +456,15 @@ export default class {
|
||||
* @private
|
||||
*/
|
||||
getComputedBackgroundColor(node, color) {
|
||||
if (!node.parentNode) {
|
||||
// This is the document node and has no colour.
|
||||
// We cannot use window.getComputedStyle on the document.
|
||||
// If we got here, then the document has no background colour. Fall back to white.
|
||||
return this.colorBase.toArray('rgba(255, 255, 255, 1)');
|
||||
}
|
||||
color = color ? color : window.getComputedStyle(node, null).getPropertyValue('background-color');
|
||||
if (color.toLowerCase() === 'transparent') {
|
||||
|
||||
if (color.toLowerCase() === 'rgba(0, 0, 0, 0)' || color.toLowerCase() === 'transparent') {
|
||||
color = 'rgba(1, 1, 1, 0)';
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user