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 17522 - pixelDepth and colorDepth do not mean the same thing.
Summary: pixelDepth and colorDepth do not mean the same thing.
Status: RESOLVED FIXED
Alias: None
Product: CSS
Classification: Unclassified
Component: CSSOM View (show other bugs)
Version: unspecified
Hardware: All All
: P2 major
Target Milestone: ---
Assignee: Simon Pieters
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
: 14071 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-06-16 23:25 UTC by Neils Christoffersen
Modified: 2013-08-08 13:28 UTC (History)
2 users (show)

See Also:


Attachments

Description Neils Christoffersen 2012-06-16 23:25:29 UTC
The CSSOM View spec section 4.2 defines two properties on the Screen interface: pixelDepth and colorDepth.

The spec is unclear/wrong on two counts:

1. pixelDepth and colorDepth are defined together, implying that they should always be the same. If they are always identical, then there is no point in having two properties.

2. Pixel depth and color depth do not always mean the same thing, depending on the display device.
Comment 1 Glenn Adams 2012-08-03 05:55:22 UTC
reassign to myself; apparently i am not the default assignee for this component
Comment 2 Simon Pieters 2013-05-14 14:52:19 UTC
How are they different?
Comment 3 Glenn Adams 2013-06-18 09:10:44 UTC
(In reply to comment #2)
> How are they different?

colorDepth is (or is often interpreted as) bits per component, also called bits per sample; while pixelDepth often refers to the combination of bits for a pixel contributed by all applicable samples;

so, e.g., RGBA4444 is 4 bits per sample, or colorDepth 4 but pixelDepth 16;

see https://en.wikipedia.org/wiki/Color_depth for more discussion

at present the definitions of both colorDepth and pixelDepth in Section 5.2 are wrong
Comment 4 Simon Pieters 2013-06-18 09:57:23 UTC
Ah. Yes, they are different to the industry terms 'color depth' and 'pixel depth'. However, the current definition is interoperably implemented in Presto/Blink/WebKit/Gecko/IE, as far as I can tell. This is a case where the implementations predated the spec, I believe.
Comment 5 Glenn Adams 2013-06-18 09:59:21 UTC
The implementations are broken. We fix broken implementations all the time. Do not close this bug again without addressing it substantively.
Comment 6 Simon Pieters 2013-06-18 10:02:42 UTC
*** Bug 14071 has been marked as a duplicate of this bug. ***
Comment 7 Simon Pieters 2013-06-18 12:59:58 UTC
In http://webdevdata.org/ data-dec2012 I see 3269 matches of "\.(color|pixel)Depth". Looking through the matches, it seems like basically all of them are for the purpose of tracking. Here's an example:

	document.write("<img src='http://counter.yadro.ru/hit;prian?r"+ escape(document.referrer)+((typeof(screen)=="undefined")?"": ";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth? screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+ ";"+Math.random()+ "' width=1 height=1 alt=''>")
Comment 8 Simon Pieters 2013-06-19 08:54:33 UTC
I made them always return 24.

https://dvcs.w3.org/hg/csswg/rev/e87354ee3440