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: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ahmad.saleem792, 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

2843035794
Reported 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
Attachments
the two file only change white-space :pre (955 bytes, application/x-zip-compressed)
2022-06-29 03:15 PDT, 2843035794
no flags
Test reduction (270 bytes, text/html)
2022-07-01 07:50 PDT, zalan
no flags
2843035794
Comment 1 2022-06-29 03:15:44 PDT
Created attachment 460537 [details] the two file only change white-space :pre
zalan
Comment 2 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.
zalan
Comment 3 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.
zalan
Comment 4 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.
zalan
Comment 5 2022-07-01 09:11:39 PDT
This looks like a RenderTreeUpdater::updateRenderTree() issue -> Antti.
Radar WebKit Bug Importer
Comment 6 2022-07-01 09:11:59 PDT
Ahmad Saleem
Comment 7 2024-08-13 04:29:53 PDT
@Alan - it seems to work in Safari 18 Beta and STP200 while still broken in Safari 17.6. I am marking this as 'RESOLVED CONFIGURATION CHANGED'.
Note You need to log in before you can comment on or make changes to this bug.