WebKit Bugzilla
Attachment 372729 Details for
Bug 194754
: Web Inspector: AXI: Audit: image label test is throwing spurious errors on elements with existing alt attr, but no value: <img alt>
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194754-20190623204455.patch (text/plain), 6.82 KB, created by
gr3g
on 2019-06-23 20:44:56 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
gr3g
Created:
2019-06-23 20:44:56 PDT
Size:
6.82 KB
patch
obsolete
>Subversion Revision: 246696 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index dfcc469ea878c4d6742450c5f5712aeabb825c40..2c1e86fb3079827f72c77b154ae03aa38fb8d45a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,15 @@ >+2019-06-23 Greg Doolittle <gr3g@apple.com> >+ >+ Web Inspector: AXI: Audit: image label test is throwing spurious errors on elements with existing alt attr, but no value: <img alt> >+ https://bugs.webkit.org/show_bug.cgi?id=194754 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: accessibility/img-alt-attribute-unassigned-value.html >+ >+ * accessibility/AccessibilityObject.cpp: >+ (WebCore::AccessibilityObject::computedRoleString const): >+ > 2019-06-21 Tim Horton <timothy_horton@apple.com> > > Preview of <picture> element doesn't match element bounds >diff --git a/Source/WebCore/accessibility/AccessibilityObject.cpp b/Source/WebCore/accessibility/AccessibilityObject.cpp >index 89603df71b995b9ed14947649992ddffc328f425..0b33d28c61bb44b90e557410c66e12dc52863832 100644 >--- a/Source/WebCore/accessibility/AccessibilityObject.cpp >+++ b/Source/WebCore/accessibility/AccessibilityObject.cpp >@@ -2493,6 +2493,9 @@ String AccessibilityObject::computedRoleString() const > // FIXME: Need a few special cases that aren't in the RoleMap: option, etc. http://webkit.org/b/128296 > AccessibilityRole role = roleValue(); > >+ if (role == AccessibilityRole::Image && accessibilityIsIgnored()) >+ return reverseAriaRoleMap().get(static_cast<int>(AccessibilityRole::Presentational)); >+ > // We do not compute a role string for generic block elements with user-agent assigned roles. > if (role == AccessibilityRole::Group || role == AccessibilityRole::TextGroup) > return ""; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 8e38033b7266ec1e5fa684fb1c99886f32e85140..c70c3412131ad5e68047d8996967152d4f07ea06 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2019-06-23 Greg Doolittle <gr3g@apple.com> >+ >+ Web Inspector: AXI: Audit: image label test is throwing spurious errors on elements with existing alt attr, but no value: <img alt> >+ https://bugs.webkit.org/show_bug.cgi?id=194754 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * accessibility/img-alt-attribute-unassigned-value-expected.txt: Added. >+ * accessibility/img-alt-attribute-unassigned-value.html: Added. >+ * inspector/dom/getAccessibilityPropertiesForNode-expected.txt: >+ > 2019-06-21 Myles C. Maxfield <mmaxfield@apple.com> > > [WHLSL] read modify write expressions do no work as expected >diff --git a/LayoutTests/accessibility/img-alt-attribute-unassigned-value-expected.txt b/LayoutTests/accessibility/img-alt-attribute-unassigned-value-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..9182a28ce0e0106c3d192c1918a14d6438176416 >--- /dev/null >+++ b/LayoutTests/accessibility/img-alt-attribute-unassigned-value-expected.txt >@@ -0,0 +1,15 @@ >+ >+ >+ >+This tests that img elements with an alt attribute and no assigned value are ignored. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS imagesGroup.childrenCount is 2 >+PASS platformValueForW3CName(imagesGroup.childAtIndex(0)) is "cake0" >+PASS platformValueForW3CName(imagesGroup.childAtIndex(1)) is "cake2" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/accessibility/img-alt-attribute-unassigned-value.html b/LayoutTests/accessibility/img-alt-attribute-unassigned-value.html >new file mode 100644 >index 0000000000000000000000000000000000000000..14c2a30741124b68372823e205eb7da61689673c >--- /dev/null >+++ b/LayoutTests/accessibility/img-alt-attribute-unassigned-value.html >@@ -0,0 +1,45 @@ >+<!DOCTYPE html PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+ <head> >+ <script src="../resources/js-test-pre.js"></script> >+ <script src="../resources/accessibility-helper.js"></script> >+ </head> >+ <body id="body"> >+ <div tabindex="0" role="group" id="images"> >+ <img alt="cake0" src="resources/cake.png" /><br /> >+ <img alt class="cake1 unassigned-alt" src="resources/cake.png" /><br /> >+ <img alt="cake2" src="resources/cake.png" /><br /> >+ </div> >+ >+ <p id="description"></p> >+ <div id="console"></div> >+ >+ <script> >+ description( >+ 'This tests that img elements with an alt attribute and no assigned value are ignored.', >+ ); >+ if (window.accessibilityController) { >+ document.getElementById('images').focus(); >+ var imagesGroup = accessibilityController.focusedElement; >+ // there are 3 images, but one has an alt attribute that is unassigned, so it should be >+ // ignored. as a result, the image count is 2. >+ shouldBe('imagesGroup.childrenCount', '2'); >+ // make sure alt text is being read before and after >+ shouldBeEqualToString( >+ 'platformValueForW3CName(imagesGroup.childAtIndex(0))', >+ 'cake0', >+ ); >+ // accessiblityController should see the <img> element w/o alt attribute as an image, >+ // and use the filename as the alt text. currently it returns an empty string. >+ // this issue is documented here: <rdar://problem/51669261> >+ // shouldBeEqualToString("platformValueForW3CName(imagesGroup.childAtIndex(1))", "cake.png"); >+ shouldBeEqualToString( >+ 'platformValueForW3CName(imagesGroup.childAtIndex(1))', >+ 'cake2', >+ ); >+ } >+ </script> >+ >+ <script src="../resources/js-test-post.js"></script> >+ </body> >+</html> >diff --git a/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode-expected.txt b/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode-expected.txt >index 9efa3ee924f0ac9e7d0f2164280a6ca1eec1a3ef..5f3f8a4aab0a51217f2ad3d713594636e6f47b4f 100644 >--- a/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode-expected.txt >+++ b/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode-expected.txt >@@ -326,7 +326,7 @@ Total elements to be tested: 122. > <img src="data:image/gif..." alt="x" aria-hidden="true"> > exists: true > label: x >- role: img >+ role: presentation > ignored: true > ignoredByDefault: true > hidden: true >@@ -339,7 +339,7 @@ Total elements to be tested: 122. > <img src="data:image/gif..." alt=""> > exists: true > label: >- role: img >+ role: presentation > ignored: true > > <img src="data:image/gif..."> >@@ -350,7 +350,7 @@ Total elements to be tested: 122. > <img src="./404.gif"> > exists: true > label: >- role: img >+ role: presentation > ignored: true > > <input style="display:none;">
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194754
:
371006
|
371801
|
371834
|
372088
|
372090
|
372091
|
372098
|
372100
|
372103
|
372631
| 372729