|
@@ -128,6 +128,7 @@ type
|
|
|
procedure Test_BorderColor_AsString;
|
|
|
procedure Test_BorderStyle_AsString;
|
|
|
procedure Test_BorderWidth_AsString;
|
|
|
+ procedure Test_Border_AsString;
|
|
|
|
|
|
procedure TestVar_NoDefault;
|
|
|
procedure TestVar_Initial;
|
|
@@ -723,8 +724,8 @@ begin
|
|
|
Div1.Parent:=Body;
|
|
|
|
|
|
Viewport.ApplyCSS;
|
|
|
- AssertEquals('Body.GetComputedFontSize',Body.GetComputedFontSize,30);
|
|
|
- AssertEquals('Div1.GetComputedFontSize',Div1.GetComputedFontSize,60);
|
|
|
+ AssertEquals('Body.GetComputedFontSize',Body.Font.GetSize,30);
|
|
|
+ AssertEquals('Div1.GetComputedFontSize',Div1.Font.GetSize,60);
|
|
|
end;
|
|
|
|
|
|
procedure TTestFresnelCSS.Test_FontSize_AsString;
|
|
@@ -740,7 +741,7 @@ begin
|
|
|
Body.Parent:=Viewport;
|
|
|
|
|
|
Viewport.ApplyCSS;
|
|
|
- AssertEquals('Body.GetComputedFontSize',30,Body.GetComputedFontSize);
|
|
|
+ AssertEquals('Body.GetComputedFontSize',30,Body.Font.GetSize);
|
|
|
AssertEquals('Body.GetComputedFontSize','30px',Body.GetComputedString(fcaFontSize));
|
|
|
end;
|
|
|
|
|
@@ -822,6 +823,42 @@ begin
|
|
|
AssertEquals('Div1.GetComputedString(fcaBorderWidth)','1px 2px 3px 4px',Div1.GetComputedString(fcaBorderWidth));
|
|
|
end;
|
|
|
|
|
|
+procedure TTestFresnelCSS.Test_Border_AsString;
|
|
|
+var
|
|
|
+ Div1: TDiv;
|
|
|
+begin
|
|
|
+ Viewport.Stylesheet.Text:=LinesToStr([
|
|
|
+ 'div {',
|
|
|
+ 'border:1px red solid;',
|
|
|
+ '}']);
|
|
|
+ Div1:=TDiv.Create(Viewport);
|
|
|
+ Div1.Name:='Div1';
|
|
|
+ Div1.Parent:=Viewport;
|
|
|
+
|
|
|
+ Viewport.ApplyCSS;
|
|
|
+ AssertEquals('Div1.GetComputedString(fcaBorderTopWidth)','1px',Div1.GetComputedString(fcaBorderTopWidth));
|
|
|
+ AssertEquals('Div1.GetComputedString(fcaBorderRightWidth)','1px',Div1.GetComputedString(fcaBorderRightWidth));
|
|
|
+ AssertEquals('Div1.GetComputedString(fcaBorderBottomWidth)','1px',Div1.GetComputedString(fcaBorderBottomWidth));
|
|
|
+ AssertEquals('Div1.GetComputedString(fcaBorderLeftWidth)','1px',Div1.GetComputedString(fcaBorderLeftWidth));
|
|
|
+
|
|
|
+ AssertEquals('Div1.GetComputedString(fcaBorderTopStyle)','solid',Div1.GetComputedString(fcaBorderTopStyle));
|
|
|
+ AssertEquals('Div1.GetComputedString(fcaBorderRightStyle)','solid',Div1.GetComputedString(fcaBorderRightStyle));
|
|
|
+ AssertEquals('Div1.GetComputedString(fcaBorderBottomStyle)','solid',Div1.GetComputedString(fcaBorderBottomStyle));
|
|
|
+ AssertEquals('Div1.GetComputedString(fcaBorderLeftStyle)','solid',Div1.GetComputedString(fcaBorderLeftStyle));
|
|
|
+
|
|
|
+ AssertEquals('Div1.GetComputedString(fcaBorderTopColor)','red',Div1.GetComputedString(fcaBorderTopColor));
|
|
|
+ AssertEquals('Div1.GetComputedString(fcaBorderRightColor)','red',Div1.GetComputedString(fcaBorderRightColor));
|
|
|
+ AssertEquals('Div1.GetComputedString(fcaBorderBottomColor)','red',Div1.GetComputedString(fcaBorderBottomColor));
|
|
|
+ AssertEquals('Div1.GetComputedString(fcaBorderLeftColor)','red',Div1.GetComputedString(fcaBorderLeftColor));
|
|
|
+
|
|
|
+ AssertEquals('Div1.GetComputedString(fcaBorderTop)','red solid 1px',Div1.GetComputedString(fcaBorderTop));
|
|
|
+ AssertEquals('Div1.GetComputedString(fcaBorderRight)','red solid 1px',Div1.GetComputedString(fcaBorderRight));
|
|
|
+ AssertEquals('Div1.GetComputedString(fcaBorderBottom)','red solid 1px',Div1.GetComputedString(fcaBorderBottom));
|
|
|
+ AssertEquals('Div1.GetComputedString(fcaBorderLeft)','red solid 1px',Div1.GetComputedString(fcaBorderLeft));
|
|
|
+
|
|
|
+ AssertEquals('Div1.GetComputedString(fcaBorderWidth)','red solid 1px',Div1.GetComputedString(fcaBorder));
|
|
|
+end;
|
|
|
+
|
|
|
procedure TTestFresnelCSS.TestVar_NoDefault;
|
|
|
var
|
|
|
Body: TBody;
|
|
@@ -863,8 +900,8 @@ begin
|
|
|
Div1.Parent:=Body;
|
|
|
|
|
|
Viewport.ApplyCSS;
|
|
|
- AssertEquals('Body.GetComputedFontSize',Body.GetComputedFontSize,30);
|
|
|
- AssertEquals('Div1.GetComputedFontSize',Div1.GetComputedFontSize,FresnelDefaultFontSize);
|
|
|
+ AssertEquals('Body.GetComputedFontSize',Body.Font.GetSize,30);
|
|
|
+ AssertEquals('Div1.GetComputedFontSize',Div1.Font.GetSize,FresnelDefaultFontSize);
|
|
|
end;
|
|
|
|
|
|
procedure TTestFresnelCSS.TestVar_Inline;
|
|
@@ -881,7 +918,7 @@ begin
|
|
|
Div1.Style:='--size:28px;';
|
|
|
|
|
|
Viewport.ApplyCSS;
|
|
|
- AssertEquals('Div1.GetComputedFontSize',28,Div1.GetComputedFontSize);
|
|
|
+ AssertEquals('Div1.GetComputedFontSize',28,Div1.Font.GetSize);
|
|
|
end;
|
|
|
|
|
|
Initialization
|