On Apr 16, 1:44 pm, Boris Zbarsky <[EMAIL PROTECTED]> wrote: > Jonathan wrote: > > Yes, I am talking about Gecko 1.8. > > What I mean is if I have text like 'Hello world' in a html page. Gecko > > creates a nsTextFrame for it, will mContentLength be 11 (length of > > 'Hello world'? > > That depends on the exact locations of the line breaks (since there is going > to > be one nsTextFrame per piece of line-broken content) and the exact time when > you're looking at the member. For example, right after the nsTextFrame is > constructed it'll have an mContentLength of 0, iirc. It will get updated to > match the text the nsTextFrame actually maps the text during reflow. > > -Boris > > P.S. Bidi reordering can also create multiple textframes all on one line, I > think, but in your example that's a non-issue. If your real text might not > all > be ltr, this is something to keep in mind.
Boris, Thank you for your detailed answer. I see what you said now. I have this example: <html> <p>We collect personal information on this site. To learn more about how we use your personal information, see our <a href="http:// us.ard.com/">Privacy Policy</a>.</p> </html> My browser window is small (400 pixels in width , so it breaks in 'how to use'). But i only see 2 nsTextFrame get created, and 1 nsInlineFrame get created before and after reflow. And as you said all values of mContentLength of both nsTextFrame are 0 before reflow. But after reflow, the mContentLength of the first nsTextFrame is 35. So my questions are: 1. I don't see a new nsTextFrame get created even when the text got broken into 2 lines. Or I mis-understand what you meant? 2. is there a better way to get the length of the text before reflow? Thank you. _______________________________________________ dev-tech-layout mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-layout

