Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/blitz-dom/src/stylo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,14 @@ impl<'a> TElement for BlitzNode<'a> {
if let Some(width) = parse_size_attr(value, |v| !is_table || *v != 0.0) {
use style::values::generics::{NonNegative, length::Size};

push_style(PropertyDeclaration::Width(Size::LengthPercentage(
NonNegative(width),
)));
}
} else if *name == local_name!("width") {
if let Some(width) = parse_size_attr(value, |_| true) {
use style::values::generics::{NonNegative, length::Size};

push_style(PropertyDeclaration::Width(Size::LengthPercentage(
Comment on lines +915 to 923
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is duplicating the block above it! We should definitely dedupe. We should also consider following the linked spec https://html.spec.whatwg.org/multipage/rendering.html#dimRendering

NonNegative(width),
)));
Expand All @@ -926,6 +934,14 @@ impl<'a> TElement for BlitzNode<'a> {
{
if let Some(height) = parse_size_attr(value, |_| true) {
use style::values::generics::{NonNegative, length::Size};
push_style(PropertyDeclaration::Height(Size::LengthPercentage(
NonNegative(height),
)));
}
} else if *name == local_name!("height") {
if let Some(height) = parse_size_attr(value, |_| true) {
use style::values::generics::{NonNegative, length::Size};

push_style(PropertyDeclaration::Height(Size::LengthPercentage(
NonNegative(height),
)));
Expand Down
Loading