Width isn't recomputed when text content changes
Reported by
sergen....@gmail.com,
Jan 16 2017
|
||||||
Issue descriptionUserAgent: 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
,
Jan 17 2017
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.
,
Jan 17 2017
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
,
Jan 17 2017
,
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.
,
Jan 18 2017
Yep, that's it.
,
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
,
Jan 18 2017
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by ajha@chromium.org
, Jan 17 2017