Skip to content

Commit

Permalink
Additional changes related to authored styles based on Simon's feedback
Browse files Browse the repository at this point in the history
(related to issue 5507)
  • Loading branch information
SebastianZ committed Jan 6, 2014
1 parent c3e2cce commit fb9e7ef
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions extension/content/firebug/css/cssPanel.js
Expand Up @@ -862,16 +862,17 @@ Firebug.CSSStyleSheetPanel.prototype = Obj.extend(Panel,
var m;
var props = [];

if (Firebug.expandShorthandProps)
if (Options.get("expandShorthandProps"))
{
var count = style.length-1;
var index = style.length;

while (index--)
{
var propName = style.item(count - index);
this.addProperty(propName, style.getPropertyValue(propName),
!!style.getPropertyPriority(propName), false, inheritMode, props);
var value = getPropertyValue(style, propName);
this.addProperty(propName, value, !!style.getPropertyPriority(propName), false,
inheritMode, props);
}
}
else
Expand All @@ -886,12 +887,14 @@ Firebug.CSSStyleSheetPanel.prototype = Obj.extend(Panel,
if(!m)
continue;

var value = (Options.get("colorDisplay") == "authored") && style.getAuthoredPropertyValue ?
style.getAuthoredPropertyValue(m[1]) : m[2];

//var name = m[1], value = m[2], important = !!m[3];
if (m[2])
this.addProperty(m[1], value, !!m[3], false, inheritMode, props);
{
var name = m[1];
var value = getPropertyValue(style, name);
var important = !!m[3];

this.addProperty(name, value, important, false, inheritMode, props);
}
}
}

Expand Down Expand Up @@ -3034,6 +3037,12 @@ function parsePriority(value)
return {value: propValue, priority: priority};
}

function getPropertyValue(style, propName)
{
return (Options.get("colorDisplay") === "authored" && style.getAuthoredPropertyValue) ?
style.getAuthoredPropertyValue(propName) : style.getPropertyValue(propName);
}

function formatColor(color)
{
switch (Options.get("colorDisplay"))
Expand Down

0 comments on commit fb9e7ef

Please sign in to comment.