|
@@ -245,9 +245,10 @@ procedure TCSSStyleInspector.UpdateDeclaration(RuleDiv: TDiv; Row: integer;
|
|
var
|
|
var
|
|
KeyEl: TCSSElement;
|
|
KeyEl: TCSSElement;
|
|
ResolvedKeyEl: TCSSResolvedIdentifierElement;
|
|
ResolvedKeyEl: TCSSResolvedIdentifierElement;
|
|
- ValueTxt, KeyTxt: String;
|
|
|
|
|
|
+ ValueTxt, KeyTxt, ValueCaption: String;
|
|
i, Index: Integer;
|
|
i, Index: Integer;
|
|
DeclDiv: TDiv;
|
|
DeclDiv: TDiv;
|
|
|
|
+ KeyData: TCSSAttributeKeyData;
|
|
begin
|
|
begin
|
|
// add or update div
|
|
// add or update div
|
|
if Row<RuleDiv.NodeCount-1 then // -1 for the footer
|
|
if Row<RuleDiv.NodeCount-1 then // -1 for the footer
|
|
@@ -274,9 +275,10 @@ begin
|
|
ValueTxt+=', ';
|
|
ValueTxt+=', ';
|
|
ValueTxt+=DeclEl.Children[i].AsFormattedString;
|
|
ValueTxt+=DeclEl.Children[i].AsFormattedString;
|
|
end;
|
|
end;
|
|
|
|
+ ValueCaption:=ValueTxt;
|
|
if DeclEl.IsImportant then
|
|
if DeclEl.IsImportant then
|
|
- ValueTxt+=' !important';
|
|
|
|
- ValueTxt+=';';
|
|
|
|
|
|
+ ValueCaption+=' !important';
|
|
|
|
+ ValueCaption+=';';
|
|
|
|
|
|
Index:=0;
|
|
Index:=0;
|
|
if (DeclEl.KeyCount<>1) then
|
|
if (DeclEl.KeyCount<>1) then
|
|
@@ -293,15 +295,21 @@ begin
|
|
writeln('TCSSStyleInspector.AddDeclaration Unknown attribute: ',i,' "',ValueTxt,'"');
|
|
writeln('TCSSStyleInspector.AddDeclaration Unknown attribute: ',i,' "',ValueTxt,'"');
|
|
end else begin
|
|
end else begin
|
|
// todo: check for validity
|
|
// todo: check for validity
|
|
- // todo: check if overriden
|
|
|
|
- // todo: split shorthands
|
|
|
|
- writeln('TCSSStyleInspector.AddDeclaration Known: ',i,' "',ValueTxt,'"');
|
|
|
|
- UpdateLabel(DeclDiv,Index,DeclKeyLabelClass,KeyTxt);
|
|
|
|
- inc(Index);
|
|
|
|
- UpdateLabel(DeclDiv,Index,DeclColonLabelClass,':');
|
|
|
|
- inc(Index);
|
|
|
|
- UpdateLabel(DeclDiv,Index,DeclValueLabelClass,ValueTxt);
|
|
|
|
- inc(Index);
|
|
|
|
|
|
+ KeyData:=TCSSAttributeKeyData(KeyEl.CustomData);
|
|
|
|
+ if KeyData.Invalid then
|
|
|
|
+ begin
|
|
|
|
+ // invalid value
|
|
|
|
+ end else begin
|
|
|
|
+ // todo: check if overriden
|
|
|
|
+ // todo: split shorthands
|
|
|
|
+ writeln('TCSSStyleInspector.AddDeclaration Known: ',i,' "',ValueTxt,'"');
|
|
|
|
+ UpdateLabel(DeclDiv,Index,DeclKeyLabelClass,KeyTxt);
|
|
|
|
+ inc(Index);
|
|
|
|
+ UpdateLabel(DeclDiv,Index,DeclColonLabelClass,':');
|
|
|
|
+ inc(Index);
|
|
|
|
+ UpdateLabel(DeclDiv,Index,DeclValueLabelClass,ValueTxt);
|
|
|
|
+ inc(Index);
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
end else begin
|
|
end else begin
|
|
// todo: unknown declaration
|
|
// todo: unknown declaration
|
|
@@ -312,7 +320,7 @@ begin
|
|
if Index=0 then
|
|
if Index=0 then
|
|
begin
|
|
begin
|
|
// invalid declaration
|
|
// invalid declaration
|
|
- UpdateLabel(DeclDiv,Index,SkippedClass,KeyTxt+': '+ValueTxt);
|
|
|
|
|
|
+ UpdateLabel(DeclDiv,Index,SkippedClass,KeyTxt+': '+ValueCaption);
|
|
inc(Index);
|
|
inc(Index);
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -389,6 +397,7 @@ begin
|
|
+'.'+DeclDivClass+' { margin-left: 2ch; }'+LineEnding
|
|
+'.'+DeclDivClass+' { margin-left: 2ch; }'+LineEnding
|
|
+'.'+DeclKeyLabelClass+' { color: cyan; }'+LineEnding
|
|
+'.'+DeclKeyLabelClass+' { color: cyan; }'+LineEnding
|
|
+'.'+DeclColonLabelClass+' { margin-right: 1ch; }'+LineEnding
|
|
+'.'+DeclColonLabelClass+' { margin-right: 1ch; }'+LineEnding
|
|
|
|
+ +'.'+SkippedClass+' { color: #aaa; }'+LineEnding
|
|
;
|
|
;
|
|
end;
|
|
end;
|
|
|
|
|