<commit_before>@charset "UTF-8";


/*doc
---
title: "Invalid nesting in a list"
name: invalid-list-nesting
category: Warnings
---

The only child allowed in `<ul>` and `<ol>` is `<li>` - and the converse is also true.

* <http://www.accessiweb.org/index.php/accessiweb-html5aria-liste-deployee.html#crit-8-2>
* <http://www.w3.org/TR/WCAG20/#ensure-compat-parses>
* <http://www.w3.org/TR/WCAG20/#ensure-compat-rsv>
* <https://github.com/Heydon/REVENGE.CSS/blob/master/revenge.css#L313>
* <https://github.com/yahoo/debugCSS/blob/master/debugCSS.css#L433>
* <http://www.w3.org/TR/html5/grouping-content.html#the-li-element>

```html_example
<ul>
  <p>I feel like I'm lost.</p>
</ul>

<li>Mom? Where are you, Mom?</li>
```
*/
ul > :not(li),
ol > :not(li),
:not(ul):not(ol) > li {
  @include warning("invalid-list-nesting");
}


/*doc
---
title: "Invalid sibling in a definition list"
name: invalid-def
category: Warnings
---

`<dt>` and `<dd>` should be direct adjacent siblings, and nothing else. Although multiple `<dd>` may follow a single `<dt>`.

* <http://www.accessiweb.org/index.php/accessiweb-html5aria-liste-deployee.html#crit-8-2>
* <http://www.w3.org/TR/WCAG20/#ensure-compat-parses>
* <http://www.w3.org/TR/WCAG20/#ensure-compat-rsv>
* <https://github.com/Heydon/REVENGE.CSS/blob/master/revenge.css#L312>
* <http://www.w3.org/TR/html5/grouping-content.html#the-dl-element>

```html_example
<dl>
  <li>I'm a list item.</li>
  <dd>What do I define?</dd>
</dl>

<dl>
  <dt>I need a definition, don't you think?</dt>
  <li>I'm a list item.</li>
</dl>
```
*/
dt + :not(dd),
:not(dt):not(dd) + dd {
  @include warning("invalid-def");
}


/*doc
---
title: "Invalid nesting in a definition list"
name: invalid-def-nesting
category: Warnings
---

`<dt>` and `<dd>` should be direct children of `<dl>`.
Any other imbrication may be a crime somewhere.

* <http://www.accessiweb.org/index.php/accessiweb-html5aria-liste-deployee.html#crit-8-2>
* <http://www.w3.org/TR/WCAG20/#ensure-compat-parses>
* <http://www.w3.org/TR/WCAG20/#ensure-compat-rsv>
* <https://github.com/Heydon/REVENGE.CSS/blob/master/revenge.css#L318>
* <https://github.com/yahoo/debugCSS/blob/master/debugCSS.css#L439>
* <http://www.w3.org/TR/html5/grouping-content.html#the-dl-element>

```html_example
<dl>
  <li>I'm a list item.</li>
  <li>I'm another list item.</li>
</dl>

<dd>Look, Ma! No context for my definition!</dd>

<dl>
  <li>I'm a list item.</li>
</dl>

<dt>I'm a lost term.</dt>
```
*/
:not(dl) > dt,
:not(dl) > dd,
dl > :not(dt):not(dd) {
  @include warning("invalid-def-nesting");
}


/*doc
---
title: "figcaption outside a figure"
name: invalid-figcaption-nesting
category: Warnings
---

`<figcaption>` doesn't make sense outside a `<figure>`.

* <http://www.accessiweb.org/index.php/accessiweb-html5aria-liste-deployee.html#crit-8-2>
* <http://www.w3.org/TR/WCAG20/#ensure-compat-parses>
* <http://www.w3.org/TR/WCAG20/#ensure-compat-rsv>
* <http://www.w3.org/html/wg/drafts/html/master/grouping-content.html#the-figcaption-element>

```html_example
<figcaption>I'm captionning something, isn't it?</figcaption>
```
*/
:not(figure) > figcaption {
  @include warning("invalid-figcaption-nesting");
}


/*doc
---
title: "figure without the group ARIA role"
name: figure-role
category: Warnings
---

`<figure>` needs `[role="group"]` for accessibility reason.

* <http://www.accessiweb.org/index.php/accessiweb-html5aria-liste-deployee.html#test-1-10-1>
* <http://www.w3.org/TR/html-alt-techniques/#m6>

```html_example
<figure>
  <img src="static/ffoodd.png" width="144" height="144" alt="Figcaption test"/>
  <figcaption>I'm a figcaption</figcaption>
</figure>
```
*/
figure:not([role="group"]) {
  @include warning("figure-role");
}

/*doc
---
title: "Invalid nesting"
name: invalid-nesting
category: Warnings
---

Some nestings are forbidden, and do not have their own test case for now:
* `<option>` and `<optgroup>` outside a `<select>`;
* `<fieldset>` outside a `<form>`;
* `<legend>` outside a `<fieldset>`;
* `<td>` or `<th>` outside a `<tr>`;
* direct children of a `<table>`.

Maybe other invalid nestings to test. Stay tuned.


* <https://github.com/yahoo/debugCSS/blob/master/debugCSS.css#L277>

```html_example
<option>I'm an option. Am I?</option>
<legend>I'm an legend. Am I?</legend>
```
*/
select > :not(option):not(optgroup),
:not(select):not(optgroup) > option,
optgroup > :not(option),<commit_msg>Fix for #142<commit_after>@charset "UTF-8";


/*doc
---
title: "Invalid nesting in a list"
name: invalid-list-nesting
category: Warnings
---

The only child allowed in `<ul>` and `<ol>` is `<li>` - and the converse is also true.

* <http://www.accessiweb.org/index.php/accessiweb-html5aria-liste-deployee.html#crit-8-2>
* <http://www.w3.org/TR/WCAG20/#ensure-compat-parses>
* <http://www.w3.org/TR/WCAG20/#ensure-compat-rsv>
* <https://github.com/Heydon/REVENGE.CSS/blob/master/revenge.css#L313>
* <https://github.com/yahoo/debugCSS/blob/master/debugCSS.css#L433>
* <http://www.w3.org/TR/html5/grouping-content.html#the-li-element>

```html_example
<ul>
  <p>I feel like I'm lost.</p>
</ul>

<li>Mom? Where are you, Mom?</li>
```
*/
ul > :not(li),
ol > :not(li),
:not(ul):not(ol) > li {
  @include warning("invalid-list-nesting");
}


/*doc
---
title: "Invalid sibling in a definition list"
name: invalid-def
category: Warnings
---

`<dt>` and `<dd>` should be direct adjacent siblings, and nothing else. Although multiple `<dd>` may follow a single `<dt>`.

* <http://www.accessiweb.org/index.php/accessiweb-html5aria-liste-deployee.html#crit-8-2>
* <http://www.w3.org/TR/WCAG20/#ensure-compat-parses>
* <http://www.w3.org/TR/WCAG20/#ensure-compat-rsv>
* <https://github.com/Heydon/REVENGE.CSS/blob/master/revenge.css#L312>
* <http://www.w3.org/TR/html5/grouping-content.html#the-dl-element>

```html_example
<dl>
  <li>I'm a list item.</li>
  <dd>What do I define?</dd>
</dl>

<dl>
  <dt>I need a definition, don't you think?</dt>
  <li>I'm a list item.</li>
</dl>
```
*/
dt + :not(dd),
:not(dt):not(dd) + dd {
  @include warning("invalid-def");
}


/*doc
---
title: "Invalid nesting in a definition list"
name: invalid-def-nesting
category: Warnings
---

`<dt>` and `<dd>` should be direct children of `<dl>`.
Any other imbrication may be a crime somewhere.

* <http://www.accessiweb.org/index.php/accessiweb-html5aria-liste-deployee.html#crit-8-2>
* <http://www.w3.org/TR/WCAG20/#ensure-compat-parses>
* <http://www.w3.org/TR/WCAG20/#ensure-compat-rsv>
* <https://github.com/Heydon/REVENGE.CSS/blob/master/revenge.css#L318>
* <https://github.com/yahoo/debugCSS/blob/master/debugCSS.css#L439>
* <http://www.w3.org/TR/html5/grouping-content.html#the-dl-element>

```html_example
<dl>
  <li>I'm a list item.</li>
  <li>I'm another list item.</li>
</dl>

<dd>Look, Ma! No context for my definition!</dd>

<dl>
  <li>I'm a list item.</li>
</dl>

<dt>I'm a lost term.</dt>
```
*/
:not(dl) > dt,
:not(dl) > dd,
dl > :not(dt):not(dd) {
  @include warning("invalid-def-nesting");
}


/*doc
---
title: "figcaption outside a figure"
name: invalid-figcaption-nesting
category: Warnings
---

`<figcaption>` doesn't make sense outside a `<figure>`.

* <http://www.accessiweb.org/index.php/accessiweb-html5aria-liste-deployee.html#crit-8-2>
* <http://www.w3.org/TR/WCAG20/#ensure-compat-parses>
* <http://www.w3.org/TR/WCAG20/#ensure-compat-rsv>
* <http://www.w3.org/html/wg/drafts/html/master/grouping-content.html#the-figcaption-element>

```html_example
<figcaption>I'm captionning something, isn't it?</figcaption>
```
*/
:not(figure) > figcaption {
  @include warning("invalid-figcaption-nesting");
}


/*doc
---
title: "figure without the group ARIA role"
name: figure-role
category: Warnings
---

`<figure>` needs `[role="group"]` for accessibility reason.

* <http://www.accessiweb.org/index.php/accessiweb-html5aria-liste-deployee.html#test-1-10-1>
* <http://www.w3.org/TR/html-alt-techniques/#m6>

```html_example
<figure>
  <img src="static/ffoodd.png" width="144" height="144" alt="Figcaption test"/>
  <figcaption>I'm a figcaption</figcaption>
</figure>
```
*/
figure:not([role="group"]) {
  @include warning("figure-role");
}

/*doc
---
title: "Invalid nesting"
name: invalid-nesting
category: Warnings
---

Some nestings are forbidden, and do not have their own test case for now:
* `<option>` and `<optgroup>` outside a `<select>`;
* `<fieldset>` outside a `<form>`;
* `<legend>` outside a `<fieldset>`;
* `<td>` or `<th>` outside a `<tr>`;
* direct children of a `<table>`.

Maybe other invalid nestings to test. Stay tuned.


* <https://github.com/yahoo/debugCSS/blob/master/debugCSS.css#L277>
* <http://www.w3.org/html/wg/drafts/html/master/semantics.html#the-fieldset-element>
* <http://www.w3.org/TR/html5/forms.html#the-fieldset-element>

```html_example
<option>I'm an option. Am I?</option>
<legend>I'm an legend. Am I?</legend>
```
*/
select > :not(option):not(optgroup),
:not(select):not(optgroup) > option,
optgroup > :not(option),
{'fraction_non_alphanumeric': 0.21057337655079916, 'fraction_numerical': 0.01743601207108528, 'mean_word_length': 4.269729093050648, 'pattern_counts': {'":': 0, '<': 187, '<?xml version=': 0, '>': 207, 'https://': 12, 'lorem ipsum': 0, 'www.': 38, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5077756', 'n_tokens_mistral': 3763, 'n_tokens_neox': 3536, 'n_words': 667}