Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions lib/web_ui/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,4 @@ analyzer:

linter:
rules:
package_api_docs: false
prefer_foreach: false
prefer_generic_function_type_aliases: false
prefer_initializing_formals: false
prefer_single_quotes: false
prefer_typing_uninitialized_variables: false
public_member_api_docs: false
flutter_style_todos: false

# We have some legitimate use-cases for this (preserve tear-off identity)
prefer_function_declarations_over_variables: false
public_member_api_docs: false
2 changes: 1 addition & 1 deletion lib/web_ui/dev/chrome.dart
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ Future<Uri> getRemoteDebuggerUrl(Uri base) async {
/// [ScreenshotManager] implementation for Chrome.
///
/// This manager can be used for both macOS and Linux.
// TODO: https://github.com/flutter/flutter/issues/65673
// TODO(yjbanov): extends tests to Window, https://github.com/flutter/flutter/issues/65673
class ChromeScreenshotManager extends ScreenshotManager {
@override
String get filenameSuffix => '';
Expand Down
4 changes: 2 additions & 2 deletions lib/web_ui/dev/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,13 @@ class DevNull implements StringSink {
void write(Object? obj) {}

@override
void writeAll(Iterable<dynamic> objects, [String separator = ""]) {}
void writeAll(Iterable<dynamic> objects, [String separator = '']) {}

@override
void writeCharCode(int charCode) {}

@override
void writeln([Object? obj = ""]) {}
void writeln([Object? obj = '']) {}
}

/// Whether the felt command is running on Cirrus CI.
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/dev/edge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Edge extends Browser {
final String version = EdgeArgParser.instance.version;

return Edge._(() async {
// TODO(nurhan): Configure info log for LUCI.
// TODO(yjbanov): Configure info log for LUCI.
final BrowserInstallation installation = await getEdgeInstallation(
version,
infoLog: DevNull(),
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/dev/edge_installation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class EdgeArgParser extends BrowserArgParser {
/// exclusively with Windows 10 and cannot be downloaded or installed separately.`
/// See: https://support.microsoft.com/en-us/help/17171/microsoft-edge-get-to-know
///
// TODO(nurhan): Investigate running tests for the tech preview downloads
// TODO(yjbanov): Investigate running tests for the tech preview downloads
// from the beta channel.
Future<BrowserInstallation> getEdgeInstallation(
String requestedVersion, {
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/dev/felt_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ IF %orTempValue%==0 (
CALL python %GN% --unoptimized --full-dart-sdk
CALL ninja -C %HOST_DEBUG_UNOPT_DIR%)

:: TODO(nurhan): The batch script does not support snanphot option.
:: TODO(yjbanov): The batch script does not support snanphot option.
:: Support snapshot option.
CALL :installdeps
IF %1==test (%DART_SDK_DIR%\bin\dart "%DEV_DIR%\felt.dart" %* --browser=chrome) ELSE ( %DART_SDK_DIR%\bin\dart "%DEV_DIR%\felt.dart" %* )
Expand Down
4 changes: 2 additions & 2 deletions lib/web_ui/dev/firefox_installer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ Future<String> _findSystemFirefoxExecutable() async {

/// Fetches the latest available Firefox build version on Linux.
Future<String> fetchLatestFirefoxVersionLinux() async {
final RegExp forFirefoxVersion = RegExp("firefox-[0-9.]+[0-9]");
final RegExp forFirefoxVersion = RegExp('firefox-[0-9.]+[0-9]');
final io.HttpClientRequest request = await io.HttpClient()
.getUrl(Uri.parse(PlatformBinding.instance.getFirefoxLatestVersionUrl()));
request.followRedirects = false;
Expand All @@ -332,7 +332,7 @@ Future<String> fetchLatestFirefoxVersionLinux() async {

/// Fetches the latest available Firefox build version on Mac OS.
Future<String> fetchLatestFirefoxVersionMacOS() async {
final RegExp forFirefoxVersion = RegExp("firefox/releases/[0-9.]+[0-9]");
final RegExp forFirefoxVersion = RegExp('firefox/releases/[0-9.]+[0-9]');
final io.HttpClientRequest request = await io.HttpClient()
.getUrl(Uri.parse(PlatformBinding.instance.getFirefoxLatestVersionUrl()));
request.followRedirects = false;
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/dev/safari_installation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class IosSafariArgParser extends BrowserArgParser {
/// Latest Safari version for Catalina, Mojave, High Siera is 13.
///
/// Latest Safari version for Sierra is 12.
// TODO(nurhan): user latest version to download and install the latest
// TODO(yjbanov): user latest version to download and install the latest
// technology preview.
Future<BrowserInstallation> getOrInstallSafari(
String requestedVersion, {
Expand Down
6 changes: 3 additions & 3 deletions lib/web_ui/dev/test_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -361,15 +361,15 @@ class TestCommand extends Command<bool> with ArgUtils<bool> {
///
/// For now Firefox integration tests only run on Linux and Mac on local.
///
// TODO: https://github.com/flutter/flutter/issues/63832
// TODO(yjbanov): https://github.com/flutter/flutter/issues/63832
bool get isFirefoxIntegrationTestAvailable =>
(isFirefox && isLuci && io.Platform.isLinux) ||
(isFirefox && !isLuci && !io.Platform.isWindows);

/// Latest versions of Safari Desktop are only available on macOS.
///
/// Integration testing on LUCI is not supported at the moment.
// TODO: https://github.com/flutter/flutter/issues/63710
// TODO(yjbanov): https://github.com/flutter/flutter/issues/63710
bool get isSafariIntegrationTestAvailable => isSafariOnMacOS && !isLuci;

/// Due to various factors integration tests might be missing on a given
Expand Down Expand Up @@ -776,7 +776,7 @@ class ClearTerminalScreenStep implements PipelineStep {
Future<void> run() async {
if (!io.Platform.isWindows) {
// See: https://en.wikipedia.org/wiki/ANSI_escape_code#CSI_sequences
print("\x1B[2J\x1B[1;2H");
print('\x1B[2J\x1B[1;2H');
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions lib/web_ui/lib/src/engine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ export 'engine/web_experiments.dart';

export 'engine/window.dart';

// The mode the app is running in.
// Keep these in sync with the same constants on the framework-side under foundation/constants.dart.
/// The mode the app is running in.
/// Keep these in sync with the same constants on the framework-side under foundation/constants.dart.
const bool kReleaseMode =
bool.fromEnvironment('dart.vm.product', defaultValue: false);
const bool kProfileMode =
Expand Down Expand Up @@ -461,7 +461,7 @@ class NullTreeSanitizer implements html.NodeTreeSanitizer {

/// The shared instance of PlatformViewManager shared across the engine to handle
/// rendering of PlatformViews into the web app.
/// TODO(dit): How to make this overridable from tests?
// TODO(dit): How to make this overridable from tests?
final PlatformViewManager platformViewManager = PlatformViewManager();

/// Converts a matrix represented using [Float64List] to one represented using
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/browser_detection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ BrowserEngine _detectBrowserEngine() {
/// Note: SAMSUNG-SGH-I717
/// SPH/SCH are very old Palm models.
bool _isSamsungBrowser(String agent) {
final RegExp exp = RegExp(r"SAMSUNG|SGH-[I|N|T]|GT-[I|N]|SM-[A|N|P|T|Z]|SHV-E|SCH-[I|J|R|S]|SPH-L");
final RegExp exp = RegExp(r'SAMSUNG|SGH-[I|N|T]|GT-[I|N]|SM-[A|N|P|T|Z]|SHV-E|SCH-[I|J|R|S]|SPH-L');
return exp.hasMatch(agent.toUpperCase());
}

Expand Down
1 change: 1 addition & 0 deletions lib/web_ui/lib/src/engine/canvaskit/canvas.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// ignore_for_file: public_member_api_docs
import 'dart:math' as math;
import 'dart:typed_data';

Expand Down
2 changes: 2 additions & 0 deletions lib/web_ui/lib/src/engine/canvaskit/canvaskit_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
/// Prefer keeping the original CanvasKit names so it is easier to locate
/// the API behind these bindings in the Skia source code.
// ignore_for_file: non_constant_identifier_names

// ignore_for_file: public_member_api_docs
@JS()
library canvaskit_api;

Expand Down
7 changes: 3 additions & 4 deletions lib/web_ui/lib/src/engine/canvaskit/font_fallbacks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class FontFallbackData {
// resetting the tree would be a matter of reconstructing
// the new resolved tree.
font.reset();
// ignore: prefer_foreach
for (final CodeunitRange range in font.approximateUnicodeRanges) {
ranges.putIfAbsent(font, () => <CodeunitRange>[]).add(range);
}
Expand Down Expand Up @@ -282,10 +283,7 @@ Future<void> findFontsForMissingCodeunits(List<int> codeUnits) async {
resolvedFonts.addAll(font.resolvedFont!.tree.intersections(codeUnit));
}
}

for (final _ResolvedNotoSubset resolvedFont in resolvedFonts) {
notoDownloadQueue.add(resolvedFont);
}
resolvedFonts.forEach(notoDownloadQueue.add);

// We looked through the Noto font tree and didn't find any font families
// covering some code units, or we did find a font family, but when we
Expand Down Expand Up @@ -402,6 +400,7 @@ _ResolvedNotoFont? _makeResolvedNotoFontFromCss(String css, String name) {
final Map<_ResolvedNotoSubset, List<CodeunitRange>> rangesMap =
<_ResolvedNotoSubset, List<CodeunitRange>>{};
for (final _ResolvedNotoSubset subset in subsets) {
// ignore: prefer_foreach
for (final CodeunitRange range in subset.ranges) {
rangesMap.putIfAbsent(subset, () => <CodeunitRange>[]).add(range);
}
Expand Down
1 change: 1 addition & 0 deletions lib/web_ui/lib/src/engine/canvaskit/image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class ImageCodecException implements Exception {
const String _kNetworkImageMessage = 'Failed to load network image.';

typedef HttpRequestFactory = html.HttpRequest Function();
// ignore: prefer_function_declarations_over_variables
HttpRequestFactory httpRequestFactory = () => html.HttpRequest();
void debugRestoreHttpRequestFactory() {
httpRequestFactory = () => html.HttpRequest();
Expand Down
8 changes: 4 additions & 4 deletions lib/web_ui/lib/src/engine/canvaskit/layer_scene_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class LayerSceneBuilder implements ui.SceneBuilder {
bool freeze = false,
ui.FilterQuality filterQuality = ui.FilterQuality.low,
}) {
// TODO(b/128315641): implement addTexture.
// TODO(hterkelsen): implement addTexture, b/128315641
}

@override
Expand Down Expand Up @@ -214,17 +214,17 @@ class LayerSceneBuilder implements ui.SceneBuilder {

@override
void setCheckerboardOffscreenLayers(bool checkerboard) {
// TODO: implement setCheckerboardOffscreenLayers
// TODO(hterkelsen): implement setCheckerboardOffscreenLayers
}

@override
void setCheckerboardRasterCacheImages(bool checkerboard) {
// TODO: implement setCheckerboardRasterCacheImages
// TODO(hterkelsen): implement setCheckerboardRasterCacheImages
}

@override
void setRasterizerTracingThreshold(int frameInterval) {
// TODO: implement setRasterizerTracingThreshold
// TODO(hterkelsen): implement setRasterizerTracingThreshold
}

T pushLayer<T extends ContainerLayer>(T layer) {
Expand Down
1 change: 1 addition & 0 deletions lib/web_ui/lib/src/engine/canvaskit/surface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class Surface {
if (surface.context != null) {
canvasKit.setCurrentContext(surface.context!);
}
// ignore: prefer_function_declarations_over_variables
final SubmitCallback submitCallback =
(SurfaceFrame surfaceFrame, CkCanvas canvas) {
return _presentSurface();
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/canvaskit/text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ class CkStrutStyle implements ui.StrutStyle {
List<String>? fontFamilyFallback,
double? fontSize,
double? height,
//TODO(LongCatIsLooong): implement leadingDistribution.
// TODO(mdebbar): implement leadingDistribution.
ui.TextLeadingDistribution? leadingDistribution,
double? leading,
ui.FontWeight? fontWeight,
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/clipboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class ExecCommandCopyStrategy implements CopyToClipboardStrategy {
class ExecCommandPasteStrategy implements PasteFromClipboardStrategy {
@override
Future<String> getData() {
// TODO(nurhan): https://github.com/flutter/flutter/issues/48581
// TODO(mdebbar): https://github.com/flutter/flutter/issues/48581
return Future<String>.error(
UnimplementedError('Paste is not implemented for this browser.'));
}
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/dom_renderer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ class DomRenderer {
setElementStyle(bodyElement, 'font', defaultCssFont);
setElementStyle(bodyElement, 'color', 'red');

// TODO(flutter_web): Disable spellcheck until changes in the framework and
// TODO(mdebbar): Disable spellcheck until changes in the framework and
// engine are complete.
bodyElement.spellcheck = false;

Expand Down
3 changes: 3 additions & 0 deletions lib/web_ui/lib/src/engine/engine_canvas.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// For member documentation see https://api.flutter.dev/flutter/dart-ui/Canvas-class.html
// ignore_for_file: public_member_api_docs

import 'dart:html' as html;
import 'dart:typed_data';

Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/host_node.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class ShadowDomHostNode implements HostNode {
// The shadowRootStyleElement must be appended to the DOM, or its `sheet` will be null later.
_shadow.append(shadowRootStyleElement);

// TODO: Apply only rules for the shadow root
// TODO(dit): Apply only rules for the shadow root
applyGlobalCssRulesToSheet(
shadowRootStyleElement.sheet! as html.CssStyleSheet,
browserEngine: browserEngine,
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/html/backdrop_filter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class PersistedBackdropFilter extends PersistedContainerSurface
..height = '${height}px';
if (browserEngine == BrowserEngine.firefox) {
// For FireFox for now render transparent black background.
// TODO(flutter_web): Switch code to use filter when
// TODO(ferhat): Switch code to use filter when
// See https://caniuse.com/#feat=css-backdrop-filter.
filterElementStyle
..backgroundColor = '#000'
Expand Down
19 changes: 10 additions & 9 deletions lib/web_ui/lib/src/engine/html/bitmap_canvas.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class BitmapCanvas extends EngineCanvas {

// Indicates the instructions following drawImage or drawParagraph that
// a child element was created to paint.
// TODO(flutter_web): When childElements are created by
// TODO(yjbanov): When childElements are created by
// drawImage/drawParagraph commands, compositing order is not correctly
// handled when we interleave these with other paint commands.
// To solve this, recording canvas will have to check the paint queue
Expand Down Expand Up @@ -183,7 +183,8 @@ class BitmapCanvas extends EngineCanvas {
// initial translation so the paint operations are positioned as expected.
//
// The flooring of the value is to ensure that canvas' top-left corner
// lands on the physical pixel. TODO: !This is not accurate if there are
// lands on the physical pixel.
// TODO(yjbanov): !This is not accurate if there are
// transforms higher up in the stack.
rootElement.style.transform =
'translate(${_canvasPositionX}px, ${_canvasPositionY}px)';
Expand Down Expand Up @@ -783,8 +784,8 @@ class BitmapCanvas extends EngineCanvas {
// left,top are set to 0 (although position is absolute) because
// Chrome will glitch if you leave them out, reproducible with
// canvas_image_blend_test on row 6, MacOS / Chrome 81.04.
..left = "0px"
..top = "0px"
..left = '0px'
..top = '0px'
..width = widthPx
..height = heightPx;
if (imageElement is! html.ImageElement) {
Expand Down Expand Up @@ -972,8 +973,8 @@ class BitmapCanvas extends EngineCanvas {
_children.add(paragraphElement);
// If there is a prior sibling such as img prevent left/top shift.
paragraphElement.style
..left = "0px"
..top = "0px";
..left = '0px'
..top = '0px';
_closeCurrentCanvas();
}

Expand All @@ -992,7 +993,7 @@ class BitmapCanvas extends EngineCanvas {
@override
void drawVertices(SurfaceVertices vertices, ui.BlendMode blendMode,
SurfacePaintData paint) {
// TODO(flutter_web): Implement shaders for [Paint.shader] and
// TODO(ferhat): Implement shaders for [Paint.shader] and
// blendMode. https://github.com/flutter/flutter/issues/40096
// Move rendering to OffscreenCanvas so that transform is preserved
// as well.
Expand Down Expand Up @@ -1132,7 +1133,7 @@ String? stringForBlendMode(ui.BlendMode? blendMode) {
return 'xor';
case ui.BlendMode.multiply:
// Falling back to multiply, ignoring alpha channel.
// TODO(flutter_web): only used for debug, find better fallback for web.
// TODO(ferhat): only used for debug, find better fallback for web.
case ui.BlendMode.modulate:
return 'multiply';
case ui.BlendMode.screen:
Expand Down Expand Up @@ -1281,7 +1282,7 @@ List<html.Element> _clipContent(List<SaveClipEntry> clipStack,
}
// Reverse the transform of the clipping element so children can use
// effective transform to render.
// TODO(flutter_web): When we have more than a single clip element,
// TODO(ferhat): When we have more than a single clip element,
// reduce number of div nodes by merging (multiplying transforms).
final html.Element reverseTransformDiv = html.DivElement();
reverseTransformDiv.style.position = 'absolute';
Expand Down
1 change: 1 addition & 0 deletions lib/web_ui/lib/src/engine/html/color_filter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class PersistedColorFilter extends PersistedContainerSurface
/// introduced by the [rootElement] translation.
html.Element? _childContainer;

/// Color filter to apply to this surface.
final ui.ColorFilter filter;
html.Element? _filterElement;
bool containerVisible = true;
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/html/dom_canvas.dart
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ void applyRRectBorderRadius(html.CssStyleDeclaration style, ui.RRect rrect) {

String _borderStrokeToCssUnit(double value) {
if (value == 0) {
// TODO: hairline nees to take into account both dpi and density.
// TODO(ferhat): hairline nees to take into account both dpi and density.
value = 1.0;
}
return '${value.toStringAsFixed(3)}px';
Expand Down
Loading