[web] Analysis cleanup (flutter/engine#27730)

This commit is contained in:
Ferhat
2021-07-27 10:06:44 -07:00
committed by GitHub
parent 2a8fc52c24
commit 43826fe892
49 changed files with 109 additions and 99 deletions

View File

@@ -13,10 +13,6 @@ analyzer:
linter:
rules:
empty_statements: false
hash_and_equals: false
implementation_imports: false
iterable_contains_unrelated_type: false
library_names: false
library_prefixes: false
list_remove_unrelated_type: false
@@ -47,9 +43,6 @@ linter:
unnecessary_getters_setters: false
unnecessary_null_aware_assignments: false
unnecessary_null_in_if_null_operators: false
unnecessary_overrides: false
unnecessary_parenthesis: false
unnecessary_this: false
unrelated_type_equality_checks: false
use_rethrow_when_possible: false
valid_regexps: false

View File

@@ -212,7 +212,7 @@ class BrowserLock {
BrowserLock._() {
final io.File lockFile = io.File(
path.join(environment.webUiRootDir.path, 'dev', 'browser_lock.yaml'));
this._configuration = loadYaml(lockFile.readAsStringSync()) as YamlMap;
_configuration = loadYaml(lockFile.readAsStringSync()) as YamlMap;
}
}

View File

@@ -41,7 +41,7 @@ class SafariArgParser extends BrowserArgParser {
_version = argResults['safari-version'] as String;
assert(_version == 'system');
final String browser = argResults['browser'] as String;
_isMobileBrowser = (browser == 'ios-safari');
_isMobileBrowser = browser == 'ios-safari';
}
@override
@@ -85,9 +85,9 @@ class IosSafariArgParser extends BrowserArgParser {
required int pinnedIosMinorVersion,
required String pinnedIosDevice,
}) :
this._pinnedIosMajorVersion = pinnedIosMajorVersion,
this._pinnedIosMinorVersion = pinnedIosMinorVersion,
this._pinnedIosDevice = pinnedIosDevice;
_pinnedIosMajorVersion = pinnedIosMajorVersion,
_pinnedIosMinorVersion = pinnedIosMinorVersion,
_pinnedIosDevice = pinnedIosDevice;
/// Returns [IosSimulator] if the [Platform] is `macOS` and simulator
/// is started.

View File

@@ -334,7 +334,7 @@ class TestCommand extends Command<bool> with ArgUtils<bool> {
String get browser => stringArg('browser')!;
/// The browser environment for the [browser].
BrowserEnvironment get browserEnvironment => (_browserEnvironment ??= _createBrowserEnvironment(browser));
BrowserEnvironment get browserEnvironment => _browserEnvironment ??= _createBrowserEnvironment(browser);
BrowserEnvironment? _browserEnvironment;
/// Whether [browser] is set to "chrome".

View File

@@ -32,6 +32,9 @@ class FilePath {
return other is FilePath && other._absolutePath == _absolutePath;
}
@override
int get hashCode => _absolutePath.hashCode;
@override
String toString() => _absolutePath;
}

View File

@@ -181,7 +181,7 @@ class CanvasPool extends _SaveStackTracking {
_canvas = null;
return;
}
_contextHandle = ContextStateHandle(this, _context!, this._density);
_contextHandle = ContextStateHandle(this, _context!, _density);
_initializeViewport(requiresClearRect);
_replayClipStack();
}

View File

@@ -978,8 +978,8 @@ class CkDrawImageCommand extends CkPaintCommand {
final ui.Offset offset;
final CkPaint paint;
CkDrawImageCommand(CkImage image, this.offset, this.paint)
: this.image = image.clone();
CkDrawImageCommand(CkImage ckImage, this.offset, this.paint)
: image = ckImage.clone();
@override
void apply(SkCanvas canvas) {
@@ -1017,8 +1017,8 @@ class CkDrawImageRectCommand extends CkPaintCommand {
final ui.Rect dst;
final CkPaint paint;
CkDrawImageRectCommand(CkImage image, this.src, this.dst, this.paint)
: this.image = image.clone();
CkDrawImageRectCommand(CkImage ckImage, this.src, this.dst, this.paint)
: image = ckImage.clone();
@override
void apply(SkCanvas canvas) {
@@ -1051,8 +1051,8 @@ class CkDrawImageRectCommand extends CkPaintCommand {
}
class CkDrawImageNineCommand extends CkPaintCommand {
CkDrawImageNineCommand(CkImage image, this.center, this.dst, this.paint)
: this.image = image.clone();
CkDrawImageNineCommand(CkImage ckImage, this.center, this.dst, this.paint)
: image = ckImage.clone();
final CkImage image;
final ui.Rect center;

View File

@@ -21,15 +21,15 @@ import 'skia_object_cache.dart';
/// the lifecycle of its [SkColorFilter].
class ManagedSkColorFilter extends ManagedSkiaObject<SkColorFilter> {
ManagedSkColorFilter(CkColorFilter ckColorFilter)
: this.ckColorFilter = ckColorFilter;
: colorFilter = ckColorFilter;
final CkColorFilter ckColorFilter;
final CkColorFilter colorFilter;
@override
SkColorFilter createDefault() => ckColorFilter._initRawColorFilter();
SkColorFilter createDefault() => colorFilter._initRawColorFilter();
@override
SkColorFilter resurrect() => ckColorFilter._initRawColorFilter();
SkColorFilter resurrect() => colorFilter._initRawColorFilter();
@override
void delete() {
@@ -37,7 +37,7 @@ class ManagedSkColorFilter extends ManagedSkiaObject<SkColorFilter> {
}
@override
int get hashCode => ckColorFilter.hashCode;
int get hashCode => colorFilter.hashCode;
@override
bool operator ==(Object other) {
@@ -45,11 +45,11 @@ class ManagedSkColorFilter extends ManagedSkiaObject<SkColorFilter> {
return false;
}
return other is ManagedSkColorFilter &&
other.ckColorFilter == ckColorFilter;
other.colorFilter == colorFilter;
}
@override
String toString() => ckColorFilter.toString();
String toString() => colorFilter.toString();
}
/// A [ui.ColorFilter] backed by Skia's [SkColorFilter].
@@ -151,6 +151,9 @@ class CkLinearToSrgbGammaColorFilter extends CkColorFilter {
@override
bool operator ==(Object other) => runtimeType == other.runtimeType;
@override
int get hashCode => runtimeType.hashCode;
@override
String toString() => 'ColorFilter.linearToSrgbGamma()';
}
@@ -164,6 +167,9 @@ class CkSrgbToLinearGammaColorFilter extends CkColorFilter {
@override
bool operator ==(Object other) => runtimeType == other.runtimeType;
@override
int get hashCode => runtimeType.hashCode;
@override
String toString() => 'ColorFilter.srgbToLinearGamma()';
}

View File

@@ -516,8 +516,8 @@ class ViewClipChain {
int _clipCount = -1;
ViewClipChain({required html.Element view})
: this._root = view,
this._slot = view;
: _root = view,
_slot = view;
html.Element get root => _root;
html.Element get slot => _slot;

View File

@@ -79,7 +79,7 @@ Future<ui.Codec> skiaInstantiateWebImageCodec(
try {
final Uint8List list =
Uint8List.view((request.response as ByteBuffer));
Uint8List.view(request.response as ByteBuffer);
final CkAnimatedImage codec = CkAnimatedImage.decodeFromBytes(list, url);
completer.complete(codec);
} catch (error, stackTrace) {

View File

@@ -135,7 +135,7 @@ class _CkBlurImageFilter extends CkImageFilter {
class _CkMatrixImageFilter extends CkImageFilter {
_CkMatrixImageFilter({ required Float64List matrix, required this.filterQuality })
: this.matrix = Float64List.fromList(matrix),
: this.matrix = Float64List.fromList(matrix), // ignore: unnecessary_this
super._();
final Float64List matrix;

View File

@@ -127,7 +127,7 @@ class IntervalTreeNode<T> {
// Don't bother checking intervals.
return false;
}
if (this.containsShallow(x)) {
if (containsShallow(x)) {
return true;
}
if (left?.containsDeep(x) == true) {
@@ -146,7 +146,7 @@ class IntervalTreeNode<T> {
return;
}
left?.searchForPoint(x, result);
if (this.containsShallow(x)) {
if (containsShallow(x)) {
result.add(value);
}
if (x < low) {

View File

@@ -177,7 +177,7 @@ class CkPaint extends ManagedSkiaObject<SkPaint> implements ui.Paint {
ui.FilterQuality _filterQuality = ui.FilterQuality.none;
@override
ui.ColorFilter? get colorFilter => _managedColorFilter?.ckColorFilter;
ui.ColorFilter? get colorFilter => _managedColorFilter?.colorFilter;
@override
set colorFilter(ui.ColorFilter? value) {
if (colorFilter == value) {

View File

@@ -79,7 +79,7 @@ class CkGradientLinear extends CkShader implements ui.Gradient {
assert(offsetIsValid(to)),
assert(colors != null), // ignore: unnecessary_null_comparison
assert(tileMode != null), // ignore: unnecessary_null_comparison
this.matrix4 = matrix {
matrix4 = matrix {
if (assertionsEnabled) {
assert(matrix4 == null || matrix4IsValid(matrix4!));
validateColorStops(colors, colorStops);

View File

@@ -235,7 +235,7 @@ class Surface {
}
void _contextLostListener(html.Event event) {
assert(event.target == this.htmlCanvas,
assert(event.target == htmlCanvas,
'Received a context lost event for a disposed canvas');
final SurfaceFactory factory = SurfaceFactory.instance;
_contextLost = true;

View File

@@ -510,7 +510,7 @@ class BitmapCanvas extends EngineCanvas {
math.min(rect.left, rect.right), math.min(rect.top, rect.bottom)),
paint);
element.style.borderRadius =
'${(rect.width / 2.0)}px / ${(rect.height / 2.0)}px';
'${rect.width / 2.0}px / ${rect.height / 2.0}px';
} else {
setUpPaint(paint, rect);
_canvasPool.drawOval(rect, paint.style);

View File

@@ -42,9 +42,9 @@ class OffScreenCanvas {
/// Returns CanvasRenderContext2D or OffscreenCanvasRenderingContext2D to
/// paint into.
Object? getContext2d() {
return (offScreenCanvas != null
return offScreenCanvas != null
? offScreenCanvas!.getContext('2d')
: canvasElement!.getContext('2d'));
: canvasElement!.getContext('2d');
}
/// Feature detection for transferToImageBitmap on OffscreenCanvas.

View File

@@ -180,7 +180,7 @@ double? chopMonoAtY(Float32List _buffer, int bufferStartPos, double y) {
} else {
tPos = tMid;
}
} while (((tPos - tNeg).abs() > tolerance));
} while ((tPos - tNeg).abs() > tolerance);
return (tNeg + tPos) / 2;
}

View File

@@ -809,7 +809,7 @@ class SurfacePath implements ui.Path {
// to start outside their marks. A round rect may lose convexity as a
// result. If the input values are on integers, place the conic on
// integers as well.
final bool expectIntegers = SPath.nearlyEqual((math.pi / 2 - thetaWidth.abs()), 0) &&
final bool expectIntegers = SPath.nearlyEqual(math.pi / 2 - thetaWidth.abs(), 0) &&
SPath.isInteger(rx) &&
SPath.isInteger(ry) &&
SPath.isInteger(x) &&
@@ -1175,7 +1175,7 @@ class SurfacePath implements ui.Path {
} else {
final double x = offsetX + points[p];
final double y = offsetY + points[p + 1];
points[p] = (matrix4[0] * (x)) + (matrix4[4] * y) + matrix4[12];
points[p] = (matrix4[0] * x) + (matrix4[4] * y) + matrix4[12];
points[p + 1] = (matrix4[1] * x) + (matrix4[5] * y) + matrix4[13];
}
}
@@ -1432,7 +1432,7 @@ class SurfacePath implements ui.Path {
}
}
if (this._firstDirection == SPathDirection.kUnknown) {
if (_firstDirection == SPathDirection.kUnknown) {
if (state.firstDirection == SPathDirection.kUnknown &&
!pathRef.getBounds().isEmpty) {
return _setComputedConvexity(state.reversals < 3
@@ -1540,7 +1540,7 @@ class SurfacePath implements ui.Path {
/// as if they had been closed, even if they were not explicitly closed.
@override
SurfacePathMetrics computeMetrics({bool forceClosed = false}) {
return SurfacePathMetrics(this.pathRef, forceClosed);
return SurfacePathMetrics(pathRef, forceClosed);
}
/// Detects if path is rounded rectangle.

View File

@@ -312,6 +312,10 @@ class PathRef {
return equals(other as PathRef);
}
@override
int get hashCode => ui.hashValues(fSegmentMask,
fPoints, _conicWeights, _fVerbs);
bool equals(PathRef ref) {
// We explicitly check fSegmentMask as a quick-reject. We could skip it,
// since it is only a cache of info in the fVerbs, but its a fast way to
@@ -583,7 +587,7 @@ class PathRef {
maxX = math.max(maxX, x);
maxY = math.max(maxY, y);
}
final bool allFinite = (accum * 0 == 0);
final bool allFinite = accum * 0 == 0;
if (allFinite) {
fBounds = ui.Rect.fromLTRB(minX, minY, maxX, maxY);
fIsFinite = true;

View File

@@ -594,8 +594,8 @@ class PersistedPicture extends PersistedLeafSurface {
_computeOptimalCullRect(oldSurface);
if (identical(picture, oldSurface.picture)) {
final bool densityChanged = (_canvas is BitmapCanvas &&
_density != (_canvas! as BitmapCanvas).density);
final bool densityChanged = _canvas is BitmapCanvas &&
_density != (_canvas! as BitmapCanvas).density;
// The picture is the same. Attempt to avoid repaint.
if (_requiresRepaint || densityChanged) {
@@ -720,7 +720,7 @@ double _computePixelDensity(Matrix4? transform, double width, double height) {
//
// On a fullscreen high dpi device dpi*density*resolution will demand
// too much memory, so clamp at 4.
scale = math.min(4.0, ((scale / 2.0).ceil() * 2.0));
scale = math.min(4.0, (scale / 2.0).ceil() * 2.0);
// Guard against webkit absolute limit.
const double kPixelLimit = 1024 * 1024 * 4;
if ((width * height * scale * scale) > kPixelLimit && scale > 2) {

View File

@@ -34,8 +34,11 @@ class SurfaceVertices implements ui.Vertices {
List<int>? indices,
}) : assert(mode != null), // ignore: unnecessary_null_comparison
assert(positions != null), // ignore: unnecessary_null_comparison
// ignore: unnecessary_this
this.colors = colors != null ? _int32ListFromColors(colors) : null,
// ignore: unnecessary_this
this.indices = indices != null ? Uint16List.fromList(indices) : null,
// ignore: unnecessary_this
this.positions = offsetListToFloat32List(positions) {
initWebGl();
}

View File

@@ -19,8 +19,8 @@ import 'webgl_context.dart';
class EngineImageShader implements ui.ImageShader {
EngineImageShader(ui.Image image, this.tileModeX, this.tileModeY,
Float64List matrix4, this.filterQuality)
: this.image = image as HtmlImage,
this.matrix4 = Float32List.fromList(matrix4);
: this.image = image as HtmlImage, // ignore: unnecessary_this
this.matrix4 = Float32List.fromList(matrix4); // ignore: unnecessary_this
final ui.TileMode tileModeX;
final ui.TileMode tileModeY;

View File

@@ -162,7 +162,7 @@ class GradientLinear extends EngineGradient {
assert(offsetIsValid(to)),
assert(colors != null), // ignore: unnecessary_null_comparison
assert(tileMode != null), // ignore: unnecessary_null_comparison
this.matrix4 = matrix == null ? null : FastMatrix32(matrix),
matrix4 = matrix == null ? null : FastMatrix32(matrix),
super._() {
if (assertionsEnabled) {
validateColorStops(colors, colorStops);

View File

@@ -46,8 +46,8 @@ class PlatformViewMessageHandler {
PlatformViewMessageHandler({
required PlatformViewManager contentManager,
PlatformViewContentHandler? contentHandler,
}) : this._contentManager = contentManager,
this._contentHandler = contentHandler;
}) : _contentManager = contentManager,
_contentHandler = contentHandler;
/// Handle a `create` Platform View message.
///

View File

@@ -47,7 +47,7 @@ class SemanticsHelper {
@visibleForTesting
set semanticsEnabler(SemanticsEnabler semanticsEnabler) {
this._semanticsEnabler = semanticsEnabler;
_semanticsEnabler = semanticsEnabler;
}
bool shouldEnableSemantics(html.Event event) {
@@ -160,7 +160,7 @@ class DesktopSemanticsEnabler extends SemanticsEnabler {
}
// Check for the event target.
final bool enableConditionPassed = (event.target == _semanticsPlaceholder);
final bool enableConditionPassed = event.target == _semanticsPlaceholder;
if (!enableConditionPassed) {
// This was not a semantics activating event; forward as normal.
@@ -256,10 +256,10 @@ class MobileSemanticsEnabler extends SemanticsEnabler {
if (_schedulePlaceholderRemoval) {
// The event type can also be click for VoiceOver.
final bool removeNow = (browserEngine != BrowserEngine.webkit ||
final bool removeNow = browserEngine != BrowserEngine.webkit ||
event.type == 'touchend' ||
event.type == 'pointerup' ||
event.type == 'click');
event.type == 'click';
if (removeNow) {
dispose();
}

View File

@@ -526,7 +526,7 @@ class SpanBox extends RangeBox {
required ui.TextDirection boxDirection,
required this.contentDirection,
required this.isSpaceOnly,
}) : this.spanometer = spanometer,
}) : this.spanometer = spanometer, // ignore: unnecessary_this
span = spanometer.currentSpan,
height = spanometer.height,
baseline = spanometer.ascent,
@@ -576,7 +576,7 @@ class SpanBox extends RangeBox {
/// Whether this box's range overlaps with the range from [startIndex] to
/// [endIndex].
bool overlapsWith(int startIndex, int endIndex) {
return startIndex < this.end.index && this.start.index < endIndex;
return startIndex < end.index && start.index < endIndex;
}
/// Returns the substring of the paragraph that's represented by this box.
@@ -907,7 +907,7 @@ class LineBuilder {
if (_boxes.isEmpty) {
return false;
}
return (_boxes.last is PlaceholderBox);
return _boxes.last is PlaceholderBox;
}
ui.TextDirection get _paragraphDirection =>
@@ -985,7 +985,7 @@ class LineBuilder {
break;
case ui.PlaceholderAlignment.middle:
final double textMidPoint = this.height / 2;
final double textMidPoint = height / 2;
final double placeholderMidPoint = placeholder.height / 2;
final double diff = placeholderMidPoint - textMidPoint;
ascent = this.ascent + diff;

View File

@@ -88,7 +88,7 @@ class EngineLineMetrics implements ui.LineMetrics {
required List<RangeBox> boxes,
}) : displayText = null,
unscaledAscent = double.infinity,
this.boxes = boxes;
this.boxes = boxes; // ignore: unnecessary_this
/// The text to be rendered on the screen representing this line.
final String? displayText;

View File

@@ -1082,6 +1082,6 @@ class MeasurementResult {
assert(maxIntrinsicWidth != null), // ignore: unnecessary_null_comparison
assert(alphabeticBaseline != null), // ignore: unnecessary_null_comparison
assert(ideographicBaseline != null), // ignore: unnecessary_null_comparison
this.textAlign = textAlign ?? ui.TextAlign.start,
this.textDirection = textDirection ?? ui.TextDirection.ltr;
this.textAlign = textAlign ?? ui.TextAlign.start,// ignore: unnecessary_this
this.textDirection = textDirection ?? ui.TextDirection.ltr;// ignore: unnecessary_this
}

View File

@@ -39,7 +39,7 @@ class TextCapitalizationConfig {
: textCapitalization = TextCapitalization.none;
const TextCapitalizationConfig.fromInputConfiguration(String inputConfiguration)
: this.textCapitalization =
: textCapitalization =
inputConfiguration == 'TextCapitalization.words'
? TextCapitalization.words
: inputConfiguration == 'TextCapitalization.characters'

View File

@@ -258,7 +258,7 @@ class EngineAutofillForm {
}
void storeForm() {
formsOnTheDom[formIdentifier] = this.formElement;
formsOnTheDom[formIdentifier] = formElement;
_hideAutofillElements(formElement, isOffScreen: true);
}

View File

@@ -148,8 +148,8 @@ bool approximatelyEqual(double ax, double ay, double bx, double by) {
if (!roughlyEqualUlps(ax, bx) || !roughlyEqualUlps(ay, by)) {
return false;
}
final double dx = (ax - bx);
final double dy = (ay - by);
final double dx = ax - bx;
final double dy = ay - by;
final double dist = math.sqrt(dx * dx + dy * dy);
final double tiniest = math.min(math.min(math.min(ax, bx), ay), by);
double largest = math.max(math.max(math.max(ax, bx), ay), by);

View File

@@ -546,7 +546,7 @@ class RRect {
assert(brRadiusY != null), // ignore: unnecessary_null_comparison
assert(blRadiusX != null), // ignore: unnecessary_null_comparison
assert(blRadiusY != null), // ignore: unnecessary_null_comparison
this.webOnlyUniformRadii = uniformRadii;
webOnlyUniformRadii = uniformRadii;
final double left;
final double top;

View File

@@ -33,7 +33,7 @@ Color _scaleAlpha(Color a, double factor) {
}
class Color {
const Color(int value) : this.value = value & 0xFFFFFFFF;
const Color(int value) : this.value = value & 0xFFFFFFFF;// ignore: unnecessary_this
const Color.fromARGB(int a, int r, int g, int b)
: value = (((a & 0xff) << 24) |
((r & 0xff) << 16) |

View File

@@ -318,7 +318,7 @@ class LocaleStringAttribute extends StringAttribute {
@override
StringAttribute copy({required TextRange range}) {
return LocaleStringAttribute(range: range, locale: this.locale);
return LocaleStringAttribute(range: range, locale: locale);
}
@override

View File

@@ -211,6 +211,7 @@ class CallbackHandle {
bool operator ==(Object other) => identical(this, other);
@override
// ignore: unnecessary_overrides
int get hashCode => super.hashCode;
}

View File

@@ -1199,7 +1199,7 @@ void _canvasTests() {
);
final CkPicture picture =
CkPicture(otherRecorder.finishRecordingAsPicture(), null, null);
final CkImage image = (await picture.toImage(1, 1)) as CkImage;
final CkImage image = await picture.toImage(1, 1) as CkImage;
final ByteData rawData =
await image.toByteData(format: ui.ImageByteFormat.rawRgba);
expect(rawData.lengthInBytes, greaterThan(0));

View File

@@ -120,8 +120,8 @@ void testMain() {
},
// TODO(nurhan): https://github.com/flutter/flutter/issues/46638
// TODO(nurhan): https://github.com/flutter/flutter/issues/50828
skip: (browserEngine == BrowserEngine.firefox ||
browserEngine == BrowserEngine.edge));
skip: browserEngine == BrowserEngine.firefox ||
browserEngine == BrowserEngine.edge);
test('accesibility placeholder is attached after creation', () {
final DomRenderer renderer = DomRenderer();

View File

@@ -152,7 +152,7 @@ void testMain() {
class _FakePlatformViewManager extends PlatformViewManager {
_FakePlatformViewManager(void Function(int) clearFunction)
: this._clearPlatformView = clearFunction;
: _clearPlatformView = clearFunction;
void Function(int) _clearPlatformView;

View File

@@ -38,8 +38,8 @@ void _testEach<T extends _BasicEventContext>(
/// Some methods in this class are skipped for iOS-Safari.
/// TODO: https://github.com/flutter/flutter/issues/60033
bool get isIosSafari => (browserEngine == BrowserEngine.webkit &&
operatingSystem == OperatingSystem.iOs);
bool get isIosSafari => browserEngine == BrowserEngine.webkit &&
operatingSystem == OperatingSystem.iOs;
void main() {
internalBootstrapBrowserTest(() => testMain);

View File

@@ -979,7 +979,7 @@ void _testTextField() {
}, // TODO(nurhan): https://github.com/flutter/flutter/issues/46638
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
// TODO(nurhan): https://github.com/flutter/flutter/issues/50754
skip: (browserEngine != BrowserEngine.blink));
skip: browserEngine != BrowserEngine.blink);
}
void _testCheckables() {

View File

@@ -90,7 +90,7 @@ void testMain() {
}, // TODO(nurhan): https://github.com/flutter/flutter/issues/46638
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
// TODO(nurhan): https://github.com/flutter/flutter/issues/50754
skip: (browserEngine != BrowserEngine.blink));
skip: browserEngine != BrowserEngine.blink);
test('Syncs editing state from framework', () async {
semantics()

View File

@@ -189,7 +189,7 @@ void testMain() {
expect(picture.updateCount, 0);
expect(picture.applyPaintCount, 2);
}, // TODO(nurhan): https://github.com/flutter/flutter/issues/46638
skip: (browserEngine == BrowserEngine.firefox));
skip: browserEngine == BrowserEngine.firefox);
});
group('Compositing order', () {

View File

@@ -203,8 +203,8 @@ void testMain() {
},
// This method failed on iOS Safari.
// TODO: https://github.com/flutter/flutter/issues/60036
skip: (browserEngine == BrowserEngine.webkit &&
operatingSystem == OperatingSystem.iOs));
skip: browserEngine == BrowserEngine.webkit &&
operatingSystem == OperatingSystem.iOs);
test('is retained', () {
final SceneBuilder builder1 = SceneBuilder();

View File

@@ -27,7 +27,7 @@ void testMain() {
..color = ui.Color.fromARGB(255, 255, 100, 100),
);
final ui.Picture picture = recorder.endRecording();
final HtmlImage image = (await picture.toImage(200, 100)) as HtmlImage;
final HtmlImage image = await picture.toImage(200, 100) as HtmlImage;
expect(image, isNotNull);
html.document.body!
..style.margin = '0'

View File

@@ -106,7 +106,7 @@ double _rectDistance(Rect a, Rect b) {
}
double _sizeDistance(Size a, Size b) {
final Offset delta = (b - a) as Offset;
final Offset delta = (b - a) as Offset; // ignore: unnecessary_parenthesis
return delta.distance;
}

View File

@@ -119,7 +119,7 @@ Future<void> testMain() async {
// TODO(nurhan): https://github.com/flutter/flutter/issues/50771
// TODO(nurhan): https://github.com/flutter/flutter/issues/46638
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
skip: (browserEngine != BrowserEngine.blink));
skip: browserEngine != BrowserEngine.blink);
testEachMeasurement('predictably lays out a multi-line rich paragraph', () {
for (double fontSize in <double>[10.0, 20.0, 30.0, 40.0]) {
@@ -145,7 +145,7 @@ Future<void> testMain() async {
// TODO(nurhan): https://github.com/flutter/flutter/issues/46638
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
// TODO(nurhan): https://github.com/flutter/flutter/issues/50771
skip: (browserEngine != BrowserEngine.blink));
skip: browserEngine != BrowserEngine.blink);
testEachMeasurement('getPositionForOffset single-line', () {
final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(

View File

@@ -32,8 +32,8 @@ Future<void> testMain() async {
},
// TODO(nurhan): https://github.com/flutter/flutter/issues/56702
// TODO(nurhan): https://github.com/flutter/flutter/issues/50770
skip: (browserEngine == BrowserEngine.edge ||
browserEngine == BrowserEngine.webkit));
skip: browserEngine == BrowserEngine.edge ||
browserEngine == BrowserEngine.webkit);
test('loads Blehm font from buffer', () async {
expect(_containsFontFamily('Blehm'), isFalse);
@@ -48,8 +48,8 @@ Future<void> testMain() async {
},
// TODO(nurhan): https://github.com/flutter/flutter/issues/56702
// TODO(nurhan): https://github.com/flutter/flutter/issues/50770
skip: (browserEngine == BrowserEngine.edge ||
browserEngine == BrowserEngine.webkit));
skip: browserEngine == BrowserEngine.edge ||
browserEngine == BrowserEngine.webkit);
test('loading font should clear measurement caches', () async {
final EngineParagraphStyle style = EngineParagraphStyle();
@@ -83,8 +83,8 @@ Future<void> testMain() async {
},
// TODO(nurhan): https://github.com/flutter/flutter/issues/56702
// TODO(nurhan): https://github.com/flutter/flutter/issues/50770
skip: (browserEngine == BrowserEngine.edge ||
browserEngine == BrowserEngine.webkit));
skip: browserEngine == BrowserEngine.edge ||
browserEngine == BrowserEngine.webkit);
test('loading font should send font change message', () async {
final ui.PlatformMessageCallback? oldHandler = ui.window.onPlatformMessage;
@@ -105,15 +105,15 @@ Future<void> testMain() async {
fontFamily: 'Blehm');
final Completer<void> completer = Completer<void>();
html.window.requestAnimationFrame( (_) { completer.complete(); } );
await(completer.future);
await (completer.future); // ignore: unnecessary_parenthesis
window.onPlatformMessage = oldHandler;
expect(actualName, 'flutter/system');
expect(message, '{"type":"fontsChange"}');
},
// TODO(nurhan): https://github.com/flutter/flutter/issues/56702
// TODO(nurhan): https://github.com/flutter/flutter/issues/50770
skip: (browserEngine == BrowserEngine.edge ||
browserEngine == BrowserEngine.webkit));
skip: browserEngine == BrowserEngine.edge ||
browserEngine == BrowserEngine.webkit);
});
}

View File

@@ -381,8 +381,8 @@ Future<void> testMain() async {
},
// TODO(nurhan): https://github.com/flutter/flutter/issues/50771
// TODO(nurhan): https://github.com/flutter/flutter/issues/46638
skip: (browserEngine == BrowserEngine.firefox ||
browserEngine == BrowserEngine.edge));
skip: browserEngine == BrowserEngine.firefox ||
browserEngine == BrowserEngine.edge);
test('adds Arial and sans-serif as fallback fonts', () {
// Set this to false so it doesn't default to 'Ahem' font.
@@ -403,8 +403,8 @@ Future<void> testMain() async {
},
// TODO(nurhan): https://github.com/flutter/flutter/issues/50771
// TODO(nurhan): https://github.com/flutter/flutter/issues/46638
skip: (browserEngine == BrowserEngine.firefox ||
browserEngine == BrowserEngine.edge));
skip: browserEngine == BrowserEngine.firefox ||
browserEngine == BrowserEngine.edge);
test('does not add fallback fonts to generic families', () {
// Set this to false so it doesn't default to 'Ahem' font.