Closed
Bug 128988
Opened 23 years ago
Closed 23 years ago
setAttribute('href', link) on <a> tag does not work properly or at all
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
VERIFIED
INVALID
People
(Reporter: jwatt, Assigned: jst)
Details
Attachments
(1 file, 3 obsolete files)
741 bytes,
text/xml
|
Details |
Any attempt to assign an <a> element that has been created by
document.createElement an href attribute fails to turn it into a link. Two
testcases have been provided. In the first the href attribute is set on the
created <a> element prior to its insertion into the document. In the second the
href attribute is set after the <a> element has been inserted into the document.
A more minor problem is that the cursor does not change when over a pre-existing
<a> element that has been assigned an href attribute after the document has
finished loading. A third testcase has been attached do demonstrate this.
![]() |
Reporter | |
Comment 1•23 years ago
|
||
![]() |
Reporter | |
Comment 2•23 years ago
|
||
![]() |
Reporter | |
Comment 3•23 years ago
|
||
Comment 4•23 years ago
|
||
The first two testcases are broken, but I get the hand cursor in the third on a
fresh Linux build.
Keywords: testcase
Comment 5•23 years ago
|
||
Probably a dup of fixed bug 113310. What build were you using? Could you please
re-test with a new build? Thanks in advance!
![]() |
Reporter | |
Comment 6•23 years ago
|
||
Fabian, build is 2002020406 (0.9.8).
Christopher has just confirmed that the main part of this bug (setting an href
attribute on a <a> element created through document.createElement) is _still_
broken on latest linux build.
However, the second part is indeed a dup of fixed bug 113310.
Keywords: testcase
![]() |
Reporter | |
Updated•23 years ago
|
Attachment #72551 -
Attachment is obsolete: true
![]() |
Reporter | |
Updated•23 years ago
|
Attachment #72549 -
Attachment description: setAttribute before appendNode → setAttribute before appendChild
![]() |
Reporter | |
Comment 7•23 years ago
|
||
Additional information:
After clicking on the text of what should be a link created through the DOM I
get this warning in the JavaScript Console:
Warning: reference to undefined property linkNode.href
Source File: chrome://communicator/content/contentAreaClick.js
Line: 153
Maybe helpful, maybe not.
I'm changing tabbrowser.xml so that a mouse hover over tabs will display that
little close button icon but it seems that the stylesheet has been disabled
after using setAttribute in onStateChange: This is how the code looks:
if (this.mIcon) {
this.mTab.setAttribute("image", this.mIcon);
mIcon = "";
}
The new code works just fine, but only if I remove setAttribute(). So the main
problem is a disabled stylesheet.
Comment 10•23 years ago
|
||
I like to know if my problem is related, or that I need to file a new bug report?
Comment 11•23 years ago
|
||
CC'ed bz on request (IRC)
Comment 12•23 years ago
|
||
I have changed browser.css (cursor: grab;) to see _if_ the stylesheet was
disabled, but that's a negative! The mouse pointer changed in a hand (mouse
hovers) so the stylesheet is still Ok. Adding this.mTab.setAttribute("class",
"tab-icon"); didn't help me either.
Boris, do you know a way (css) to change the favicon/icon on the tabs on mouse
hovers? This is what I use now:
<snap>
tab:hover, tab[busy]:hover {
list-style-image: url("chrome://global/skin/icons/close.gif") !important;
}
</snap>
Assignee | ||
Comment 13•23 years ago
|
||
Working testcase.
Attachment #72549 -
Attachment is obsolete: true
Attachment #72550 -
Attachment is obsolete: true
Assignee | ||
Comment 14•23 years ago
|
||
We're dealing with XML here, which means if you want to create XHTML elements,
you must use the DOM's createElementNS method to create elements in the XHTML
namespace. document.createElement('a') will just create a vanilla 'a' element in
no namespace.
INVALID.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
Component: DOM: Core → DOM: Core & HTML
QA Contact: stummala → general
You need to log in
before you can comment on or make changes to this bug.
Description
•