Skip to content

Commit

Permalink
change rule id #1675
Browse files Browse the repository at this point in the history
  • Loading branch information
shunguoy committed Nov 3, 2023
1 parent aedb7c2 commit c4cfab9
Show file tree
Hide file tree
Showing 7 changed files with 627 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ import { Rule, RuleResult, RuleContext, RulePass, RuleContextHierarchy, RulePote
import { eRulePolicy, eToolkitLevel } from "../api/IRule";
import { VisUtil } from "../../v2/dom/VisUtil";

export let element_draggable_alternative: Rule = {
id: "element_draggable_alternative",
export let draggable_alternative_exists: Rule = {
id: "draggable_alternative_exists",
context: "dom:*[draggable]",
dependencies: [],
help: {
"en-US": {
"group": "element_draggable_alternative.html",
"pass": "element_draggable_alternative.html",
"potential_obscured": "element_draggable_alternative.html"
"group": "draggable_alternative_exists.html",
"pass": "draggable_alternative_exists.html",
"potential_obscured": "draggable_alternative_exists.html"
}
},
messages: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!--
/******************************************************************************
Copyright:: 2020- IBM, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*****************************************************************************/
-->

<html lang="en">

<head>
<title>RPT Test Suite</title>
<script>
const draggableElement = document.querySelector('p[draggable="true"]');
console.log("dragstart: "+ draggableElement);
draggableElement.addEventListener("dragstart", (event) => { console.log("dragstart");
event.dataTransfer.setData("text/plain", "This text may be dragged");
});
</script>
</head>

<body>

<p draggable="true">This text <strong>may</strong> be dragged.</p>

<script>
UnitTest = {
ruleIds: ["draggable_alternative_exists"],
results: [
{
"ruleId": "element_tabbable_unobscured",
"value": [
"INFORMATION",
"POTENTIAL"
],
"path": {
"dom": "/html[1]/body[1]/div[1]",
"aria": "/document[1]"
},
"reasonId": "potential_obscured",
"message": "Confirm that when the element receives focus, it is not covered or, if covered by user action, can be uncovered without moving focus",
"messageArgs": [],
"apiArgs": [],
"category": "Accessibility"
},
{
"ruleId": "element_tabbable_unobscured",
"value": [
"INFORMATION",
"PASS"
],
"path": {
"dom": "/html[1]/body[1]/div[2]",
"aria": "/document[1]"
},
"reasonId": "pass",
"message": "The element is not entirely covered by other content",
"messageArgs": [],
"apiArgs": [],
"category": "Accessibility"
}
]
}
</script>
</body>

</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!--
/******************************************************************************
Copyright:: 2020- IBM, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*****************************************************************************/
-->

<html lang="en">

<head>
<title>RPT Test Suite</title>
<style>
div {
position: absolute;
width: 75px;
height: 75px;
border-radius: 10px;
color: white;
padding: 5px;
text-align: left;
}

#second {
width: 175px;
height: 175px;
z-index: 3;
background-color: #FF5C35;
top: 10px;
left: 10px;
}

#first {
z-index: 2;
background-color: #192733;
top: 30px;
left: 30px;
}

</style>
</head>

<body>

<div id="first" tabindex="0">1</div>
<div id="second" tabindex="0">2</div>

<script>
UnitTest = {
ruleIds: ["element_tabbable_unobscured"],
results: [
{
"ruleId": "element_tabbable_unobscured",
"value": [
"INFORMATION",
"POTENTIAL"
],
"path": {
"dom": "/html[1]/body[1]/div[1]",
"aria": "/document[1]"
},
"reasonId": "potential_obscured",
"message": "Confirm that when the element receives focus, it is not covered or, if covered by user action, can be uncovered without moving focus",
"messageArgs": [],
"apiArgs": [],
"category": "Accessibility"
},
{
"ruleId": "element_tabbable_unobscured",
"value": [
"INFORMATION",
"PASS"
],
"path": {
"dom": "/html[1]/body[1]/div[2]",
"aria": "/document[1]"
},
"reasonId": "pass",
"message": "The element is not entirely covered by other content",
"messageArgs": [],
"apiArgs": [],
"category": "Accessibility"
}
]
}
</script>
</body>

</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!--
/******************************************************************************
Copyright:: 2020- IBM, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*****************************************************************************/
-->

<html lang="en">

<head>
<title>RPT Test Suite</title>
<style>
div {
position: absolute;
width: 75px;
height: 75px;
border-radius: 10px;
color: white;
padding: 5px;
text-align: left;
}

#first {
width: 175px;
height: 175px;
background-color: #FF5C35;
top: 10px;
left: 10px;
}

#second {
background-color: #192733;
top: 30px;
left: 30px;
}

</style>
</head>

<body>

<div id="first" tabindex="0">1</div>
<div id="second" tabindex="0">2</div>

<script>
UnitTest = {
ruleIds: ["element_tabbable_unobscured"],
results: [
{
"ruleId": "element_tabbable_unobscured",
"value": [
"INFORMATION",
"PASS"
],
"path": {
"dom": "/html[1]/body[1]/div[1]",
"aria": "/document[1]"
},
"reasonId": "pass",
"message": "The element is not entirely covered by other content",
"messageArgs": [],
"apiArgs": [],
"category": "Accessibility"
},
{
"ruleId": "element_tabbable_unobscured",
"value": [
"INFORMATION",
"PASS"
],
"path": {
"dom": "/html[1]/body[1]/div[2]",
"aria": "/document[1]"
},
"reasonId": "pass",
"message": "The element is not entirely covered by other content",
"messageArgs": [],
"apiArgs": [],
"category": "Accessibility"
}
]
}
</script>
</body>

</html>
Loading

0 comments on commit c4cfab9

Please sign in to comment.