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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 1 04:59:54 PDT 2010


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





--- Comment #22 from Yoshiki Hayashi <yhayashi at google.com>  2010-06-01 04:59:52 PST ---
(In reply to comment #21)
> (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 ' '.

Sorry for being dense but if you have html fragment that only works with isSpaceOrNewline, I'd like to add it to the testcase.  Meanwhile, I'll change it to use isSpaceOrNewline.

> > 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?

Ah, yes, thank you for the explanation.  It means I can unify the logic more, so I'll work on rewriting my patch.  Unfortunately I was busy doing other stuff today but should be able to find some time tomorrow.

-- 
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