Bug 132188 - <textarea> with float:left disappears when editing text
Summary: <textarea> with float:left disappears when editing text
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.9
: P2 Normal
Assignee: zalan
URL: http://eris.bytecamp.net/textarea.html
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2014-04-25 04:17 PDT by Björn Barnekow
Modified: 2023-06-07 09:26 PDT (History)
16 users (show)

See Also:


Attachments
textarea test (1012 bytes, text/html)
2014-04-25 04:17 PDT, Björn Barnekow
no flags Details
screen recording on STP 171 (1.74 MB, video/quicktime)
2023-05-31 20:10 PDT, Karl Dubost
no flags Details
(non-textarea) test reduction (388 bytes, text/html)
2023-06-03 10:39 PDT, zalan
no flags Details
Patch (5.92 KB, patch)
2023-06-04 20:37 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (5.93 KB, patch)
2023-06-06 15:20 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Barnekow 2014-04-25 04:17:48 PDT
Created attachment 230163 [details]
textarea test

setup: textarea with float:left or float:right, some text, enough to scroll

action: delete some text

bug: <textarea> disappears completely, reappears undoing the text change
Comment 1 Michael Catanzaro 2017-02-27 10:30:58 PST
Nice....

I can reproduce only if I delete *all* of the text (Ctrl+A then Delete).
Comment 2 Ahmad Saleem 2023-05-31 14:57:33 PDT
Is it platform specific because I am not able to reproduce this bug in Safari 16.5 & STP171.

I think it might got fixed along the way and we can mark this as "RESOLVED CONFIGURATION CHANGED". Thanks!
Comment 3 Michael Catanzaro 2023-05-31 15:37:05 PDT
I can't reproduce anymore. Probably fixed at some point in the past several years.
Comment 4 Karl Dubost 2023-05-31 20:10:11 PDT
Created attachment 466559 [details]
screen recording on STP 171

It is vanishing on Safari Technical Preview 171
Comment 5 Radar WebKit Bug Importer 2023-05-31 20:10:59 PDT
<rdar://problem/110093535>
Comment 6 Michael Catanzaro 2023-06-01 07:14:54 PDT
Reopening
Comment 7 Ahmad Saleem 2023-06-01 09:44:44 PDT
OK, I did try it with Ctrl+A on whole text rather than paragraph.

@Karl - thanks a lot for video.
Comment 8 Ahmad Saleem 2023-06-01 09:56:53 PDT
Similar bug in Chrome: crbug.com/833602

Based on comment 04, it happens with non-textarea as well:

https://bugs.chromium.org/p/chromium/issues/detail?id=833602#c4

Tested with the above test case (from Chrome bug) as well and it is reproducible in Safari.
Comment 9 Ahmad Saleem 2023-06-01 10:08:16 PDT
CCing Alan - since Google / Blink fix was in Layout / Rendering area. We might have different bug but just wanted to get input from layout & rendering side.
Comment 10 zalan 2023-06-01 10:31:56 PDT
yeah, this looks like a repaint bug so that blink change may indeed be relevant. will take a look into it in a bit.
Comment 11 zalan 2023-06-03 10:39:51 PDT
Created attachment 466577 [details]
(non-textarea) test reduction

This bug is not specific to textarea. Floats going from self-painting to non-self-painting have this bug when they are also considered layout boundaries.
Comment 12 zalan 2023-06-03 10:49:29 PDT
when a self-paining float becomes non-self painting, its containing block starts taking care of it painting. Containing block consults the floating object's shouldPaint() to check if it is supposed to initiate the paint of the float box (this is at paint time)
shouldPaint() relies on an up-to-date value of m_paintsFloat.
m_paintsFloat gets updated at _layout_ time (see RenderBlockFlow::addIntrudingFloats).
However when the layout's entry point is the float (and then the float becomes non-self-painting) its containing block never gets the chance to update the m_paintsFloat bit since layout flow never reaches said containing block.
Comment 13 zalan 2023-06-04 20:37:05 PDT
Created attachment 466589 [details]
Patch
Comment 14 Simon Fraser (smfr) 2023-06-06 12:57:08 PDT
Comment on attachment 466589 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=466589&action=review

> COMMIT_MESSAGE:16
> +4. However self-paining float boxes always paint themselves (this is not specific to floats, all renderers behave like this).

"self-paining"

> Source/WebCore/rendering/RenderBox.cpp:5722
> +void RenderBox::updateFloatBoxAfterSelfPaintingLayerChange()

"update float box" makes it sound like this is changing the float box itself. Maybe "updateFloatPainter..."?
Comment 15 zalan 2023-06-06 15:20:53 PDT
Created attachment 466608 [details]
Patch
Comment 16 EWS 2023-06-07 09:26:13 PDT
Committed 264943@main (df850bbc342e): <https://commits.webkit.org/264943@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 466608 [details].