Skip to content

Commit

Permalink
chore(innate): add css rules parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Oct 5, 2023
1 parent df3152d commit bcd1311
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions kayle_innate/src/engine/rules/wcag_rule_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ lazy_static! {
Rule::new(Techniques::H32, Criteria::Error, Principle::Operable, Guideline::Predictable, |_rule, nodes, _css_parser| {
// check the first element for now
let mut valid = false;
let selector = unsafe { Selector::parse("button[type=submit]").unwrap_unchecked() };

for ele in nodes {
// todo: static selectors
let selector = unsafe { Selector::parse("button[type=submit]").unwrap_unchecked() };
valid = match ele.select(&selector).next() {
Some(_) => true,
_ => false
Expand Down
1 change: 0 additions & 1 deletion kayle_innate/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ pub fn _audit_not_ready(html: &str, _css_rules: &str) -> Result<JsValue, JsValue
let css_rules = &mut cssparser::ParserInput::new(&_css_rules);
// TODO: build the rules to css blocks that selectors can be used to find the element of the style.
let mut _css_parser = cssparser::Parser::new(css_rules);

let css_rules_parser = cssparser::RuleListParser::new_for_stylesheet(
&mut _css_parser,
crate::engine::styles::rules::RulesParser,
Expand Down

0 comments on commit bcd1311

Please sign in to comment.