[Webkit-unassigned] [Bug 39863] innerText does not include a letter with :first-letter applied

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 31 21:48:27 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=39863





--- Comment #21 from mitz at webkit.org  2010-05-31 21:48:24 PST ---
(In reply to comment #16)

> There are two cases when handling leading whitespaces.  One is whitespaces are collapsed and another is not collapsed.  When whitespace is not collapsed, all leading whitespaces should be preserved as you pointed out above.   So this whil e loop shouldn't be run.  When whitespaces should be collapsed, those should be already replaced to one ' ' so the above loop should correctly skip that.  The RenderBlock code you mentioned also skips punctuations when finding the first letter that could get :first-letter to be applied but here, we want to output them as text so we don't need special handling for those.  So unless I'm missing something (which is quite possible as I just did in the previous patch), I think the new code should work.

I think you’re missing the part where isSpaceOrNewline() differs from comparing to ' '.

> As to the latter point, if I understand the code correctly, RenderTextFragment doesn't have InlineTextBox and it holds text directly.  RenderTextFragment itself has start and end but those are offset into original text which will produce the text fragment (text_fragment = original_text.substring(start, end)) so those can't be used, either.  So looking at the RenderTextFragment.cpp, I don't know if there's a better way to do it.

All rendered text is rendered by InlineTextBox instances. In your patch, handleTextNodeFirstLetter() is called from handleTextBox(), where the text box has a RenderTextFragment() as its renderer. The offsets in the text box are into the RenderTextFragment’s text(), and I think you can use the RenderTextFragment’s start and end to map those into offsets in the node. Does that make sense?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list