Closed Bug 207274 Opened 21 years ago Closed 20 years ago

Right-click text for properties doesn't show up based on xml:lang (language) attribute

Categories

(Core :: Internationalization, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: ccurzio+mozilla, Assigned: smontagu)

References

()

Details

(Keywords: intl)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030506
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030506

Right-clicking on text on a page with the "lang" attribute defined displays a
"Properties" link which displays the text language. If the page uses the
"xml:lang" attribute, the properties link is missing. 

Reproducible: Always

Steps to Reproduce:
1. Go to http://hewgill.com/esperanto/
2. Right-click on text and choose properties
3. Go to http://www.mozilla.org/
4. Right-click on text.
Actual Results:  
Properties link was available the first time, not available the second time. 

Expected Results:  
Have the properties link available for all pages and all available languages.
It should be noted that http://www.mozilla.org does not use an "xml:lang"
attribute, so it is reasonable that the Properties menu option need not be
displayed (since Mozilla would be unsure of the actual text language). However,
a page that uses "xml:lang" but not "lang" will not cause Mozilla to display the
Properties menu option.

XHTML 1.1 removes the "lang" attribute in favour of "xml:lang":
http://www.w3.org/TR/xhtml11/changes.html#a_changes
Righto. Check out http://www.accipiter.org instead. There's an xml:lang
attribute set, but no plain-jane lang attribute. The Properties menu option is
still missing. 
Confirmed 2003052708 winXP
On accipiter.org, this happens because:

1) xml:lang is an XML attribute
2) They are serving the page as text/html
3) Mozilla will not treat text/html as an XML document in any case, so the
xml:lang attribute is ignored.

If the page was served as application/xhtml+xml, the Properties window would
include language information.

Technically they are served an invalid document, since under the guidelines to
serve XHTML as text/html, a "lang" attribute is required along with "xml:lang".

This bug, as written (no language info in Properties) is a WORKSFORME, since
Mozilla is functioning correctly.  If someone wants to complain about
accipiter.org, that would be a separate Tech Evang bug to file.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → WORKSFORME
Mark as verified as worksforme per previous comment.
Status: RESOLVED → VERIFIED
The page http://hewgill.com/esperanto/index.xhtml is served as content-type
"application/xhtml+xml" yet the Properties menu option still does not appear on
the right-click menu unless the "lang" attribute is present. (The default
index.html file is still served as text/html and is not standards compliant. I
believe index.xhtml is standards compliant for XHTML 1.1 per comment #4.)
In my opinion, this request still is an open /bug/, since in XHTML 1.1, you are
/only/ allowed to define language via the 'xml:lang' attribute. And if you're
also correctly delivering your XHTML 1.1 pages as 'application/xhtml+xml',
Mozilla /should/ recognize the language and represent it via the 'Properties'
context menu entry.

Please take my site http://meiert.com/ as an example, too. I didn't want to
arbitrarily reopen this bug, but I'd appreciate if this was definitely checked
again.
In both pages mentioned in the previous two comments (which have only 'xml:lang'
and are served as 'xml/....'), I got 'Properties' menu which brought up a pop-up
window when clicked on. In the pop-up window, I had 'Esperanto' and 'German',
respectively. I'm running 1.7 at the moment and will try the trunk in a moment
to see if there's a regression. Otherwise, it works for me. 
I used Mozilla 1.7.1 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.1)
Gecko/20040707) and just tested it again with Firefox 0.9 -- result as
mentioned, no 'Properties' entry in the context menu (right click on page, to
make it sure).

I think using themes for both UAs cannot cause this problem, so what happens here?
Oops. sorry I thought it's supposed to work only for links. 

It's a bit odd that when I right-clicks on a link, I get 'properties' with
'language' correctly identified while for non-link texts, I don't get
properties.  In pages with 'lang', both cases work. 

This may or may not be a dupe of another bug dealing with 'xml:lang' which I
can't find at the moment.

Status: VERIFIED → REOPENED
OS: Linux → All
Hardware: PC → All
Resolution: WORKSFORME → ---
*** Bug 217352 has been marked as a duplicate of this bug. ***
'xml' needs to be a part of the summary line for an easier tracking/search.
Keywords: intl
Summary: Right-click text for properties doesn't show up based on language attribute → Right-click text for properties doesn't show up based on xml:lang (language) attribute
Attached patch patchSplinter Review
This patch should fix this bug.

Seeking review...
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041017 Firefox/1.0

Just compiled.  Patch WFM.

http://www.accipiter.org and http://meiert.com/ show the Properties menu item
and the language attribute properly.

I've been awaiting this fix for a while.  Thanks Florian.
(In reply to comment #14)
> Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041017 Firefox/1.0
> 
> Just compiled.  Patch WFM.
> 
> http://www.accipiter.org and http://meiert.com/ show the Properties menu item
> and the language attribute properly.
> 
> I've been awaiting this fix for a while.  Thanks Florian.

With the patch, on my computer (Mozilla/5.0 (Windows; U; Windows NT 5.1;
rv:1.7.3) Gecko/20040913 Firefox/0.10.1), the Properties menu item and the
language attribute are not shown on http://www.accipiter.org. Comment #4 explain
why.
The Properties menu item and the language attribute are shown properly on those
testcases :
http://hewgill.com/esperanto/index.xhtml
http://meiert.com/
attachment 130451 [details] (testcase attached to bug 217352)
Oh god, I jumped the gun when I said that, didn't I?  Quite sorry.

accipter does not work, I was mistaken earlier.  (Page renders as text/html
instead of application/xhtml+xml.)

However, this does work correctly on pages served as XML type files.
Attachment #158069 - Flags: superreview?(bzbarsky)
Attachment #158069 - Flags: review?(jag)
Comment on attachment 158069 [details] [diff] [review]
patch

sr=bzbarsky
Attachment #158069 - Flags: superreview?(bzbarsky) → superreview+
Comment on attachment 158069 [details] [diff] [review]
patch

r=jag
Attachment #158069 - Flags: review?(jag) → review+
Patch checked in.
Status: REOPENED → RESOLVED
Closed: 21 years ago20 years ago
Resolution: --- → FIXED
Thunderbird has its own copy of nsContextMenu.js -- does it need a version of
this patch also?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: