Bug 220627 - style object does not return full array of DOM properties
Summary: style object does not return full array of DOM properties
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-30 02:30 UTC by John A. Bilicki III
Modified: 2011-02-18 00:13 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John A. Bilicki III 2009-12-30 02:30:42 UTC
Version:            (using KDE 4.3.2)
OS:                Linux
Installed from:    Unspecified Linux

This script works correctly in Opera, Firefox, and IE...

var dom_properties=new Array();

for (var a in document.getElementById('element_id').style)
{dom_properties.push(a);}

dom_properties.sort();

alert(dom_properties);
Comment 1 John A. Bilicki III 2009-12-30 02:34:47 UTC
I should add this bug also occurs in WebKit as well.

It's very important that this bug gets fixed for Konqueror because the documentation is unfortunately lacking so it barrels down to manually guessing is an object is supported or not. By fixing this bug a list of existing DOM properties can be generated and then folks like myself can take advantage of what Konqueror has to offer.
Comment 2 Maksim Orlovich 2009-12-30 03:05:34 UTC
So you want it to return the list of all CSS dynamic properties, 
not the bound ones you can get via standard .length and .item methods?
Comment 3 John A. Bilicki III 2009-12-30 03:10:52 UTC
Just run the script in Firefox, IE, or Opera; they return all the DOM properties that exist. This is massively useful as it makes discovering what is available much easier and removes the need for having to sit around waiting for someone to document everything.

When you say 'dynamic properties' I'm not exactly following you...I'll take a best guess...are the properties that *are* currently being returned the ones that have a set "current" value while the ones that are not have no "set" values for the object in question?

In example I was able to determine what new properties are supported in Opera 10.5: OTabSize, OTransform, OTransition, OTransitionDelay, OTransitionDuration, 
OTransitionProperty, OTransitionTimingFunction (etc) by comparing the generated lists from Opera 10.1 and Opera 10.5.
Comment 4 Maksim Orlovich 2009-12-30 03:37:24 UTC
SVN commit 1067634 by orlovich:

Enumerate dynamic properties in CSSStyleDeclaration
(Note: this includes the SVG properties as well...)

BUG:220627



 M  +28 -4     kjs_css.cpp  
 M  +5 -4      kjs_css.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1067634
Comment 5 Maksim Orlovich 2009-12-30 03:40:14 UTC
FWIW, http://lxr.kde.org/source/KDE/kdelibs/khtml/css/cssproperties.in gives 
all supported properties.
Comment 6 Gérard Talbot (no longer involved) 2011-02-18 00:13:06 UTC
It is now at

http://lxr.kde.org/source/kde/kdelibs-git/khtml/css/cssproperties.in

DHTML demo on listing CSS properties: List of computed style property value for each style property of body node
http://www.gtalbot.org/DHTMLSection/ListComputedStylePropertyValues.html
(I may improve this demo or make it more versatile one day)

One detail worth mentioning. At least one property ( shorthand borderRadius ) is not settable dynamically in Konqueror 4.6 while it will be listed in both cssproperties.in and in my demopage. The workaround is to set all 4 properties: borderBottomLeftRadius, borderBottomRightRadius, borderTopLeftRadius, borderTopRightRadius

regards, Gérard