Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions WAIC-CODE/WAIC-CODE-0143-01.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>WAIC-CODE-0143-01</title>
<meta name="copyright" content="This document is licensed under a Creative Commons 4.0">
<link rel="license" href="https://creativecommons.org/licenses/by/4.0/">
<meta name="author" content="ウェブアクセシビリティ基盤委員会(WAIC)">
<style>
#chatMessage {
list-style: none;
}
</style>
</head>

<body>
<div role="main">
<h1>チャット</h1>
<p>メッセージを送信すると、「会話のログ」見出しの後にメッセージが表示されます。<br>その後、3秒おきに2回、自動返信のメッセージが追加で表示されます。</p>
<div role="group" aria-labelledby="messageHeading">
<h2 id="messageHeading">メッセージ入力</h2>
<p id="messageDescription">(メッセージの入力内容は変更できません)</p>
<input type="text" name="fakeinput" readonly value="こんにちわ" aria-describedby="messageDescription">
<button id="messageButton" onclick="initiateChat()">メッセージを送る</button>
</div>
<div>
<h2 id="chatHeading">会話のログ</h2>
<div id="chatLog" role="log" aria-labelledby="chatHeading">
<ul id="chatMessage"></ul>
</div>
</div>
</div>


<script>
var counter = 0;
var myVar;
var onetime = 0;
function makeChat () {
var chatText = ["自動返信:こんにちわ!", "自動返信:返信はこれで終了です"];
var chatContent = document.getElementById("chatMessage");
var list = document.createElement("li")
var item = document.createTextNode(chatText[counter]);
list.appendChild(item);
chatContent.appendChild(list);
counter++;
if (counter > 1) {
clearInterval(myVar);
}
}
function initiateChat () {
if (onetime < 1) {
document.getElementById("chatMessage").innerHTML += "<li>あなた:こんにちわ</li>";
myVar = setInterval(makeChat, 3000);
document.getElementById("messageButton").disabled = true;
onetime++;
} else {
return false;
}
}
</script>

</body>
</html>
92 changes: 92 additions & 0 deletions WAIC-TEST/HTML/WAIC-TEST-0143-01.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# テスト ID

WAIC-TEST-0143-01

# テストのタイトル

role属性による逐次的な更新の通知(role="log"の使用)

# テストの目的

role="log"を持つ要素の内容を更新した際に、更新内容だけが通知されることを確認する。
Comment on lines +5 to +11
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

逐次的な更新に対して、更新内容だけが通知されることの確認をテストの目的としています。
更新の都度、role="log" が示す領域全体の内容が通知されることを弾きたい意図です。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

相談事項:
ARIA23 のタイトルは「逐次的な情報更新を識別するために role=log を使用する」となっています。
「逐次的な情報更新を識別する」は、変更箇所のみが通知される(aria-atomic="false")ことで識別できると判断して良いでしょうか?
あるいは、logロールが通知されることで満たされると判断した方が良いでしょうか?

現状では、logロールの通知は必須ではなく「変更箇所のみが通知される」で十分と判断してテスト手順などを作成しています。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 領域がログであることを通知する必要はなく、されない方がいい場合が多いと考えられる


# テストの対象となる達成基準 (複数)

4.1.3

# 関連する達成方法 (複数)

ARIA23

# テストコードのソース (抜粋)

```html
<h2 id="chatHeading">会話のログ</h2>
<div id="chatLog" role="log" aria-labelledby="chatHeading">
<ul id="chatMessage"></ul>
</div>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

role="log" に対してラベルの設置をすべきか悩みましたが、log ロール領域の識別のためにはラベルは必要と捉えました。

以下、手元での簡単な確認の結果となります。

  • logロールにラベルがない場合
    • 変更通知の際も、logロール領域に差し掛かった際も、ロールを通知しない。
  • logロールにラベルがある場合
    • 領域に差し掛かったとき
      • Chrome + NVDA:ラベル名称は通知しないが、「グループ」を通知する。
      • Chrome + VO:ラベル名称と「ログ」を通知する。
    • 更新内容を通知するとき
      • Chrome + NVDA:変更内容とあわせて、ラベル名称を通知する。
      • Chrome + VO:変更内容のみが通知される。(通知内容に log ロールもラベル名称も含まれない)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ラベルを通知するかしないかは支援技術のポリシー
  • ステータスメッセージの要件は変更のあった内容の通知。それがわかりやすいかどうかはASの要件ではない。
  • log role はなんらかのランドマーク領域。おそらく generic role を「グループ」と読み上げる (NVDA)
  • SC 4.1.3 としてはラベルは不要
  • 差し掛かったときのことはテストでは考えなくていい?
  • ラベルをつけると丁寧に読み上げるが、読み上げの量が増えて、簡潔さ、タイミングなどの点でテストしにくいかも?
  • log role にラベルのある場合とない場合の両方のテストをしたほうがいい?
  • 全体を読むか、変更箇所だけを読むか、これについてはテスト手順や期待される結果で言及するか? 現状では変更箇所以外の読み上げもあってよいという説明になっている?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コンテンツから labelledby を削除した

```

```JavaScript
function makeChat () {
var chatText = ["自動返信:こんにちわ!", "自動返信:返信はこれで終了です"];
var chatContent = document.getElementById("chatMessage");
var list = document.createElement("li")
var item = document.createTextNode(chatText[counter]);
list.appendChild(item);
chatContent.appendChild(list);
counter++;
if (counter > 1) {
clearInterval(myVar);
}
}
```

# テスト手順 (視覚閲覧環境)

## テスト手順 1

「メッセージを送る」ボタンを押下する
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

視覚閲覧環境に対するテスト実施は不要かもしれません。
操作箇所とは異なる箇所を変更していることを示す意図で記載しています。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 視覚閲覧環境のテストをやっても AS かどうかのテストにはならない


## 期待される結果 1

「会話のログ」見出しの後に、「あなた:こんにちわ」と表示される

## テスト手順 2

「メッセージを送る」の押下後、何もしないまま6秒程度待つ

## 期待される結果 2

3秒後に「自動返信:こんにちわ!」と通知され、さらに3秒後に「自動返信:返信はこれで終了です」と表示される

# テスト実施時の注意点 (視覚閲覧環境)

- ブラウザのJavaScriptが有効になっていることを確認すること

# テスト手順 (音声閲覧環境)

## テスト手順 1

「メッセージを送る」ボタンを押下する

## 期待される結果 1

「あなた:こんにちわ」と通知される

## テスト手順 2

「メッセージを送る」の押下後、何もしないまま6秒程度待つ

## 期待される結果 2

3秒後に「自動返信:こんにちわ!」と通知され、さらに3秒後に「自動返信:返信はこれで終了です」と通知される

# テスト実施時の注意点 (音声閲覧環境)

- ブラウザのJavaScriptが有効になっていることを確認すること
- テストの通知を待つ間に他の通知が生じた場合、他の通知の完了後にテストによるメッセージが通知される。そのため、必ずしも3秒後にメッセージが通知されるとは限らない
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2点目は、aria-live="polite" であることを踏まえ、念の為の記載しています。
macOS VO + Chrome では、メッセージ通知を待つ間にフォーカス箇所(「メッセージを送る」ボタン)の通知が生じる場合がありました。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ボタンを押した後、他のところが読めるようなコンテンツにして、それを読んでいるあいだに log が読まれる、といったことはできないか?
  • 操作に対する読み上げと通知されるメッセージの区別はつきにくい。役割が読まれることを想定するよりも、読まれる内容を工夫した方がいいのでは。
  • div role=log に aria-labelledby をつけることも論点。W3C の例は付けたり付けなかったりしている。


# 関連する要素や属性

role属性、aria-labelledby属性