Closed Bug 8591 Opened 25 years ago Closed 25 years ago

{css1} Unitless numbers are not ignored

Categories

(Core :: CSS Parsing and Computation, defect, P3)

x86
Windows 95
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: ian, Assigned: peterl-retired)

References

()

Details

(Keywords: css1, Whiteboard: Nav Quirk 8/19: Pending verification in Standard mode)

In CSS, numbers without units should not be parsed as lengths, and should
cause the entire declaration to be ignored, if a length is what is expected.

For example:

   DIV { font-size: 12; }

...should be ignored, because font-size does not accept pure numbers, only
lengths, which requires units.

Here are some tests for this requirement:
   http://www.fas.harvard.edu/~dbaron/css/test/unitless
   http://www.bath.ac.uk/%7Epy8ieh/internet/projects/mozilla/unitless.html

Currently, we are assuming that numbers without units are actually lengths
in pixels. This is counter to the specs.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → WONTFIX
Whiteboard: Nav Quirk
This is a Nav Quirk (IE quirk too), unfortunately there are too many pages
already in existence that rely on this (like, all pages generated by MS word).

Try it in standard mode, we reject it properly then.
Status: RESOLVED → REOPENED
I am reopening this because you aren't ignoring them in Standard mode, on the
assumption that you do consider ignoring them in standard mode to be a bug.  I
confirmed I was in standard mode using
http://www.fas.harvard.edu/~dbaron/css/test/sec170501  and found no changes in
the test http://www.fas.harvard.edu/~dbaron/css/test/unitless , where you still
fail to reject the unitless numbers.
Resolution: WONTFIX → ---
Clearing Won't Fix resolution since this is Reopened.
Ian, could you please change the doctype of your test page to HTML4.0 strict?

We're finally connecting the quirk mode switches to the doctype. Note that the
user pref in viewer only currently controls the presentation-time quirk mode,
the CSS parsing is controlled by a seperate, parse time switch (which will be
controlled by the doctype).
The DOCTYPEs on both my page and David's page are already HTML4 Strict:

   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">

I would have been very surprised if they weren't.
Summary: Unitless numbers are not ignored → {css1} Unitless numbers are not ignored
Status: REOPENED → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → FIXED
CSS quirk mode now connected to document DTD state. (but the DTD state isn't
being set by the parser yet).
The 07-07 build is not showing any improvement here.  The switch in the viewer
menu doesn't help things, even if I:
* reload (as I always must)
* set it before loading for the first time.

This switch does change all the other things that should be affected by quirks
mode, such as table column backgrounds (
http://www.fas.harvard.edu/~dbaron/css/test/sec170501 ) or inheritance into
tables ( http://www.webstandards.org/css/winie/tablegackdemo1.html ).

Shouldn't this be the same switch?  [Not reopening, yet...]
The switch in viewer only effects the presentation mode, not the DTD mode. So it
will not change parse-time behaviors (as this is). I considered adding a new
switch (or hooking that switch to both mechanisms), but I thought it would be a
better use of time to just make auto quirk mode work (then the switch becomes
fairly useless anyway). (Still waiting for parser support for the final
connection of auto mode.)
Whiteboard: Nav Quirk → Nav Quirk 8/19 - verification pending response from peterl
Peter: I am using 8/16 Viewer and have opened the following in both Nav Quirk
and Standard modes (using Transitional and Strict DTD):

<html>
<head>
<title>8591</title>
<style="text/css">
.one { font-size: 26px }
.two { font-size: 26 }
</style>
</head>
<body>
<div class="one">This div should display the font size of 26 as there is a px
unit specification
</div>
<div class="two">This div should ignore the font size of 26 as there is no unit
specification
</div>
</body>
</html>

The DIV that has no unit assignment is not being ignored.
Is this still a bug or is it just that I will not be able to verify this in
Viewer as it stands today?
You cannot switch between quirk and standard mode via the DTD yet.
Whiteboard: Nav Quirk 8/19 - verification pending response from peterl → Nav Quirk 8/19 Unable to verify at present-can't switch to Nav Quirk via DTD yet
Whiteboard: Nav Quirk 8/19 Unable to verify at present-can't switch to Nav Quirk via DTD yet → Nav Quirk 8/19: Pending verification in Standard mode
Peter: Which milestone was this fixed in? Could you please add that to the
category? Thanks
Status: RESOLVED → VERIFIED
This seems to work with Win32 1999-10-04.
Keywords: css1
Migrating from {css1} to css1 keyword. The {css1}, {css2}, {css3} and {css-moz}
radars should now be considered deprecated in favour of keywords.
I am *really* sorry about the spam...
You need to log in before you can comment on or make changes to this bug.