Skip to content

Commit f1c7e50

Browse files
committed
Fixed a bug where messages relating to the parent document (only notices in this case) were not being included in the main message set. This resolves #220.
1 parent bffd7e7 commit f1c7e50

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed

Auditor/HTMLCSAuditor.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,9 @@ _global.HTMLCSAuditor = new function()
816816
msgElementSourceInner.className = _prefix + 'issue-source-inner-u2p';
817817
var msg = _global.HTMLCS.getTranslation('auditor_unable_to_point');
818818

819-
if (message.element.ownerDocument === null) {
819+
if (message.element.nodeName === '#document') {
820+
msg = _global.HTMLCS.getTranslation('auditor_applies_entire_document');
821+
} else if (message.element.ownerDocument === null) {
820822
msg = _global.HTMLCS.getTranslation('auditor_unable_to_point_removed');
821823
} else {
822824
var body = message.element.ownerDocument.getElementsByTagName('body')[0];
@@ -943,12 +945,14 @@ _global.HTMLCSAuditor = new function()
943945
msgElementSourceInner.appendChild(msgElementSourceMain);
944946
msgElementSourceInner.appendChild(_doc.createTextNode(postText));
945947
msgElementSource.appendChild(msgElementSourceInner);
948+
} else if (message.element.nodeName === '#document') {
949+
// Show nothing, it's the document root.
946950
} else {
947951
// No support for outerHTML.
948952
var msgElementSourceInner = _doc.createElement('div');
949953
msgElementSourceInner.className = _prefix + 'issue-source-not-supported';
950954

951-
var nsText = 'The code snippet functionality is not supported in this browser.';
955+
var nsText = _global.HTMLCS.getTranslation('auditor_unsupported_browser');
952956

953957
msgElementSourceInner.appendChild(_doc.createTextNode(nsText));
954958
msgElementSource.appendChild(msgElementSourceInner);

HTMLCS.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ _global.HTMLCS = new function()
286286
}
287287
}//end while
288288

289+
_messages = _messages.concat(topMsgs);
290+
289291
// Due to filtering of presentation roles for general sniffing these need to be handled
290292
// separately. The 1.3.1 sniff needs to run to detect any incorrect usage of the presentation
291293
// role.

Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_1 = {
3434
*/
3535
process: function(element, top)
3636
{
37-
HTMLCS.addMessage(HTMLCS.NOTICE, top, _global.HTMLCS.getTranslation("1_4_1_G14,G182"), 'G14,G182');
37+
HTMLCS.addMessage(HTMLCS.NOTICE, top, _global.HTMLCS.getTranslation("1_4_1_G14,G18"), 'G14,G182');
3838
}
3939
};

Translations/en.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ _global.translation['en'] = {
3535
,"auditor_view_the_changelog" : 'View the changelog'
3636
,"auditor_success_criterion" : "Success Criterion"
3737
,"auditor_suggested_techniques" : "Suggested Techniques"
38+
,"auditor_applies_entire_document" : "This applies to the entire document"
3839

3940
//1_1_1.js
4041
,"1_1_1_H30.2" : 'Img element is the only content of the link, but is missing alt text. The alt text should describe the purpose of the link.'

Translations/pl.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ _global.translation['pl'] = {
3535
,"auditor_view_the_changelog" : 'Zobacz dziennik zmian'
3636
,"auditor_success_criterion" : "Kryteria sukcesu"
3737
,"auditor_suggested_techniques" : "Sugerowane techniki"
38+
,"auditor_applies_entire_document" : "Dotyczy to całego dokumentu"
3839

3940
//1_1_1.js
4041
,"1_1_1_H30.2" : 'Grafika jest jedyną treścią linku i powinna zostać uzupełniona o opis alternatywny opisujący jego funkcję.'

0 commit comments

Comments
 (0)