The default bug view has changed. See this FAQ.

Honor the 'lang' attribute on SVG as we do in HTML

RESOLVED FIXED in mozilla13

Status

()

Core
SVG
RESOLVED FIXED
5 years ago
3 months ago

People

(Reporter: jwatt, Assigned: jwatt)

Tracking

(Depends on: 1 bug, Blocks: 1 bug, {dev-doc-needed})

Trunk
mozilla13
dev-doc-needed
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(3 attachments, 2 obsolete attachments)

(Assignee)

Description

5 years ago
We should support the 'lang' attribute in SVG just as we do in HTML.
(Assignee)

Comment 1

5 years ago
Created attachment 592325 [details]
testcase
(Assignee)

Updated

5 years ago
Attachment #592325 - Attachment is patch: false
(Assignee)

Updated

5 years ago
Attachment #592325 - Attachment mime type: text/plain → image/svg+xml
(Assignee)

Comment 2

5 years ago
Chrome supports this.
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="".
(Assignee)

Comment 4

5 years ago
Thanks, that'd be great.
(Assignee)

Comment 5

5 years ago
Created attachment 592432 [details]
testcase showing lang="foo" working in HTML
Blocks: 722097
(Assignee)

Comment 6

5 years ago
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.)
(Assignee)

Comment 7

5 years ago
> 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.
(Assignee)

Comment 8

5 years ago
Created attachment 592486 [details] [diff] [review]
patch
Attachment #592484 - Attachment is obsolete: true

Updated

5 years ago
No longer blocks: 722097
(Assignee)

Comment 9

5 years ago
Created attachment 598198 [details] [diff] [review]
patch
Attachment #592486 - Attachment is obsolete: true
Attachment #598198 - Flags: review?(bzbarsky)
Comment on attachment 598198 [details] [diff] [review]
patch

r=me
Attachment #598198 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/d9c03190bd47
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13

Updated

5 years ago
Depends on: 728974
Keywords: dev-doc-needed
Blocks: 1328534
You need to log in before you can comment on or make changes to this bug.