Bug 242104

Summary: white-space value change is ignored when the content is whitespace only.
Product: WebKit Reporter: 2843035794
Component: CSSAssignee: Antti Koivisto <koivisto>
Status: NEW ---    
Severity: Normal CC: karlcow, koivisto, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: BrowserCompat, InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Linux   
Attachments:
Description Flags
the two file only change white-space :pre
none
Test reduction none

Description 2843035794 2022-06-29 03:14:34 PDT
Some grammar in webkit and chrome have different display .
When use white-space:pre and the label not have content.
Chrome and webkit have different display.
Then I see the https://developer.mozilla.org/en-US/docs/Web/CSS/white-space,I think might be save the white space.

WebKitGTK version is 2.36.3
Comment 1 2843035794 2022-06-29 03:15:44 PDT
Created attachment 460537 [details]
the two file only change white-space :pre
Comment 2 zalan 2022-07-01 07:50:08 PDT
Created attachment 460609 [details]
Test reduction

It looks like we ignore the white-space style change when the content is whitespace only.
Comment 3 zalan 2022-07-01 08:32:16 PDT
(In reply to 2843035794 from comment #0)
> Some grammar in webkit and chrome have different display .
> When use white-space:pre and the label not have content.
> Chrome and webkit have different display.
> Then I see the
> https://developer.mozilla.org/en-US/docs/Web/CSS/white-space,I think might
> be save the white space.
You are right, white-space handling has a bug in WebKit. Thank you for filing it.
Comment 4 zalan 2022-07-01 09:10:53 PDT
1. initially we don't create a renderer (RenderText) for the collapsed whitespace content
2. however when style changes to "yes, please preserve whitespace", we don't recover from it by constructing a RenderText object.
Comment 5 zalan 2022-07-01 09:11:39 PDT
This looks like a RenderTreeUpdater::updateRenderTree() issue -> Antti.
Comment 6 Radar WebKit Bug Importer 2022-07-01 09:11:59 PDT
<rdar://problem/96295935>