Skip to content

Commit 97da63f

Browse files
authored
Fix inversion of mobile and desktop numbers for anchors_with_role_button (#3048)
1 parent d8313a8 commit 97da63f

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/content/en/2021/accessibility.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,14 +626,14 @@ When a button role is applied to an `<a>` element, it overrides the implicit lin
626626

627627
{{ figure_markup(
628628
caption="Desktop websites have at least one link with a button role",
629-
content="17.5%",
629+
content="18.6%",
630630
classes="big-number",
631631
sheets_gid="1014817325",
632632
sql_file="anchors_with_role_button.sql"
633633
)
634634
}}
635635

636-
We found that 18% of desktop pages (up from 16% in 2020) and 19% (up from 15% in 2020) of mobile pages contained at least one anchor element with `role="button"`. A native `<button>` element would be a better choice, <a hreflang="en" href="https://www.w3.org/TR/using-aria/#rule1">per the first rule of ARIA</a>.
636+
We found that 19% of desktop pages (up from 16% in 2020) and 18% (up from 15% in 2020) of mobile pages contained at least one anchor element with `role="button"`. A native `<button>` element would be a better choice, <a hreflang="en" href="https://www.w3.org/TR/using-aria/#rule1">per the first rule of ARIA</a>.
637637

638638
This act of adding ARIA roles, or a <a hreflang="en" href="https://adrianroselli.com/2020/02/role-up.html">"role-up"</a>, is usually less ideal than using the correct native HTML element. Again, in the vast majority of these cases a better pattern than explicitly defining `role="button"` on the element in question would be to leverage the native HTML `<button>` element, as it comes with the expected semantics and behavior.
639639

src/content/ja/2021/accessibility.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,14 +626,14 @@ ARIAロールのもっとも一般的な誤用の1つは、 `<div>`や `<span>`
626626

627627
{{ figure_markup(
628628
caption="デスクトップのWebサイトには、少なくとも1つのボタンの役割を持つリンクがあります。",
629-
content="17.5%",
629+
content="18.6%",
630630
classes="big-number",
631631
sheets_gid="1014817325",
632632
sql_file="anchors_with_role_button.sql"
633633
)
634634
}}
635635

636-
デスクトップページの18%(2020年の16%から増加)、モバイルページの19%(2020年の15%から増加)に `role="button"` のアンカー要素が少なくとも1つ含まれていることがわかりました。ネイティブの `<button>` 要素の方が、<a hreflang="en" href="https://www.w3.org/TR/using-aria/#rule1">ARIAの最初の規則</a>にしたがって、より良い選択でしょう。
636+
デスクトップページの19%(2020年の16%から増加)、モバイルページの18%(2020年の15%から増加)に `role="button"` のアンカー要素が少なくとも1つ含まれていることがわかりました。ネイティブの `<button>` 要素の方が、<a hreflang="en" href="https://www.w3.org/TR/using-aria/#rule1">ARIAの最初の規則</a>にしたがって、より良い選択でしょう。
637637

638638
このARIAロールを追加する行為、つまり<a hreflang="en" href="https://adrianroselli.com/2020/02/role-up.html">"role-up"</a>は、通常、正しいネイティブHTML要素を使用するより理想的ではありません。繰り返しますが、これらのケースの大部分では、問題の要素に明示的に `role="button"` を定義するよりも、ネイティブのHTML`<button>` 要素を活用する方が良いパターンでしょう。
639639

0 commit comments

Comments
 (0)