Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit a9c358c

Browse files
committed
more web fixes
1 parent 5ddd80b commit a9c358c

File tree

4 files changed

+5
-19
lines changed

4 files changed

+5
-19
lines changed

lib/web_ui/lib/src/engine/canvas_pool.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,13 +1011,10 @@ class ContextStateHandle {
10111011
context.translate(shaderBounds!.left, shaderBounds.top);
10121012
}
10131013
}
1014-
} else if (paint.color != null) {
1014+
} else {
10151015
final String? colorString = colorValueToCssString(paint.color);
10161016
fillStyle = colorString;
10171017
strokeStyle = colorString;
1018-
} else {
1019-
fillStyle = '#000000';
1020-
strokeStyle = '#000000';
10211018
}
10221019

10231020
final ui.MaskFilter? maskFilter = paint.maskFilter;

lib/web_ui/lib/src/engine/html/dom_canvas.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ DomHTMLElement buildDrawRectElement(
257257
..transformOrigin = '0 0 0'
258258
..transform = effectiveTransform;
259259

260-
String cssColor =
261-
paint.color == null ? '#000000' : colorValueToCssString(paint.color)!;
260+
String cssColor = colorValueToCssString(paint.color)!;
262261

263262
if (paint.maskFilter != null) {
264263
final double sigma = paint.maskFilter!.webOnlySigma;
@@ -352,10 +351,8 @@ SVGSVGElement pathToSvgElement(SurfacePath path, SurfacePaintData paint) {
352351
svgPath.setAttribute('stroke-linecap', '${stringForStrokeCap(paint.strokeCap)}');
353352
}
354353
svgPath.setAttribute('fill', 'none');
355-
} else if (paint.color != null) {
356-
svgPath.setAttribute('fill', colorValueToCssString(paint.color)!);
357354
} else {
358-
svgPath.setAttribute('fill', '#000000');
355+
svgPath.setAttribute('fill', colorValueToCssString(paint.color)!);
359356
}
360357
if (path.fillType == ui.PathFillType.evenOdd) {
361358
svgPath.setAttribute('fill-rule', 'evenodd');

lib/web_ui/lib/src/engine/html/painting.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,7 @@ class SurfacePaintData {
268268
if (strokeJoin != null) {
269269
buffer.write('strokeJoin = $strokeJoin; ');
270270
}
271-
if (color != null) {
272-
buffer.write('color = ${colorToCssString(ui.Color(color))}; ');
273-
}
271+
buffer.write('color = ${colorToCssString(ui.Color(color))}; ');
274272
if (shader != null) {
275273
buffer.write('shader = $shader; ');
276274
}

lib/web_ui/lib/src/engine/semantics/semantics.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,6 @@ class SemanticsObject {
868868
void updateSelf(SemanticsNodeUpdate update) {
869869
// Update all field values and their corresponding dirty flags before
870870
// applying the updates to the DOM.
871-
assert(update.flags != null);
872871
if (_flags != update.flags) {
873872
_flags = update.flags;
874873
_markFlagsDirty();
@@ -1613,12 +1612,7 @@ class EngineSemanticsOwner {
16131612
/// the Web Engine.
16141613
///
16151614
/// The default mode is [AccessibilityMode.unknown].
1616-
AccessibilityMode get mode => _mode;
1617-
set mode(AccessibilityMode value) {
1618-
_mode = value;
1619-
}
1620-
1621-
AccessibilityMode _mode = AccessibilityMode.unknown;
1615+
AccessibilityMode mode = AccessibilityMode.unknown;
16221616

16231617
/// Currently used [GestureMode].
16241618
///

0 commit comments

Comments
 (0)