|
@@ -1167,7 +1167,7 @@ type
|
|
|
// CSS pseudo classes
|
|
|
property CSSPseudoClass[Pseudo: TFresnelCSSPseudoClass]: boolean read GetCSSPseudoClass write SetCSSPseudoClass;
|
|
|
// CSS computed attributes
|
|
|
- procedure ComputeStyleElement; virtual; // parse inline style
|
|
|
+ procedure ComputeInlineStyle; virtual; // parse inline style
|
|
|
procedure ComputeCSSValues; virtual; // call resolver to collect CSS values and resolve shorthands
|
|
|
procedure ComputeCSSAfterLayoutNode(Layouter: TFresnelLayouter); virtual; // called after layouter node, before layouter traverse children
|
|
|
function GetCSSString(AttrID: TCSSNumericalID; Compute: boolean; out Complete: boolean): string; virtual;
|
|
@@ -1255,6 +1255,8 @@ type
|
|
|
TPseudoElement = class(TFresnelElement)
|
|
|
public
|
|
|
constructor Create(AOwner: TComponent); override;
|
|
|
+ class function CSSTypeID: TCSSNumericalID; override;
|
|
|
+ class function CSSTypeName: TCSSString; override;
|
|
|
{ ICSSNode }
|
|
|
// CSS identifier implementation of ICSSNode
|
|
|
function GetCSSID: TCSSString; override;
|
|
@@ -5714,17 +5716,15 @@ procedure TFresnelViewport.ApplyCSS;
|
|
|
El.FResolver:=Resolver;
|
|
|
El.FViewPort:=Self;
|
|
|
end;
|
|
|
- El.ComputeStyleElement;
|
|
|
+ El.ComputeInlineStyle;
|
|
|
El.ComputeCSSValues;
|
|
|
|
|
|
+ if fesPseudoElement in FStates then
|
|
|
+ exit;
|
|
|
for i:=0 to El.NodeCount-1 do
|
|
|
TraverseCSS(El.Nodes[i]);
|
|
|
for i:=0 to El.PseudoNodeCount-1 do
|
|
|
- begin
|
|
|
- PE:=El.PseudoNodes[i];
|
|
|
- PE.FResolver:=Resolver;
|
|
|
- PE.FViewPort:=Self;
|
|
|
- end;
|
|
|
+ TraverseCSS(El.PseudoNodes[i]);
|
|
|
end;
|
|
|
|
|
|
begin
|
|
@@ -6343,7 +6343,7 @@ begin
|
|
|
DomChanged;
|
|
|
end;
|
|
|
|
|
|
-procedure TFresnelElement.ComputeStyleElement;
|
|
|
+procedure TFresnelElement.ComputeInlineStyle;
|
|
|
begin
|
|
|
if not (fesStyleChanged in FStates) then exit;
|
|
|
Exclude(FStates,fesStyleChanged);
|
|
@@ -7957,12 +7957,18 @@ end;
|
|
|
|
|
|
procedure TFresnelElement.ComputeBoxSizing;
|
|
|
begin
|
|
|
- FComputedBoxSizing:=GetComputedKeyword(fcaBoxSizing,CSSRegistry.Chk_BoxSizing_KeywordIDs);
|
|
|
+ if fesPseudoElement in FStates then
|
|
|
+ FComputedVisibility:=CSSRegistry.kwContentBox
|
|
|
+ else
|
|
|
+ FComputedBoxSizing:=GetComputedKeyword(fcaBoxSizing,CSSRegistry.Chk_BoxSizing_KeywordIDs);
|
|
|
end;
|
|
|
|
|
|
procedure TFresnelElement.ComputeDirection;
|
|
|
begin
|
|
|
- FComputedDirection:=GetComputedKeyword(fcaDirection,CSSRegistry.Chk_Direction_KeywordIDs);
|
|
|
+ if fesPseudoElement in FStates then
|
|
|
+ FComputedVisibility:=CSSRegistry.kwLTR
|
|
|
+ else
|
|
|
+ FComputedDirection:=GetComputedKeyword(fcaDirection,CSSRegistry.Chk_Direction_KeywordIDs);
|
|
|
end;
|
|
|
|
|
|
procedure TFresnelElement.ComputeDisplay;
|
|
@@ -7974,7 +7980,7 @@ var
|
|
|
begin
|
|
|
FComputedDisplayInside:=CSSIDNone;
|
|
|
FComputedDisplayOutside:=CSSIDNone;
|
|
|
- if FComputedVisibility=CSSRegistry.kwCollapse then
|
|
|
+ if (FComputedVisibility=CSSRegistry.kwCollapse) or (fesPseudoElement in FStates) then
|
|
|
exit;
|
|
|
|
|
|
aValue:=GetCSSString(CSSRegistry.FresnelAttrs[fcaDisplay].Index,false,Complete);
|
|
@@ -8041,17 +8047,26 @@ end;
|
|
|
|
|
|
procedure TFresnelElement.ComputePosition;
|
|
|
begin
|
|
|
- FComputedPosition:=GetComputedKeyword(fcaPosition,CSSRegistry.Chk_Position_KeywordIDs);
|
|
|
+ if fesPseudoElement in FStates then
|
|
|
+ FComputedVisibility:=CSSRegistry.kwStatic
|
|
|
+ else
|
|
|
+ FComputedPosition:=GetComputedKeyword(fcaPosition,CSSRegistry.Chk_Position_KeywordIDs);
|
|
|
end;
|
|
|
|
|
|
procedure TFresnelElement.ComputeVisibility;
|
|
|
begin
|
|
|
- FComputedVisibility:=GetComputedKeyword(fcaVisibility,CSSRegistry.Chk_Visible_KeywordIDs);
|
|
|
+ if fesPseudoElement in FStates then
|
|
|
+ FComputedVisibility:=CSSRegistry.kwHidden
|
|
|
+ else
|
|
|
+ FComputedVisibility:=GetComputedKeyword(fcaVisibility,CSSRegistry.Chk_Visible_KeywordIDs);
|
|
|
end;
|
|
|
|
|
|
procedure TFresnelElement.ComputeWritingMode;
|
|
|
begin
|
|
|
- FComputedWritingMode:=GetComputedKeyword(fcaWritingMode,CSSRegistry.Chk_WritingMode_KeywordIDs);
|
|
|
+ if fesPseudoElement in FStates then
|
|
|
+ FComputedVisibility:=CSSRegistry.kwHorizontalTB
|
|
|
+ else
|
|
|
+ FComputedWritingMode:=GetComputedKeyword(fcaWritingMode,CSSRegistry.Chk_WritingMode_KeywordIDs);
|
|
|
end;
|
|
|
|
|
|
function TFresnelElement.ComputeAttribute(aDesc: TCSSAttributeDesc; var aValue: String
|
|
@@ -8375,6 +8390,16 @@ begin
|
|
|
inherited Create(AOwner);
|
|
|
end;
|
|
|
|
|
|
+class function TPseudoElement.CSSTypeID: TCSSNumericalID;
|
|
|
+begin
|
|
|
+ Result:=CSSIDNone;
|
|
|
+end;
|
|
|
+
|
|
|
+class function TPseudoElement.CSSTypeName: TCSSString;
|
|
|
+begin
|
|
|
+ Result:='';
|
|
|
+end;
|
|
|
+
|
|
|
function TPseudoElement.GetCSSID: TCSSString;
|
|
|
begin
|
|
|
Result:='';
|