Commit 96df9b40 authored by Aleks Totic's avatar Aleks Totic Committed by Commit Bot

[Layout] Avoid double relayout on window resize

While investigating youtube button, I've noticed that
window resize was always causing double relayouts.

What happens is that on window resize we do one layout,
notice size has changed, and always force another layout.

I think SetNeedsLayout call is not needed, as
MarkViewportConstrainedObjectsForLayout will already
mark ancestors for layout if needed.

https://chromium-review.googlesource.com/c/chromium/src/+/1649086

Bug: 970171
Change-Id: I4b65486557a798ab00ca939baea93af3706bdccb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1649066Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Commit-Queue: Aleks Totic <atotic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667299}
parent 49b34f1e
...@@ -848,7 +848,6 @@ void LocalFrameView::UpdateLayout() { ...@@ -848,7 +848,6 @@ void LocalFrameView::UpdateLayout() {
IntSize new_size(Size()); IntSize new_size(Size());
if (old_size != new_size) { if (old_size != new_size) {
SetNeedsLayout();
MarkViewportConstrainedObjectsForLayout( MarkViewportConstrainedObjectsForLayout(
old_size.Width() != new_size.Width(), old_size.Width() != new_size.Width(),
old_size.Height() != new_size.Height()); old_size.Height() != new_size.Height());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment