Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!takemy.news.telefonica.de!telefonica.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <1803366.4W3vaeNJFY@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Fri, 30 Mar 2012 20:59:42 +0200 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 7Bit Subject: Re: Browser Default Colors Newsgroups: comp.lang.javascript References: Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 65 NNTP-Posting-Date: 30 Mar 2012 20:59:42 CEST NNTP-Posting-Host: 25629483.newsspool3.arcor-online.net X-Trace: DXC=RX>5`gjQ]I^YQ5E:l On 30 Mar 2012 06:50:56 GMT, "Evertjan." > wrote in : >> Dr.Kral wrote on 29 mrt 2012 in comp.lang.javascript: See, most of that is what I referred to in my other answer as unnecessary and unwanted (because distracting) duplication of message header field values in my other answer. >>> I would like to get the default colors used by a browser using >>> ECMAScript from within the displayed page. >> In fact you are asking for DOM-functions, not for ECMA-script functions. There are no "DOM-functions" and there is no "ECMA-script". There are DOM (API) methods and there is ECMAScript. The W3C DOM Specification defines an ECMAScript language binding for interface attributes and methods, and DOM implementations allow an ECMAScript implementation to make use of those. You are obviously not good at splitting hairs, so please don't. > Without splitting hairs, I'm asking for the script function that retrieves > a parameter from the browser (background color) in a similar way to > getting, say, window height and screen width. There must be some default > style sheet (or equivalent) that has all the defaults parameters. There is, but it should be of no concern to script authors which is why they cannot access it in all cases. If you are interested in the default value as a developer, use a CSS inspector application (as included in all recent Web browsers). But never rely on it. >> I cannot imagine why you would need to know the browser default colours >> as a web-page programmer. As a programmer you should set those colours >> yourself if you concerned if the view will be as you wish. > > One simple example -- swap color and background color in a section. Can't > do it without knowing both for transparent text is not readable. AISB, if the body text color was declared, the body background color should be declared as well (and vice-versa). If not, that is an authoring error as the document is running the risk of being unreadable. So you can always know the background color and there is no real problem switching background and foreground color, regardless if this would ever be necessary or advisable. >> Methinks that information, especially the dynamic colours of the , are >> or should be hidden from the script under normal security-settings, as it >> is an improper way to measure the external links that are clicked. > > Note I was asking about the default colors for link:visited not for a > visited link element. AFAIK the `:visited' pseudo-class does not apply to `link' elements. PointedEars -- realism: HTML 4.01 Strict evangelism: XHTML 1.0 Strict madness: XHTML 1.1 as application/xhtml+xml -- Bjoern Hoehrmann