Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 2 additions & 4 deletions Libraries/LibWeb/HTML/HTMLInputElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1684,10 +1684,8 @@ void HTMLInputElement::form_associated_element_attribute_changed(Utf16FlyString
} else if (name == HTML::AttributeNames::size) {
// size feeds the element's default preferred width, which reaches layout only
// through the replaced-content facts; nothing else schedules a relayout.
if (old_value != value) {
if (auto* layout_node = this->layout_node())
layout_node->set_needs_layout_update(DOM::SetNeedsLayoutReason::DefaultPreferredSizeAttributeChange);
}
if (old_value != value)
set_needs_layout_update(DOM::SetNeedsLayoutReason::DefaultPreferredSizeAttributeChange);
}

// AD-HOC: A change to any of these attributes can change whether the element satisfies its constraints, and
Expand Down
6 changes: 2 additions & 4 deletions Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,8 @@ void HTMLTextAreaElement::form_associated_element_attribute_changed(Utf16FlyStri
} else if (first_is_one_of(name, HTML::AttributeNames::rows, HTML::AttributeNames::cols)) {
// rows and cols feed the element's default preferred size, which reaches layout
// only through the replaced-content facts; nothing else schedules a relayout.
if (old_value != value) {
if (auto* layout_node = this->layout_node())
layout_node->set_needs_layout_update(DOM::SetNeedsLayoutReason::DefaultPreferredSizeAttributeChange);
}
if (old_value != value)
set_needs_layout_update(DOM::SetNeedsLayoutReason::DefaultPreferredSizeAttributeChange);
}

// AD-HOC: A change to any of these attributes can change whether the element satisfies its constraints, and
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!DOCTYPE html>
<input id="input" type="text">
<script>
document.body.offsetHeight;
document.body.appendChild(document.createElement("div"));
input.size = 40;
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!DOCTYPE html>
<textarea id="textarea"></textarea>
<script>
document.body.offsetHeight;
document.body.appendChild(document.createElement("div"));
textarea.cols = 40;
</script>