Closed Bug 80000 Opened 19 years ago Closed 19 years ago

Advanced Dialog for CSS properties should rely on ElementCSSInlineStyle

Categories

(Core :: DOM: Editor, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla0.9.2

People

(Reporter: glazou, Assigned: glazou)

Details

Attachments

(3 files)

Advanced Dialog for CSS properties should rely on DOM Level 2
ElementCSSInlineStyle instead of parsing by hand the contents of the STYLE
attribute.
Attached patch patch v1.0Splinter Review
Patch for this bug added above. I think it is much more reliable than the former
parsing "by hand" of tokens separated by semi-colons. In particular, the value
of a CSS property can be a string containing a semi-colon...

r= and sr= needed, thanks.
Status: NEW → ASSIGNED
r=cmanske
Can you solve the problem that we have in Advanced editor that we always end up
with separate CSS attributes (e.g.: border-left : 10px; border-right : 10px...)
instead of combined (e.g. border : 10px)?
Priority: -- → P3
Target Milestone: --- → mozilla0.9.2
Hum. This is a very complex problem. 'border-width' is not really a property in
itself but a shorthand setting the 4 values of border-left -right -bottom -top.
I think that our CSS OM does not correctly support queries on shorthand properties
for the moment and your problem is a side-effect of that one.
Question ... the old code:

-  var style = element.getAttribute("style");

returns a string and the new code:

+  var style = element.style;

returns an object?

Shouldn't we check if style is undefined before we try to access style.length?

+  var style = element.style;
+  var l = style.length;
+
+  if(style == undefined || style == "" || l == 0)
Agreed ; will submit a rewriting tomorrow
Attached patch patch v1.1Splinter Review
patch re-submitted in answer to Kin. sr= ?
sr=kin@netscape.com with the changes we discussed over aim. (Remove dump 
statements where not neccessary.)
yay! checked in :-) 
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Glazman, can you verify this and mark verified-fixed? thanks!
glazman, please verify this one...thanks...
code level fix...marking verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.