Bug 51620 - white-space:pre does not work on contenteditable elements
Summary: white-space:pre does not work on contenteditable elements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2010-12-26 09:56 PST by Nico Weber
Modified: 2023-08-17 06:13 PDT (History)
6 users (show)

See Also:


Attachments
repro case (615 bytes, text/html)
2010-12-26 09:56 PST, Nico Weber
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Weber 2010-12-26 09:56:17 PST
Created attachment 77460 [details]
repro case

white-space:pre should not add any line breaks. This works fine with normal elements, but breaks when an element becomes contenteditable. See the attached repo case.

Expected: Both elements in the repo case look the same.
Actual: The contents of the contenteditable div get wrapped.

Works fine in Ff3.6 and Ff4 beta.
Comment 1 Patrick Gillespie 2012-05-19 15:23:20 PDT
Ran into this same issue. Firefox and IE behave differently than Safari and Chrome. Created another test case page:

http://patorjk.com/browser-issues/contentedibable-pre.htm
Comment 2 Ryosuke Niwa 2012-05-19 20:37:25 PDT
I suppose this is caused by applyEditingStyleToElement:
http://trac.webkit.org/browser/trunk/Source/WebCore/editing/Editor.cpp?rev=117590#L2695
Comment 3 holytrousers 2018-01-18 08:44:53 PST
this problems seems to be fixed in chromium but it is still present in webkit2gtk. Seems quite impotant to me as it also affects text-areas
Comment 4 Nico Weber 2023-08-17 06:12:38 PDT
Looks like this got fixed at some point.
Comment 5 Radar WebKit Bug Importer 2023-08-17 06:13:14 PDT
<rdar://problem/114023429>