Contains methods for interacting with a CSS class applied to the computed style.
The computed style of a html element. This holds exactly where it should go and how it should look.
Public Member Functions | |
void | ChangeTagProperty (string cssProperty, Css.Value newValue, bool requestLayout) |
This is called to change a CSS property from an element. For example, font color=".." uses this. It sets a specifity of 0 as required by https://www.w3.org/TR/CSS2/cascade.html 6.4.4 More... | |
void | ChangeTagProperty (string cssProperty, Css.Value newValue) |
This is called to change a CSS property from an element. For example, font color=".." uses this. It sets a specifity of 0 as required by https://www.w3.org/TR/CSS2/cascade.html 6.4.4 More... | |
Css.Value | ChangeTagProperty (string cssProperty, string newValue) |
This is called to change a CSS property from an element. For example, font color=".." uses this. It sets a specifity of 0 as required by https://www.w3.org/TR/CSS2/cascade.html 6.4.4 More... | |
BoxStyle | GetMarginBox (int displayMode, int floatMode, ref bool dimsRequired) |
Computes the margin as it is right now. More... | |
BoxStyle | GetPaddingBox (int displayMode) |
Computes the padding as it is right now. More... | |
BoxStyle | GetBorderBox (int displayMode) |
Computes the border widths as it is right now. More... | |
BoxStyle | GetPositionBox (int positionMode) |
Computes the positions as it is right now (right, left etc). More... | |
BoxStyle | GetScrollBox () |
Computes the scroll values as it is right now (top and left only). More... | |
ComputedStyle (Node element) | |
Creates a new computed style for the given element. More... | |
void | ApplyMatchedStyles () |
Applies all the matched styles now. More... | |
List< MatchingSelector > | MatchedSelectors () |
Used for debugging only. Lists selectors that matched this element (including pseudo's). More... | |
Css.Style | BuildMatchedStyles () |
Used for debugging only. Builds all matched selectors into a single style object. More... | |
Node | GetVirtualChild (string name) |
Gets a virtual element which can be targeted with the psuedo-element CSS selectors such as ::before. More... | |
void | AttributeChanged (string name) |
Called when an attribute changed. More... | |
void | RefreshLocal (bool bubble) |
Refreshes pseudo classes such as :hover on this element. Optionally refreshes all parents too. Internally they're called "local matchers". More... | |
void | RefreshLocal () |
Refreshes pseudo classes such as :hover on this element. Internally they're called "local matchers". More... | |
void | TryApplyLate (StyleRule rule) |
Attempts to apply the given selector to this style (but only if it's a select or a partial select). More... | |
void | RemoveVirtual (int priority) |
Removes a virtual node. More... | |
SparkInformerNode | GetOrCreateVirtualInformer (int priority, bool virtSpark) |
Gets/ creates a virtual informer element of the given priority. More... | |
Node | GetOrCreateVirtual (int priority, string tag) |
Gets/ creates a virtual element of the given priority. More... | |
Node | GetOrCreateVirtual (int priority, string tag, bool sparkVirtual) |
Gets/ creates a virtual element of the given priority. More... | |
bool | MatchChanged (Style style, bool active) |
Called when a matcher has changed and the given style must now be applied to this CS. Dealing with pseudo's is handled by the callee. More... | |
void | RefreshStructure () |
Refreshes this elements selectors. More... | |
BoxRegion | GetBounds () |
bool | BoxOverlap (ComputedStyle style) |
float | GetMidpointX () |
Gets the position of the midpoint on the x axis. More... | |
float | GetMidpointY () |
Gets the position of the midpoint on the y axis. More... | |
void | ParentPropertyChanged (CssProperty property, RenderableData context, Css.Value newValue) |
Called when a specific property of the parent was changed. More... | |
void | ParentChanged () |
Called when the parent of the element was changed. Doesn't apply when the element is first created and wasn't on anything anyway. It updates all the inherited properties to make sure they're now inheriting the right thing. More... | |
float | VisiblePercentageX () |
How much of this elements horizontal content is currently visible? Used by scrolling. More... | |
float | VisiblePercentageY () |
How much of this elements vertical content is currently visible? Used by scrolling. More... | |
void | ChangeProperty (CssProperty property, Css.Value newValue) |
This is called to change the named property on this element. More... | |
void | ResetScrollbars (int overflowX, int overflowY) |
Resets the scrollbar elements for this element. More... | |
void | RequestPaintAll () |
Requests that the document repaints this element (and all kids) when possible. More... | |
void | RequestPaint () |
Requests that the document repaints this element, when possible. More... | |
void | RequestLayout () |
Requests that the renderer performs a layout on the next update. Note that layouts are more expensive than a paint. Paints simply update vertex colours and uvs where as layouts rebuild the whole mesh. More... | |
void | RequestFastLayout () |
Requests that the renderer performs a shortform layout on the next update. More... | |
Css.Value | Resolve (CssProperty property) |
If this style defines the named property then it gets returned. Otherwise, it'll either return an inherited value or the default, depending on the properties own settings. More... | |
Public Member Functions inherited from Css.Style | |
Style (Node element) | |
Creates a new style for the given element. More... | |
Style (string text, Node element) | |
Creates a new style with the given css text string seperated by semicolons. More... | |
Style | Clone () |
Clone this style object. More... | |
string | getPropertyValue (string property) |
JS API for getting property values. In PowerUI you can just use this[property] instead. More... | |
void | CopyTo (Style otherStyle, StyleCopyMode mode) |
Copies this objects properties to the other given style, overwriting existing properties if told to do so. More... | |
void | LoadProperties (CssLexer lexer, OnReadProperty onPropertyRead) |
Reads the properties for this style block from the lexer. Essentially treats it like a set of properties only. Terminated by }, null or >. More... | |
Value | Get (string cssProperty) |
Gets the value of the given property, if any. More... | |
void | CallChange (CssProperty property, Value value) |
Lets the sheet know that a value changed. Non-alias values here only. More... | |
virtual ComputedStyle | GetComputed () |
Gets the computed form of this style. More... | |
Css.Value | Set (string cssProperty, string valueText) |
Sets the named property on this style to the given value. More... | |
void | SetComposite (string cssProperty, Css.Value newValue, Css.Value composite) |
Sets a property from a composite set. Any new values that are null are set to the initial value and inherit the specifity from the composite value. More... | |
virtual void | OnChanged (CssProperty property, Value newValue) |
called when the named property changes. More... | |
virtual string | GetString (string cssProperty) |
Gets the given property as a css string. May optionally read the given inner index of it as a css string. More... | |
override string | ToString () |
Public Attributes | |
KeyframesAnimationInstance | AnimationInstance |
The live keyframes animation, if there is one. More... | |
RenderableData | RenderData |
Information such as this nodes computed box model. More... | |
float | ZIndex |
The depth of this element. More... | |
float | MaxZIndex |
The depth of this elements deepest child. More... | |
MatchingRoot | FirstMatch |
The set of style matches currently being applied here as a linked list. More... | |
MatchingRoot | LastMatch |
The set of style matches currently being applied here as a linked list. More... | |
const int | HorizontalScrollPriority =VirtualElements.SCROLLBAR_ZONE |
const int | VerticalScrollPriority =HorizontalScrollPriority+2 |
const int | ResizerPriority =VerticalScrollPriority+2 |
Public Attributes inherited from Css.Style | |
Node | Element |
The element that this style belongs to, if any. More... | |
Dictionary< CssProperty, Value > | Properties =new Dictionary<CssProperty,Value>() |
The mapping of css property (e.g. display) to value ("none" as a Css.Value). Do not set values directly into this - use style[property]=value; instead to correctly handle aliases. More... | |
Package Functions | |
int | ResolveInt (CssProperty prop) |
Resolves the given property at this style as an integer. More... | |
float | ResolveDecimal (CssProperty prop) |
Resolves the given property at this style as a float. More... | |
float | ClipWidth (int displayMode, float width) |
Clips a width value by min/max, if they're defined. Note that you'll need to be careful with regards to box-sizing. More... | |
float | ClipHeight (int displayMode, float height) |
Clips a height value by min/max, if they're defined. Note that you'll need to be careful with regards to box-sizing. More... | |
Package Functions inherited from Css.Style | |
Css.Value | GetBaseValue (CssProperty property) |
Gets or creates the base value for the given property. The base value is essentially the value held directly in this style sheet. E.g. if the value you're setting is the R channel of color-overlay, this sets up the color-overlay value for you. More... | |
Properties | |
float | OffsetTop [get] |
The global offset from the top edge. Computed in secondary layout pass. More... | |
float | OffsetLeft [get] |
The global offset from the left edge. Computed in secondary layout pass. More... | |
float | PixelWidth [get] |
The total width in pixels of this element. More... | |
float | PixelHeight [get] |
The total height in pixels of this element. More... | |
float | ContentWidth [get] |
The width of the content inside the box. Note that this is different from both InnerWidth and PixelWidth (which describe the "window" in which the content is seen). More... | |
float | ContentHeight [get] |
The width of the content inside the box. Note that this is different from both InnerWidth and PixelWidth (which describe the "window" in which the content is seen). More... | |
float | InnerWidth [get] |
The width of this element, excluding the border and padding. More... | |
float | InnerHeight [get] |
The height of this element, excluding the border and padding. More... | |
float | ScrollLeft [get] |
The scroll offset (from the left) of this element More... | |
float | ScrollTop [get] |
The scroll offset (from the top) of this element More... | |
LayoutBox | FirstBox [get] |
The first layout box. Can be null. More... | |
float | ZoomX [get] |
The raw zoom value. More... | |
Transformation | TransformX [get] |
The transform if there is one. More... | |
int | HorizontalAlignX [get] |
The horizontal-align mode. More... | |
int | HorizontalAlignLastX [get] |
The horizontal-align-last mode. More... | |
int | VerticalAlignX [get] |
The vertical-align mode. More... | |
int | WhiteSpaceX [get] |
The white-space mode. More... | |
Css.Value | ZIndexX [get] |
The z-index mode. More... | |
int | VisibilityX [get] |
The visibility mode. More... | |
int | DisplayX [get] |
The inner/ outer CSS display mode. More... | |
int | PositionX [get] |
Defines the position of this element. Static, fixed etc. More... | |
int | DrawDirectionX [get] |
This elements draw direction. See DirectionMode. More... | |
int | FontWeightX [get] |
Resolves the font size for this style. More... | |
Css.Units.FontFamilyUnit | FontFamilyX [get] |
Resolves the font family for this style. Note that this can be null. More... | |
Css.Value | LineHeightX [get] |
Resolves the minimum line height for this style. Returns the raw value so the font size/ font can be cached separately. More... | |
float | LineHeightFullX [get] |
Resolves the minimum line height for this style. More... | |
float | FontSizeX [get] |
Resolves the font size for this style. More... | |
Color | ColorOverlayX [get] |
Resolves the colour overlay from this style. More... | |
Css.Value | Scroll [get] |
The current scroll amount. More... | |
Css.Value | WidthX [get] |
The defined width, if there is one. More... | |
Css.Value | HeightX [get] |
The defined height, if there is one. More... | |
float | HeightFullX [get] |
Resolves the full declared height. It's -1 if it's undefined. More... | |
bool | BorderBoxModel [get] |
True if this element is using the border-box model. More... | |
int | EndSpaceSize [get] |
The width in pixels of the last whitespace of this element, if it's got one. More... | |
bool | WritingSystemInverted [get] |
True if vertical values are mapped to being horizontal by the writing system and vice-versa. More... | |
int[] | WritingSystemMap [get] |
Gets the mapping for the writing system. More... | |
ReflowDocument | reflowDocument [get] |
The current reflow capable document. More... | |
override Value | this[CssProperty property] [get, set] |
Gets or sets the parsed value of this style by property name. More... | |
int | FloatMode [get] |
The CSS float mode. Left, right, none etc. More... | |
ShaderSet | CustomShaders [get] |
A custom shader set on this element. More... | |
Properties inherited from Css.Style | |
ReflowDocument | document [get] |
The document containing this style. More... | |
string | cssText [get, set] |
Sets the css text of this style as a css string seperated by semicolons (;). More... | |
Value | this[string cssProperty] [get, set] |
Gets or sets the parsed value of this style by property name. More... | |
virtual Value | this[CssProperty property] [get, set] |
Gets or sets the parsed value of this style by property name. More... | |
Private Member Functions | |
bool | RunMatch (CssEvent matcher, StyleRule rule, List< Selector > selectors) |
bool | RunMatch (CssEvent matcher, List< StyleRule > styles) |
bool | NeedsScrollbar (int type) |
Checks if the given overflow type requires a scrollbar. More... | |
HtmlScrollbarElement | MakeScrollbar (bool horizontal, bool both, bool auto) |
Generates a new scrollbar with the given orientation. More... | |
Static Private Attributes | |
static CssEvent | StandardMatcher =new CssEvent() |
Additional Inherited Members | |
Static Public Member Functions inherited from Css.Style | |
static Style | Create (string properties, Node element) |
Creates a style from the given property block with the given parent. More... | |
|
inline |
Creates a new computed style for the given element.
element | The element that this is a computed style for. |
|
inline |
Applies all the matched styles now.
|
inline |
Called when an attribute changed.
|
inline |
|
inline |
Used for debugging only. Builds all matched selectors into a single style object.
|
inline |
This is called to change the named property on this element.
property | The css property being changed. |
newValue | The new property value. |
|
inline |
This is called to change a CSS property from an element. For example, font color=".." uses this. It sets a specifity of 0 as required by https://www.w3.org/TR/CSS2/cascade.html 6.4.4
cssProperty | The css property being changed. |
newValue | The new property value. |
|
inline |
This is called to change a CSS property from an element. For example, font color=".." uses this. It sets a specifity of 0 as required by https://www.w3.org/TR/CSS2/cascade.html 6.4.4
cssProperty | The css property being changed. |
newValue | The new property value. |
|
inline |
This is called to change a CSS property from an element. For example, font color=".." uses this. It sets a specifity of 0 as required by https://www.w3.org/TR/CSS2/cascade.html 6.4.4
cssProperty | The css property being changed. |
newValue | The new property value. |
|
inlinepackage |
Clips a height value by min/max, if they're defined. Note that you'll need to be careful with regards to box-sizing.
|
inlinepackage |
Clips a width value by min/max, if they're defined. Note that you'll need to be careful with regards to box-sizing.
|
inline |
Computes the border widths as it is right now.
|
inline |
|
inline |
Computes the margin as it is right now.
|
inline |
Gets the position of the midpoint on the x axis.
|
inline |
Gets the position of the midpoint on the y axis.
|
inline |
Gets/ creates a virtual element of the given priority.
|
inline |
Gets/ creates a virtual element of the given priority.
|
inline |
Gets/ creates a virtual informer element of the given priority.
virtSpark | True if this informer is a virtual spark one and need to be destroyed when style refreshes. |
|
inline |
Computes the padding as it is right now.
|
inline |
Computes the positions as it is right now (right, left etc).
|
inline |
Computes the scroll values as it is right now (top and left only).
|
inline |
Gets a virtual element which can be targeted with the psuedo-element CSS selectors such as ::before.
|
inlineprivate |
Generates a new scrollbar with the given orientation.
horizontal | True for a horizontal scrollbar, false for vertical. |
|
inline |
Called when a matcher has changed and the given style must now be applied to this CS. Dealing with pseudo's is handled by the callee.
|
inline |
Used for debugging only. Lists selectors that matched this element (including pseudo's).
|
inlineprivate |
Checks if the given overflow type requires a scrollbar.
type | The overflow type to check. |
|
inline |
Called when the parent of the element was changed. Doesn't apply when the element is first created and wasn't on anything anyway. It updates all the inherited properties to make sure they're now inheriting the right thing.
|
inline |
Called when a specific property of the parent was changed.
|
inline |
Refreshes pseudo classes such as :hover on this element. Optionally refreshes all parents too. Internally they're called "local matchers".
|
inline |
Refreshes pseudo classes such as :hover on this element. Internally they're called "local matchers".
|
inline |
Refreshes this elements selectors.
|
inline |
Removes a virtual node.
|
inline |
Requests that the renderer performs a shortform layout on the next update.
|
inline |
Requests that the renderer performs a layout on the next update. Note that layouts are more expensive than a paint. Paints simply update vertex colours and uvs where as layouts rebuild the whole mesh.
|
inline |
Requests that the document repaints this element, when possible.
|
inline |
Requests that the document repaints this element (and all kids) when possible.
|
inline |
Resets the scrollbar elements for this element.
|
inline |
If this style defines the named property then it gets returned. Otherwise, it'll either return an inherited value or the default, depending on the properties own settings.
|
inlinepackage |
Resolves the given property at this style as a float.
|
inlinepackage |
Resolves the given property at this style as an integer.
|
inlineprivate |
|
inline |
Attempts to apply the given selector to this style (but only if it's a select or a partial select).
|
inline |
How much of this elements horizontal content is currently visible? Used by scrolling.
|
inline |
How much of this elements vertical content is currently visible? Used by scrolling.
KeyframesAnimationInstance Css.ComputedStyle.AnimationInstance |
The live keyframes animation, if there is one.
MatchingRoot Css.ComputedStyle.FirstMatch |
The set of style matches currently being applied here as a linked list.
const int Css.ComputedStyle.HorizontalScrollPriority =VirtualElements.SCROLLBAR_ZONE |
MatchingRoot Css.ComputedStyle.LastMatch |
The set of style matches currently being applied here as a linked list.
float Css.ComputedStyle.MaxZIndex |
The depth of this elements deepest child.
RenderableData Css.ComputedStyle.RenderData |
Information such as this nodes computed box model.
const int Css.ComputedStyle.ResizerPriority =VerticalScrollPriority+2 |
const int Css.ComputedStyle.VerticalScrollPriority =HorizontalScrollPriority+2 |
float Css.ComputedStyle.ZIndex |
The depth of this element.
|
get |
True if this element is using the border-box model.
|
get |
Resolves the colour overlay from this style.
|
get |
The width of the content inside the box. Note that this is different from both InnerWidth and PixelWidth (which describe the "window" in which the content is seen).
|
get |
The width of the content inside the box. Note that this is different from both InnerWidth and PixelWidth (which describe the "window" in which the content is seen).
|
get |
A custom shader set on this element.
|
get |
The inner/ outer CSS display mode.
|
get |
This elements draw direction. See DirectionMode.
|
get |
The width in pixels of the last whitespace of this element, if it's got one.
|
get |
The first layout box. Can be null.
|
get |
The CSS float mode. Left, right, none etc.
|
getpackage |
Resolves the font family for this style. Note that this can be null.
|
get |
Resolves the font size for this style.
|
get |
Resolves the font size for this style.
|
get |
Resolves the full declared height. It's -1 if it's undefined.
|
get |
The defined height, if there is one.
|
get |
The horizontal-align-last mode.
|
get |
The horizontal-align mode.
|
get |
The height of this element, excluding the border and padding.
|
get |
The width of this element, excluding the border and padding.
|
get |
Resolves the minimum line height for this style.
|
get |
Resolves the minimum line height for this style. Returns the raw value so the font size/ font can be cached separately.
|
get |
The global offset from the left edge. Computed in secondary layout pass.
|
get |
The global offset from the top edge. Computed in secondary layout pass.
|
get |
The total height in pixels of this element.
|
get |
The total width in pixels of this element.
|
get |
Defines the position of this element. Static, fixed etc.
|
get |
The current reflow capable document.
|
get |
The current scroll amount.
|
get |
The scroll offset (from the left) of this element
|
get |
The scroll offset (from the top) of this element
|
getset |
Gets or sets the parsed value of this style by property name.
property | The property to get the value for. |
|
get |
The transform if there is one.
|
get |
The vertical-align mode.
|
get |
The visibility mode.
|
get |
The white-space mode.
|
get |
The defined width, if there is one.
|
get |
True if vertical values are mapped to being horizontal by the writing system and vice-versa.
|
get |
Gets the mapping for the writing system.
|
get |
The z-index mode.
|
get |
The raw zoom value.