Closed Bug 263685 Opened 20 years ago Closed 20 years ago

getComputedStyle not working on -moz-outline-radius

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: aaronlev, Assigned: aaronlev)

Details

Attachments

(1 file)

(Spinoff from bug 24676)
Code needs to be edited in mozilla/content/html/style/src/nsComputedDOMStyle.cpp
to support computed style for -moz-outline-radius
With this patch the following code returns the correct thing:
document.defaultView.getComputedStyle(node,'').getPropertyValue("-moz-outline-radius-topleft"));


However, I cannot seem to get any of these lines to work:
node.outline = "solid 3px black";	   node.mozOutline = "solid 3px black";

node.outlineStyle = "solid";		   node.mozOutlineStyle = "solid"
node.outlineWidth = "3px";		   node.mozOutlineWidth = "3px";
node.outlineColor = "black";		   node.mozOutlineColor = "black";
node.outlineRadius = "2px";		   node.mozOutlineRadius = "2px";
etc.

P.S. When should we get rid of the -moz and just make it outline?
Assignee: dbaron → aaronleventhal
Status: NEW → ASSIGNED
Attachment #161638 - Flags: superreview?(dbaron)
Actually changing the outline through node.style does work, but you have to
capitalize the M in Moz, e.g.:
node.MozOutline = "solid 3px black";

I was thrown off by that -- usualy JS properties start with a lowercase letter.
Comment on attachment 161638 [details] [diff] [review]
Support outline in computed style

>+    switch (aSide) {
>+      case NS_SIDE_TOP:
>+        outline->mOutlineRadius.GetTop(coord);
>+        break;
>+      case NS_SIDE_BOTTOM:
>+        outline->mOutlineRadius.GetBottom(coord);
>+        break;
>+      case NS_SIDE_LEFT:
>+        outline->mOutlineRadius.GetLeft(coord);
>+        break;
>+      case NS_SIDE_RIGHT:
>+        outline->mOutlineRadius.GetRight(coord);
>+        break;
>+      default:
>+        NS_WARNING("double check the side");
>+        break;
>+    }

Change this to just be:

outline->mOutlineRadius.Get(aSide, coord);

and fix where you copied it from as well.  (nsComputedDOMStyle has too much
copy&pasted code.  It needs to use nsCSSPropList.h somehow.  It may be worth
filing a bug on that (probably on me).)

>+    // Don't impl _moz_outline / outline since it just returns null as per spec

Don't add this -- there's already a comment above explaining what "////" means,
and you're not adding this comment to all the other "////", which seems to
imply that it's different from them, which it isn't.

sr=dbaron with those changes
Attachment #161638 - Flags: superreview?(dbaron) → superreview+
Comment on attachment 161638 [details] [diff] [review]
Support outline in computed style

Will post a new patch addressing David's comments if requested to do so.
Attachment #161638 - Flags: review?(roc)
Checking in nsComputedDOMStyle.cpp;
/cvsroot/mozilla/content/html/style/src/nsComputedDOMStyle.cpp,v  <-- 
nsComputedDOMStyle.cpp
new revision: 1.130; previous revision: 1.129
done
Checking in nsComputedDOMStyle.h;
/cvsroot/mozilla/content/html/style/src/nsComputedDOMStyle.h,v  <-- 
nsComputedDOMStyle.h
new revision: 1.23; previous revision: 1.22
done
Status: ASSIGNED → RESOLVED
Closed: 20 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: