This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 10345 - hspace and vspace on HTMLImageElement are signed long in DOM 2 HTML. Was there a good reason for the incompatible change to unsigned long?
Summary: hspace and vspace on HTMLImageElement are signed long in DOM 2 HTML. Was the...
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
: 9914 10344 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-08-11 04:38 UTC by contributor
Modified: 2010-10-04 23:59 UTC (History)
8 users (show)

See Also:


Attachments

Description contributor 2010-08-11 04:38:51 UTC
Section: http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis

Comment:
hspace and vspace on HTMLImageElement are signed long in DOM 2 HTML.  Was
there a good reason for the incompatible change to unsigned long?

Posted from: 71.178.154.231
Comment 1 Aryeh Gregor 2010-08-11 20:16:44 UTC
*** Bug 9914 has been marked as a duplicate of this bug. ***
Comment 2 Aryeh Gregor 2010-08-11 20:22:07 UTC
Also width on HTMLPreElement, and rowSpan/colSpan on HTMLTableCellElement, and hspace/vspace on various interfaces other than HTMLImageElement, and span on HTMLTableColElement, and cols/rows on HTMLTextAreaElement.  Those are all the ones I can see.
Comment 3 Anne 2010-08-16 07:54:57 UTC
What are they in implementations though? That is what matters.
Comment 4 Aryeh Gregor 2010-08-16 10:50:33 UTC
They're signed long in Gecko.  See discussion:

https://bugzilla.mozilla.org/show_bug.cgi?id=586126
Comment 5 Ian 'Hixie' Hickson 2010-09-24 01:34:07 UTC
There are a number of other unsigned long attributes; the bug you linked to mentions that Gecko only has four. Are you sure the ones you mentioned are the only ones that need changing?

(The differences from DOM2 are completely unintentional; I just assumed these were unsigned instead of checking when I added them. My bad.)
Comment 6 Aryeh Gregor 2010-09-26 12:08:27 UTC
I think those are all the cases for reflected attributes, yes.  IIRC, I used my reflection test suite to get the list in comment #2 (just seeing which tests Gecko failed), so I didn't look for other places where the types didn't match.
Comment 7 Aryeh Gregor 2010-09-26 12:09:53 UTC
(I mean, I looked for where Gecko failed and then confirmed that there was indeed a mismatch between HTML5 and DOM 2 HTML, I didn't just assume that Gecko must be right.  I did implicitly assume that Gecko doesn't match HTML5 anywhere that HTML5 disagrees with DOM 2 HTML, so if that's wrong the list might be incomplete.)
Comment 8 Ian 'Hixie' Hickson 2010-09-28 17:54:47 UTC
*** Bug 10344 has been marked as a duplicate of this bug. ***
Comment 9 Ian 'Hixie' Hickson 2010-10-01 18:55:59 UTC
Given:
   http://www.hixie.ch/tests/adhoc/dom/webidl/attributes/
   http://krijnhoetmer.nl/irc-logs/whatwg/20090714#l-102
...I'm not really sure what it means, in practice, for an attribute to be signed or unsigned, from a historical perspective.

Given how bad the interop is here, I think it might be better to just go with sanity, which the spec, IMHO, is closer to than most browsers. In particular, I'm not sure Gecko's behaviour here is necessarily more sensible than any other browser's. They're all pretty nutty.

However, I am very open to changing the spec here, if we know what we want to change it _to_. It's not clear to me that DOM2 HTML is any more sensible (or closer to interop) here than what we have here in DOM5 HTML.

Any opinions?

Maybe we should WONTFIX this overall bug and just consider changes on a per-attribute basis?
Comment 10 Aryeh Gregor 2010-10-03 16:23:32 UTC
Behavior when giving negative values for this sort of attribute is all over the place.  Some browsers clamp, some browsers wrap, some ignore out-of-range values, some do one thing sometimes and another thing other times.  The current spec seems sane to me: make them unsigned longs in the interface, and unsigned longs ignore out-of-range values in content attributes.  And the ones we don't want to be 0 also ignore a content attribute of 0.  (Not so sure about the reasonableness of throwing exceptions on IDL set, though, unless that consistently happens on out-of-range IDL sets.)
Comment 11 Ian 'Hixie' Hickson 2010-10-04 23:59:24 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale:

Ok.

As per the discussion above, I'm rejecting this bug on the principle that in general we want the types to represent roughly what the allowed ranges are for the IDL attributes.

It's almost certainly the case that:

 * some IDL attributes have the wrong types, given this definition
 * the "reflection" rules are wrong, either on specific aspects (e.g. raising exceptions on certain cases), or for specific attributes (e.g. maybe some attributes need particular weird behaviours for compat).
 * some attributes have the wrong ranges.

Please file specific bugs if there are specific concerns like this. In particular there are three rationales that are IMHO strong here:

 1. Specific pages require specific behaviour (legacy content compatibility). Please cite URLs so I can look into what the constraints are when filing such bugs.

 2. What the spec says is illogical, and no known specific compatibility constraints exist, and there is no wide interop, so we can probably change the spec to be more logical.

 3. All (or most) of the browsers do the same thing on a specific case that the spec disagrees on.