Fix css changes with macOS 13 and Safari (flutter/engine#48807)

Safari on macOS 13 outputs different styling than before. Adjust tests to accept new changes. 

Fixes https://github.com/flutter/flutter/issues/136274. Fixes https://github.com/flutter/flutter/issues/136279.

Example passing on macOS 12: https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20linux_web_engine/16401/overview
Example passing on macOS 13: https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20linux_web_engine/16396/overview

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
Victoria Ashworth
2023-12-11 13:31:25 -06:00
committed by GitHub
parent d84b450b1e
commit 9622acd973
2 changed files with 16 additions and 4 deletions

View File

@@ -799,7 +799,12 @@ void _testContainer() {
owner().semanticsHost.querySelector('flt-semantics-container')!;
expect(parentElement.style.transform, 'matrix(1, 0, 0, 1, 10, 10)');
expect(parentElement.style.transformOrigin, '0px 0px 0px');
if (isSafari) {
// macOS 13 returns different values than macOS 12.
expect(parentElement.style.transformOrigin, anyOf(contains('0px 0px 0px'), contains('0px 0px')));
} else {
expect(parentElement.style.transformOrigin, '0px 0px 0px');
}
expect(container.style.top, '-10px');
expect(container.style.left, '-10px');
semantics().semanticsEnabled = false;

View File

@@ -3075,11 +3075,18 @@ Future<void> testMain() async {
final DomHTMLElement input = editingStrategy!.activeDomElement;
expect(input.style.color, contains('transparent'));
expect(input.style.background, contains('transparent'));
if (isSafari) {
// macOS 13 returns different values than macOS 12.
expect(input.style.background, anyOf(contains('transparent'), contains('none')));
expect(input.style.outline, anyOf(contains('none'), contains('currentcolor')));
expect(input.style.border, anyOf(contains('none'), contains('medium')));
} else {
expect(input.style.background, contains('transparent'));
expect(input.style.outline, contains('none'));
expect(input.style.border, contains('none'));
}
expect(input.style.backgroundColor, contains('transparent'));
expect(input.style.caretColor, contains('transparent'));
expect(input.style.outline, contains('none'));
expect(input.style.border, contains('none'));
expect(input.style.textShadow, contains('none'));
});