Differences Between: [Versions 311 and 402] [Versions 311 and 403]
(no description)
File Size: | 541 lines (21 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
brickfield_accessibility_css:: (13 methods):
__construct()
load_css()
load_imported_files()
get_specificity()
get_style()
add_selector()
get_node_style()
walkup_tree_for_inheritance()
load_uri()
format_css()
get_xpath()
is_char()
parse_selector()
Class: brickfield_accessibility_css - X-Ref
Parse content to check CSS validity.__construct(\DOMDocument &$dom, string $uri, string $type, array $path, bool $cmsmode = false,array $cssfiles = []) X-Ref |
Class constructor. We are just building and importing variables here and then loading the CSS param: \DOMDocument $dom The DOMDocument object param: string $uri The URI of the request param: string $type The type of request param: array $path param: bool $cmsmode Whether we are running in CMS mode param: array $cssfiles An array of additional CSS files to load |
load_css() X-Ref |
Loads all the CSS files from the document using LINK elements or @import commands |
load_imported_files() X-Ref |
Imports files from the CSS file using @import commands |
get_specificity(string $selector) X-Ref |
Returns a specificity count to the given selector. Higher specificity means it overrides other styles. param: string $selector The CSS Selector return: int $specifity |
get_style($element) X-Ref |
Interface method for tests to call to lookup the style information for a given DOMNode param: \stdClass $element A DOMElement/DOMNode object return: array An array of style information (can be empty) |
add_selector(string $key, string $codestr) X-Ref |
Adds a selector to the CSS index param: string $key The CSS selector param: string $codestr The CSS Style code string return: null |
get_node_style($element) X-Ref |
Returns the style from the CSS index for a given element by first looking into its tag bucket then iterating over every item for an element that matches param: \stdClass $element return: array An array of all the style elements that _directly_ apply to that element (ignoring inheritance) |
walkup_tree_for_inheritance($element, array $style) X-Ref |
A helper function to walk up the DOM tree to the end to build an array of styles. param: \stdClass $element The DOMNode object to walk up from param: array $style The current style built for the node return: array The array of the DOM element, altered if it was overruled through css inheritance |
load_uri(string $rel) X-Ref |
Loads a CSS file from a URI param: string $rel The URI of the CSS file |
format_css() X-Ref |
Formats the CSS to be ready to import into an array of styles return: bool Whether there were elements imported or not |
get_xpath(string $selector) X-Ref |
Converts a CSS selector to an Xpath query param: string $selector The selector to convert return: string An Xpath query string |
is_char(string $char) X-Ref |
Checks that a string is really a regular character param: string $char The character return: bool Whether the string is a character |
parse_selector(string $query) X-Ref |
Parses a CSS selector into an array of rules. param: string $query The CSS Selector query return: array An array of the CSS Selector parsed into rule segments |