RESOLVED CONFIGURATION CHANGED 14363
Implement the CSS 2 Properties extended interface on style objects
https://bugs.webkit.org/show_bug.cgi?id=14363
Summary Implement the CSS 2 Properties extended interface on style objects
Gérard Talbot (no longer involved)
Reported 2007-06-24 01:58:43 PDT
Steps to reproduce ------------------ 1- Load provided URL 2- Click "List computed style properties of body node" button Actual results -------------- The cssText lists (in lexicographical order) all of the possible style properties and their correspondent computed value. Only 10 other properties are listed for document.body.style: 2. getPropertyCSSValue = function getPropertyCSSValue() { [native code] } 3. getPropertyPriority = function getPropertyPriority() { [native code] } 4. getPropertyShorthand = function getPropertyShorthand() { [native code] } 5. getPropertyValue = function getPropertyValue() { [native code] } 6. isPropertyImplicit = function isPropertyImplicit() { [native code] } 7. item = function item() { [native code] } 8. length = 127 9. parentRule = null 10. removeProperty = function removeProperty() { [native code] } 11. setProperty = function setProperty() { [native code] } Expected results ---------------- The applicable style properties should all be listed with their correspondent computed value. The cssText should just be listed as a property of the style object with an empty value. Notes ----- - cssText is supposed to apply to stylesheet objects, cssRules objects and style declarations; cssText should return (get) the textual declaration of their object. - Firefox 2.0.0.4 and Opera 9.21 get the expected results; MSIE 7 via currentStyle get the expected results. - I've searched for duplicates and couldn't find any. - Safari 3.0.2 build 522.13.1 here
Attachments
David Kilzer (:ddkilzer)
Comment 1 2007-06-24 07:34:14 PDT
Confirmed with Safari 3.0 (522.12) with a local debug build of WebKit r23748 on Mac OS X 10.4.10 (8R218) in comparison to Firefox 2.0.0.4 and Opera 9.21.
Sam Weinig
Comment 2 2007-06-24 14:51:44 PDT
I think the main issue here is that we don't enumerate the attributes that are part of the CSS2Properties interface yet. I don't see why our result for cssText is incorrect though. Could you please explain your reasoning.
Gérard Talbot (no longer involved)
Comment 3 2007-06-25 11:10:24 PDT
I'm looking for a DOM 2 CSS code which will report back all of the possible attributes, properties of an object (here, the document.body.style object). And when I get a property or an attribute, find out/get their default or current value. So, I would have expected to have the css properties to be returned like this: 1. background-attachment: scroll; > we don't enumerate the attributes that are > part of the CSS2Properties interface yet Yes, that's one problem; implementation of the CSS2Properties interface. One has to use setProperty(propertyName, value) to workaround this limitation. I don't understand why the cssText property holds all or almost all (127 style properties) of data I was looking for. I'm still experimenting and reading the DOM 2 CSS spec... Differential implementation in details can contribute to fragment the web. Doing as accurately as possible what Mozilla Firefox and Opera do can help convince Microsoft not to be incompatible when implementing new properties.
Gérard Talbot (no longer involved)
Comment 4 2008-02-27 12:29:34 PST
(In reply to comment #2) > (...) why our result for > cssText is incorrect though. Could you please explain your reasoning. When cssText is an attribute of a CSS rule: "cssText of type DOMString The parsable textual representation of the rule. This reflects the current state of the rule and not its initial value." http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS-CSSRule-cssText when When cssText is an attribute of a CSS declaration (which is *this* case wrt this bug's testcase): " cssText of type DOMString The parsable textual representation of the declaration block (excluding the surrounding curly braces). Setting this attribute will result in the parsing of the new value and resetting of all the properties in the declaration block including the removal or addition of properties. " http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS-CSSStyleDeclaration-cssText "cssText is the full text of the style rules as they are written in the stylesheet." http://www.scottandrew.com/weblog/articles/dhtml_ns6 {cssText can get (read) but also set (write) the text value according to DOM 2 CSS.} In the testpage, body.element.style has no textual declaration, except in the linked external stylesheet http://www.gtalbot.org/Stylesheets/StartSection.css . I think that's why other browsers give an empty value like cssText= for the cssText More tests could be done here. margin: 8px; padding: 0px; color: black; background-color: #DDD; /* 221 */ is the parsable textual representation of the declaration block in the external stylesheet for the body element while Safari 3.0.4 build 523.12.9 do not return such text of the declaration block when doing the testcase.
Eric Seidel (no email)
Comment 5 2009-03-05 16:47:09 PST
Please file separate bugs (with nice test cases) for the cssText issue vs. the CSS2 Properties issue. I'm going adopt this bug to cover implementation of the CSS 2 properties interface since that seems to be your primary complaint. :) http://www.w3.org/TR/DOM-Level-2-Style/css.html
Alexey Proskuryakov
Comment 6 2010-11-30 12:15:27 PST
Unless I'm misreading the bugs, bug 33033 tracks CSS2Properties now.
Alexander Pavlov (apavlov)
Comment 7 2012-11-21 01:41:42 PST
Bug 23946 fix seemingly covers this bug, too.
Brent Fulgham
Comment 8 2022-07-07 12:41:17 PDT
We believe this is fixed. Please reopen if you believe there are other issues to resolve.
Note You need to log in before you can comment on or make changes to this bug.