Closed
Bug 278679
Opened 21 years ago
Closed 21 years ago
"cite" attribute of blockquote and q is not interpreted as URI
Categories
(Core :: DOM: HTML Parser, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: minghong, Unassigned)
Details
Attachments
(1 file, 1 obsolete file)
1.99 KB,
application/xhtml+xml
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
According to W3C, the cite attribute of blockquote is is a URI that designates a
source document or message:
http://www.w3.org/TR/REC-html40/struct/text.html#edef-BLOCKQUOTE
However, the HTML parser of Mozilla doesn't interpreted it as URI. It just treat
it as a string.
Reproducible with Mozilla 1.8a6.
The fix should be easy? Just treat it like "href" attribute of <a> element...
FYI, Opera 8.0 beta handles it correctly.
Reproducible: Always
Steps to Reproduce:
1. Get the cite attribute of a blockquote element using JavaScript or CSS.
Actual Results:
The value is the original string.
Expected Results:
The string should be URL-encoded. Also relative path should be converted to full
path.
This was originally reported at bug 30376. But Ben Bucksch (see comment 13) said
that I misunderstood that bug. So I better open a new one here.
Reporter | ||
Comment 1•21 years ago
|
||
Please compare this test case with Mozilla and Opera.
Reporter | ||
Comment 2•21 years ago
|
||
Comment on attachment 171473 [details]
Lack of cite attribute support uncovered by CSS and JavaScript
><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" xmlns:xml="http://www.w3.org/XML/1998/namespace">
> <head>
> <title>Please interprete "cite" attribute as URL!</title>
> <style type="text/css">
> /* Make "cite" attribute visible */
> blockquote[cite]:before {
> display: block;
> content: attr(cite);
> }
> q[cite]:before {
> display: inline;
> content: "[" attr(cite) "]";
> }
> </style>
> <script type="text/javascript">
> window.onload = function()
> {
> alert( document.getElementById( "blockquote" ).getAttribute( "cite" ) );
> alert( document.getElementById( "q" ).getAttribute( "cite" ) );
> }
> </script>
> </head>
> <body>
> <!-- The inline styles are not important. Please ignore them. -->
> <div style="margin: 1em; padding: 1em; background: yellow none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;">
> <p style="font-weight: bold;">Test case:</p>
> <blockquote cite="/relative/path/to/a file" id="blockquote">
> <ol>
> <li><q cite="/another/path" id="q">Cite</q> attribute is not interpreted as URL in Mozilla.</li>
> <li>Relative path is not converted to full path, and no URL encoding.</li>
> <li>Please open this test case in Opera 8.0.</li>
> <li>IMO, Opera handles this correctly.</li>
> </ol>
> </blockquote>
> </div>
> <div style="margin: 1em; padding: 1em; background: yellow none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;">
> <p style="font-weight: bold;">If your browser supports "cite" attribute, you should see something like this:</p>
> <blockquote>
> <p>https://bugzilla.mozilla.org/relative/path/to/a%20file</p>
> <ol>
> <li>[https://bugzilla.mozilla.org/another/path]Cite" attribute is not interpreted as URL in Mozilla.</li>
> <li>Relative path is not converted to full path, and no URL encoding.</li>
> <li>Please open this test case in Opera 8.0.</li>
> <li>IMO, Opera handles this correctly.</li>
> </ol>
> </blockquote>
> </div>
> </body>
></html>
Reporter | ||
Updated•21 years ago
|
Attachment #171473 -
Attachment is obsolete: true
Reporter | ||
Updated•21 years ago
|
Summary: "cite" attribute of blockquote is not interpreted as URI → "cite" attribute of blockquote and q is not interpreted as URI
Reporter | ||
Comment 3•21 years ago
|
||
Compare with Opera 8.0 beta.
![]() |
||
Comment 4•21 years ago
|
||
Opera's behavior is just completely buggy. getAttribute is guaranteed to return
the original attribute value in the original source. Similarly, the attr()
notation in CSS should return the original value.
Note that the "cite" _property_ is a fully resolved URI in Mozilla, as it should
be. But the attribute value should not be getting munged into a resolved URI.
Note that the "href" attribute of <a> is treated the same way by Mozilla as a
"cite" attribute of <blockquote> or <p> is. So I can only presume you didn't
even bother to test your assertion in comment 0 that "cite" should act like
"href" -- it already does.
Ian, could you open a ticket in the Opera bug database on this bustage, please?
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
Reporter | ||
Comment 5•21 years ago
|
||
You're right. Sorry for mixing up property and attribute...
Comment 6•21 years ago
|
||
That Opera resolves all attributes that it knows are URIs is a known bug.
You need to log in
before you can comment on or make changes to this bug.
Description
•