Bug 62111 - Long text doesn't appear
Summary: Long text doesn't appear
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kenichi Ishibashi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-05 19:06 PDT by Kenichi Ishibashi
Modified: 2014-04-01 19:01 PDT (History)
4 users (show)

See Also:


Attachments
test page (207 bytes, text/html)
2011-06-05 19:07 PDT, Kenichi Ishibashi
no flags Details
A tentative patch (4.43 KB, patch)
2011-06-05 19:28 PDT, Kenichi Ishibashi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenichi Ishibashi 2011-06-05 19:06:36 PDT
A long text (more than 65535 characters) without spaces doesn't appear.  The attached file reproduces the problem.

This comes from an overflow of the m_len member variable in InlineTextBox.  It's type is unsigned short, but InlineTextBox::setLen() takes unsigned as the argument, so an overflow will occur when the text length is more than 65535.

We might need to change the type of m_len to unsigned or truncate the text.  Firefox renders a long text without truncation.  Since changing the type of the m_len increases the size of InlineTextBox, I'm not sure which way is better.
Comment 1 Kenichi Ishibashi 2011-06-05 19:07:42 PDT
Created attachment 96058 [details]
test page
Comment 2 Kenichi Ishibashi 2011-06-05 19:28:30 PDT
Created attachment 96059 [details]
A tentative patch
Comment 3 Kenichi Ishibashi 2011-06-05 19:37:03 PDT
(In reply to comment #2)
> Created an attachment (id=96059) [details]
> A tentative patch

A patch to change the type of m_len to unsigned.  Not including tests and ChangeLog because I'd like to ask suggestion before going forward with it.
Comment 4 Alexey Proskuryakov 2011-06-05 22:15:27 PDT
The effect on memory use may be a problem indeed.

See also: bug 29636, bug 28201.
Comment 5 Kenichi Ishibashi 2011-06-06 22:48:57 PDT
Hi Alexey,

(In reply to comment #4)
> The effect on memory use may be a problem indeed.

IMHO, truncating text might be better because it would be rare that a page contains such long text (without spaces), while increasing the size of InlineTextBox will impact almost all pages. 

> See also: bug 29636, bug 28201.

Thank you for letting me know these bugs.  I think the cause of these bugs is the same.