Bug 40481 - Consider adding support for :first-letter and :first-line in SVG
Summary: Consider adding support for :first-letter and :first-line in SVG
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Normal
Assignee: Nobody
URL: http://jsfiddle.net/rLCLj/
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-11 10:42 PDT by Abhishek Arya
Modified: 2022-07-15 14:51 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Abhishek Arya 2010-06-11 10:42:37 PDT
There was no seperate implementation of :first-letter and :first-line for SVG, which is why we had crashes and incorrect layouts when those pseudo classes were used for text elements in SVG. As a result, we disabled them in security bug - https://bugs.webkit.org/show_bug.cgi?id=40031. Other browsers such as firefox, opera, (svg implementation batik) don't support it. However, after chatting with Dave, Maciej, we should consider writing these features.
Comment 1 Dirk Schulze 2010-06-11 22:57:39 PDT
:first-line doesn't make sense for texts in SVG. We don't have block level elements like paragraph in SVG. So :first-line would always be true on texts. Are there other application areas for this pseudo element?
Comment 2 Abhishek Arya 2010-06-23 10:21:24 PDT
How about :first-letter, does that apply to SVG ?
Comment 3 Dirk Schulze 2010-06-23 10:37:03 PDT
(In reply to comment #2)
> How about :first-letter, does that apply to SVG ?

Yea, I think so.
Comment 4 Abhishek Arya 2010-06-23 11:25:33 PDT
cut-copy-paste from 40031

In an SVG user agent that supports CSS style sheets, the following facilities from [CSS2] must be supported:
---------
    * CSS2's dynamic pseudo-classes :hover, :active and :focus and pseudo-classes :first-child, :visited, :link and :lang. The remaining CSS2 pseudo-classes, including those having to do with generated content, are not part of the SVG language definition. (Note: an SVG element gains focus when it is selected. See Text selection.)
---------

Is it part of SVG specification or a requirement ?
Comment 5 Stephen Chenney 2012-01-18 12:51:13 PST
Adding myself to CC list.
Comment 6 Dirk Schulze 2014-05-12 05:49:21 PDT
I attached a test case. It does not seem to run in any browser.
Comment 7 Brent Fulgham 2022-07-15 14:51:56 PDT
Safari, Chrome, and Firefox all agree on rendering for this test case. I don't believe there is any remaining compatibility issue.