Last Comment Bug 721920 - Honor the 'lang' attribute on SVG as we do in HTML
: Honor the 'lang' attribute on SVG as we do in HTML
Status: RESOLVED FIXED
: dev-doc-needed
Product: Core
Classification: Components
Component: SVG (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla13
Assigned To: Jonathan Watt [:jwatt]
:
Mentors:
http://www.w3.org/TR/SVG11/fonts.html...
Depends on: 728974
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-27 16:46 PST by Jonathan Watt [:jwatt]
Modified: 2016-01-13 22:49 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (179 bytes, image/svg+xml)
2012-01-27 16:49 PST, Jonathan Watt [:jwatt]
no flags Details
testcase showing lang="foo" working in HTML (167 bytes, text/html)
2012-01-28 12:20 PST, Jonathan Watt [:jwatt]
no flags Details
patch (4.47 KB, patch)
2012-01-29 04:28 PST, Jonathan Watt [:jwatt]
no flags Details | Diff | Review
patch (4.46 KB, patch)
2012-01-29 04:36 PST, Jonathan Watt [:jwatt]
no flags Details | Diff | Review
patch (12.77 KB, patch)
2012-02-17 04:09 PST, Jonathan Watt [:jwatt]
bzbarsky: review+
Details | Diff | Review

Description Jonathan Watt [:jwatt] 2012-01-27 16:46:39 PST
We should support the 'lang' attribute in SVG just as we do in HTML.
Comment 1 Jonathan Watt [:jwatt] 2012-01-27 16:49:51 PST
Created attachment 592325 [details]
testcase
Comment 2 Jonathan Watt [:jwatt] 2012-01-27 16:58:21 PST
Chrome supports this.
Comment 3 Cameron McCormack (:heycam) 2012-01-27 17:05:05 PST
SVG 1.1 uses xml:lang="" for declaring the language of text content, and lang="" just for declaring what language a particular SVG Font glyph is for.  I'll file an issue for SVG 2 to use lang="" rather than xml:lang="".
Comment 4 Jonathan Watt [:jwatt] 2012-01-27 17:09:28 PST
Thanks, that'd be great.
Comment 5 Jonathan Watt [:jwatt] 2012-01-28 12:20:47 PST
Created attachment 592432 [details]
testcase showing lang="foo" working in HTML
Comment 6 Jonathan Watt [:jwatt] 2012-01-29 04:28:30 PST
Created attachment 592484 [details] [diff] [review]
patch

Still need tests, but this works. (The fact that selector matching doesn't use the nsStyleFont struct caught me out for a while, but I figured it out.)
Comment 7 Jonathan Watt [:jwatt] 2012-01-29 04:31:23 PST
> The fact that selector matching doesn't use the nsStyleFont struct...

By which I mean the code for ePseudoClass_lang in nsCSSRuleProcessor.cpp uses GetLang(), not an nsStyleFont...hence the change to nsIContent.h in the patch.
Comment 8 Jonathan Watt [:jwatt] 2012-01-29 04:36:18 PST
Created attachment 592486 [details] [diff] [review]
patch
Comment 9 Jonathan Watt [:jwatt] 2012-02-17 04:09:59 PST
Created attachment 598198 [details] [diff] [review]
patch
Comment 10 Boris Zbarsky [:bz] 2012-02-17 07:19:00 PST
Comment on attachment 598198 [details] [diff] [review]
patch

r=me
Comment 11 Ed Morley [:emorley] 2012-02-20 10:21:48 PST
https://hg.mozilla.org/mozilla-central/rev/d9c03190bd47

Note You need to log in before you can comment on or make changes to this bug.