Closed
Bug 1213842
Opened 9 years ago
Closed 9 years ago
:lang() should not fall back to HTTP headers if empty lang attribute is specified
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: ayg, Assigned: ayg)
Details
Attachments
(1 file, 2 obsolete files)
4.37 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
If the lang attribute is set on an element to the empty string, the :lang() selector will ignore the lang attribute and fall back to HTTP headers. This test thinks that behavior is wrong: http://w3c-test.org/html/dom/elements/global-attributes/the-lang-attribute-009.html IE and Chrome both pass the test and we fail. HTML says: "If the resulting value is the empty string, then it must be interpreted as meaning that the language of the node is explicitly unknown." https://html.spec.whatwg.org/multipage/dom.html#attr-lang This is consistent with the behavior of lang="nonempty" on an ancestor, insofar as in the markup <x lang="en"><y lang=""></y></x> the <y> element has a language of "", not "en". If lang="" were meant to be equivalent to not specifying the language, <y> should have a language of "en" here. So I think the test/IE/Chrome are right and we should change to match them.
Assignee | ||
Updated•9 years ago
|
Summary: :lang() should treat lang="" as no language specified for this element → :lang() should not fall back to HTTP headers if empty lang attribute is specified
Assignee | ||
Comment 1•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=bbeb4a1a4897
Attachment #8672605 -
Flags: review?(dbaron)
Assignee | ||
Comment 2•9 years ago
|
||
Comment on attachment 8672605 [details] [diff] [review] Patch The patch is broken, new version coming up.
Attachment #8672605 -
Attachment is obsolete: true
Attachment #8672605 -
Flags: review?(dbaron)
Assignee | ||
Comment 3•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=b1335d54cdc0
Attachment #8672647 -
Flags: review?(bzbarsky)
Comment 4•9 years ago
|
||
Comment on attachment 8672647 [details] [diff] [review] Patch v2 Please just return true if hasAttr and return false at the end of the method to indicate whether we found a language, instead of smuggling that information out in the string.
Attachment #8672647 -
Flags: review?(bzbarsky) → review-
Assignee | ||
Comment 5•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=e29a4f52dc09
Attachment #8672647 -
Attachment is obsolete: true
Attachment #8672697 -
Flags: review?(bzbarsky)
Comment 6•9 years ago
|
||
Comment on attachment 8672697 [details] [diff] [review] Patch v3 > * Determing language. Look at the nearest ancestor element that has a lang While you're here, "Determine", right? r=me
Attachment #8672697 -
Flags: review?(bzbarsky) → review+
Comment 8•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/ea52ca27ff99
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in
before you can comment on or make changes to this bug.
Description
•