diff --git a/bridge/third_party/quickjs/compat/win32/pthread-win32 b/bridge/third_party/quickjs/compat/win32/pthread-win32 new file mode 160000 index 0000000000..3309f4d6e7 --- /dev/null +++ b/bridge/third_party/quickjs/compat/win32/pthread-win32 @@ -0,0 +1 @@ +Subproject commit 3309f4d6e7538f349ae450347b02132ecb0606a7 diff --git a/bridge/third_party/quickjs/vendor/mimalloc b/bridge/third_party/quickjs/vendor/mimalloc index 43ce4bd7fd..db3d8485d2 160000 --- a/bridge/third_party/quickjs/vendor/mimalloc +++ b/bridge/third_party/quickjs/vendor/mimalloc @@ -1 +1 @@ -Subproject commit 43ce4bd7fd34bcc730c1c7471c99995597415488 +Subproject commit db3d8485d2f45a6f179d784f602f9eff4f60795c diff --git a/webf/example/assets/bundle.html b/webf/example/assets/bundle.html index 117d4470e3..6c4fa9fdc6 100644 --- a/webf/example/assets/bundle.html +++ b/webf/example/assets/bundle.html @@ -35,17 +35,20 @@ -
+ + 123123123123123 + +
11111
+
11111
+
11111
+
11111
+
11111
+
+ diff --git a/webf/example/ios/Runner.xcodeproj/project.pbxproj b/webf/example/ios/Runner.xcodeproj/project.pbxproj index bddae76e80..7ae8a7ab40 100644 --- a/webf/example/ios/Runner.xcodeproj/project.pbxproj +++ b/webf/example/ios/Runner.xcodeproj/project.pbxproj @@ -342,7 +342,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -429,7 +429,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -478,7 +478,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/webf/example/rust_builder/rust/Cargo.lock b/webf/example/rust_builder/rust/Cargo.lock new file mode 100644 index 0000000000..ffeca2a788 --- /dev/null +++ b/webf/example/rust_builder/rust/Cargo.lock @@ -0,0 +1,187 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "example_app" +version = "0.1.0" +dependencies = [ + "webf-sys", +] + +[[package]] +name = "libc" +version = "0.2.162" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" + +[[package]] +name = "proc-macro2" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "syn" +version = "2.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "webf-sys" +version = "0.16.0" +dependencies = [ + "libc", + "windows", +] + +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core", + "windows-targets", +] + +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-strings", + "windows-targets", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/webf/ios/Frameworks/quickjs.xcframework b/webf/ios/Frameworks/quickjs.xcframework index 91a82aa39b..551432f329 120000 --- a/webf/ios/Frameworks/quickjs.xcframework +++ b/webf/ios/Frameworks/quickjs.xcframework @@ -1 +1 @@ -../../../bridge/build/ios/framework/quickjs.xcframework \ No newline at end of file +/Users/user/Desktop/Binance/webf-2/webf/ios/Frameworks/../../../bridge/build/ios/framework/quickjs.xcframework \ No newline at end of file diff --git a/webf/ios/Frameworks/webf_bridge.xcframework b/webf/ios/Frameworks/webf_bridge.xcframework index da0bd96f47..f7f37667b0 120000 --- a/webf/ios/Frameworks/webf_bridge.xcframework +++ b/webf/ios/Frameworks/webf_bridge.xcframework @@ -1 +1 @@ -../../../bridge/build/ios/framework/webf_bridge.xcframework \ No newline at end of file +/Users/user/Desktop/Binance/webf-2/webf/ios/Frameworks/../../../bridge/build/ios/framework/webf_bridge.xcframework \ No newline at end of file diff --git a/webf/lib/src/css/position.dart b/webf/lib/src/css/position.dart index a2e7ecfeef..ad2efdf5f8 100644 --- a/webf/lib/src/css/position.dart +++ b/webf/lib/src/css/position.dart @@ -106,7 +106,7 @@ mixin CSSPositionMixin on RenderStyle { void _markNeedsSort() { if (renderBoxModel?.parentData is RenderLayoutParentData) { - AbstractNode? parent = renderBoxModel!.parent; + RenderObject? parent = renderBoxModel!.parent; if (parent is RenderLayoutBox) { parent.markChildrenNeedsSort(); } @@ -122,7 +122,7 @@ mixin CSSPositionMixin on RenderStyle { if (renderBoxModel?.parentData is RenderLayoutParentData) { RenderStyle renderStyle = renderBoxModel!.renderStyle; if (force || renderStyle.position != DEFAULT_POSITION_TYPE) { - AbstractNode? parent = renderBoxModel!.parent; + RenderObject? parent = renderBoxModel!.parent; if (parent is RenderObject) { parent.markNeedsLayout(); } @@ -141,7 +141,7 @@ mixin CSSPositionMixin on RenderStyle { if (renderStyle.position != DEFAULT_POSITION_TYPE || parentRenderStyle?.effectiveDisplay == CSSDisplay.flex || parentRenderStyle?.effectiveDisplay == CSSDisplay.inlineFlex) { - AbstractNode? parent = renderBoxModel!.parent; + RenderObject? parent = renderBoxModel!.parent; if (parent is RenderObject) { parent.markNeedsPaint(); } diff --git a/webf/lib/src/css/positioned.dart b/webf/lib/src/css/positioned.dart index 9b776ac46c..de71db84c8 100644 --- a/webf/lib/src/css/positioned.dart +++ b/webf/lib/src/css/positioned.dart @@ -15,7 +15,7 @@ import 'package:webf/rendering.dart'; // We need to reset these offset to keep positioned elements render at their original position. // @NOTE: Attention that renderObjects in tree may not all subtype of RenderBoxModel, use `is` to identify. Offset? _getRenderPositionHolderScrollOffset(RenderPositionPlaceholder holder, RenderObject root) { - AbstractNode? current = holder.parent; + RenderObject? current = holder.parent; while (current != null && current != root) { if (current is RenderBoxModel) { if (current.clipX || current.clipY) { diff --git a/webf/lib/src/css/values/length.dart b/webf/lib/src/css/values/length.dart index 9e53cb6b0c..347aed1b4a 100644 --- a/webf/lib/src/css/values/length.dart +++ b/webf/lib/src/css/values/length.dart @@ -189,7 +189,7 @@ class CSSLengthValue { RenderBoxModel? renderBoxModel = renderStyle!.renderBoxModel; // Should access the renderStyle of renderBoxModel parent but not renderStyle parent // cause the element of renderStyle parent may not equal to containing block. - AbstractNode? containerRenderBox = renderBoxModel?.parent; + RenderObject? containerRenderBox = renderBoxModel?.parent; CSSRenderStyle? parentRenderStyle; while (containerRenderBox != null) { if (containerRenderBox is RenderBoxModel && (_isPercentageRelativeContainer(containerRenderBox))) { diff --git a/webf/lib/src/html/listview.dart b/webf/lib/src/html/listview.dart index 8a71c6cf29..0b9156db32 100644 --- a/webf/lib/src/html/listview.dart +++ b/webf/lib/src/html/listview.dart @@ -1,3 +1,4 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:webf/webf.dart'; @@ -25,8 +26,30 @@ class FlutterListViewElement extends WidgetElement { @override Widget build(BuildContext context, List children) { - return ListView( - children: children, + return ListView.builder( + itemBuilder: (BuildContext context, int index) { + return CupertinoContextMenu.builder( + actions: [ + CupertinoContextMenuAction( + child: Text('Action 1'), + onPressed: () { + Navigator.pop(context); + print('1111'); + }, + ), + CupertinoContextMenuAction( + child: Text('Action 2'), + onPressed: () { + Navigator.pop(context); + print('2222'); + }, + ), + ], + builder: (BuildContext context, Animation animation) { + return children[index]; + } + ); + }, padding: const EdgeInsets.all(0), controller: controller, physics: const AlwaysScrollableScrollPhysics(), diff --git a/webf/lib/src/rendering/box_model.dart b/webf/lib/src/rendering/box_model.dart index 717b54c9bd..504e6aa424 100644 --- a/webf/lib/src/rendering/box_model.dart +++ b/webf/lib/src/rendering/box_model.dart @@ -832,7 +832,7 @@ class RenderBoxModel extends RenderBox // child has percentage length and parent's size can not be calculated by style // thus parent needs relayout for its child calculate percentage length. void markParentNeedsRelayout() { - AbstractNode? parent = this.parent; + RenderObject? parent = this.parent; if (parent is RenderBoxModel) { parent.needsRelayout = true; } @@ -865,7 +865,7 @@ class RenderBoxModel extends RenderBox /// Mark children needs layout when drop child as Flutter did /// @override - void dropChild(RenderBox child) { + void dropChild(RenderObject child) { super.dropChild(child); // Loop to mark all the children to needsLayout as flutter did _syncChildNeedsLayoutFlag(child); @@ -1098,7 +1098,7 @@ class RenderBoxModel extends RenderBox /// Find scroll container RenderBoxModel? findScrollContainer() { RenderBoxModel? scrollContainer; - AbstractNode? parent = this.parent; + RenderObject? parent = this.parent; while (parent != null && parent is RenderLayoutBox) { if (parent.isScrollingContentBox && parent.parent is RenderLayoutBox) { @@ -1453,7 +1453,7 @@ class RenderBoxModel extends RenderBox Offset getTotalScrollOffset() { double top = scrollTop; double left = scrollLeft; - AbstractNode? parentNode = parent; + RenderObject? parentNode = parent; while (parentNode is RenderBoxModel) { top += parentNode.scrollTop; left += parentNode.scrollLeft; diff --git a/webf/lib/src/rendering/event.dart b/webf/lib/src/rendering/event.dart index f726dd6edd..8402694af5 100644 --- a/webf/lib/src/rendering/event.dart +++ b/webf/lib/src/rendering/event.dart @@ -15,7 +15,7 @@ mixin RenderEventListenerMixin on RenderBox { HandleGetEventTarget? getEventTarget; GestureDispatcher? get gestureDispatcher { - AbstractNode? p = parent; + RenderObject? p = parent; while(p != null) { if (p is RenderViewportBox) { return p.gestureDispatcher; diff --git a/webf/lib/src/rendering/paragraph.dart b/webf/lib/src/rendering/paragraph.dart index 459d9afd38..549bf658b7 100644 --- a/webf/lib/src/rendering/paragraph.dart +++ b/webf/lib/src/rendering/paragraph.dart @@ -9,6 +9,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; import 'package:webf/css.dart'; + const String _kEllipsis = '\u2026'; /// Forked from Flutter RenderParagraph @@ -18,8 +19,8 @@ const String _kEllipsis = '\u2026'; /// W3C line-height spec: https://www.w3.org/TR/css-inline-3/#inline-height class WebFRenderParagraph extends RenderBox with - ContainerRenderObjectMixin, - RenderBoxContainerDefaultsMixin, + ContainerRenderObjectMixin>, + RenderBoxContainerDefaultsMixin>, RelayoutWhenSystemFontsChangeMixin { /// Creates a paragraph render object. /// @@ -255,22 +256,22 @@ class WebFRenderParagraph extends RenderBox bool hitTestChildren(BoxHitTestResult result, {Offset? position}) { RenderBox? child = firstChild; while (child != null) { - final TextParentData textParentData = child.parentData as TextParentData; + final ContainerBoxParentData textParentData = child.parentData as ContainerBoxParentData; final Matrix4 transform = Matrix4.translationValues( textParentData.offset.dx, textParentData.offset.dy, 0.0, )..scale( - textParentData.scale, - textParentData.scale, - textParentData.scale, + 1, + 1, + 1, ); final bool isHit = result.addWithPaintTransform( transform: transform, position: position!, hitTest: (BoxHitTestResult result, Offset transformed) { assert(() { - final Offset manualPosition = (position - textParentData.offset) / textParentData.scale!; + final Offset manualPosition = (position - textParentData.offset) / 1; return (transformed.dx - manualPosition.dx).abs() < precisionErrorTolerance && (transformed.dy - manualPosition.dy).abs() < precisionErrorTolerance; }());