Closed Bug 78202 Opened 23 years ago Closed 23 years ago

getComputedStyle not implemented for text-decoration property

Categories

(Core :: DOM: CSS Object Model, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.9.1

People

(Reporter: glazou, Assigned: harishd)

References

Details

(Keywords: css1, dom2, testcase, Whiteboard: [Hixie-PF] [fix in hand])

Attachments

(2 files)

getComputedStyle DOM 2 Style is not implemented for text-decoration property.
The answer is always "".

This is needed for the CSSization of Composer.
adding dependency : blocking 77705
Blocks: 77705
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.1
Attached patch Patch v1.1Splinter Review
Whiteboard: [fix in hand]
I have a question related to your patch :

+  
+  if(text) {
+    const nsCString& decoration=
+     
nsCSSProps::SearchKeywordTable(text->mTextDecoration,nsCSSProps::kTextDecorationKTable);
+    val->SetString(decoration);
+  }
+  else {
+    val->SetString("");
+  }

What means here a "" return string ?
Empty value is not a valid value for text-decoration. What does it mean ?
If it means 'equal to the initial value because the property is not inherited
and no specific value is assigned', I suggest you use the value "none" for
fallback instead of "".
Using the initial value should also be the fallback for all other properties.

Cc:ing Hixie because I would like to read his opinion.
I don't have a particular opinion. The result of GetComputedStyle for text-
decoration is quite well defined, and will be one of the following strings:

   "none"                           
   "underline"                       "overline"
   "line-through"                    "blink"
   "underline overline"              "underline line-through"
   "underline blink"                 "overline line-through" 
   "overline blink"                  "line-through blink"
   "underline overline line-through" "underline overline blink"
   "underline line-through blink"    "overline line-through blink"

Note that the CSS3 text module will change this. In CSS3, "" will be a valid 
response for GetComputedStyle.textDecoration. It will represent the cases that
do not map to the text-decoration shorthand (this is similar to how "border"
can be "" for some cases).
Keywords: css1, dom2, testcase
Whiteboard: [fix in hand] → [Hixie-PF] [fix in hand]
heikki says r=heikki
Daniel, you'd only get "" in an error case if the style system screws up, you'll
get default values n' all that from the style system.

sr=jst
aaaahhh, ok, thanks jst
Fix is in. Marking FIXED.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: