Closed
Bug 263834
Opened 21 years ago
Closed 21 years ago
Some strangeness with relative links in data URI's
Categories
(Core :: Networking, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: martijn.martijn, Assigned: bzbarsky)
References
()
Details
Attachments
(1 file)
1.03 KB,
patch
|
darin.moz
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a5) Gecko/20041010 Firefox/0.9.1+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a5) Gecko/20041010 Firefox/0.9.1+
See the URL testcase.
The first link gets the typical layout of a link, but the second link not.
These are the two links:
<a href="">Testlink1</a>
<a href="#">Testlink2</a>
Also clicking on the first link doesn't work, because it doesn't point to the
data URI. Also middle-clicking to open the link in a new tab doesn't work.
Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1•21 years ago
|
||
hmm, why does the first link end up pointing at ":"?
the second link gets no link appearance because data: does not support relative
uris, neither does it support fragment identifiers (iirc)
Comment 2•21 years ago
|
||
Why are fragment identifiers a function of the protocol? Aren't they a function
of the content-type of the document?
![]() |
Assignee | |
Comment 3•21 years ago
|
||
(In reply to comment #2)
> Why are fragment identifiers a function of the protocol? Aren't they a
> function of the content-type of the document?
Because some URI types simply have no concept of fragment identifiers. See
nsSimpleURI and the nsIURI api (which does not expose fragment identifiers,
unlike the nsIURL api). I believe this is actually consistent with the URI RFC.
Note that for a data: URI we treat a trailing '#whatever' as part of the data.
We keep thinking it would have been better to put fragment identifiers on nsIURI
(it would certainly make things like bug 225910 a lot less controversial). It's
not clear to me whether that's consistent with the URI RFC and with the data:
RFC, of course.
(In reply to comment #1)
> hmm, why does the first link end up pointing at ":"?
That's a bug in nsSimpleURI, actually. SetSpec() will allow setting an empty
spec (but it synthesizes a ':' in GetSpec()). Right after the NS_OK return for
empty spec we check for a ':' and bail out if we don't find one. I think we
should simply remove that |if (specLen == 0)| check.
Comment 4•21 years ago
|
||
(In reply to comment #2)
> Why are fragment identifiers a function of the protocol? Aren't they a function
> of the content-type of the document?
each protocol handler creates the URIs for its scheme itself; and not all uri
implementations support fragments
![]() |
Assignee | |
Comment 5•21 years ago
|
||
![]() |
Assignee | |
Updated•21 years ago
|
Attachment #161773 -
Flags: superreview?(darin)
Attachment #161773 -
Flags: review?(darin)
Comment 6•21 years ago
|
||
Comment on attachment 161773 [details] [diff] [review]
Like so
r+sr=darin
Attachment #161773 -
Flags: superreview?(darin)
Attachment #161773 -
Flags: superreview+
Attachment #161773 -
Flags: review?(darin)
Attachment #161773 -
Flags: review+
![]() |
Assignee | |
Updated•21 years ago
|
Assignee: darin → bzbarsky
![]() |
Assignee | |
Comment 7•21 years ago
|
||
Fixed (in that the anchors now behave consistently).
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 8•21 years ago
|
||
Hmm, I already had a feeling it would be fixed this way.
At least it is consistent now :-)
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•