Bug 20288 - editable span with empty text gets optimized away
Summary: editable span with empty text gets optimized away
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 525.x (Safari 3.1)
Hardware: All Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-05 05:48 PDT by Bernhard Rosenkraenzer
Modified: 2008-08-13 11:10 PDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Rosenkraenzer 2008-08-05 05:48:28 PDT
In the following test case:

=================
<html>
<head><title>test</title></head>
<body>
<div contenteditable="true">
<span contenteditable="false">Enter some text:</span>
<span id="bug">        </span>
</div>
</body>
</html>
=================

The span with id "bug" should be editable - but there is no way to edit it because it gets optimized away.

Even trying to force it with document.getElementById('bug').focus(); doesn't trigger any edit action on the span.

Forcing the span to have non-zero width and height with CSS (<span id="bug" contenteditable="true" style="width: 10cm; height: 10cm;"></span>) doesn't change anything either.

Adding any non-whitespace text inside the span does help.
Comment 1 Glenn Wilson 2008-08-13 11:10:14 PDT
I would argue that this is not a bug.

Collapsing whitespace is the default behavior of CSS2.1 text, and typically what is expected.  You can specify style="white-space:pre;" and the space will be drawn and you can edit it...

Try this:

=================
<html>
<head><title>test</title></head>
<body>
<div contenteditable="true">
<span contenteditable="false">Enter some text:</span>
<span style="white-space:pre;" id="bug">        </span>
</div>
</body>
</html>
=================