Bug 17830 - innerText returns incorrectly capitalized text with text-transform: uppercase
: innerText returns incorrectly capitalized text with text-transform: uppercase
Status: NEW
Product: WebKit
Classification: Unclassified
Component: HTML DOM
: 523.x (Safari 3)
: Macintosh OS X 10.5
: P2 Normal
Assigned To: Nobody
: HasReduction
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-13 11:19 PDT by Mark Ambachtsheer
Modified: 2013-03-31 12:22 PDT (History)
3 users (show)

See Also:


Attachments
test HTML file that reproduces the erroneous behavior (656 bytes, text/html)
2008-03-13 11:20 PDT, Mark Ambachtsheer
no flags Details
screenshot of Safari 3.0.4 rendering the test HTML file. (37.27 KB, application/octet-stream)
2008-03-13 11:24 PDT, Mark Ambachtsheer
no flags Details
screenshot of Internet Explorer 7 rendering the HTML test file. (19.74 KB, application/octet-stream)
2008-03-13 11:27 PDT, Mark Ambachtsheer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Ambachtsheer 2008-03-13 11:19:03 PDT
When innerText is used to retrieve the text content of an element, and that text has the CSS style 'text-transform: uppercase' on it, innerText returns capitalized plain text.
Comment 1 Mark Ambachtsheer 2008-03-13 11:20:31 PDT
Created attachment 19733 [details]
test HTML file that reproduces the erroneous behavior
Comment 2 Mark Ambachtsheer 2008-03-13 11:24:56 PDT
Created attachment 19734 [details]
screenshot of Safari 3.0.4 rendering the test HTML file.

WebKit nightly r30966 looks exactly the same.
Comment 3 Mark Ambachtsheer 2008-03-13 11:27:19 PDT
Created attachment 19736 [details]
screenshot of Internet Explorer 7 rendering the HTML test file.

Shows Internet Explorer rendering the test file. 'innerText' is not part of any standard, but it is supported by Internet Explorer.  Presumably this is therefore the reference rendering.
Comment 4 Mark Ambachtsheer 2008-03-13 11:30:14 PDT
Comment on attachment 19733 [details]
test HTML file that reproduces the erroneous behavior

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title>text-transform: uppercase and innerText</title>
</head>
<body>
<div id='testDiv' style='text-transform: uppercase;'>The quick brown fox jumped over the lazy dogs</div>
<div>The following text is the result of retrieving the innerText property of the div containing the previous text:</div
>
<div>
<script type="text/javascript">
<!--
var testDiv = document.getElementById('testDiv');
document.write(testDiv.innerText);
-->
</script>
</div>
</body>
</html>
Comment 5 Mark Ambachtsheer 2008-03-13 11:31:57 PDT
Comment on attachment 19733 [details]
test HTML file that reproduces the erroneous behavior

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title>text-transform: uppercase and innerText</title>
</head>
<body>
<div id='testDiv' style='text-transform: uppercase;'>The quick brown fox jumped over the lazy dogs</div>
<div>The following text is the result of retrieving the innerText property of the div containing the previous text:</div
>
<div>
<script type="text/javascript">
<!--
var testDiv = document.getElementById('testDiv');
document.write(testDiv.innerText);
-->
</script>
</div>
</body>
</html>
Comment 6 Dave Hyatt 2008-03-13 15:22:41 PDT
I'm surprised by this behavior.  I thought .innerText is supposed to show rendered text (and not just raw DOM contents).  Therefore I'd expect the text-transform to be included.


Comment 7 Jerome Leclanche 2013-03-31 12:22:45 PDT
This surprised me today; is it still unclear what the behaviour ought to be?