Skip to content

Commit edc5df2

Browse files
committed
WIP: Add CSSBoxWidget to clean up box rendering
1 parent e427ed8 commit edc5df2

File tree

10 files changed

+688
-53
lines changed

10 files changed

+688
-53
lines changed

lib/html_parser.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -893,16 +893,18 @@ class ContainerSpan extends StatelessWidget {
893893
@override
894894
Widget build(BuildContext context) {
895895

896+
final bool isReplaced = REPLACED_EXTERNAL_ELEMENTS.contains(renderContext.tree.name);
897+
896898
//Calculate auto widths and margins:
897-
final widthsAndMargins = WidthAndMargins.calculate(style, containingBlockSize, context);
899+
final widthsAndMargins = WidthAndMargins.calculate(style, containingBlockSize, isReplaced, context);
898900

899901
Widget container = Container(
900902
decoration: BoxDecoration(
901903
border: style.border,
902904
color: style.backgroundColor,
903905
),
904-
height: style.height,
905-
width: style.width, //widthsAndMargins.width,
906+
height: style.height?.value, //TODO
907+
width: widthsAndMargins.width,
906908
padding: style.padding?.nonNegative,
907909
margin: widthsAndMargins.margins,
908910
alignment: shrinkWrap ? null : style.alignment,
@@ -917,7 +919,9 @@ class ContainerSpan extends StatelessWidget {
917919
),
918920
);
919921

920-
return container;
922+
return LayoutBuilder(builder: (context, constraints) {
923+
return container;
924+
});
921925
}
922926
}
923927

0 commit comments

Comments
 (0)