Skip to content

Commit

Permalink
rebase test due to pygments upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
tabatkins committed Jan 14, 2025
1 parent fe09b4e commit 51dc1ab
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/github/WICG/aom/spec/custom-element-semantics.html
Original file line number Diff line number Diff line change
Expand Up @@ -837,30 +837,30 @@ <h4 class="heading settled" data-level="1.1.2" id="element-semantics"><span clas
to modify the semantic details for the elements
as they change in response to user interaction.
<pre class="language-js highlight"><c- a>class</c-> CustomTab <c- k>extends</c-> HTMLElement <c- p>{</c->
#internals <c- o>=</c-> <c- kc>null</c-><c- p>;</c->
#tablist <c- o>=</c-> <c- kc>null</c-><c- p>;</c->
#tabpanel <c- o>=</c-> <c- kc>null</c-><c- p>;</c->
<c- n>#internals</c-> <c- o>=</c-> <c- kc>null</c-><c- p>;</c->
<c- n>#tablist</c-> <c- o>=</c-> <c- kc>null</c-><c- p>;</c->
<c- n>#tabpanel</c-> <c- o>=</c-> <c- kc>null</c-><c- p>;</c->

<c- kr>constructor</c-><c- p>()</c-> <c- p>{</c->
<c- k>super</c-><c- p>();</c->
<c- k>this</c-><c- p>.</c->#internals <c- o>=</c-> customElements<c- p>.</c->createInternals<c- p>(</c-><c- k>this</c-><c- p>);</c->
<c- k>this</c-><c- p>.</c->#internals<c- p>.</c->role <c- o>=</c-> <c- u>"tab"</c-><c- p>;</c->
<c- k>this</c-><c- p>.</c-><c- n>#internals</c-> <c- o>=</c-> customElements<c- p>.</c->createInternals<c- p>(</c-><c- k>this</c-><c- p>);</c->
<c- k>this</c-><c- p>.</c-><c- n>#internals</c-><c- p>.</c->role <c- o>=</c-> <c- u>"tab"</c-><c- p>;</c->
<c- p>}</c->

<c- c1>// Observe the custom "active" attribute.</c->
<c- k>static</c-> get observedAttributes<c- p>()</c-> <c- p>{</c-> <c- k>return</c-> <c- p>[</c-><c- u>"active"</c-><c- p>];</c-> <c- p>}</c->

connectedCallback<c- p>()</c-> <c- p>{</c->
<c- k>this</c-><c- p>.</c->#tablist <c- o>=</c-> <c- k>this</c-><c- p>.</c->parentElement<c- p>;</c->
<c- k>this</c-><c- p>.</c-><c- n>#tablist</c-> <c- o>=</c-> <c- k>this</c-><c- p>.</c->parentElement<c- p>;</c->
<c- p>}</c->

setTabPanel<c- p>(</c->tabpanel<c- p>)</c-> <c- p>{</c->
<c- k>if</c-> <c- p>(</c->tabpanel<c- p>.</c->localName <c- o>!==</c-> <c- u>"custom-tabpanel"</c-> <c- o>||</c-> tabPanel<c- p>.</c->id <c- o>===</c-> <c- u>""</c-><c- p>)</c->
<c- k>return</c-><c- p>;</c-> <c- c1>// fail silently</c->

<c- k>this</c-><c- p>.</c->#tabpanel <c- o>=</c-> tabpanel<c- p>;</c->
<c- k>this</c-><c- p>.</c-><c- n>#tabpanel</c-> <c- o>=</c-> tabpanel<c- p>;</c->
tabpanel<c- p>.</c->setTab<c- p>(</c-><c- k>this</c-><c- p>);</c->
<c- k>this</c-><c- p>.</c->#internals<c- p>.</c->ariaControls <c- o>=</c-> tabPanel<c- p>;</c-> <c- c1>// does not reflect</c->
<c- k>this</c-><c- p>.</c-><c- n>#internals</c-><c- p>.</c->ariaControls <c- o>=</c-> tabPanel<c- p>;</c-> <c- c1>// does not reflect</c->
<c- p>}</c->

<c- c1>// ... setters/getters for custom properties which reflect to attributes</c->
Expand All @@ -869,14 +869,14 @@ <h4 class="heading settled" data-level="1.1.2" id="element-semantics"><span clas
<c- k>switch</c-><c- p>(</c->name<c- p>)</c-> <c- p>{</c->
<c- k>case</c-> <c- u>"active"</c-><c- o>:</c->
<c- a>let</c-> active <c- o>=</c-> <c- p>(</c->newValue <c- o>!=</c-> <c- kc>null</c-><c- p>);</c->
<c- k>this</c-><c- p>.</c->#tabpanel<c- p>.</c->shown <c- o>=</c-> active<c- p>;</c->
<c- k>this</c-><c- p>.</c-><c- n>#tabpanel</c-><c- p>.</c->shown <c- o>=</c-> active<c- p>;</c->

<c- c1>// When the custom "active" attribute changes,</c->
<c- c1>// keep the accessible "selected" state in sync.</c->
<c- k>this</c-><c- p>.</c->#internals<c- p>.</c->ariaSelected <c- o>=</c-> <c- p>(</c->newValue <c- o>!==</c-> <c- kc>null</c-><c- p>);</c->
<c- k>this</c-><c- p>.</c-><c- n>#internals</c-><c- p>.</c->ariaSelected <c- o>=</c-> <c- p>(</c->newValue <c- o>!==</c-> <c- kc>null</c-><c- p>);</c->

<c- k>if</c-> <c- p>(</c->selected<c- p>)</c->
<c- k>this</c-><c- p>.</c->#tablist<c- p>.</c->setSelectedTab<c- p>(</c-><c- k>this</c-><c- p>);</c-> <c- c1>// ensure no other tab has "active" set</c->
<c- k>this</c-><c- p>.</c-><c- n>#tablist</c-><c- p>.</c->setSelectedTab<c- p>(</c-><c- k>this</c-><c- p>);</c-> <c- c1>// ensure no other tab has "active" set</c->
<c- k>break</c-><c- p>;</c->
<c- p>}</c->
<c- p>}</c->
Expand Down Expand Up @@ -1003,14 +1003,14 @@ <h3 class="heading settled" data-level="2.1" id="semantics-precedence-intro"><sp
<c- k>switch</c-><c- p>(</c->name<c- p>)</c-> <c- p>{</c->
<c- k>case</c-> <c- u>"active"</c-><c- o>:</c->
<c- a>let</c-> selected <c- o>=</c-> <c- p>(</c->newValue <c- o>!=</c-> <c- kc>null</c-><c- p>);</c->
<c- k>this</c-><c- p>.</c->#tabpanel<c- p>.</c->shown <c- o>=</c-> selected<c- p>;</c->
<c- k>this</c-><c- p>.</c-><c- n>#tabpanel</c-><c- p>.</c->shown <c- o>=</c-> selected<c- p>;</c->

<c- c1>// Note: overrides value set in custom element definition.</c->
<c- k>this</c-><c- p>.</c->#internals<c- p>.</c->ariaSelected <c- o>=</c-> selected<c- p>;</c->
<c- k>this</c-><c- p>.</c-><c- n>#internals</c-><c- p>.</c->ariaSelected <c- o>=</c-> selected<c- p>;</c->

<c- c1>// ensure no other tab has "selected" set</c->
<c- k>if</c-> <c- p>(</c->selected<c- p>)</c->
<c- k>this</c-><c- p>.</c->#tablist<c- p>.</c->setSelectedTab<c- p>(</c-><c- k>this</c-><c- p>);</c->
<c- k>this</c-><c- p>.</c-><c- n>#tablist</c-><c- p>.</c->setSelectedTab<c- p>(</c-><c- k>this</c-><c- p>);</c->
<c- k>break</c-><c- p>;</c->
<c- p>}</c->
<c- p>}</c->
Expand Down

0 comments on commit 51dc1ab

Please sign in to comment.