Closed
Bug 12766
Opened 25 years ago
Closed 25 years ago
html.css: XLink links should look like links
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Core
CSS Parsing and Computation
Tracking
()
VERIFIED
FIXED
M18
People
(Reporter: dbaron, Assigned: attinasi)
References
Details
Attachments
(6 files)
DESCRIPTION: I think, by default, simple links created using XLink should look
like links. Otherwise the user will have no idea the links are there.
(At the very least, the pointer should change. I'd understand if you disagreed
about the color and underline, but I'd still disagree, I think.)
STEPS TO REPRODUCE: Load attached document.
ACTUAL RESULTS: The word "link" does not look like a link (blue, underlined),
nor does the pointer change when over it. However, it does work when clicked.
EXPECTED RESULTS: The pointer should certainly change when over the link. I
think it should be blue and underlined as well.
DOES NOT WORK CORRECTLY ON:
* Linux, apprunner, 1999-08-28, build from 12:15 PDT
ADDITIONAL INFORMATION:
I think this could be fixed by changing ua.css to change all references to
a:link or a:visited (assuming the a:active bug, bug 12765, is fixed first) to
purely :link and :visited (that is, remove the element "a" from the selector).
Reporter | ||
Comment 1•25 years ago
|
||
Updated•25 years ago
|
Comment 2•25 years ago
|
||
Comment 3•25 years ago
|
||
Moving non-beta 1 items to M15
Comment 4•25 years ago
|
||
Reassigning peterl's bugs to myself.
Comment 5•25 years ago
|
||
Accepting peterl's bugs that have a Target Milestone
Updated•25 years ago
|
Summary: XLink links should look like links → HTML.CSS: XLink links should look like links
Comment 6•25 years ago
|
||
In bug 17518, there is the following comment from py8ieh=bugzilla@bath.ac.uk 11/
01/99 16:56
Just sub-optimal. I wouldn't back it out unless you implement the fixes
mentioned in bug 12765 and bug 12766.
Having said that, doing those two fixes is easy.
Replace all occurances of... with...
a[href]:link :link
a[href]:visited :visited
a[href]:link img :link img
a[href]:visited img :visited img
a[href]:active :link:active, :visited:active
a[href]:active img :link:active img, :visited:active img
a[href]:hover :link:hover, :visited:hover
a[href]:hover img :link:hover img, :visited:hover img
a[href]:focus :link:focus, :visited:focus
a[href]:focus img :link:focus img, :visited:focus img
I'm not sure what the ":out-of-date" pseudo is, but similar things have to
happen to that too.
Updated•25 years ago
|
Summary: HTML.CSS: XLink links should look like links → html.css: XLink links should look like links
Comment 7•25 years ago
|
||
I was just writing this when Pierre wrote the above. Hi Pierre. :-)
I've now found out what the :out-of-date psuedo is (as far as the code is
concerned, anyway) -- it is a link pseudo class mutually exclusive with the
:link and :visited pseudo classes.
So what needs doing now is that the html.css file should have...
...all occurances of... ...replaced with...
a[href]:link :link
a[href]:visited :visited
a[href]:out-of-date :out-of-date
a[href]:link img :link img
a[href]:visited img :visited img
a[href]:out-of-date img :out-of-date img
a[href]:active :link:active, :visited:active
a[href]:active img :link:active img, :visited:active img
a[href]:hover :link:hover, :visited:hover
a[href]:hover img :link:hover img, :visited:hover img
a[href]:focus :link:focus, :visited:focus
a[href]:focus img :link:focus img, :visited:focus img
This will fix both this bug and bug 12765.
Updated•25 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
Comment 8•25 years ago
|
||
Reporter | ||
Comment 9•25 years ago
|
||
I mind strongly unless you actually check that the :link selector matches
XLinks, which I believe currently it does not. (I wasn't aware of that at the
time -- but maybe that's been fixed since I found that out too...)
Comment 10•25 years ago
|
||
David: This last issue is already covered by bug 6306, this bug (12766) was
only actually in charge of making XLinks look like HTML A links once XLinks
were recognised as links by the stylesystem at all.
I mentioned this in my first comment to this bug, back in August...
Reporter | ||
Updated•25 years ago
|
Status: RESOLVED → REOPENED
Reporter | ||
Comment 11•25 years ago
|
||
Reporter | ||
Updated•25 years ago
|
Resolution: DUPLICATE → ---
Comment 12•25 years ago
|
||
Pushing my M15 bugs to M16
Comment 13•25 years ago
|
||
It looks like XLinks don't work after all. CCd Nisheeth who worked on it a few
weeks ago. Reassigned to Marc like bug 6306.
Assignee: pierre → attinasi
Status: REOPENED → NEW
Reporter | ||
Comment 14•25 years ago
|
||
My original testcase uses the old XLink syntax, so it probably shouldn't work.
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M16 → M18
Assignee | ||
Comment 15•25 years ago
|
||
Assignee | ||
Comment 16•25 years ago
|
||
Assignee | ||
Comment 17•25 years ago
|
||
I have made a small change to the SelectorMatches method in the CSSStyleSheet so
that XML XLinks are treated as links. This change is specific to XLinks: in
addition to checking if the content is an A with an href, we also now check if
the element is an XMLElement with a href in the xlink namespace. This change
allows xlinks get the :link (and :visited and :out-of-date) style just like an A
would. I'll attach the diff for review...
Bug 6306 covers the more general case of supporting links in arbitrary DTDs,
however this fix covers the simple XLink case. If and when we decide to tackle
bug 6306 this change will probably be rendered obsolete.
Assignee | ||
Comment 18•25 years ago
|
||
Reporter | ||
Comment 19•25 years ago
|
||
In IsXLink(), do you want to test for the type attribute as well? I'm not sure.
Assignee | ||
Comment 20•25 years ago
|
||
Good catch, David. I think we have to check for the type since the xlink won't
even act as a link type="simple". I was leary of the extra processing, but since
it is a requirment for the functioning of the link, I think we had better check
it.
Assignee | ||
Comment 21•25 years ago
|
||
Fixed. (nsCSSStyleSheet.cpp)
Status: ASSIGNED → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 22•25 years ago
|
||
Assignee | ||
Comment 23•25 years ago
|
||
Heh, why isn't there vote against option?
But seriously, I wouldn't want us to style XLinks automatically. The only case
where I'd want that to happen would be if we have NO stylesheet at all. In that
case it is nice to see the links. Normally I want to have full control over my
document, and it annoys me when someone does it for me. XML is supposed to be
completely without style information, remember?
Another point about the implementation. The XLink spec specifically says that
type="simple" is enough for link check. There is no need to check for href. If
there is no href attribute then it is simply untraversble link. This is how I
implemented the handling of simple XLinks.
Comment 25•25 years ago
|
||
"XML is supposed to be completely without style information, remember?"
Who said that?! It is my opinion that the most useful XML will be data in known
formats, for example XHTML and MathML. These most certainly _should_ have UA
stylesheets. It is in the interest of the user (the most important person as far
as we are concerned) that links look consistent across all documents. Thus if we
have a default link style, we are doing the user a favour.
Assignee | ||
Comment 26•25 years ago
|
||
The CSS2 spec states:
'The document language determines which elements are hyperlink source anchors.'
Clearly XLinks *are* hyperlink source anchors as defined by the document
language (XLINK) so we apply the :link selector to them. Section 5.11.2 of the
CSS2 spec also states that:
'The :link pseudo-class applies for links that have not yet been visited.'
I don't see how we can *not* apply the :link selector to XLinks.
If, on the other hand, we don't want to apply our default link styles to xlinks,
then we *could* change the rules in html.css to be 'A:link' 'A:visited' etc.
instead of ':link' and ':visited'. I disagree with this idea, but if somebody
(Heikki?) wants to make a case for that, then I think it is a separate issue
from how :link selectors are resolved.
Regarding the comment that an XLink with no href is a valid link: Since the
xlink spec indicates that the type is enough, then I will remove the href check
- I was merely following the HTML Anchor logic, which obviously is different. I
have now read the xlink spec and it is clear enough. I'll open a new bug on
myself for that. Thanks for educating me on this.
Assignee | ||
Comment 27•25 years ago
|
||
Opened bug 39616 for XLinks not needing the href attribute.
Doh, I wasn't on the CC...
Does CSS (any version) say what the the user agent stylesheet should be like?
For example that :link should be in the default user agent stylesheet?
Regarding my comment about XML being without style info... HTML comes with
recommendations/old practices of styling. You expect the browser to style your
HTML files even if you do not explicitly provide style. But where in the XML
Recommendation do you see that this and this element should be styled this and
this? Do you see these guidelines even in the XLink spec?
I opened a new bug for a pref that would handle these issues, see 41659.
Assignee | ||
Comment 29•25 years ago
|
||
CSS2 has a recommended ua style sheet, and there is no :link rule in it.
However, it is simply an example, not normative.
The CSS2 spec states:
'The document language determines which elements are hyperlink source anchors.'
XLinks are clearly hyperlink shource anchors, affectionately know as links.
That's why XLinks automatically get the :link rules applied.
Comment 30•25 years ago
|
||
Testing on Windows, Mac and Linux using M18 builds, verified fixed.
Status: RESOLVED → VERIFIED
Comment hidden (collapsed) |
You need to log in
before you can comment on or make changes to this bug.
Description
•