Moodle APIs 4.1
Moodle 4.1.9+ (Build: 20240402)
|
Parse content to check CSS validity. More...
Classes | |
class | tool_brickfield\local\htmlchecker\common\brickfield_accessibility_css |
Namespaces | |
namespace | tool_brickfield\local\htmlchecker\common |
| |
Parse content to check CSS validity.
This class first parses all the CSS in the document and prepares an index of CSS styles to be used by accessibility tests to determine color and positioning.
First, in loadCSS we get all the inline and linked style sheet information and merge it into a large CSS file string.
Second, in setStyles we use XPath queries to find all the DOM elements which are effected by CSS styles and then build up an index in style_index of all the CSS styles keyed by an attriute we attach to all DOM objects to lookup the style quickly.
Most of the second step is to get around the problem where XPath DOMNodeList objects are only marginally referential to the original elements and cannot be altered directly.