Divooka.WebpageRenderer
Divooka.WebpageRenderer.Controls.IFrameControl
Control that renders an HTML iframe element with its own content and styling
Divooka.WebpageRenderer.Controls.IFrameControl.StyleSheet
Shared stylesheet for iframe content styling
Divooka.WebpageRenderer.Controls.IFrameControl.#ctor()
Initializes a new iframe control with specified element and base URL
Divooka.WebpageRenderer.Controls.IFrameControl.SetStyleSheet()
Sets the global stylesheet for all iframes
Divooka.WebpageRenderer.LayoutConverter
Converts HTML DOM elements into a hierarchical structure of UI controls.
Handles layout conversion for text, media, forms, and structural elements.
Divooka.WebpageRenderer.LayoutConverter._httpClient
Shared HTTP client instance for downloading remote resources
Reused to avoid socket exhaustion
Divooka.WebpageRenderer.LayoutConverter.ConvertElement()
Maps HTML elements to their corresponding UI control converters.
Returns null for unsupported or ignored elements (script, style).
Logs warning for unhandled tags.
Parameters
| Name | Description | Default |
|---|---|---|
element |
The HTML element to convert |
Returns
A UI Control instance or null if element should be skipped
Divooka.WebpageRenderer.LayoutConverter.LogUnsupportedTag()
Logs unsupported HTML tags and returns a spacer as fallback
Parameters
| Name | Description | Default |
|---|---|---|
element |
The unsupported HTML element |
Returns
A Spacer control as placeholder
Divooka.WebpageRenderer.LayoutConverter.ConvertBody()
Converts the HTML body element into a vertical stack panel.
Recursively processes all child elements maintaining document structure.
Divooka.WebpageRenderer.LayoutConverter.ConvertHeader()
Converts HTML heading elements (h1-h6) into styled text containers
Parameters
| Name | Description | Default |
|---|---|---|
element |
The heading element to convert | |
fontSize |
Font size in pixels for the heading level |
Returns
A StackPanel containing the formatted heading
Divooka.WebpageRenderer.LayoutConverter.ConvertFlowContainer()
Handles inline text flow and block elements for container elements like div and p
Parameters
| Name | Description | Default |
|---|---|---|
element |
The container element to process | |
defaultSpacing |
Optional spacing between elements |
Returns
A StackPanel containing the formatted content
Divooka.WebpageRenderer.LayoutConverter.CreateNewLine()
Creates a new horizontal line container for inline elements
Divooka.WebpageRenderer.LayoutConverter.ProcessNode()
Processes a single DOM node and adds it to the appropriate container
Divooka.WebpageRenderer.LayoutConverter.ProcessElementNode()
Processes an element node, handling line breaks and block/inline elements
Divooka.WebpageRenderer.LayoutConverter.ProcessTextNode()
Processes a text node, adding it to the current line if non-empty
Divooka.WebpageRenderer.LayoutConverter.ConvertDiv()
Converts an HTML div element into a flow container.
Handles both block-level and inline content while maintaining proper layout flow.
Parameters
| Name | Description | Default |
|---|---|---|
element |
The div element to convert |
Returns
A StackPanel control containing the div's formatted content
Divooka.WebpageRenderer.LayoutConverter.ConvertParagraph()
Converts an HTML paragraph element into a flow container.
Creates a block-level container that handles inline content and maintains text flow.
Parameters
| Name | Description | Default |
|---|---|---|
element |
The paragraph element to convert |
Returns
A StackPanel control containing the paragraph's formatted content
Divooka.WebpageRenderer.LayoutConverter.ConvertSpan()
Converts a span element into a flow container that handles inline content.
Reuses existing flow container logic for consistent text and element handling.
Parameters
| Name | Description | Default |
|---|---|---|
element |
The span element to convert |
Returns
A StackPanel control containing the span's formatted content
Divooka.WebpageRenderer.LayoutConverter.ConvertBoldText()
Converts text to bold formatting using BBCode
Parameters
| Name | Description | Default |
|---|---|---|
element |
The bold/strong element to convert |
Returns
A BBCodeText control with bold formatting
Divooka.WebpageRenderer.LayoutConverter.ConvertItalicText()
Converts text to italic formatting using BBCode
Parameters
| Name | Description | Default |
|---|---|---|
element |
The italic/em element to convert |
Returns
A BBCodeText control with italic formatting
Divooka.WebpageRenderer.LayoutConverter.ConvertUnderlineText()
Converts text to underlined formatting using BBCode
Parameters
| Name | Description | Default |
|---|---|---|
element |
The underline element to convert |
Returns
A BBCodeText control with underline formatting
Divooka.WebpageRenderer.LayoutConverter.ConvertListItem()
Converts a list item element into a formatted container with bullet point or number
Parameters
| Name | Description | Default |
|---|---|---|
element |
The list item element to convert | |
listNumber |
Optional number for ordered lists |
Returns
A container with bullet/number and formatted content
Divooka.WebpageRenderer.LayoutConverter.ConvertSelect()
Converts an HTML select element into a dropdown control.
Processes option elements and maintains selected state.
Parameters
| Name | Description | Default |
|---|---|---|
element |
The select element to convert |
Returns
A Dropdown control populated with options
Divooka.WebpageRenderer.LayoutConverter.ConvertImage()
Converts an HTML img element into an ImageDisplay control.
Handles downloading remote images, dimension calculations, and background colors.
Parameters
| Name | Description | Default |
|---|---|---|
element |
The HTML img element to convert |
Returns
An ImageDisplay control or null if conversion fails
Divooka.WebpageRenderer.LayoutConverter.ConvertLink()
Converts an HTML anchor element into a clickable link using BBCode formatting.
Preserves the href attribute and applies standard link styling.
Parameters
| Name | Description | Default |
|---|---|---|
element |
The anchor element to convert |
Returns
A BBCodeText control formatted as a hyperlink
Divooka.WebpageRenderer.LayoutConverter.IsBlockElement()
Determines if an HTML element should be treated as a block-level element.
Block elements start on new lines and take up full width.
Parameters
| Name | Description | Default |
|---|---|---|
tagName |
HTML tag name to check |
Returns
True if element is block-level, false otherwise
Divooka.WebpageRenderer.LayoutConverter.ParseColor()
Parses color strings in various formats into SKColor objects.
Supports hex colors (#RGB, #RRGGBB) and common named colors.
Parameters
| Name | Description | Default |
|---|---|---|
colorStr |
The color string to parse |
Returns
SKColor object or null if parsing fails
Divooka.WebpageRenderer.LayoutConverter.ParseHexColor()
Parses hex color strings into SKColor objects.
Supports both 3-digit (#RGB) and 6-digit (#RRGGBB) formats.
Parameters
| Name | Description | Default |
|---|---|---|
hex |
The hex color string to parse |
Returns
SKColor object or null if format is invalid
Divooka.WebpageRenderer.LayoutConverter.ConvertSvg()
Converts an SVG element into an ImageDisplay control.
Handles both inline SVG and SVG files referenced through img tags.
Parameters
| Name | Description | Default |
|---|---|---|
element |
The SVG element to convert |
Returns
An ImageDisplay control containing the rendered SVG
Divooka.WebpageRenderer.Styling.CSSParser
Parses CSS from HTML documents and creates StyleSheet objects
Divooka.WebpageRenderer.Styling.CSSParser._httpClient
Shared HTTP client for downloading CSS files with default user agent
Divooka.WebpageRenderer.Styling.CSSParser.ParseDocument()
Extracts and parses CSS from an HTML document, including inline styles and external stylesheets
Divooka.WebpageRenderer.Styling.CSSParser.DownloadCSS()
Downloads CSS content from a URL, returning null if download fails
Divooka.WebpageRenderer.Styling.CSSParser.ResolveUrl()
Resolves a relative URL to an absolute URL using the base URL
Divooka.WebpageRenderer.Styling.StyleProperties
Represents CSS properties that can be applied to UI elements
Divooka.WebpageRenderer.Styling.StyleProperties.Display
Gets or sets the display type (flex, block, inline)
Divooka.WebpageRenderer.Styling.StyleProperties.FlexDirection
Gets or sets the flex direction (row, column)
Divooka.WebpageRenderer.Styling.StyleProperties.FlexWrap
Gets or sets the flex wrap behavior (wrap, nowrap)
Divooka.WebpageRenderer.Styling.StyleProperties.JustifyContent
Gets or sets the justify content alignment
Divooka.WebpageRenderer.Styling.StyleProperties.AlignItems
Gets or sets the align items alignment
Divooka.WebpageRenderer.Styling.StyleProperties.Width
Gets or sets the element width
Divooka.WebpageRenderer.Styling.StyleProperties.Height
Gets or sets the element height
Divooka.WebpageRenderer.Styling.StyleProperties.Margin
Gets or sets the margin for all sides
Divooka.WebpageRenderer.Styling.StyleProperties.MarginTop
Gets or sets individual margin values
Divooka.WebpageRenderer.Styling.StyleProperties.Padding
Gets or sets the padding for all sides
Divooka.WebpageRenderer.Styling.StyleProperties.PaddingTop
Gets or sets individual padding values
Divooka.WebpageRenderer.Styling.StyleProperties.BackgroundColor
Gets or sets the background color
Divooka.WebpageRenderer.Styling.StyleProperties.TextColor
Gets or sets the text color
Divooka.WebpageRenderer.Styling.StyleProperties.BorderWidth
Gets or sets the border width for all sides
Divooka.WebpageRenderer.Styling.StyleProperties.BorderTopWidth
Gets or sets individual border width values
Divooka.WebpageRenderer.Styling.StyleProperties.BorderColor
Gets or sets the border color
Divooka.WebpageRenderer.Styling.StyleProperties.BorderStyle
Gets or sets the border style (solid, dashed, dotted)
Divooka.WebpageRenderer.Styling.StyleProperties.BorderRadius
Gets or sets the border radius
Divooka.WebpageRenderer.Styling.StyleProperties.FontSize
Gets or sets the font size
Divooka.WebpageRenderer.Styling.StyleProperties.FontWeight
Gets or sets the font weight (normal, bold)
Divooka.WebpageRenderer.Styling.StyleProperties.FontStyle
Gets or sets the font style (normal, italic)
Divooka.WebpageRenderer.Styling.StyleProperties.TextAlign
Gets or sets the text alignment
Divooka.WebpageRenderer.Styling.StyleProperties.LineHeight
Gets or sets the line height
Divooka.WebpageRenderer.Styling.StyleProperties.GetEffectiveMargin()
Gets the effective margin for a specific side, falling back to the general margin if not set
Divooka.WebpageRenderer.Styling.StyleProperties.GetEffectivePadding()
Gets the effective padding for a specific side, falling back to the general padding if not set
Divooka.WebpageRenderer.Styling.StyleProperties.GetEffectiveBorderWidth()
Gets the effective border width for a specific side, falling back to the general border width if not set
Divooka.WebpageRenderer.Styling.StyleProperties.FlexGrow
Gets or sets the flex grow factor
Divooka.WebpageRenderer.Styling.StyleProperties.FlexShrink
Gets or sets the flex shrink factor
Divooka.WebpageRenderer.Styling.StyleProperties.FlexBasis
Gets or sets the flex basis
Divooka.WebpageRenderer.Styling.StyleProperties.Gap
Gets or sets the gap between flex items
Divooka.WebpageRenderer.Styling.StyleRule
Represents a CSS rule with selector and associated style properties
Divooka.WebpageRenderer.Styling.StyleRule.Selector
Gets or sets the CSS selector for this rule
Divooka.WebpageRenderer.Styling.StyleRule.Properties
Gets or sets the style properties associated with this rule
Divooka.WebpageRenderer.Styling.StyleRule.Specificity
Gets or sets the specificity value of this rule
Higher values take precedence when multiple rules match
Divooka.WebpageRenderer.Styling.StyleRule.Matches()
Determines if this rule matches the given element
Parameters
| Name | Description | Default |
|---|---|---|
element |
The element to test against the selector |
Returns
True if the selector matches the element
Divooka.WebpageRenderer.Styling.StyleRule.SplitSelector()
Splits a compound selector into its constituent parts
Divooka.WebpageRenderer.Styling.StyleRule.MatchesSelectorPart()
Matches a single part of a selector against an element
Divooka.WebpageRenderer.Styling.StyleRule.MatchesAttribute()
Matches attribute selectors against an element
Divooka.WebpageRenderer.Styling.StyleRule.MatchesPseudoClass()
Matches pseudo-class selectors against an element
Divooka.WebpageRenderer.Styling.StyleRule.CalculateSpecificity
Calculates and updates the specificity value for this rule
Divooka.WebpageRenderer.Styling.StyleSheet.Rules
Gets the collection of CSS rules in this stylesheet
Divooka.WebpageRenderer.Styling.StyleSheet.AddRule()
Adds a new style rule to the stylesheet
Divooka.WebpageRenderer.Styling.StyleSheet.ParseCSS()
Parses CSS text and adds rules to the stylesheet
Divooka.WebpageRenderer.Styling.StyleSheet.ParseDeclarations()
Parses CSS declarations and applies them to the provided properties object
Divooka.WebpageRenderer.Styling.StyleSheet.GetMatchingStyles()
Gets the combined styles that apply to an element
Divooka.WebpageRenderer.Styling.StyleSheet.MergeWith()
Merges styles from another stylesheet into this one
Parameters
| Name | Description | Default |
|---|---|---|
other |
The stylesheet to merge from |