|
@@ -1064,6 +1064,12 @@ type
|
|
);
|
|
);
|
|
TFresnelLayoutModes = set of TFresnelLayoutMode;
|
|
TFresnelLayoutModes = set of TFresnelLayoutMode;
|
|
|
|
|
|
|
|
+ TFresnelLayoutFlag = (
|
|
|
|
+ flfHorizontalScrollbar,
|
|
|
|
+ flfVerticalScrollbar
|
|
|
|
+ );
|
|
|
|
+ TFresnelLayoutFlags = set of TFresnelLayoutFlag;
|
|
|
|
+
|
|
{ TFresnelLayoutNode }
|
|
{ TFresnelLayoutNode }
|
|
|
|
|
|
TFresnelLayoutNode = class(TComponent)
|
|
TFresnelLayoutNode = class(TComponent)
|
|
@@ -1097,6 +1103,7 @@ type
|
|
Container: TFresnelElement;
|
|
Container: TFresnelElement;
|
|
SkipLayout: boolean; // e.g. element or ancestor display:none or visibility=collapse
|
|
SkipLayout: boolean; // e.g. element or ancestor display:none or visibility=collapse
|
|
SkipRendering: boolean; // e.g. element or ancestor display:none or visibility<>visible
|
|
SkipRendering: boolean; // e.g. element or ancestor display:none or visibility<>visible
|
|
|
|
+ Flags: TFresnelLayoutFlags;
|
|
|
|
|
|
// used values
|
|
// used values
|
|
ZIndex: TFresnelLength; // position=static has 0, non static have z-index+0.5
|
|
ZIndex: TFresnelLength; // position=static has 0, non static have z-index+0.5
|
|
@@ -1125,7 +1132,7 @@ type
|
|
// scroll values below are only valid if CanScrollX or CanScrollY
|
|
// scroll values below are only valid if CanScrollX or CanScrollY
|
|
ScrollGutterBothEdges: boolean; // when scrollbar needs gutter space, add space on both edges
|
|
ScrollGutterBothEdges: boolean; // when scrollbar needs gutter space, add space on both edges
|
|
ScrollGutterStable: boolean; // true: classic(not overlay) scrollbars need gutter if overflow is auto, scroll, or hidden, even if the box is not overflowing
|
|
ScrollGutterStable: boolean; // true: classic(not overlay) scrollbars need gutter if overflow is auto, scroll, or hidden, even if the box is not overflowing
|
|
- ScrollGutterWidth: TCSSNumericalID; // 0, none, thin, auto, see attribute 'scrollbar-width'
|
|
|
|
|
|
+ ScrollbarWidth: TCSSNumericalID; // 0, none, thin, auto, see attribute 'scrollbar-width'
|
|
|
|
|
|
// Left, Top, Right, Bottom are initialized with the CSS values, then applied depending on position
|
|
// Left, Top, Right, Bottom are initialized with the CSS values, then applied depending on position
|
|
// the result is the MarginBox
|
|
// the result is the MarginBox
|
|
@@ -1308,6 +1315,8 @@ type
|
|
FEventDispatcher : TFresnelEventDispatcher;
|
|
FEventDispatcher : TFresnelEventDispatcher;
|
|
FUsedBorderBox: TFresnelRect;
|
|
FUsedBorderBox: TFresnelRect;
|
|
FUsedContentBox: TFresnelRect;
|
|
FUsedContentBox: TFresnelRect;
|
|
|
|
+ function GetClientHeight: TFresnelLength;
|
|
|
|
+ function GetClientWidth: TFresnelLength;
|
|
function GetNodeCount: integer;
|
|
function GetNodeCount: integer;
|
|
function GetNodes(Index: integer): TFresnelElement;
|
|
function GetNodes(Index: integer): TFresnelElement;
|
|
function GetPeudoNodeCount: integer;
|
|
function GetPeudoNodeCount: integer;
|
|
@@ -1490,11 +1499,19 @@ type
|
|
function GetContainerContentHeight(UseNaNOnFail: boolean): TFresnelLength; virtual; // used value
|
|
function GetContainerContentHeight(UseNaNOnFail: boolean): TFresnelLength; virtual; // used value
|
|
function GetContainerOffset: TFresnelPoint; virtual;
|
|
function GetContainerOffset: TFresnelPoint; virtual;
|
|
function IsBlockFormattingContext: boolean; virtual;
|
|
function IsBlockFormattingContext: boolean; virtual;
|
|
|
|
+ property ClientWidth: TFresnelLength read GetClientWidth;
|
|
|
|
+ property ClientHeight: TFresnelLength read GetClientHeight;
|
|
property LayoutNode: TFresnelLayoutNode read FLayoutNode write FLayoutNode;
|
|
property LayoutNode: TFresnelLayoutNode read FLayoutNode write FLayoutNode;
|
|
property UsedBorderBox: TFresnelRect read FUsedBorderBox write FUsedBorderBox; // relative to layout parent's used contentbox
|
|
property UsedBorderBox: TFresnelRect read FUsedBorderBox write FUsedBorderBox; // relative to layout parent's used contentbox
|
|
property UsedContentBox: TFresnelRect read FUsedContentBox write FUsedContentBox; // relative to layout parent's used contentbox
|
|
property UsedContentBox: TFresnelRect read FUsedContentBox write FUsedContentBox; // relative to layout parent's used contentbox
|
|
|
|
+ // Scrolling
|
|
|
|
+ property ScrollLeft: TFresnelLength read FScrollLeft write SetScrollLeft;
|
|
|
|
+ property ScrollTop: TFresnelLength read FScrollTop write SetScrollTop;
|
|
|
|
+ property ScrollWidth: TFresnelLength read GetScrollWidth;
|
|
|
|
+ property ScrollHeight: TFresnelLength read GetScrollHeight;
|
|
// Renderer
|
|
// Renderer
|
|
function GetBorderBoxOnViewport: TFresnelRect; virtual;
|
|
function GetBorderBoxOnViewport: TFresnelRect; virtual;
|
|
|
|
+ function GetRenderedPaddingBox: TFresnelRect;
|
|
property Rendered: boolean read FRendered write FRendered;
|
|
property Rendered: boolean read FRendered write FRendered;
|
|
property RenderedBorderBox: TFresnelRect read FRenderedBorderBox write FRenderedBorderBox; // relative to layout parent's rendered contentbox
|
|
property RenderedBorderBox: TFresnelRect read FRenderedBorderBox write FRenderedBorderBox; // relative to layout parent's rendered contentbox
|
|
property RenderedContentBox: TFresnelRect read FRenderedContentBox write FRenderedContentBox; // relative to layout parent's rendered contentbox
|
|
property RenderedContentBox: TFresnelRect read FRenderedContentBox write FRenderedContentBox; // relative to layout parent's rendered contentbox
|
|
@@ -1509,11 +1526,6 @@ type
|
|
property Resolver: TCSSResolver read FResolver;
|
|
property Resolver: TCSSResolver read FResolver;
|
|
property ViewportConnected: boolean read GetViewportConnected write SetViewportConnected; // true for example if using a Font of Viewport
|
|
property ViewportConnected: boolean read GetViewportConnected write SetViewportConnected; // true for example if using a Font of Viewport
|
|
property Viewport: TFresnelViewport read FViewPort;
|
|
property Viewport: TFresnelViewport read FViewPort;
|
|
- // Scroll
|
|
|
|
- property ScrollLeft: TFresnelLength read FScrollLeft write SetScrollLeft;
|
|
|
|
- property ScrollTop: TFresnelLength read FScrollTop write SetScrollTop;
|
|
|
|
- property ScrollWidth: TFresnelLength read GetScrollWidth;
|
|
|
|
- property ScrollHeight: TFresnelLength read GetScrollHeight;
|
|
|
|
published
|
|
published
|
|
property CSSClasses: TStrings read FCSSClasses write SetCSSClasses;
|
|
property CSSClasses: TStrings read FCSSClasses write SetCSSClasses;
|
|
property Style: string read FStyle write SetStyle;
|
|
property Style: string read FStyle write SetStyle;
|
|
@@ -6464,6 +6476,8 @@ end;
|
|
|
|
|
|
procedure TFresnelLayoutNode.ResetUsedLengths;
|
|
procedure TFresnelLayoutNode.ResetUsedLengths;
|
|
begin
|
|
begin
|
|
|
|
+ Flags:=[];
|
|
|
|
+
|
|
MarginLeft:=0;
|
|
MarginLeft:=0;
|
|
MarginRight:=0;
|
|
MarginRight:=0;
|
|
MarginTop:=0;
|
|
MarginTop:=0;
|
|
@@ -6488,7 +6502,7 @@ begin
|
|
ScrollGutterBottom:=0;
|
|
ScrollGutterBottom:=0;
|
|
ScrollGutterBothEdges:=false;
|
|
ScrollGutterBothEdges:=false;
|
|
ScrollGutterStable:=false;
|
|
ScrollGutterStable:=false;
|
|
- ScrollGutterWidth:=0;
|
|
|
|
|
|
+ ScrollbarWidth:=0;
|
|
|
|
|
|
Left:=NaN;
|
|
Left:=NaN;
|
|
Top:=NaN;
|
|
Top:=NaN;
|
|
@@ -7407,6 +7421,24 @@ begin
|
|
Result:=FChildren.Count;
|
|
Result:=FChildren.Count;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TFresnelElement.GetClientWidth: TFresnelLength;
|
|
|
|
+var
|
|
|
|
+ n: TFresnelLayoutNode;
|
|
|
|
+begin
|
|
|
|
+ n:=LayoutNode;
|
|
|
|
+ Result:=n.Width-n.ScrollGutterLeft-n.ScrollGutterRight;
|
|
|
|
+ if Result<0 then Result:=0;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+function TFresnelElement.GetClientHeight: TFresnelLength;
|
|
|
|
+var
|
|
|
|
+ n: TFresnelLayoutNode;
|
|
|
|
+begin
|
|
|
|
+ n:=LayoutNode;
|
|
|
|
+ Result:=n.Height-n.ScrollGutterTop-n.ScrollGutterBottom;
|
|
|
|
+ if Result<0 then Result:=0;
|
|
|
|
+end;
|
|
|
|
+
|
|
function TFresnelElement.GetViewportConnected: boolean;
|
|
function TFresnelElement.GetViewportConnected: boolean;
|
|
begin
|
|
begin
|
|
Result:=fesViewportConnected in FStates;
|
|
Result:=fesViewportConnected in FStates;
|
|
@@ -8287,6 +8319,18 @@ begin
|
|
//debugln(['TFresnelElement.GetBoundingClientRect ',Name,' Result=',Result.Left,',',Result.Top,',',Result.Right,',',Result.Bottom]);
|
|
//debugln(['TFresnelElement.GetBoundingClientRect ',Name,' Result=',Result.Left,',',Result.Top,',',Result.Right,',',Result.Bottom]);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TFresnelElement.GetRenderedPaddingBox: TFresnelRect;
|
|
|
|
+var
|
|
|
|
+ N: TFresnelLayoutNode;
|
|
|
|
+begin
|
|
|
|
+ Result:=RenderedContentBox;
|
|
|
|
+ N:=LayoutNode;
|
|
|
|
+ Result.Left:=Result.Left-N.PaddingLeft;
|
|
|
|
+ Result.Top:=Result.Top-N.PaddingTop;
|
|
|
|
+ Result.Right:=Result.Right+N.PaddingRight;
|
|
|
|
+ Result.Bottom:=Result.Bottom+N.PaddingBottom;
|
|
|
|
+end;
|
|
|
|
+
|
|
function TFresnelElement.GetComputedBorderRadius(Corner: TFresnelCSSCorner
|
|
function TFresnelElement.GetComputedBorderRadius(Corner: TFresnelCSSCorner
|
|
): TFresnelPoint;
|
|
): TFresnelPoint;
|
|
var
|
|
var
|