|
@@ -97,8 +97,8 @@ type
|
|
fcaBorder, // shorthand for border-width border-style border-color
|
|
fcaBorder, // shorthand for border-width border-style border-color
|
|
fcaBorderTopLeftRadius,
|
|
fcaBorderTopLeftRadius,
|
|
fcaBorderTopRightRadius,
|
|
fcaBorderTopRightRadius,
|
|
- fcaBorderBottomLeftRadius,
|
|
|
|
fcaBorderBottomRightRadius,
|
|
fcaBorderBottomRightRadius,
|
|
|
|
+ fcaBorderBottomLeftRadius,
|
|
fcaBorderRadius, // shorthand for border-[top-left,top-right,bottom-right,bottom-left]-radius
|
|
fcaBorderRadius, // shorthand for border-[top-left,top-right,bottom-right,bottom-left]-radius
|
|
fcaFontFeatureSettings,
|
|
fcaFontFeatureSettings,
|
|
fcaFontFamily,
|
|
fcaFontFamily,
|
|
@@ -252,8 +252,8 @@ type
|
|
// one of four corner(s)
|
|
// one of four corner(s)
|
|
fcsTopLeft,
|
|
fcsTopLeft,
|
|
fcsTopRight,
|
|
fcsTopRight,
|
|
- fcsBottomLeft,
|
|
|
|
- fcsBottomRight
|
|
|
|
|
|
+ fcsBottomRight,
|
|
|
|
+ fcsBottomLeft
|
|
);
|
|
);
|
|
TFresnelCSSCorners = set of TFresnelCSSCorner;
|
|
TFresnelCSSCorners = set of TFresnelCSSCorner;
|
|
|
|
|
|
@@ -387,7 +387,7 @@ type
|
|
procedure SplitLonghandSides(var AttrIDs: TCSSNumericalIDArray; var Values: TCSSStringArray;
|
|
procedure SplitLonghandSides(var AttrIDs: TCSSNumericalIDArray; var Values: TCSSStringArray;
|
|
Top, Right, Bottom, Left: TFresnelCSSAttribute; const Found: TCSSStringArray);
|
|
Top, Right, Bottom, Left: TFresnelCSSAttribute; const Found: TCSSStringArray);
|
|
procedure SplitLonghandCorners(var AttrIDs: TCSSNumericalIDArray; var Values: TCSSStringArray;
|
|
procedure SplitLonghandCorners(var AttrIDs: TCSSNumericalIDArray; var Values: TCSSStringArray;
|
|
- TopLeft, TopRight, BottomLeft, BottomRight: TFresnelCSSAttribute; const Found: TCSSStringArray);
|
|
|
|
|
|
+ TopLeft, TopRight, BottomRight, BottomLeft: TFresnelCSSAttribute; const Found: TCSSStringArray);
|
|
|
|
|
|
// split shorthands
|
|
// split shorthands
|
|
procedure SplitBackground(Resolver: TCSSBaseResolver; var AttrIDs: TCSSNumericalIDArray; var Values: TCSSStringArray); virtual;
|
|
procedure SplitBackground(Resolver: TCSSBaseResolver; var AttrIDs: TCSSNumericalIDArray; var Values: TCSSStringArray); virtual;
|
|
@@ -406,6 +406,7 @@ type
|
|
|
|
|
|
// get computed attribute as string
|
|
// get computed attribute as string
|
|
function GetBackground(El: TFresnelElement): string; virtual;
|
|
function GetBackground(El: TFresnelElement): string; virtual;
|
|
|
|
+ function GetBackgroundPosition(El: TFresnelElement): string; virtual;
|
|
function GetBorder(El: TFresnelElement): string; virtual;
|
|
function GetBorder(El: TFresnelElement): string; virtual;
|
|
function GetBorderColor(El: TFresnelElement): string; virtual;
|
|
function GetBorderColor(El: TFresnelElement): string; virtual;
|
|
function GetBorderSide(El: TFresnelElement; Side: TFresnelCSSSide): string; virtual;
|
|
function GetBorderSide(El: TFresnelElement; Side: TFresnelCSSSide): string; virtual;
|
|
@@ -2553,6 +2554,21 @@ begin
|
|
if El=nil then ;
|
|
if El=nil then ;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TFresnelCSSRegistry.GetBackgroundPosition(El: TFresnelElement): string;
|
|
|
|
+var
|
|
|
|
+ X, Y: String;
|
|
|
|
+begin
|
|
|
|
+ X:=El.GetComputedString(fcaBackgroundPositionX);
|
|
|
|
+ Y:=El.GetComputedString(fcaBackgroundPositionY);
|
|
|
|
+ if X>'' then
|
|
|
|
+ begin
|
|
|
|
+ Result:=X;
|
|
|
|
+ if Y>'' then
|
|
|
|
+ Result+=' '+Y;
|
|
|
|
+ end else
|
|
|
|
+ Result:=Y;
|
|
|
|
+end;
|
|
|
|
+
|
|
function TFresnelCSSRegistry.GetBorder(El: TFresnelElement): string;
|
|
function TFresnelCSSRegistry.GetBorder(El: TFresnelElement): string;
|
|
var
|
|
var
|
|
aLeft, aRight, aTop, aBottom: String;
|
|
aLeft, aRight, aTop, aBottom: String;
|
|
@@ -2772,7 +2788,7 @@ begin
|
|
SetLength(AttrIDs,2);
|
|
SetLength(AttrIDs,2);
|
|
SetLength(Values,2);
|
|
SetLength(Values,2);
|
|
AttrIDs[0]:=FresnelAttrs[fcaBackgroundPositionX].Index;
|
|
AttrIDs[0]:=FresnelAttrs[fcaBackgroundPositionX].Index;
|
|
- AttrIDs[1]:=FresnelAttrs[fcaBackgroundPositionX].Index;
|
|
|
|
|
|
+ AttrIDs[1]:=FresnelAttrs[fcaBackgroundPositionY].Index;
|
|
Values[0]:=X;
|
|
Values[0]:=X;
|
|
Values[1]:=Y;
|
|
Values[1]:=Y;
|
|
end;
|
|
end;
|
|
@@ -3118,12 +3134,12 @@ begin
|
|
// border-radius
|
|
// border-radius
|
|
AddFresnelLonghand(fcaBorderTopLeftRadius,false,@CheckBorderRadius);
|
|
AddFresnelLonghand(fcaBorderTopLeftRadius,false,@CheckBorderRadius);
|
|
AddFresnelLonghand(fcaBorderTopRightRadius,false,@CheckBorderRadius);
|
|
AddFresnelLonghand(fcaBorderTopRightRadius,false,@CheckBorderRadius);
|
|
- AddFresnelLonghand(fcaBorderBottomLeftRadius,false,@CheckBorderRadius);
|
|
|
|
AddFresnelLonghand(fcaBorderBottomRightRadius,false,@CheckBorderRadius);
|
|
AddFresnelLonghand(fcaBorderBottomRightRadius,false,@CheckBorderRadius);
|
|
|
|
+ AddFresnelLonghand(fcaBorderBottomLeftRadius,false,@CheckBorderRadius);
|
|
Chk_BorderRadius_Dim.AllowedUnits:=cuAllLengthsAndPercent;
|
|
Chk_BorderRadius_Dim.AllowedUnits:=cuAllLengthsAndPercent;
|
|
Chk_BorderRadius_Dim.AllowFrac:=true;
|
|
Chk_BorderRadius_Dim.AllowFrac:=true;
|
|
AddFresnelShorthand(fcaBorderRadius,@CheckBorderRadius,@SplitBorderRadius,@GetBorderRadius,
|
|
AddFresnelShorthand(fcaBorderRadius,@CheckBorderRadius,@SplitBorderRadius,@GetBorderRadius,
|
|
- [fcaBorderTopLeftRadius,fcaBorderTopRightRadius,fcaBorderBottomLeftRadius,fcaBorderBottomRightRadius]);
|
|
|
|
|
|
+ [fcaBorderTopLeftRadius,fcaBorderTopRightRadius,fcaBorderBottomRightRadius,fcaBorderBottomLeftRadius]);
|
|
|
|
|
|
// float
|
|
// float
|
|
AddFresnelLonghand(fcaFloat,false,@CheckFloat,'none');
|
|
AddFresnelLonghand(fcaFloat,false,@CheckFloat,'none');
|
|
@@ -3244,8 +3260,9 @@ begin
|
|
Chk_BackgroundPositionY_Dim.AllowedKeywordIDs:=[kwTop,kwCenter,kwBottom];
|
|
Chk_BackgroundPositionY_Dim.AllowedKeywordIDs:=[kwTop,kwCenter,kwBottom];
|
|
Chk_BackgroundPositionY_Dim.AllowedUnits:=cuAllLengthsAndPercent;
|
|
Chk_BackgroundPositionY_Dim.AllowedUnits:=cuAllLengthsAndPercent;
|
|
Chk_BackgroundPositionY_Dim.AllowFrac:=true;
|
|
Chk_BackgroundPositionY_Dim.AllowFrac:=true;
|
|
- // background-position-y
|
|
|
|
- AddFresnelLonghand(fcaBackgroundPosition,false,@CheckBackgroundPosition,'0% 0%');
|
|
|
|
|
|
+ // background-position
|
|
|
|
+ AddFresnelShorthand(fcaBackgroundPosition,@CheckBackgroundPosition,@SplitBackgroundPosition,
|
|
|
|
+ @GetBackgroundPosition,[fcaBackgroundPositionX,fcaBackgroundPositionY]);
|
|
Chk_BackgroundPosition_Dim.AllowedKeywordIDs:=[kwLeft,kwRight,kwTop,kwBottom,kwCenter];
|
|
Chk_BackgroundPosition_Dim.AllowedKeywordIDs:=[kwLeft,kwRight,kwTop,kwBottom,kwCenter];
|
|
Chk_BackgroundPosition_Dim.AllowedUnits:=cuAllLengthsAndPercent;
|
|
Chk_BackgroundPosition_Dim.AllowedUnits:=cuAllLengthsAndPercent;
|
|
Chk_BackgroundPosition_Dim.AllowFrac:=true;
|
|
Chk_BackgroundPosition_Dim.AllowFrac:=true;
|
|
@@ -3334,14 +3351,14 @@ begin
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TFresnelCSSRegistry.SplitLonghandCorners(var AttrIDs: TCSSNumericalIDArray;
|
|
procedure TFresnelCSSRegistry.SplitLonghandCorners(var AttrIDs: TCSSNumericalIDArray;
|
|
- var Values: TCSSStringArray; TopLeft, TopRight, BottomLeft, BottomRight: TFresnelCSSAttribute;
|
|
|
|
|
|
+ var Values: TCSSStringArray; TopLeft, TopRight, BottomRight, BottomLeft: TFresnelCSSAttribute;
|
|
const Found: TCSSStringArray);
|
|
const Found: TCSSStringArray);
|
|
begin
|
|
begin
|
|
AddSplitLonghandCorners(AttrIDs,Values,
|
|
AddSplitLonghandCorners(AttrIDs,Values,
|
|
FresnelAttrs[TopLeft].Index,
|
|
FresnelAttrs[TopLeft].Index,
|
|
FresnelAttrs[TopRight].Index,
|
|
FresnelAttrs[TopRight].Index,
|
|
- FresnelAttrs[BottomLeft].Index,
|
|
|
|
FresnelAttrs[BottomRight].Index,
|
|
FresnelAttrs[BottomRight].Index,
|
|
|
|
+ FresnelAttrs[BottomLeft].Index,
|
|
Found);
|
|
Found);
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -3378,11 +3395,11 @@ end;
|
|
|
|
|
|
function TFresnelRoundRect.ToString: String;
|
|
function TFresnelRoundRect.ToString: String;
|
|
begin
|
|
begin
|
|
- Result:='['+Box.TopLeft.ToString+','+Box.BottomRight.ToString+'] - [';
|
|
|
|
- Result:=Result+Radii[fcsTopLeft].ToString+',';
|
|
|
|
- Result:=Result+Radii[fcsTopRight].ToString+',';
|
|
|
|
- Result:=Result+Radii[fcsBottomLeft].ToString+',';
|
|
|
|
- Result:=Result+Radii[fcsBottomRight].ToString+']';
|
|
|
|
|
|
+ Result:='['+Box.ToString+'] - [';
|
|
|
|
+ Result:=Result+'TL='+Radii[fcsTopLeft].ToString+',';
|
|
|
|
+ Result:=Result+'TR='+Radii[fcsTopRight].ToString+',';
|
|
|
|
+ Result:=Result+'BR='+Radii[fcsBottomRight].ToString+',';
|
|
|
|
+ Result:=Result+'BL='+Radii[fcsBottomLeft].ToString+']';
|
|
end;
|
|
end;
|
|
|
|
|
|
{ TFresnelLayoutNode }
|
|
{ TFresnelLayoutNode }
|
|
@@ -4865,15 +4882,16 @@ begin
|
|
Result.X:=0;
|
|
Result.X:=0;
|
|
Result.Y:=0;
|
|
Result.Y:=0;
|
|
|
|
|
|
- Attr:=TFresnelCSSAttribute(ord(fcaBorderTopLeftRadius)+ord(Corner)-ord(fcsTopLeft));
|
|
|
|
|
|
+ Attr:=TFresnelCSSAttribute(ord(fcaBorderTopLeftRadius)+ord(Corner));
|
|
AttrID:=CSSRegistry.FresnelAttrs[Attr].Index;
|
|
AttrID:=CSSRegistry.FresnelAttrs[Attr].Index;
|
|
s:=GetCSSString(AttrID,false,Complete);
|
|
s:=GetCSSString(AttrID,false,Complete);
|
|
aComp.EndP:=PChar(s);
|
|
aComp.EndP:=PChar(s);
|
|
if not Resolver.ReadComp(aComp) then exit;
|
|
if not Resolver.ReadComp(aComp) then exit;
|
|
if not GetRadius(X,true) then exit;
|
|
if not GetRadius(X,true) then exit;
|
|
- if Resolver.ReadComp(aComp) then
|
|
|
|
|
|
+ if Resolver.ReadComp(aComp) and (aComp.Kind=rvkSymbol) and (aComp.StartP^='/') then
|
|
begin
|
|
begin
|
|
- if not GetRadius(Y,true) then exit;
|
|
|
|
|
|
+ if not Resolver.ReadComp(aComp) then exit;
|
|
|
|
+ if not GetRadius(Y,false) then exit;
|
|
end else
|
|
end else
|
|
Y:=X;
|
|
Y:=X;
|
|
Result.X:=X;
|
|
Result.X:=X;
|