[Webkit-unassigned] [Bug 130457] Improper styling of pseudo element first-letter

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 20 04:05:58 PDT 2014


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


Mario Sanchez Prada <mario at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #227193|review?                     |
               Flag|                            |




--- Comment #7 from Mario Sanchez Prada <mario at webkit.org>  2014-03-20 04:06:13 PST ---
(From update of attachment 227193)
After investigating this issue a bit more, it seems to me that the difference in the results comes from the fact that the backported code came with a problem, inherited from Blink r159205:

+  if (descendant->isText()) {
+     // FIXME: If there is leading punctuation in a different RenderText than
+     // the first letter, we'll not apply the correct style to it.
+     length = firstLetterLength(toRenderText(*descendant).originalText());
+     if (length)
+         break;

For instance, in editing/selection/extend-by-word-002.html, for the following code (where we have defined "ul.menu li:first-letter { font-size:20px;line-height:10px; }"):

  <li>· <a href="detail.asp?cat=13">Soups & Salads</a></li>

According to the spec, the UA does not need to create a first-letter pseudoelement in this case, which is what Opera and Firefox do. However, the present patch applies the first-letter style to the "A" after the dot, which is wrong. Even worse, I've tried the following code:

  <li>· Starter <a href="detail.asp?cat=13">Soups & Salads</a></li>

And I get the list element rendered applying the first letter style over the "S" of "Soups", instead of doing nothing (as there's a space after the dot. If however, I remove the space between the dot and "Starter":

  <li>·Starter <a href="detail.asp?cat=13">Soups & Salads</a></li>

I get consistent rendering across all browsers, applying the style over the "S" of "Starter". It's a pity I didn't detect this first in Blink, but the way how extend-by-words-002.html is tested there didn't catch this issue

So, I think I'll get back to blink, try to fix these issues there first and then will come back here. Now removing flags.

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