W3C home > Mailing lists > Public > public-html-bugzilla@w3.org > September 2011

[Bug 14203] JavaScript API to access unsupported CSS properties

From: <bugzilla@jessica.w3.org>
Date: Mon, 19 Sep 2011 01:06:54 +0000
To: public-html-bugzilla@w3.org
Message-Id: <E1R5SJy-0006SR-OO@jessica.w3.org>

--- Comment #2 from Marat Tanalin (tanalin.com) <mtanalin@yandex.ru> 2011-09-19 01:06:53 UTC ---
(In reply to comment #1)

Thank you for valuable comment, David.

The API I've proposed is a _minimal_ API _enough_ to get value of an
unsupported property.

Such minimal/enough API is _much, much_ better then current situation when we
have no access to unsupported properties _at all_ and are forced to parse
stylesheets entirely from scratch.

As far as I understand CSS-parsing mechanism, if we have following unsupported
property declaration:

    some-property: some value;

then entire string "some-property: some value;" is skipped by browser.

In this string, a browser can automatically treat string before first colon as
property name, while treating rest part of the string (after colon) as its

Inheritance (when needed) could be calculated by JS-script itself by
iteratively checking the property for all parents of the element -- from direct
parent to root element of element's owner-document.

Feel free to supplement the API with additional features that would make
accessing unsupported properties (as well as unsupported values of supported
properties) even easier for web-developers.

Based on information available at your link, we could add 'inherit' boolean
parameter to getStyle() method:

// Second parameter specifies whether property should be inherited (false by
element.getStyle('some-property', true);

(Actually, it's enough to be able to read individual properties via only
getStyle() method to achieve subject goal. getStyles() method is optional
compared with getStyle().)

As for "parse + compute function", I'm not sure it's reasonable enough to use
them in _client_ scripts (as opposed to internal browser's chrome scripts).
Appropriate parts of parsing script could be called later in script -- when raw
value is already obtained. There is no big need to do these actions in exactly
one step.


Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Monday, 19 September 2011 01:06:56 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:02:03 UTC