Skip to content

Commit

Permalink
Correct typos throughout the engine/embedder (flutter#25346)
Browse files Browse the repository at this point in the history
Used the the `misspell` tool available at
https://github.com/client9/misspell, then applied hand-corrections. It's
possible we could adopt this as a presubmit, but there are still enough
false positives that it may not be worth the effort.
  • Loading branch information
cbracken authored Apr 1, 2021
1 parent 1eaef55 commit 6b5f5c3
Show file tree
Hide file tree
Showing 102 changed files with 151 additions and 150 deletions.
2 changes: 1 addition & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ config("config") {
# This define is transitional and will be removed after the embedder API
# transition is complete.
#
# TODO(bugs.fuchsia.dev/54041): Remove when no longer neccesary.
# TODO(bugs.fuchsia.dev/54041): Remove when no longer necessary.
if (is_fuchsia && flutter_enable_legacy_fuchsia_embedder) {
defines = [ "LEGACY_FUCHSIA_EMBEDDER" ]
}
Expand Down
2 changes: 1 addition & 1 deletion assets/asset_resolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AssetResolver {
/// run configuration, the tooling can avoid needing to sync all
/// application assets through the Dart devFS upon connecting to
/// the VM Service. Besides improving the startup performance of
/// running a Flutter application, it also reduces the occurance
/// running a Flutter application, it also reduces the occurrence
/// of tool failures due to repeated network flakes caused by
/// damaged cables or hereto unknown bugs in the Dart HTTP server
/// implementation.
Expand Down
4 changes: 2 additions & 2 deletions ci/bin/lint.dart
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ void main(List<String> arguments) async {
}

if (!options.wasParsed('compile-commands')) {
stderr.writeln('ERROR: The --compile-commands argument is requried.');
stderr.writeln('ERROR: The --compile-commands argument is required.');
_usage(parser);
}

if (!options.wasParsed('repo')) {
stderr.writeln('ERROR: The --repo argument is requried.');
stderr.writeln('ERROR: The --repo argument is required.');
_usage(parser);
}

Expand Down
2 changes: 1 addition & 1 deletion ci/licenses_golden/tool_signature
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Signature: 249aeecf2b9a309a2b26c2be6cd18b12
Signature: d63f7a9bbfe816cff5a335245a3bac58

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class MyHomePage extends StatefulWidget {
class _MyHomePageState extends State<MyHomePage> {
String infoText = 'no-enter';

// Controller with no inital value;
// Controller with no initial value;
final TextEditingController _emptyController = TextEditingController();

final TextEditingController _controller =
Expand Down
6 changes: 3 additions & 3 deletions flow/embedded_views.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class MutatorsStack {
const std::vector<std::shared_ptr<Mutator>>::const_reverse_iterator Bottom()
const;

// Returns an iterator pointing to the begining of the mutator vector, which
// Returns an iterator pointing to the beginning of the mutator vector, which
// is the mutator that is furtherest from the leaf node.
const std::vector<std::shared_ptr<Mutator>>::const_iterator Begin() const;

Expand Down Expand Up @@ -218,7 +218,7 @@ class EmbeddedViewParams {
final_bounding_rect_ = other.final_bounding_rect_;
};

// The trasnformation Matrix corresponding to the sum of all the
// The transformation Matrix corresponding to the sum of all the
// transformations in the platform view's mutator stack.
const SkMatrix& transformMatrix() const { return matrix_; };
// The original size of the platform view before any mutation matrix is
Expand Down Expand Up @@ -280,7 +280,7 @@ class ExternalViewEmbedder {
// sets the stage for the next pre-roll.
virtual void CancelFrame() = 0;

// Indicates the begining of a frame.
// Indicates the beginning of a frame.
//
// The `raster_thread_merger` will be null if |SupportsDynamicThreadMerging|
// returns false.
Expand Down
2 changes: 1 addition & 1 deletion flow/layers/container_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ContainerLayer : public Layer {
// 2. The context does not have a valid raster cache.
// 3. The layer's paint bounds does not intersect with the cull rect.
//
// We make this a static function instead of a member function that directy
// We make this a static function instead of a member function that directly
// uses the "this" pointer as the layer because we sometimes need to raster
// cache a child layer and one can't access its child's protected method.
static void TryToPrepareRasterCache(PrerollContext* context,
Expand Down
4 changes: 2 additions & 2 deletions flow/raster_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ class RasterCache {

// Find the raster cache for the layer and draw it to the canvas.
//
// Addional paint can be given to change how the raster cache is drawn (e.g.,
// draw the raster cache with some opacity).
// Additional paint can be given to change how the raster cache is drawn
// (e.g., draw the raster cache with some opacity).
//
// Return true if the layer raster cache is found and drawn.
bool Draw(const Layer* layer,
Expand Down
2 changes: 1 addition & 1 deletion flow/scene_update_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ SceneUpdateContext::Frame::Frame(std::shared_ptr<SceneUpdateContext> context,
paint_bounds_(SkRect::MakeEmpty()) {
// Increment elevation trackers before calculating any local elevation.
// |UpdateView| can modify context->next_elevation_, which is why it is
// neccesary to track this addtional state.
// necessary to track this additional state.
context->top_elevation_ += kScenicZElevationBetweenLayers;
context->next_elevation_ += kScenicZElevationBetweenLayers;

Expand Down
2 changes: 1 addition & 1 deletion lib/ui/key.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class KeyData {
///
/// For example, some key downs or ups might be lost when the window loses
/// focus. Some platforms provides ways to query whether a key is being held.
/// If the embedder detects an inconsistancy between its internal record and
/// If the embedder detects an inconsistency between its internal record and
/// the state returned by the system, the embedder will synthesize a
/// corresponding event to synchronize the state without breaking the event
/// model.
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/painting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1611,7 +1611,7 @@ enum PixelFormat {
///
/// A class or method that receives an image object must call [dispose] on the
/// handle when it is no longer needed. To create a shareable reference to the
/// underlying image, call [clone]. The method or object that recieves
/// underlying image, call [clone]. The method or object that receives
/// the new instance will then be responsible for disposing it, and the
/// underlying image itself will be disposed when all outstanding handles are
/// disposed.
Expand Down Expand Up @@ -1727,7 +1727,7 @@ class Image {
/// It is safe to pass an [Image] handle to another object or method if the
/// current holder no longer needs it.
///
/// To check whether two [Image] references are refering to the same
/// To check whether two [Image] references are referring to the same
/// underlying image memory, use [isCloneOf] rather than the equality operator
/// or [identical].
///
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/text/paragraph_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ParagraphBuilder : public RefCountedDartWrappable<ParagraphBuilder> {

Dart_Handle addText(const std::u16string& text);

// Pushes the information requried to leave an open space, where Flutter may
// Pushes the information required to leave an open space, where Flutter may
// draw a custom placeholder into.
//
// Internally, this method adds a single object replacement character (0xFFFC)
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ class SingletonFlutterWindow extends FlutterWindow {
///
/// {@macro dart.ui.window.accessorForwardWarning}
///
/// It's prefered to use [SchedulerBinding.addTimingsCallback] than to use
/// It's preferred to use [SchedulerBinding.addTimingsCallback] than to use
/// [SingletonFlutterWindow.onReportTimings] directly because
/// [SchedulerBinding.addTimingsCallback] allows multiple callbacks.
///
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/window/key_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ enum class KeyEventType : int64_t {
//
// This structure is unpacked by hooks.dart.
struct alignas(8) KeyData {
// Timestamp in microseconds from an arbitrary and consistant start point
// Timestamp in microseconds from an arbitrary and consistent start point
uint64_t timestamp;
KeyEventType type;
uint64_t physical;
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ the new revision.

If you are making changes in the `felt` tool itself, you need to be aware of Dart snapshots. We create a Dart snapshot of the `felt` tool to make the startup faster.

To make sure you are running the `felt` tool with your changes included, you would need to stop using the snapshot. This can be achived through the environment variable `FELT_USE_SNAPSHOT`:
To make sure you are running the `felt` tool with your changes included, you would need to stop using the snapshot. This can be achieved through the environment variable `FELT_USE_SNAPSHOT`:

```
FELT_USE_SNAPSHOT=false felt <command>
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/dev/felt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fi

if [[ "$FELT_USE_SNAPSHOT" == "false" || "$FELT_USE_SNAPSHOT" == "0" ]]; then
echo "[Snapshot mode: off]"
# Running without snapshot means there is high likelyhood of local changes. In
# Running without snapshot means there is high likelihood of local changes. In
# that case, let's clear the snapshot to avoid any surprises.
rm -f "$SNAPSHOT_PATH"
rm -f "$STAMP_PATH"
Expand Down
6 changes: 3 additions & 3 deletions lib/web_ui/dev/integration_tests_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,17 @@ class IntegrationTestsManager {
{String mode = 'profile', String webRenderer = 'html'}) async {
String executable =
_useSystemFlutter ? 'flutter' : environment.flutterCommand.path;
Map<String, String> enviroment = Map<String, String>();
Map<String, String> flutterEnvironment = Map<String, String>();
if (_doUpdateScreenshotGoldens) {
enviroment['UPDATE_GOLDENS'] = 'true';
flutterEnvironment['UPDATE_GOLDENS'] = 'true';
}
final IntegrationArguments arguments =
IntegrationArguments.fromBrowser(_browser);
final int exitCode = await runProcess(
executable,
arguments.getTestArguments(testName, mode, webRenderer),
workingDirectory: directory.path,
environment: enviroment,
environment: flutterEnvironment,
);

if (exitCode != 0) {
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/dev/safari.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Safari extends Browser {
// TODO(nurhan): https://github.com/flutter/flutter/issues/50809
var process = await Process.start(installation.executable, [
// These are flags for `open` command line tool.
'-F', // Open a fresh Safari with no persistant state.
'-F', // Open a fresh Safari with no persistent state.
'-W', // Wait until the Safari opens.
'-n', // Open a new instance of the Safari even another one is open.
'-b', // Specifies the bundle identifier for the application to use.
Expand Down
6 changes: 3 additions & 3 deletions lib/web_ui/dev/safari_installation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class IosSafariArgParser extends BrowserArgParser {
? _iosSimulator
: throw StateError('iosSimulator not started. Please first call '
'initIOSSimulator method'))
: throw StateError('iOS Simulator is only avaliable on macOS machines.');
: throw StateError('iOS Simulator is only available on macOS machines.');

IosSimulator _iosSimulator;

Expand Down Expand Up @@ -139,7 +139,7 @@ class IosSafariArgParser extends BrowserArgParser {
..addOption('device',
defaultsTo: '$_pinnedIosDevice',
help: 'The device to be used for the iOS Simulator during the tests. '
'Use `.` instead of space for seperating the words. '
'Use `.` instead of space for separating the words. '
'Common examples: iPhone.8, iPhone.8.Plus, iPhone.11, '
'iPhone 11 Pro. Use command: '
'`xcrun simctl list devices` for listing the available '
Expand All @@ -150,7 +150,7 @@ class IosSafariArgParser extends BrowserArgParser {
@override
void parseOptions(ArgResults argResults) {
final String iosVersion = argResults['version'] as String;
// The version will contain major and minor version seperated by a comma,
// The version will contain major and minor version separated by a comma,
// for example: 13.1, 12.2
assert(iosVersion.split('.').length == 2,
'The version should be in format 13.5');
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/dev/test_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ class BrowserManager {

// For the cases where we use a delegator such as `adb` (for Android) or
// `xcrun` (for IOS), these delegator processes can shut down before the
// websocket is available. Therefore do not throw an error if proccess
// websocket is available. Therefore do not throw an error if process
// exits with exitCode 0. Note that `browser` will throw and error if the
// exit code was not 0, which will be processed by the next callback.
browser.onExit.catchError((dynamic error, StackTrace stackTrace) {
Expand Down
4 changes: 2 additions & 2 deletions lib/web_ui/dev/test_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ class TestCommand extends Command<bool> with ArgUtils {
bool get isChromeIntegrationTestAvailable =>
(isChrome && isLuci && io.Platform.isLinux) || (isChrome && !isLuci);

/// Due to efficiancy constraints, Firefox integration tests only run on
/// Due to efficiency constraints, Firefox integration tests only run on
/// Linux on LUCI.
///
/// For now Firefox integration tests only run on Linux and Mac on local.
Expand Down Expand Up @@ -541,7 +541,7 @@ class TestCommand extends Command<bool> with ArgUtils {
/// Runs all tests specified in [targets].
///
/// Unlike [_runAllTestsForCurrentPlatform], this does not filter targets
/// by platform/browser capabilites, and instead attempts to run all of
/// by platform/browser capabilities, and instead attempts to run all of
/// them.
Future<void> _runSpecificTests(List<FilePath> targets) async {
await _runTestBatch(targets, concurrency: 1, expectFailure: false);
Expand Down
4 changes: 2 additions & 2 deletions lib/web_ui/lib/src/engine/bitmap_canvas.dart
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ class BitmapCanvas extends EngineCanvas {
// code path that sets the size of the element and clips.
//
// If there is a color filter set however, we maybe using background-image
// to render therefore we have to explicitely set width/height of the
// to render therefore we have to explicitly set width/height of the
// element for blending to work with background-color.
if (dst.width == image.width &&
dst.height == image.height &&
Expand Down Expand Up @@ -750,7 +750,7 @@ class BitmapCanvas extends EngineCanvas {
final String heightPx = '${targetHeight.toStringAsFixed(2)}px';
imageStyle
// left,top are set to 0 (although position is absolute) because
// Chrome will glitch if you leave them out, reproducable with
// 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"
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 @@ -433,7 +433,7 @@ class CkParagraph extends ManagedSkiaObject<SkParagraph>
/// is deleted.
final List<_ParagraphCommand> _paragraphCommands;

/// The constraints from the last time we layed the paragraph out.
/// The constraints from the last time we laid the paragraph out.
///
/// This is used to resurrect the paragraph if the initial paragraph
/// is deleted.
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 @@ -79,7 +79,7 @@ class DomRenderer {
html.Element? get sceneElement => _sceneElement;
html.Element? _sceneElement;

/// This is state persistant across hot restarts that indicates what
/// This is state persistent across hot restarts that indicates what
/// to clear. We delay removal of old visible state to make the
/// transition appear smooth.
static const String _staleHotRestartStore = '__flutter_state';
Expand Down
4 changes: 2 additions & 2 deletions lib/web_ui/lib/src/engine/html/path/path.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ part of engine;
/// self-intersect.
///
/// Stores the verbs and points as they are given to us, with exceptions:
/// - we only record "Close" if it was immediately preceeded by Move | Line | Quad | Cubic
/// - we only record "Close" if it was immediately preceded by Move | Line | Quad | Cubic
/// - we insert a Move(0,0) if Line | Quad | Cubic is our first command
///
/// The iterator does more cleanup, especially if forceClose == true
/// 1. If we encounter degenerate segments, remove them
/// 2. if we encounter Close, return a cons'd up Line() first (if the curr-pt != start-pt)
/// 3. if we encounter Move without a preceeding Close, and forceClose is true, goto #2
/// 3. if we encounter Move without a preceding Close, and forceClose is true, goto #2
/// 4. if we encounter Line | Quad | Cubic after Close, cons up a Move
class SurfacePath implements ui.Path {
// Initial valid of last move to index so we can detect if a move to
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/html/path/path_ref.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class PathRef {
int get isRect => fIsRect ? fRRectOrOvalStartIdx : -1;
ui.RRect? getRRect() => fIsRRect ? _getRRect() : null;
ui.Rect? getRect() {
/// Use _detectRect() for detection if explicity addRect was used (fIsRect) or
/// Use _detectRect() for detection if explicitly addRect was used (fIsRect) or
/// it is a potential due to moveTo + 3 lineTo verbs.
if (fIsRect) {
return ui.Rect.fromLTRB(
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/semantics/semantics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ class EngineSemanticsOwner {

/// Declares that the [child] must be attached to the [parent].
///
/// Attachments take precendence over detachments (see [_detachObject]). This
/// Attachments take precedence over detachments (see [_detachObject]). This
/// allows the same node to be detached from one parent in the tree and
/// reattached to another parent.
void _attachObject({required SemanticsObject parent, required SemanticsObject child}) {
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/semantics/semantics_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ String placeholderMessage = 'Enable accessibility';
/// event which should be forwarded to the framework.
///
/// It does this by using a [SemanticsEnabler]. The [SemanticsEnabler]
/// implementation is choosen using form factor type.
/// implementation is chosen using form factor type.
///
/// See [DesktopSemanticsEnabler], [MobileSemanticsEnabler].
class SemanticsHelper {
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/text/layout_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ class LineBuilder {
// 3. `allowEmpty` is false.
if (breakingPoint == nextBreak.indexWithoutTrailingSpaces) {
// In this case, we just extend to `nextBreak` instead of creating a new
// artifical break. It's safe (and better) to do so, because we don't
// artificial break. It's safe (and better) to do so, because we don't
// want the trailing white space to go to the next line.
extendTo(nextBreak);
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/text/line_breaker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ LineBreakResult nextLineBreak(String text, int index, {int? maxEnd}) {
/// The index of the last character that wasn't a new line.
int lastNonNewlineIndex = index;

// When the text/line starts with SP, we should treat the begining of text/line
// When the text/line starts with SP, we should treat the beginning of text/line
// as if it were a WJ (word joiner).
if (curr == LineCharProperty.SP) {
baseOfSpaceSequence = LineCharProperty.WJ;
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/text_editing/input_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class NumberInputType extends EngineInputType {
/// Decimal input type.
///
/// Input keyboard with containing the digits 0–9 and a decimal separator.
/// Seperator can be `.`, `,` depending on the locale.
/// Separator can be `.`, `,` depending on the locale.
class DecimalInputType extends EngineInputType {
const DecimalInputType();

Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/text_editing/text_editing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class EngineAutofillForm {
ids.sort();
final StringBuffer idBuffer = StringBuffer();

// Add a seperator between element identifiers.
// Add a separator between element identifiers.
for (final String id in ids) {
if (idBuffer.length > 0) {
idBuffer.write('*');
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/ui/key.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class KeyData {
///
/// For example, some key downs or ups might be lost when the window loses
/// focus. Some platforms provides ways to query whether a key is being held.
/// If Flutter detects an inconsistancy between the state Flutter records and
/// If Flutter detects an inconsistency between the state Flutter records and
/// the state returned by the system, Flutter will synthesize a corresponding
/// event to synchronize the state without breaking the event model.
///
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/test/engine/history_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ void testMain() {
// TODO(nurhan): https://github.com/flutter/flutter/issues/50836
skip: browserEngine == BrowserEngine.edge);

test('browser back button push route infromation correctly', () async {
test('browser back button push route information correctly', () async {
final TestUrlStrategy strategy = TestUrlStrategy.fromEntry(
TestHistoryEntry('initial state', null, '/home'),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/test/text_editing_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ void testMain() {
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
skip: browserEngine == BrowserEngine.webkit);

test('input font set succesfully with null fontWeightIndex', () {
test('input font set successfully with null fontWeightIndex', () {
final MethodCall setClient = MethodCall(
'TextInput.setClient', <dynamic>[123, flutterSinglelineConfig]);
sendFrameworkMessage(codec.encodeMethodCall(setClient));
Expand Down
Loading

0 comments on commit 6b5f5c3

Please sign in to comment.