|
@@ -417,6 +417,7 @@ type
|
|
|
function IndexOfStyle(aStyle: TCSSElement): integer; virtual;
|
|
|
procedure RemoveStyle(aStyle: TCSSElement); virtual;
|
|
|
procedure DeleteStyle(aIndex: integer); virtual;
|
|
|
+ procedure ClearStyles; virtual;
|
|
|
property StyleCount: integer read GetStyleCount;
|
|
|
property Styles[Index: integer]: TCSSElement read GetStyles write SetStyles;
|
|
|
property OwnsStyle: boolean read FOwnsStyle write FOwnsStyle default false;
|
|
@@ -568,6 +569,7 @@ begin
|
|
|
if C=TCSSCompoundElement then
|
|
|
begin
|
|
|
Compound:=TCSSCompoundElement(El);
|
|
|
+ //writeln('TCSSResolver.ComputeElement Compound.ChildCount=',Compound.ChildCount);
|
|
|
for i:=0 to Compound.ChildCount-1 do
|
|
|
ComputeElement(Compound.Children[i]);
|
|
|
end else if C=TCSSRuleElement then
|
|
@@ -635,6 +637,7 @@ var
|
|
|
C: TClass;
|
|
|
begin
|
|
|
Result:=CSSSpecifityInvalid;
|
|
|
+ //writeln('TCSSResolver.SelectorMatches ',aSelector.ClassName,' ',TestNode.GetCSSTypeName);
|
|
|
C:=aSelector.ClassType;
|
|
|
if C=TCSSIdentifierElement then
|
|
|
Result:=SelectorIdentifierMatches(TCSSIdentifierElement(aSelector),TestNode,OnlySpecifity)
|
|
@@ -1769,6 +1772,7 @@ begin
|
|
|
end;
|
|
|
|
|
|
// resolve user defined names
|
|
|
+ //writeln('TCSSResolver.ResolveIdentifier ',Kind,' "',aName,'"');
|
|
|
if Result=CSSIDNone then
|
|
|
Result:=FNumericalIDs[Kind][aName];
|
|
|
|
|
@@ -1929,22 +1933,17 @@ begin
|
|
|
end;
|
|
|
|
|
|
destructor TCSSResolver.Destroy;
|
|
|
-var
|
|
|
- i: Integer;
|
|
|
begin
|
|
|
+ Clear;
|
|
|
FreeAndNil(FLogEntries);
|
|
|
- if FOwnsStyle then
|
|
|
- begin
|
|
|
- for i:=0 to high(FStyles) do
|
|
|
- FStyles[i].Free;
|
|
|
- end;
|
|
|
- FStyles:=nil;
|
|
|
inherited Destroy;
|
|
|
end;
|
|
|
|
|
|
procedure TCSSResolver.Clear;
|
|
|
begin
|
|
|
+ FLogEntries.Clear;
|
|
|
ClearStyleCustomData;
|
|
|
+ ClearStyles;
|
|
|
end;
|
|
|
|
|
|
procedure TCSSResolver.ClearStyleCustomData;
|
|
@@ -1988,6 +1987,7 @@ procedure TCSSResolver.Commit;
|
|
|
var
|
|
|
i: Integer;
|
|
|
begin
|
|
|
+ //writeln('TCSSResolver.Commit FAttributeCount=',FAttributeCount);
|
|
|
for i:=0 to FAttributeCount-1 do
|
|
|
with FAttributes[i] do
|
|
|
FNode.SetCSSValue(AttrID,Value);
|
|
@@ -2023,5 +2023,15 @@ begin
|
|
|
Delete(FStyles,aIndex,1);
|
|
|
end;
|
|
|
|
|
|
+procedure TCSSResolver.ClearStyles;
|
|
|
+var
|
|
|
+ i: Integer;
|
|
|
+begin
|
|
|
+ if OwnsStyle then
|
|
|
+ for i:=0 to high(FStyles) do
|
|
|
+ FStyles[i].Free;
|
|
|
+ FStyles:=nil;
|
|
|
+end;
|
|
|
+
|
|
|
end.
|
|
|
|