New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 681657 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
NOT IN USE
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Width isn't recomputed when text content changes

Reported by sergen....@gmail.com, Jan 16 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.91 YaBrowser/17.1.1.264 (beta) Yowser/2.5 Safari/537.36

Steps to reproduce the problem:
1. Open attached file
2. Wait 1500ms.
3. Observe that all texts is clipped with ellipsis.
4. Wait 1500ms.
5. Observe that second text changes its width according to content.

What is the expected behavior?
All elements should change its width according to content.

What went wrong?
The container does not change the width independently.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 55.0.2883.91  Channel: n/a
OS Version: 10.0
Flash Version: Shockwave Flash 24.0 r0
 
issue_chrome_width.html
758 bytes View Download

Comment 1 by ajha@chromium.org, Jan 17 2017

Labels: Needs-Triage-M55

Comment 2 by rbyers@chromium.org, Jan 17 2017

Components: Blink>Layout
Status: Untriaged (was: Unconfirmed)
Summary: text-overflow:ellipses elides text unnecessarily/unreliably (was: Width is not recalculated after content change)
There's definitely something weird going on here.  Chrome appears to be doing the elision when there's no obvious reason to (width is 100% - so should be no overflow, right?).  Safari, Firefox and Edge don't elide at all, which I think is the correct behavior.

Comment 3 by rbyers@chromium.org, Jan 17 2017

Labels: -OS-Windows OS-All
Summary: Width isn't recomputed when text content changes (was: text-overflow:ellipses elides text unnecessarily/unreliably)
Oh sorry I understand the original summary now - indeed it's not just the elision but the element's width is not being updated when the text content changes.
Reproduced on Chrome 56.0.2924.58 on ChromeOS and Chrome 57.0.2973.0 on Windows

Comment 4 by e...@chromium.org, Jan 17 2017

Cc: cbiesin...@chromium.org msten...@opera.com kojii@chromium.org
Labels: -Pri-2 Pri-3
Status: Available (was: Untriaged)

Comment 5 by msten...@opera.com, Jan 18 2017

Suspecting objectIsRelayoutBoundary() in LayoutObject.cpp and that it returns true for the overflow:hidden object, so that we don't re-layout its parent when its child changes width. But I haven't verified this yet.

In the attached test, if you resize the window, the square appears.
tc.html
361 bytes View Download

Comment 6 by msten...@opera.com, Jan 18 2017

Owner: msten...@opera.com
Status: Assigned (was: Available)
Yep, that's it.
Project Member

Comment 7 by bugdroid1@chromium.org, Jan 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/da179e152dff0ab3e3dabc72299bd4fb586881c9

commit da179e152dff0ab3e3dabc72299bd4fb586881c9
Author: mstensho <mstensho@opera.com>
Date: Wed Jan 18 20:40:07 2017

Percent-width blocks cannot form a re-layout boundary.

A block with non-visible overflow can only form a re-layout boundary if both
width and height are fixed.

The block may be inside a shrink-to-fit container (there's no cheap and
reliable way to detect that), so that changes inside it may affect its width.

BUG= 681657 

Review-Url: https://codereview.chromium.org/2643703002
Cr-Commit-Position: refs/heads/master@{#444467}

[add] https://crrev.com/da179e152dff0ab3e3dabc72299bd4fb586881c9/third_party/WebKit/LayoutTests/fast/css-intrinsic-dimensions/resize-inside-percent-width-overflow-hidden.html
[modify] https://crrev.com/da179e152dff0ab3e3dabc72299bd4fb586881c9/third_party/WebKit/Source/core/layout/LayoutObject.cpp

Comment 8 by msten...@opera.com, Jan 18 2017

Status: Fixed (was: Assigned)

Sign in to add a comment