Closed Bug 69196 Opened 24 years ago Closed 23 years ago

border of HTMLImageElement not dynamically changeable

Categories

(Core :: DOM: Core & HTML, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla0.9.9

People

(Reporter: martin.honnen, Assigned: jst)

References

Details

(Keywords: dom1, Whiteboard: [HAVE FIX])

Attachments

(3 files)

I try to set the
  border
property of an HTMLImageElement from JavaScript but nothing shows up. The border
property is listed in DOM level 1 HTML and there are no restrictions that it
should only be readable.

<HTML>
<HEAD>
<SCRIPT>
var step = 1;
var border = 0;
function borderAnimation () {
  document.imageName.border = border = border + step;
  window.status = 'border = ' + document.imageName.border;
  if (border == 20)
    step = -1;
  if (step > 1 || border > 0)
    setTimeout('borderAnimation()', 100);
}
</SCRIPT>
</HEAD>
<BODY ONLOAD="borderAnimation();">
<FORM NAME="gui">
<SELECT NAME="border"
        ONCHANGE="document.imageName.border = this.selectedIndex;
                  window.status = 'border = ' + document.imageName.border;"
>
<SCRIPT>
for (var i = 0; i < 20; i++)
  document.write('<OPTION>' + i);
</SCRIPT>
</SELECT>
</FORM>
<SCRIPT>
document.gui.border.selectedIndex = -1;
</SCRIPT>
<IMG NAME="imageName" SRC="kiboInside.gif">
</BODY>
</HTML>
Attached image needed for bug demo
Aiming for mozilla1.0
OS: other → All
Priority: -- → P3
Hardware: PC → All
Target Milestone: --- → mozilla1.0
Keywords: dom1
Component: DOM Level 1 → DOM HTML
QA contact Update
QA Contact: janc → desale
Updating QA contact to Shivakiran Tummala.
QA Contact: desale → stummala
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1 
(you can query for this string to delete spam or retrieve the list of bugs I've 
moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
The patch adds a NS_IMPL_PIXEL_ATTR macro in nsGenericHTMLElement.h.
I could get away with using NS_IMPL_INT_ATTR for the getter, but the setter
required a new macro. I modified three HTMLImageElement properties to use the
new macro. We can change other properties to use this macro as the issues
arise, I guess.
Status: NEW → ASSIGNED
Priority: P3 → P2
Whiteboard: [HAVE FIX]
Target Milestone: mozilla1.0.1 → mozilla0.9.9
Comment on attachment 67510 [details] [diff] [review]
Proposed fix for this baby

Looks great, sr=jst
Attachment #67510 - Flags: superreview+
jonas, could you please review this patch? thanks in advance :-)
Comment on attachment 67510 [details] [diff] [review]
Proposed fix for this baby

The code looks fine, but I'm not 100% sure I understand why it fixes the bug.
Is it becuase the stylesystem relies on that the attribute has pixel unit?
Attachment #67510 - Flags: review+
*** Bug 47249 has been marked as a duplicate of this bug. ***
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
*** Bug 120089 has been marked as a duplicate of this bug. ***
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: