Browse Source

demo: fixed

mattias 5 months ago
parent
commit
6002a1cdfc

+ 1 - 0
demo/ButtonGenerator/MainUnit.lfm

@@ -4,4 +4,5 @@ object FresnelForm1: TFresnelForm1
   FormWidth = 320
   FormWidth = 320
   FormHeight = 600
   FormHeight = 600
   OnCreate = FresnelForm1Create
   OnCreate = FresnelForm1Create
+  Visible = true
 end
 end

+ 4 - 4
demo/democomps/fresnel.demoslider.pas

@@ -5,7 +5,7 @@ unit Fresnel.DemoSlider;
 interface
 interface
 
 
 uses
 uses
-  Classes, SysUtils, math, Fresnel.DOM, Fresnel.Controls,
+  Classes, SysUtils, math, System.UITypes, Fresnel.DOM, Fresnel.Controls,
   Fresnel.Classes, FCL.Events, Fresnel.Events, fpCSSTree;
   Fresnel.Classes, FCL.Events, Fresnel.Events, fpCSSTree;
 
 
 type
 type
@@ -110,7 +110,7 @@ begin
     Evt:=TFresnelMouseDownEvent(Event);
     Evt:=TFresnelMouseDownEvent(Event);
     if Evt.Buttons=[mbLeft] then
     if Evt.Buttons=[mbLeft] then
     begin
     begin
-      w:=SliderDiv.RenderedBorderBox.Width;
+      w:=SliderDiv.UsedBorderBox.Width;
       if w<1 then exit;
       if w<1 then exit;
       SliderPosition:=Evt.X/w * (MaxPosition-MinPosition) + MinPosition;
       SliderPosition:=Evt.X/w * (MaxPosition-MinPosition) + MinPosition;
     end;
     end;
@@ -128,9 +128,9 @@ begin
     if Evt.Buttons=[mbLeft] then
     if Evt.Buttons=[mbLeft] then
     begin
     begin
       // compute X on SliderDiv
       // compute X on SliderDiv
-      w:=SliderDiv.RenderedBorderBox.Width;
+      w:=SliderDiv.UsedBorderBox.Width;
       if w<1 then exit;
       if w<1 then exit;
-      x:=Evt.X + SliderPoint.RenderedContentBox.Left;
+      x:=Evt.X + SliderPoint.UsedContentBox.Left;
       SliderPosition:=x/w * (MaxPosition-MinPosition) + MinPosition;
       SliderPosition:=x/w * (MaxPosition-MinPosition) + MinPosition;
     end;
     end;
   end;
   end;

+ 4 - 4
design/fresnel.register.pas

@@ -232,7 +232,7 @@ begin
   begin
   begin
     // return borderbox
     // return borderbox
     El:=TFresnelElement(AComponent);
     El:=TFresnelElement(AComponent);
-    aBox:=El.RenderedBorderBox;
+    aBox:=El.UsedBorderBox;
     FresnelRectToRect(aBox,CurBounds);
     FresnelRectToRect(aBox,CurBounds);
   end else
   end else
     inherited GetBounds(AComponent,CurBounds);
     inherited GetBounds(AComponent,CurBounds);
@@ -295,7 +295,7 @@ begin
         El.SetStyleAttr('width',FloatToCSSPx(NewWidth));
         El.SetStyleAttr('width',FloatToCSSPx(NewWidth));
       if El.GetStyleAttr('height')<>'' then
       if El.GetStyleAttr('height')<>'' then
         El.SetStyleAttr('height',FloatToCSSPx(NewHeight));
         El.SetStyleAttr('height',FloatToCSSPx(NewHeight));
-      debugln(['TFresnelFormMediator.SetBounds AComponent=',DbgSName(AComponent),' OldStyle=[',OldStyle,'] OldBorderBox=',FloatToCSSStr(El.RenderedBorderBox.Left),',',FloatToCSSStr(El.RenderedBorderBox.Top),' w=',FloatToCSSStr(El.RenderedBorderBox.Width),',h=',FloatToCSSStr(El.RenderedBorderBox.Height),' box-sizing=',CSSRegistry.Keywords[El.ComputedBoxSizing],' NewLeft,Top=',FloatToCSSStr(NewLeft),',',FloatToCSSStr(NewTop),' NewWH=',FloatToCSSStr(NewWidth),'x',FloatToCSSStr(NewHeight)]);
+      debugln(['TFresnelFormMediator.SetBounds AComponent=',DbgSName(AComponent),' OldStyle=[',OldStyle,'] OldBorderBox=',FloatToCSSStr(El.UsedBorderBox.Left),',',FloatToCSSStr(El.UsedBorderBox.Top),' w=',FloatToCSSStr(El.UsedBorderBox.Width),',h=',FloatToCSSStr(El.UsedBorderBox.Height),' box-sizing=',CSSRegistry.Keywords[El.ComputedBoxSizing],' NewLeft,Top=',FloatToCSSStr(NewLeft),',',FloatToCSSStr(NewTop),' NewWH=',FloatToCSSStr(NewWidth),'x',FloatToCSSStr(NewHeight)]);
     end;
     end;
   end else begin
   end else begin
     inherited SetBounds(AComponent, NewBounds);
     inherited SetBounds(AComponent, NewBounds);
@@ -315,8 +315,8 @@ begin
   end else if AComponent is TFresnelElement then begin
   end else if AComponent is TFresnelElement then begin
     // return contentbox inside the borderbox
     // return contentbox inside the borderbox
     El:=TFresnelElement(AComponent);
     El:=TFresnelElement(AComponent);
-    BorderBox:=El.RenderedBorderBox;
-    Box:=El.RenderedContentBox;
+    BorderBox:=El.UsedBorderBox;
+    Box:=El.UsedContentBox;
     Box.Offset(-BorderBox.Left,-BorderBox.Top);
     Box.Offset(-BorderBox.Left,-BorderBox.Top);
     FresnelRectToRect(Box,CurClientArea);
     FresnelRectToRect(Box,CurClientArea);
   end else
   end else

+ 1 - 1
src/base/fresnel.dom.pas

@@ -1604,7 +1604,7 @@ type
     Size: TFresnelLength; // ScrollWidth/Height
     Size: TFresnelLength; // ScrollWidth/Height
     Page: TFresnelLength; // ClientWidth/Height
     Page: TFresnelLength; // ClientWidth/Height
     Color: TFPColor;
     Color: TFPColor;
-    Box: TFresnelRect; // relative to layoutnode parent's RenderedContentBox
+    Box: TFresnelRect; // same coord system as parent, e.g. parent.UsedBorderBox
     MouseDownHit: THit;
     MouseDownHit: THit;
     MouseDownPos: TFresnelLength;
     MouseDownPos: TFresnelLength;
     constructor Create(TheElement: TFresnelElement; aHorizontal: boolean); overload;
     constructor Create(TheElement: TFresnelElement; aHorizontal: boolean); overload;

+ 1 - 1
src/base/fresnel.renderer.pas

@@ -831,7 +831,7 @@ begin
 
 
   FLLog(etDebug,'TFresnelRenderer.DrawElement %s %s',[El.GetPath,aBorderBox.ToString]);
   FLLog(etDebug,'TFresnelRenderer.DrawElement %s %s',[El.GetPath,aBorderBox.ToString]);
 
 
-  //writeln('TFresnelRenderer.DrawElement ',El.Name,' BorderBox=',El.RenderedBorderBox.ToString,' ContentBox=',El.RenderedContentBox.ToString);
+  //writeln('TFresnelRenderer.DrawElement ',El.Name,' BorderBox=',El.UsedBorderBox.ToString,' ContentBox=',El.UsedContentBox.ToString);
 
 
   // background and border
   // background and border
   BorderParams:=CreateBorderAndBackground;
   BorderParams:=CreateBorderAndBackground;

+ 2 - 0
src/gtk3/fresnel.gtk3.pas

@@ -862,6 +862,7 @@ procedure TGtk3WSForm.SetPointerCapture(const aPointerId: TFreHandle);
 var
 var
   w: PGtkWidget;
   w: PGtkWidget;
 begin
 begin
+  if aPointerId=nil then exit;
   w:=gtk_grab_get_current;
   w:=gtk_grab_get_current;
   if w=PGtkWidget(Window) then exit;
   if w=PGtkWidget(Window) then exit;
   if w<>nil then
   if w<>nil then
@@ -873,6 +874,7 @@ procedure TGtk3WSForm.ReleasePointerCapture(const aPointerId: TFreHandle);
 var
 var
   w: PGtkWidget;
   w: PGtkWidget;
 begin
 begin
+  if aPointerId=nil then exit;
   w:=gtk_grab_get_current;
   w:=gtk_grab_get_current;
   if w=PGtkWidget(Window) then
   if w=PGtkWidget(Window) then
     gtk_grab_remove(w);
     gtk_grab_remove(w);

+ 81 - 81
tests/base/TCFlowLayout.pas

@@ -112,10 +112,10 @@ begin
   Viewport.Draw;
   Viewport.Draw;
   AssertEquals('SliderDiv.Rendered',true,SliderDiv.Rendered);
   AssertEquals('SliderDiv.Rendered',true,SliderDiv.Rendered);
   AssertEquals('SliderDiv.GetComputedString(fcaPosition)','relative',SliderDiv.GetComputedString(fcaPosition));
   AssertEquals('SliderDiv.GetComputedString(fcaPosition)','relative',SliderDiv.GetComputedString(fcaPosition));
-  AssertEquals('SliderDiv.RenderedBorderBox.Left',0,SliderDiv.RenderedBorderBox.Left);
-  AssertEquals('SliderDiv.RenderedBorderBox.Top',7,SliderDiv.RenderedBorderBox.Top);
-  AssertEquals('SliderDiv.RenderedBorderBox.Right',786,SliderDiv.RenderedBorderBox.Right);
-  AssertEquals('SliderDiv.RenderedBorderBox.Bottom',18,SliderDiv.RenderedBorderBox.Bottom);
+  AssertEquals('SliderDiv.UsedBorderBox.Left',0,SliderDiv.UsedBorderBox.Left);
+  AssertEquals('SliderDiv.UsedBorderBox.Top',7,SliderDiv.UsedBorderBox.Top);
+  AssertEquals('SliderDiv.UsedBorderBox.Right',786,SliderDiv.UsedBorderBox.Right);
+  AssertEquals('SliderDiv.UsedBorderBox.Bottom',18,SliderDiv.UsedBorderBox.Bottom);
 end;
 end;
 
 
 procedure TTestFlowLayout.TestFlowLayout_SliderRangePoint;
 procedure TTestFlowLayout.TestFlowLayout_SliderRangePoint;
@@ -199,34 +199,34 @@ begin
   AssertEquals('PointDiv.GetComputedString(fcaMarginLeft)','-0.6em',PointDiv.GetComputedString(fcaMarginLeft));
   AssertEquals('PointDiv.GetComputedString(fcaMarginLeft)','-0.6em',PointDiv.GetComputedString(fcaMarginLeft));
 
 
   // then check layout values
   // then check layout values
-  //writeln('TTestFlowLayout.TestFlowLayout_SliderRangePoint Body.RenderedBorderBox=',Body.RenderedBorderBox.ToString);
-  AssertEquals('Body.RenderedBorderBox.Left',8,Body.RenderedBorderBox.Left);
-  AssertEquals('Body.RenderedBorderBox.Top',8,Body.RenderedBorderBox.Top);
-  AssertEquals('Body.RenderedContentBox.Width',784,Body.RenderedContentBox.Width);
-  AssertEquals('Body.RenderedBorderBox.Right',792,Body.RenderedBorderBox.Right); // 800-8
-  AssertEquals('Body.RenderedBorderBox.Bottom',31,Body.RenderedBorderBox.Bottom); // 8(body margin)+Slider:7(margin)+1(border)+9(height)+1(border)+5(margin)
-
-  //writeln('TTestFlowLayout.TestFlowLayout_SliderRangePoint SliderDiv.RenderedBorderBox=',SliderDiv.RenderedBorderBox.ToString);
-  AssertEquals('SliderDiv.RenderedBorderBox.Left',0,SliderDiv.RenderedBorderBox.Left);
-  AssertEquals('SliderDiv.RenderedBorderBox.Top',7,SliderDiv.RenderedBorderBox.Top);
-  AssertEquals('SliderDiv.RenderedBorderBox.Right',786,SliderDiv.RenderedBorderBox.Right); // 784(width:100%) + 2*1(border) + 0(margin)
-  AssertEquals('SliderDiv.RenderedBorderBox.Bottom',18,SliderDiv.RenderedBorderBox.Bottom);
-  AssertEquals('SliderDiv.RenderedContentBox.Width',784,SliderDiv.RenderedContentBox.Width);
-  AssertEquals('SliderDiv.RenderedContentBox.Left',1,SliderDiv.RenderedContentBox.Left);
-  AssertEquals('SliderDiv.RenderedContentBox.Top',8,SliderDiv.RenderedContentBox.Top);
-  AssertEquals('SliderDiv.RenderedContentBox.Right',785,SliderDiv.RenderedContentBox.Right);
-  AssertEquals('SliderDiv.RenderedContentBox.Bottom',17,SliderDiv.RenderedContentBox.Bottom);
-
-  //writeln('TTestFlowLayout.TestFlowLayout_SliderRangePoint RangeDiv.RenderedBorderBox=',RangeDiv.RenderedBorderBox.ToString);
+  //writeln('TTestFlowLayout.TestFlowLayout_SliderRangePoint Body.UsedBorderBox=',Body.UsedBorderBox.ToString);
+  AssertEquals('Body.UsedBorderBox.Left',8,Body.UsedBorderBox.Left);
+  AssertEquals('Body.UsedBorderBox.Top',8,Body.UsedBorderBox.Top);
+  AssertEquals('Body.UsedContentBox.Width',784,Body.UsedContentBox.Width);
+  AssertEquals('Body.UsedBorderBox.Right',792,Body.UsedBorderBox.Right); // 800-8
+  AssertEquals('Body.UsedBorderBox.Bottom',31,Body.UsedBorderBox.Bottom); // 8(body margin)+Slider:7(margin)+1(border)+9(height)+1(border)+5(margin)
+
+  //writeln('TTestFlowLayout.TestFlowLayout_SliderRangePoint SliderDiv.UsedBorderBox=',SliderDiv.UsedBorderBox.ToString);
+  AssertEquals('SliderDiv.UsedBorderBox.Left',0,SliderDiv.UsedBorderBox.Left);
+  AssertEquals('SliderDiv.UsedBorderBox.Top',7,SliderDiv.UsedBorderBox.Top);
+  AssertEquals('SliderDiv.UsedBorderBox.Right',786,SliderDiv.UsedBorderBox.Right); // 784(width:100%) + 2*1(border) + 0(margin)
+  AssertEquals('SliderDiv.UsedBorderBox.Bottom',18,SliderDiv.UsedBorderBox.Bottom);
+  AssertEquals('SliderDiv.UsedContentBox.Width',784,SliderDiv.UsedContentBox.Width);
+  AssertEquals('SliderDiv.UsedContentBox.Left',1,SliderDiv.UsedContentBox.Left);
+  AssertEquals('SliderDiv.UsedContentBox.Top',8,SliderDiv.UsedContentBox.Top);
+  AssertEquals('SliderDiv.UsedContentBox.Right',785,SliderDiv.UsedContentBox.Right);
+  AssertEquals('SliderDiv.UsedContentBox.Bottom',17,SliderDiv.UsedContentBox.Bottom);
+
+  //writeln('TTestFlowLayout.TestFlowLayout_SliderRangePoint RangeDiv.UsedBorderBox=',RangeDiv.UsedBorderBox.ToString);
   AssertEquals('RangeDiv.Rendered',true,RangeDiv.Rendered);
   AssertEquals('RangeDiv.Rendered',true,RangeDiv.Rendered);
-  AssertEquals('RangeDiv.RenderedBorderBox.Left',0,RangeDiv.RenderedBorderBox.Left);
-  AssertEquals('RangeDiv.RenderedBorderBox.Top',0,RangeDiv.RenderedBorderBox.Top);
-  AssertEquals('RangeDiv.RenderedBorderBox.Right',392,RangeDiv.RenderedBorderBox.Right);
-  AssertEquals('RangeDiv.RenderedBorderBox.Bottom',9,RangeDiv.RenderedBorderBox.Bottom);
-  AssertEquals('RangeDiv.RenderedContentBox.Left',0,RangeDiv.RenderedContentBox.Left);
-  AssertEquals('RangeDiv.RenderedContentBox.Top',0,RangeDiv.RenderedContentBox.Top);
-  AssertEquals('RangeDiv.RenderedContentBox.Right',392,RangeDiv.RenderedContentBox.Right);
-  AssertEquals('RangeDiv.RenderedContentBox.Bottom',9,RangeDiv.RenderedContentBox.Bottom);
+  AssertEquals('RangeDiv.UsedBorderBox.Left',0,RangeDiv.UsedBorderBox.Left);
+  AssertEquals('RangeDiv.UsedBorderBox.Top',0,RangeDiv.UsedBorderBox.Top);
+  AssertEquals('RangeDiv.UsedBorderBox.Right',392,RangeDiv.UsedBorderBox.Right);
+  AssertEquals('RangeDiv.UsedBorderBox.Bottom',9,RangeDiv.UsedBorderBox.Bottom);
+  AssertEquals('RangeDiv.UsedContentBox.Left',0,RangeDiv.UsedContentBox.Left);
+  AssertEquals('RangeDiv.UsedContentBox.Top',0,RangeDiv.UsedContentBox.Top);
+  AssertEquals('RangeDiv.UsedContentBox.Right',392,RangeDiv.UsedContentBox.Right);
+  AssertEquals('RangeDiv.UsedContentBox.Bottom',9,RangeDiv.UsedContentBox.Bottom);
 
 
   AssertEquals('PointDiv.Rendered',true,PointDiv.Rendered);
   AssertEquals('PointDiv.Rendered',true,PointDiv.Rendered);
   AssertEquals('PointDiv.LayoutNode.MarginLeft',-6,PointDiv.LayoutNode.MarginLeft);
   AssertEquals('PointDiv.LayoutNode.MarginLeft',-6,PointDiv.LayoutNode.MarginLeft);
@@ -234,14 +234,14 @@ begin
   AssertEquals('PointDiv.LayoutNode.Height',15,PointDiv.LayoutNode.Height);
   AssertEquals('PointDiv.LayoutNode.Height',15,PointDiv.LayoutNode.Height);
   AssertEquals('PointDiv.LayoutNode.Top',-3,PointDiv.LayoutNode.Top);
   AssertEquals('PointDiv.LayoutNode.Top',-3,PointDiv.LayoutNode.Top);
   AssertEquals('PointDiv.LayoutNode.Left',392,PointDiv.LayoutNode.Left);
   AssertEquals('PointDiv.LayoutNode.Left',392,PointDiv.LayoutNode.Left);
-  AssertEquals('PointDiv.RenderedBorderBox.Left',386,PointDiv.RenderedBorderBox.Left);
-  AssertEquals('PointDiv.RenderedBorderBox.Top',-3,PointDiv.RenderedBorderBox.Top);
-  AssertEquals('PointDiv.RenderedBorderBox.Right',403,PointDiv.RenderedBorderBox.Right);
-  AssertEquals('PointDiv.RenderedBorderBox.Bottom',14,PointDiv.RenderedBorderBox.Bottom);
-  AssertEquals('PointDiv.RenderedContentBox.Left',387,PointDiv.RenderedContentBox.Left);
-  AssertEquals('PointDiv.RenderedContentBox.Top',-2,PointDiv.RenderedContentBox.Top);
-  AssertEquals('PointDiv.RenderedContentBox.Right',402,PointDiv.RenderedContentBox.Right);
-  AssertEquals('PointDiv.RenderedContentBox.Bottom',13,PointDiv.RenderedContentBox.Bottom);
+  AssertEquals('PointDiv.UsedBorderBox.Left',386,PointDiv.UsedBorderBox.Left);
+  AssertEquals('PointDiv.UsedBorderBox.Top',-3,PointDiv.UsedBorderBox.Top);
+  AssertEquals('PointDiv.UsedBorderBox.Right',403,PointDiv.UsedBorderBox.Right);
+  AssertEquals('PointDiv.UsedBorderBox.Bottom',14,PointDiv.UsedBorderBox.Bottom);
+  AssertEquals('PointDiv.UsedContentBox.Left',387,PointDiv.UsedContentBox.Left);
+  AssertEquals('PointDiv.UsedContentBox.Top',-2,PointDiv.UsedContentBox.Top);
+  AssertEquals('PointDiv.UsedContentBox.Right',402,PointDiv.UsedContentBox.Right);
+  AssertEquals('PointDiv.UsedContentBox.Bottom',13,PointDiv.UsedContentBox.Bottom);
 end;
 end;
 
 
 procedure TTestFlowLayout.TestMarginPercentage;
 procedure TTestFlowLayout.TestMarginPercentage;
@@ -267,19 +267,19 @@ begin
     '}']);
     '}']);
 
 
   Viewport.Draw;
   Viewport.Draw;
-  AssertEquals('Body.RenderedContentBox.Width',800,Body.RenderedContentBox.Width);
+  AssertEquals('Body.UsedContentBox.Width',800,Body.UsedContentBox.Width);
 
 
   AssertEquals('Div1.Rendered',true,Div1.Rendered);
   AssertEquals('Div1.Rendered',true,Div1.Rendered);
 
 
-  //writeln('TTestFlowLayout.TestPaddingPercentage ',Div1.RenderedBorderBox.ToString);
+  //writeln('TTestFlowLayout.TestPaddingPercentage ',Div1.UsedBorderBox.ToString);
   AssertEquals('Div1.LayoutNode.MarginLeft',160,Div1.LayoutNode.MarginLeft);
   AssertEquals('Div1.LayoutNode.MarginLeft',160,Div1.LayoutNode.MarginLeft);
   AssertEquals('Div1.LayoutNode.MarginTop',40,Div1.LayoutNode.MarginTop);
   AssertEquals('Div1.LayoutNode.MarginTop',40,Div1.LayoutNode.MarginTop);
   AssertEquals('Div1.LayoutNode.MarginRight',80,Div1.LayoutNode.MarginRight);
   AssertEquals('Div1.LayoutNode.MarginRight',80,Div1.LayoutNode.MarginRight);
   AssertEquals('Div1.LayoutNode.MarginBottom',120,Div1.LayoutNode.MarginBottom);
   AssertEquals('Div1.LayoutNode.MarginBottom',120,Div1.LayoutNode.MarginBottom);
-  AssertEquals('Div1.RenderedBorderBox.Left',160,Div1.RenderedBorderBox.Left);
-  AssertEquals('Div1.RenderedBorderBox.Top',40,Div1.RenderedBorderBox.Top);
-  AssertEquals('Div1.RenderedBorderBox.Right',720,Div1.RenderedBorderBox.Right);
-  AssertEquals('Div1.RenderedBorderBox.Bottom',50,Div1.RenderedBorderBox.Bottom);
+  AssertEquals('Div1.UsedBorderBox.Left',160,Div1.UsedBorderBox.Left);
+  AssertEquals('Div1.UsedBorderBox.Top',40,Div1.UsedBorderBox.Top);
+  AssertEquals('Div1.UsedBorderBox.Right',720,Div1.UsedBorderBox.Right);
+  AssertEquals('Div1.UsedBorderBox.Bottom',50,Div1.UsedBorderBox.Bottom);
 end;
 end;
 
 
 procedure TTestFlowLayout.TestPaddingPercentage;
 procedure TTestFlowLayout.TestPaddingPercentage;
@@ -305,19 +305,19 @@ begin
     '}']);
     '}']);
 
 
   Viewport.Draw;
   Viewport.Draw;
-  AssertEquals('Body.RenderedContentBox.Width',800,Body.RenderedContentBox.Width);
+  AssertEquals('Body.UsedContentBox.Width',800,Body.UsedContentBox.Width);
 
 
   AssertEquals('Div1.Rendered',true,Div1.Rendered);
   AssertEquals('Div1.Rendered',true,Div1.Rendered);
 
 
-  //writeln('TTestFlowLayout.TestPaddingPercentage ',Div1.RenderedBorderBox.ToString);
+  //writeln('TTestFlowLayout.TestPaddingPercentage ',Div1.UsedBorderBox.ToString);
   AssertEquals('Div1.LayoutNode.PaddingLeft',160,Div1.LayoutNode.PaddingLeft);
   AssertEquals('Div1.LayoutNode.PaddingLeft',160,Div1.LayoutNode.PaddingLeft);
   AssertEquals('Div1.LayoutNode.PaddingTop',40,Div1.LayoutNode.PaddingTop);
   AssertEquals('Div1.LayoutNode.PaddingTop',40,Div1.LayoutNode.PaddingTop);
   AssertEquals('Div1.LayoutNode.PaddingRight',80,Div1.LayoutNode.PaddingRight);
   AssertEquals('Div1.LayoutNode.PaddingRight',80,Div1.LayoutNode.PaddingRight);
   AssertEquals('Div1.LayoutNode.PaddingBottom',120,Div1.LayoutNode.PaddingBottom);
   AssertEquals('Div1.LayoutNode.PaddingBottom',120,Div1.LayoutNode.PaddingBottom);
-  AssertEquals('Div1.RenderedContentBox.Left',160,Div1.RenderedContentBox.Left);
-  AssertEquals('Div1.RenderedContentBox.Top',40,Div1.RenderedContentBox.Top);
-  AssertEquals('Div1.RenderedContentBox.Right',720,Div1.RenderedContentBox.Right);
-  AssertEquals('Div1.RenderedContentBox.Bottom',50,Div1.RenderedContentBox.Bottom);
+  AssertEquals('Div1.UsedContentBox.Left',160,Div1.UsedContentBox.Left);
+  AssertEquals('Div1.UsedContentBox.Top',40,Div1.UsedContentBox.Top);
+  AssertEquals('Div1.UsedContentBox.Right',720,Div1.UsedContentBox.Right);
+  AssertEquals('Div1.UsedContentBox.Bottom',50,Div1.UsedContentBox.Bottom);
 end;
 end;
 
 
 procedure TTestFlowLayout.TestPositionAbsolute_Right_WidthAuto;
 procedure TTestFlowLayout.TestPositionAbsolute_Right_WidthAuto;
@@ -364,15 +364,15 @@ begin
     '}']);
     '}']);
 
 
   Viewport.Draw;
   Viewport.Draw;
-  AssertEquals('Body.RenderedContentBox.Width',800,Body.RenderedContentBox.Width);
+  AssertEquals('Body.UsedContentBox.Width',800,Body.UsedContentBox.Width);
 
 
   AssertEquals('Div3.Rendered',true,Div3.Rendered);
   AssertEquals('Div3.Rendered',true,Div3.Rendered);
 
 
-  //writeln('TTestFlowLayout.TestPositionAbsolute_Right_WidthAuto Div3.RenderedBorderBox=',Div3.RenderedBorderBox.ToString);
+  //writeln('TTestFlowLayout.TestPositionAbsolute_Right_WidthAuto Div3.UsedBorderBox=',Div3.UsedBorderBox.ToString);
   AssertEquals('Div3.LayoutNode.Width',100,Div3.LayoutNode.Width);
   AssertEquals('Div3.LayoutNode.Width',100,Div3.LayoutNode.Width);
   AssertEquals('Div3.LayoutNode.Height',30,Div3.LayoutNode.Height);
   AssertEquals('Div3.LayoutNode.Height',30,Div3.LayoutNode.Height);
 
 
-  //writeln('TTestFlowLayout.TestPositionAbsolute_Right_WidthAuto Div1.RenderedBorderBox=',Div1.RenderedBorderBox.ToString);
+  //writeln('TTestFlowLayout.TestPositionAbsolute_Right_WidthAuto Div1.UsedBorderBox=',Div1.UsedBorderBox.ToString);
   AssertEquals('Div1.GetComputedString(fcaPosition)','absolute',Div1.GetComputedString(fcaPosition));
   AssertEquals('Div1.GetComputedString(fcaPosition)','absolute',Div1.GetComputedString(fcaPosition));
   AssertEquals('Div1.GetComputedString(fcaBoxSizing)','content-box',Div1.GetComputedString(fcaBoxSizing));
   AssertEquals('Div1.GetComputedString(fcaBoxSizing)','content-box',Div1.GetComputedString(fcaBoxSizing));
   AssertEquals('Div1.GetComputedString(fcaWidth)','auto',Div1.GetComputedString(fcaWidth));
   AssertEquals('Div1.GetComputedString(fcaWidth)','auto',Div1.GetComputedString(fcaWidth));
@@ -381,7 +381,7 @@ begin
   AssertEquals('Div1.LayoutNode.Right',30,Div1.LayoutNode.Right);
   AssertEquals('Div1.LayoutNode.Right',30,Div1.LayoutNode.Right);
   AssertEquals('Div1.LayoutNode.Left',670,Div1.LayoutNode.Left); // 800-30-100 = 670
   AssertEquals('Div1.LayoutNode.Left',670,Div1.LayoutNode.Left); // 800-30-100 = 670
 
 
-  //writeln('TTestFlowLayout.TestPositionAbsolute_Right_WidthAuto Div2.RenderedBorderBox=',Div2.RenderedBorderBox.ToString);
+  //writeln('TTestFlowLayout.TestPositionAbsolute_Right_WidthAuto Div2.UsedBorderBox=',Div2.UsedBorderBox.ToString);
   AssertEquals('Div2.GetComputedString(fcaPosition)','static',Div2.GetComputedString(fcaPosition));
   AssertEquals('Div2.GetComputedString(fcaPosition)','static',Div2.GetComputedString(fcaPosition));
   AssertEquals('Div2.GetComputedString(fcaBoxSizing)','border-box',Div2.GetComputedString(fcaBoxSizing));
   AssertEquals('Div2.GetComputedString(fcaBoxSizing)','border-box',Div2.GetComputedString(fcaBoxSizing));
   AssertEquals('Div2.GetComputedString(fcaWidth)','80%',Div2.GetComputedString(fcaWidth));
   AssertEquals('Div2.GetComputedString(fcaWidth)','80%',Div2.GetComputedString(fcaWidth));
@@ -446,31 +446,31 @@ begin
   // Body width/height includes Label1 and Label2, but not Div1
   // Body width/height includes Label1 and Label2, but not Div1
 
 
   Viewport.Draw;
   Viewport.Draw;
-  AssertEquals('Body.RenderedContentBox.Width',800,Body.RenderedContentBox.Width);
+  AssertEquals('Body.UsedContentBox.Width',800,Body.UsedContentBox.Width);
 
 
   AssertEquals('Div1.Rendered',true,Div1.Rendered);
   AssertEquals('Div1.Rendered',true,Div1.Rendered);
 
 
-  //writeln('TTestFlowLayout.TestPositionAbsolute_DivDefaultPos Label1.RenderedBorderBox=',Label1.RenderedBorderBox.ToString);
+  //writeln('TTestFlowLayout.TestPositionAbsolute_DivDefaultPos Label1.UsedBorderBox=',Label1.UsedBorderBox.ToString);
   AssertEquals('Label1.GetComputedString(fcaPosition)','static',Label1.GetComputedString(fcaPosition));
   AssertEquals('Label1.GetComputedString(fcaPosition)','static',Label1.GetComputedString(fcaPosition));
   AssertEquals('Label1.GetComputedString(fcaDisplay)','inline flow',Label1.GetComputedString(fcaDisplay));
   AssertEquals('Label1.GetComputedString(fcaDisplay)','inline flow',Label1.GetComputedString(fcaDisplay));
   AssertEquals('Label1.GetComputedString(fcaWidth)','auto',Label1.GetComputedString(fcaWidth));
   AssertEquals('Label1.GetComputedString(fcaWidth)','auto',Label1.GetComputedString(fcaWidth));
-  AssertEquals('Label1.RenderedBorderBox.Top',0,Label1.RenderedBorderBox.Left);
-  AssertEquals('Label1.RenderedBorderBox.Left',0,Label1.RenderedBorderBox.Left);
-  AssertEquals('Label1.RenderedBorderBox.Height',23,Label1.RenderedBorderBox.Height);
+  AssertEquals('Label1.UsedBorderBox.Top',0,Label1.UsedBorderBox.Left);
+  AssertEquals('Label1.UsedBorderBox.Left',0,Label1.UsedBorderBox.Left);
+  AssertEquals('Label1.UsedBorderBox.Height',23,Label1.UsedBorderBox.Height);
 
 
-  //writeln('TTestFlowLayout.TestPositionAbsolute_DivDefaultPos Label2.RenderedBorderBox=',Label2.RenderedBorderBox.ToString);
+  //writeln('TTestFlowLayout.TestPositionAbsolute_DivDefaultPos Label2.UsedBorderBox=',Label2.UsedBorderBox.ToString);
   AssertEquals('Label2.GetComputedString(fcaPosition)','static',Label2.GetComputedString(fcaPosition));
   AssertEquals('Label2.GetComputedString(fcaPosition)','static',Label2.GetComputedString(fcaPosition));
   AssertEquals('Label2.GetComputedString(fcaDisplay)','inline flow',Label2.GetComputedString(fcaDisplay));
   AssertEquals('Label2.GetComputedString(fcaDisplay)','inline flow',Label2.GetComputedString(fcaDisplay));
   AssertEquals('Label2.GetComputedString(fcaWidth)','auto',Label2.GetComputedString(fcaWidth));
   AssertEquals('Label2.GetComputedString(fcaWidth)','auto',Label2.GetComputedString(fcaWidth));
-  AssertEquals('Label2.RenderedBorderBox.Height',23,Label2.RenderedBorderBox.Height);
-  AssertEquals('Label2.RenderedBorderBox.Top',0,Label2.RenderedBorderBox.Top);
-  AssertEquals('Label2.RenderedBorderBox.Left',Label1.RenderedBorderBox.Right,Label2.RenderedBorderBox.Left);
-
-  //writeln('TTestFlowLayout.TestPositionAbsolute_DivDefaultPos Div1.RenderedBorderBox=',Div1.RenderedBorderBox.ToString);
-  AssertEquals('Div1.RenderedBorderBox.Width',30,Div1.RenderedBorderBox.Width);
-  AssertEquals('Div1.RenderedBorderBox.Height',20,Div1.RenderedBorderBox.Height);
-  AssertEquals('Div1.RenderedBorderBox.Left',0,Div1.RenderedBorderBox.Left);
-  AssertEquals('Div1.RenderedBorderBox.Top',23,Div1.RenderedBorderBox.Top);
+  AssertEquals('Label2.UsedBorderBox.Height',23,Label2.UsedBorderBox.Height);
+  AssertEquals('Label2.UsedBorderBox.Top',0,Label2.UsedBorderBox.Top);
+  AssertEquals('Label2.UsedBorderBox.Left',Label1.UsedBorderBox.Right,Label2.UsedBorderBox.Left);
+
+  //writeln('TTestFlowLayout.TestPositionAbsolute_DivDefaultPos Div1.UsedBorderBox=',Div1.UsedBorderBox.ToString);
+  AssertEquals('Div1.UsedBorderBox.Width',30,Div1.UsedBorderBox.Width);
+  AssertEquals('Div1.UsedBorderBox.Height',20,Div1.UsedBorderBox.Height);
+  AssertEquals('Div1.UsedBorderBox.Left',0,Div1.UsedBorderBox.Left);
+  AssertEquals('Div1.UsedBorderBox.Top',23,Div1.UsedBorderBox.Top);
 end;
 end;
 
 
 procedure TTestFlowLayout.TestPositionAbsolute_DivDefaultPosBehindRelative;
 procedure TTestFlowLayout.TestPositionAbsolute_DivDefaultPosBehindRelative;
@@ -510,26 +510,26 @@ begin
   // Body width/height includes Label1 static bounds, and not Div1
   // Body width/height includes Label1 static bounds, and not Div1
 
 
   Viewport.Draw;
   Viewport.Draw;
-  AssertEquals('Body.RenderedContentBox.Width',800,Body.RenderedContentBox.Width);
+  AssertEquals('Body.UsedContentBox.Width',800,Body.UsedContentBox.Width);
 
 
   AssertEquals('Div1.Rendered',true,Div1.Rendered);
   AssertEquals('Div1.Rendered',true,Div1.Rendered);
 
 
-  //writeln('TTestFlowLayout.TestPositionAbsolute_DivDefaultPos Label1.RenderedBorderBox=',Label1.RenderedBorderBox.ToString);
+  //writeln('TTestFlowLayout.TestPositionAbsolute_DivDefaultPos Label1.UsedBorderBox=',Label1.UsedBorderBox.ToString);
   AssertEquals('Label1.GetComputedString(fcaPosition)','relative',Label1.GetComputedString(fcaPosition));
   AssertEquals('Label1.GetComputedString(fcaPosition)','relative',Label1.GetComputedString(fcaPosition));
   AssertEquals('Label1.GetComputedString(fcaDisplay)','inline flow',Label1.GetComputedString(fcaDisplay));
   AssertEquals('Label1.GetComputedString(fcaDisplay)','inline flow',Label1.GetComputedString(fcaDisplay));
   AssertEquals('Label1.GetComputedString(fcaWidth)','auto',Label1.GetComputedString(fcaWidth));
   AssertEquals('Label1.GetComputedString(fcaWidth)','auto',Label1.GetComputedString(fcaWidth));
   AssertEquals('Label1.GetComputedString(fcaTop)','10px',Label1.GetComputedString(fcaTop));
   AssertEquals('Label1.GetComputedString(fcaTop)','10px',Label1.GetComputedString(fcaTop));
-  AssertEquals('Label1.RenderedBorderBox.Top',10,Label1.RenderedBorderBox.Top);
-  AssertEquals('Label1.RenderedBorderBox.Left',0,Label1.RenderedBorderBox.Left);
-  AssertEquals('Label1.RenderedBorderBox.Height',23,Label1.RenderedBorderBox.Height);
+  AssertEquals('Label1.UsedBorderBox.Top',10,Label1.UsedBorderBox.Top);
+  AssertEquals('Label1.UsedBorderBox.Left',0,Label1.UsedBorderBox.Left);
+  AssertEquals('Label1.UsedBorderBox.Height',23,Label1.UsedBorderBox.Height);
 
 
-  AssertEquals('Body.RenderedBorderBox.Height',23,Body.RenderedBorderBox.Height);
+  AssertEquals('Body.UsedBorderBox.Height',23,Body.UsedBorderBox.Height);
 
 
-  //writeln('TTestFlowLayout.TestPositionAbsolute_DivDefaultPos Div1.RenderedBorderBox=',Div1.RenderedBorderBox.ToString);
-  AssertEquals('Div1.RenderedBorderBox.Width',30,Div1.RenderedBorderBox.Width);
-  AssertEquals('Div1.RenderedBorderBox.Height',20,Div1.RenderedBorderBox.Height);
-  AssertEquals('Div1.RenderedBorderBox.Left',0,Div1.RenderedBorderBox.Left);
-  AssertEquals('Div1.RenderedBorderBox.Top',23,Div1.RenderedBorderBox.Top);
+  //writeln('TTestFlowLayout.TestPositionAbsolute_DivDefaultPos Div1.UsedBorderBox=',Div1.UsedBorderBox.ToString);
+  AssertEquals('Div1.UsedBorderBox.Width',30,Div1.UsedBorderBox.Width);
+  AssertEquals('Div1.UsedBorderBox.Height',20,Div1.UsedBorderBox.Height);
+  AssertEquals('Div1.UsedBorderBox.Left',0,Div1.UsedBorderBox.Left);
+  AssertEquals('Div1.UsedBorderBox.Top',23,Div1.UsedBorderBox.Top);
 end;
 end;
 
 
 Initialization
 Initialization