Skip to content

Commit 4dbfca3

Browse files
committed
revert: revert UI command.
1 parent e2851df commit 4dbfca3

4 files changed

Lines changed: 10 additions & 36 deletions

File tree

webf/lib/src/bridge/to_native.dart

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -725,14 +725,6 @@ _NativeCommandData readNativeUICommandMemory(double contextId) {
725725
return _NativeCommandData(flag, commandLength, rawMemory);
726726
}
727727

728-
bool _isStartRecording(UICommand? command) {
729-
return command?.type == UICommandType.startRecordingCommand;
730-
}
731-
732-
// bool _isFinishedRecording(UICommand? command) {
733-
// return command?.type == UICommandType.finishRecordingCommand;
734-
// }
735-
736728
void flushUICommand(WebFViewController view, Pointer<NativeBindingObject> selfPointer, int reason) {
737729
assert(_allocatedPages.containsKey(view.contextId));
738730
if (view.disposed) return;
@@ -742,27 +734,7 @@ void flushUICommand(WebFViewController view, Pointer<NativeBindingObject> selfPo
742734
if (rawCommands.rawMemory.isNotEmpty) {
743735
commands = nativeUICommandToDart(rawCommands.rawMemory, rawCommands.length, view.contextId);
744736

745-
bool isBeginningRecording = _isStartRecording(commands.isEmpty ? null : commands.first);
737+
execUICommands(view, commands);
746738
SchedulerBinding.instance.scheduleFrame();
747-
// if (isBeginningRecording) {
748-
// assert(view.pendingUICommands.isEmpty());
749-
// }
750-
751-
// view.pendingUICommands.add(commands, rawCommands.flag);
752-
view.pendingUICommands.add(commands);
753739
}
754-
755-
// bool isFinishedRecording = commands != null ? _isFinishedRecording(commands.isEmpty ? null : commands.last) : false;
756-
757-
// if (shouldExecUICommands(view, isFinishedRecording, selfPointer, view.pendingUICommands.commandFlag, reason)) {
758-
// if (view.pendingUICommands.size() > 0) {
759-
// execUICommands(view, view.pendingUICommands);
760-
// view.pendingUICommands.clear();
761-
// }
762-
if (view.pendingUICommands.isNotEmpty) {
763-
execUICommands(view, view.pendingUICommands);
764-
view.pendingUICommands.clear();
765-
}
766-
767-
// }
768740
}

webf/lib/src/bridge/ui_command.dart

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,11 @@ UI COMMAND CONDITION CHECK:
141141
return isElementCreation || isElementMutation || isDependsOnElement || isDependsOnStyleLayout || isStyleUpdate;
142142
}
143143

144-
void execUICommands(WebFViewController view, List<List<UICommand>> commands) {
145-
print('BEGIN EXEC UI COMMAND >>>>>> .');
144+
void execUICommands(WebFViewController view, List<UICommand> commands) {
146145
Map<int, bool> pendingStylePropertiesTargets = {};
147146
Set<int> pendingRecalculateTargets = {};
148147

149-
// final iterable = UICommandIterable(commands);
150-
151-
for(UICommand? command in iterable) {
152-
if (command == null) continue;
153-
148+
for(UICommand command in commands) {
154149
UICommandType commandType = command.type;
155150

156151
if (enableWebFCommandLog) {
@@ -162,6 +157,9 @@ void execUICommands(WebFViewController view, List<List<UICommand>> commands) {
162157
case UICommandType.setAttribute:
163158
printMsg = 'nativePtr: ${command.nativePtr} type: ${command.type} key: ${nativeStringToString(command.nativePtr2.cast<NativeString>())} value: ${command.args}';
164159
break;
160+
case UICommandType.createTextNode:
161+
printMsg = 'nativePtr: ${command.nativePtr} type: ${command.type} data: ${command.args}';
162+
break;
165163
default:
166164
printMsg = 'nativePtr: ${command.nativePtr} type: ${command.type} args: ${command.args} nativePtr2: ${command.nativePtr2}';
167165
}

webf/lib/src/html/pseudo.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ class PseudoElement extends Element {
1818
final PseudoKind kind;
1919
final Element parent;
2020

21+
@override
22+
String tagName = 'Pseudo';
23+
2124
PseudoElement(this.kind, this.parent, [BindingContext? context]) : super(context);
2225

2326
@override

webf/lib/src/rendering/box_model.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Offset getLayoutTransformTo(RenderObject current, RenderObject ancestor, {bool e
4545
}
4646
renderers.add(ancestor);
4747
Offset offset = Offset.zero;
48+
final Matrix4 transform = Matrix4.identity();
4849

4950
for (int index = renderers.length - 1; index > 0; index -= 1) {
5051
RenderObject parentRenderer = renderers[index];

0 commit comments

Comments
 (0)