mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 07:09:29 +02:00
fcl-css: test inline style
This commit is contained in:
parent
02f41731eb
commit
d4a7431938
@ -319,8 +319,7 @@ Var
|
||||
aEl : TCSSElement;
|
||||
Terms : TCSSTokens;
|
||||
begin
|
||||
Terms:=[ctkEOF];
|
||||
Include(Terms,aStopOn);
|
||||
Terms:=[ctkEOF,aStopOn];
|
||||
aList:=TCSSCompoundElement(CreateElement(TCSSCompoundElement));
|
||||
Try
|
||||
While not (CurrentToken in Terms) do
|
||||
@ -346,7 +345,6 @@ begin
|
||||
Result:=ParseRuleList;
|
||||
end;
|
||||
|
||||
|
||||
function TCSSParser.GetNextToken: TCSSToken;
|
||||
begin
|
||||
FPrevious:=FCurrent;
|
||||
|
@ -317,6 +317,9 @@ var
|
||||
begin
|
||||
if El=nil then exit;
|
||||
C:=El.ClassType;
|
||||
{$IFDEF VerboseCSSResolver}
|
||||
//writeln('TCSSResolver.ComputeElement ',GetCSSPath(El));
|
||||
{$ENDIF}
|
||||
if C=TCSSCompoundElement then
|
||||
begin
|
||||
Compound:=TCSSCompoundElement(El);
|
||||
|
@ -243,11 +243,13 @@ type
|
||||
// ToDo: :lang()
|
||||
|
||||
// ToDo: inline style
|
||||
procedure Test_InlineStyle;
|
||||
|
||||
// ToDo: specifity
|
||||
|
||||
// pseudo elements
|
||||
|
||||
// skipping for forward compatibility
|
||||
// ToDo: invalid token in selector makes selector invalid
|
||||
|
||||
end;
|
||||
@ -921,6 +923,24 @@ begin
|
||||
AssertEquals('Div2.Top','',Div2.Top);
|
||||
end;
|
||||
|
||||
procedure TTestCSSResolver.Test_InlineStyle;
|
||||
var
|
||||
Div1: TDemoDiv;
|
||||
begin
|
||||
Doc.Root:=TDemoNode.Create(nil);
|
||||
|
||||
Div1:=TDemoDiv.Create(Doc);
|
||||
Div1.Parent:=Doc.Root;
|
||||
Div1.Style:='left: 10px;';
|
||||
|
||||
Doc.Style:=LinesToStr([
|
||||
'div { left: 6px; }',
|
||||
'']);
|
||||
Doc.ApplyStyle;
|
||||
AssertEquals('Root.Left','',Doc.Root.Left);
|
||||
AssertEquals('Div1.Left','10px',Div1.Left);
|
||||
end;
|
||||
|
||||
{ TDemoDiv }
|
||||
|
||||
class function TDemoDiv.CSSTypeName: TCSSString;
|
||||
|
Loading…
Reference in New Issue
Block a user