Bug 40481
| Summary: | Consider adding support for :first-letter and :first-line in SVG | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Abhishek Arya <inferno> |
| Component: | SVG | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED CONFIGURATION CHANGED | ||
| Severity: | Normal | CC: | bfulgham, ddkilzer, hyatt, krit, schenney, zimmermann |
| Priority: | P3 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | All | ||
| OS: | All | ||
| URL: | http://jsfiddle.net/rLCLj/ | ||
Abhishek Arya
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.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Dirk Schulze
: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?
Abhishek Arya
How about :first-letter, does that apply to SVG ?
Dirk Schulze
(In reply to comment #2)
> How about :first-letter, does that apply to SVG ?
Yea, I think so.
Abhishek Arya
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 ?
Stephen Chenney
Adding myself to CC list.
Dirk Schulze
I attached a test case. It does not seem to run in any browser.
Brent Fulgham
Safari, Chrome, and Firefox all agree on rendering for this test case. I don't believe there is any remaining compatibility issue.