Diff
Modified: trunk/LayoutTests/ChangeLog (157433 => 157434)
--- trunk/LayoutTests/ChangeLog 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/LayoutTests/ChangeLog 2013-10-15 00:23:25 UTC (rev 157434)
@@ -1,3 +1,24 @@
+2013-10-14 Samuel White <[email protected]>
+
+ AX: fieldset should have GroupRole and legend should be description.
+ https://bugs.webkit.org/show_bug.cgi?id=122534
+
+ Reviewed by Chris Fleizach.
+
+ legend no longer treated as titleUIElement so removing tests that check this functionality.
+ Added test to check that legend is used as AXDescription of fieldset if present.
+
+ * accessibility/fieldset-element.html: Added.
+ * accessibility/hidden-legend-expected.txt: Removed.
+ * accessibility/hidden-legend.html: Removed.
+ * accessibility/legend.html: Removed.
+ * platform/efl/accessibility/legend-expected.txt: Removed.
+ * platform/gtk/accessibility/legend-expected.txt: Removed.
+ * platform/mac/accessibility/fieldset-element-expected.txt: Added.
+ * platform/mac/accessibility/legend-expected.txt: Removed.
+ * platform/mac/accessibility/role-subrole-roledescription-expected.txt:
+ * platform/mac/accessibility/role-subrole-roledescription.html:
+
2013-10-14 Ryosuke Niwa <[email protected]>
Assertion failure in Range::processContentsBetweenOffsets
Added: trunk/LayoutTests/accessibility/fieldset-element.html (0 => 157434)
--- trunk/LayoutTests/accessibility/fieldset-element.html (rev 0)
+++ trunk/LayoutTests/accessibility/fieldset-element.html 2013-10-15 00:23:25 UTC (rev 157434)
@@ -0,0 +1,93 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<title>Fieldset Element</title>
+</head>
+<body>
+
+<form>
+<!-- fieldset with aria-label. -->
+<fieldset aria-label="High Score:" class="fieldsetTest" id="f0">
+Name: <input type="text">
+</fieldset>
+</form>
+
+<form>
+<!-- fieldset and legend. -->
+<fieldset class="fieldsetTest" id="f1">
+<legend>High Score:</legend>
+Name: <input type="text">
+</fieldset>
+</form>
+
+<form>
+<!-- fieldset with aria-label and legend. -->
+<fieldset aria-label="New High Score:" class="fieldsetTest" id="f2">
+<legend>High Score:</legend>
+Name: <input type="text">
+</fieldset>
+</form>
+
+<form>
+<!-- fieldset and legend with aria-label. -->
+<fieldset class="fieldsetTest" id="f3">
+<legend aria-label="New High Score:">High Score:</legend>
+Name: <input type="text">
+</fieldset>
+</form>
+
+<form>
+<!-- fieldset and hidden legend. -->
+<fieldset class="fieldsetTest" id="f4">
+<legend aria-hidden="true">High Score:</legend>
+Name: <input type="text">
+</fieldset>
+</form>
+
+<form>
+<!-- fieldset and offscreen legend. -->
+<fieldset class="fieldsetTest" id="f5">
+<legend style="left:-9999px; position:absolute;">High Score:</legend>
+Name: <input type="text">
+</fieldset>
+</form>
+
+<form>
+<!-- fieldset and unrendered legend. -->
+<fieldset class="fieldsetTest" id="f6">
+<legend style="display:none;">High Score:</legend>
+Name: <input type="text">
+</fieldset>
+</form>
+
+<!-- legend outside fieldset. -->
+<legend id="l0">Other:</legend>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+ description("This tests that fieldset and legend elements are exposed correctly.");
+
+ if (window.accessibilityController) {
+ var fieldsetDescription = 0;
+ var fieldsetTestCount = 0;
+ var legendValue = 0;
+
+ // fieldset tests.
+ fieldsetTestCount = document.getElementsByClassName("fieldsetTest").length;
+ for (var i = 0; i < fieldsetTestCount; ++i) {
+ fieldsetDescription = accessibilityController.accessibleElementById("f" + i).description;
+ debug(fieldsetDescription);
+ }
+
+ // legend tests.
+ legendValue = accessibilityController.accessibleElementById("l0").childAtIndex(0).stringValue;
+ debug(legendValue);
+ }
+</script>
+
+<script src=""
+</body>
+</html>
Deleted: trunk/LayoutTests/accessibility/hidden-legend-expected.txt (157433 => 157434)
--- trunk/LayoutTests/accessibility/hidden-legend-expected.txt 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/LayoutTests/accessibility/hidden-legend-expected.txt 2013-10-15 00:23:25 UTC (rev 157434)
@@ -1,16 +0,0 @@
-Pick your favourite colour:
- red yellow
-Pick your favourite colour: red yellow
- red yellow
-This tests that the legend is still used as the title UI element even when off-screen (but not when display:none is used)
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS fieldset1.titleUIElement().isEqual(fieldset1.childAtIndex(0)) is true
-PASS fieldset2.titleUIElement().isEqual(fieldset2.childAtIndex(0)) is true
-PASS fieldset3.titleUIElement() == null || !fieldset3.titleUIElement().isValid is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: trunk/LayoutTests/accessibility/hidden-legend.html (157433 => 157434)
--- trunk/LayoutTests/accessibility/hidden-legend.html 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/LayoutTests/accessibility/hidden-legend.html 2013-10-15 00:23:25 UTC (rev 157434)
@@ -1,62 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<body>
-<script src=""
-
-<style>
-#form2 legend {position:absolute; left:-9999px;}
-#form3 legend {display:none;}
-</style>
-
-<form action="" method="post" id="form1">
-<fieldset tabindex=0 role="group" id="fieldset1">
-<legend>Pick your favourite colour:</legend>
-<input type="radio" name="colours3" value="red3" id="red3"> <label for=""
-<input type="radio" name="colours3" value="yellow3" id="yellow3"> <label for=""
-</fieldset>
-</form>
-
-<form action="" method="post" id="form2">
-<fieldset tabindex=0 role="group" id="fieldset2">
-<legend>Pick your favourite colour:</legend>
-<input type="radio" name="colours3" value="red3" id="red3"> <label for=""
-<input type="radio" name="colours3" value="yellow3" id="yellow3"> <label for=""
-</fieldset>
-</form>
-
-<form action="" method="post" id="form3">
-<fieldset tabindex=0 role="group" id="fieldset3">
-<legend>Pick your favourite colour:</legend>
-<input type="radio" name="colours3" value="red3" id="red3"> <label for=""
-<input type="radio" name="colours3" value="yellow3" id="yellow3"> <label for=""
-</fieldset>
-</form>
-
-<div id="console"></div>
-<script>
-description("This tests that the legend is still used as the title UI element even when off-screen (but not when display:none is used)")
-
-if (window.testRunner && window.accessibilityController) {
-
- // 1st case: testing when a fieldset uses an unmodified legend. The title UI element
- // should be the legend (which is the first child).
- document.getElementById('fieldset1').focus();
- var fieldset1 = accessibilityController.focusedElement;
- shouldBeTrue("fieldset1.titleUIElement().isEqual(fieldset1.childAtIndex(0))");
-
- // 2nd case: a hidden legend should still be the title UI element.
- document.getElementById('fieldset2').focus();
- var fieldset2 = accessibilityController.focusedElement;
- shouldBeTrue("fieldset2.titleUIElement().isEqual(fieldset2.childAtIndex(0))");
-
- // 3rd case: a legend with display:none should not be a title UI element.
- document.getElementById('fieldset3').focus();
- var fieldset3 = accessibilityController.focusedElement;
- shouldBeTrue("fieldset3.titleUIElement() == null || !fieldset3.titleUIElement().isValid");
-}
-
-</script>
-
-<script src=""
-</body>
-</html>
Deleted: trunk/LayoutTests/accessibility/legend.html (157433 => 157434)
--- trunk/LayoutTests/accessibility/legend.html 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/LayoutTests/accessibility/legend.html 2013-10-15 00:23:25 UTC (rev 157434)
@@ -1,71 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script>
-
- function buildAccessibilityTree(accessibilityObject, indent, targetObject, targetString) {
- var str = "";
- for (var i = 0; i < indent; i++)
- str += " ";
- str += accessibilityObject.role;
- str += " " + accessibilityObject.stringValue;
- if (targetObject && accessibilityObject.isEqual(targetObject))
- str += " " + targetString;
- str += "\n";
- document.getElementById("tree").innerText += str;
-
- if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
- return false;
-
- var count = accessibilityObject.childrenCount;
- for (var i = 0; i < count; ++i) {
- if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1, targetObject, targetString))
- return false;
- }
-
- return true;
- }
-</script>
-<script src=""
-</head>
-<body id="body">
-
-<fieldset>
- <legend>Choose a shipping method:</legend>
- <input id="overnight" type="radio" name="shipping" value="overnight" />Overnight
-</fieldset>
-
-<div>End of test</div>
-
-<p id="description"></p>
-<pre id="tree"></pre>
-<div id="console"></div>
-
-<script>
-
- description("This tests that a fieldset's title ui element is the legend.");
-
- if (window.accessibilityController) {
- document.body.focus();
- var body = accessibilityController.focusedElement;
- var fieldset = body.childAtIndex(0);
- var titleUIElement = fieldset.titleUIElement();
-
- // Print out the tree of accessible objects, indicating the titleUIElement so
- // that each platform can verify their expected object has been found
- buildAccessibilityTree(body, 0, titleUIElement, "<< fieldset's titleUIElement");
-
- // Verify that we have gotten the titleUIElement and it has the expected text,
- // which should be in the last descendant regardless of platform.
- shouldBeTrue("titleUIElement != null");
- var titleUIElementText = titleUIElement;
- while (titleUIElementText && titleUIElementText.childrenCount)
- titleUIElementText = titleUIElementText.childAtIndex(0);
-
- shouldBe("titleUIElementText.stringValue", "'AXValue: Choose a shipping method:'");
- }
-</script>
-
-<script src=""
-</body>
-</html>
Deleted: trunk/LayoutTests/platform/efl/accessibility/legend-expected.txt (157433 => 157434)
--- trunk/LayoutTests/platform/efl/accessibility/legend-expected.txt 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/LayoutTests/platform/efl/accessibility/legend-expected.txt 2013-10-15 00:23:25 UTC (rev 157434)
@@ -1,19 +0,0 @@
-Choose a shipping method:
-Overnight
-End of test
-This tests that a fieldset's title ui element is the legend.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-AXRole: AXWebArea
- AXRole: AXGroup
- AXRole: AXLabel AXValue: Choose a shipping method: << fieldset's titleUIElement
- AXRole: AXRadioButton AXValue:
- AXRole: AXDiv AXValue: End of test
-PASS titleUIElement != null is true
-PASS titleUIElementText.stringValue is 'AXValue: Choose a shipping method:'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: trunk/LayoutTests/platform/gtk/accessibility/legend-expected.txt (157433 => 157434)
--- trunk/LayoutTests/platform/gtk/accessibility/legend-expected.txt 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/LayoutTests/platform/gtk/accessibility/legend-expected.txt 2013-10-15 00:23:25 UTC (rev 157434)
@@ -1,19 +0,0 @@
-Choose a shipping method:
-Overnight
-End of test
-This tests that a fieldset's title ui element is the legend.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-AXRole: AXWebArea
- AXRole: AXGroup
- AXRole: AXLabel AXValue: Choose a shipping method: << fieldset's titleUIElement
- AXRole: AXRadioButton AXValue:
- AXRole: AXDiv AXValue: End of test
-PASS titleUIElement != null is true
-PASS titleUIElementText.stringValue is 'AXValue: Choose a shipping method:'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Added: trunk/LayoutTests/platform/mac/accessibility/fieldset-element-expected.txt (0 => 157434)
--- trunk/LayoutTests/platform/mac/accessibility/fieldset-element-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/fieldset-element-expected.txt 2013-10-15 00:23:25 UTC (rev 157434)
@@ -0,0 +1,29 @@
+Name:
+High Score:
+Name:
+High Score:
+Name:
+High Score:
+Name:
+High Score:
+Name:
+High Score: Name:
+Name:
+Other:
+This tests that fieldset and legend elements are exposed correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+AXDescription: High Score:
+AXDescription: High Score:
+AXDescription: New High Score:
+AXDescription: New High Score:
+AXDescription:
+AXDescription: High Score:
+AXDescription:
+AXValue: Other:
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Deleted: trunk/LayoutTests/platform/mac/accessibility/legend-expected.txt (157433 => 157434)
--- trunk/LayoutTests/platform/mac/accessibility/legend-expected.txt 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/LayoutTests/platform/mac/accessibility/legend-expected.txt 2013-10-15 00:23:25 UTC (rev 157434)
@@ -1,23 +0,0 @@
-Choose a shipping method:
-Overnight
-End of test
-This tests that a fieldset's title ui element is the legend.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-AXRole: AXWebArea AXValue:
- AXRole: AXGroup AXValue:
- AXRole: AXGroup AXValue: << fieldset's titleUIElement
- AXRole: AXStaticText AXValue: Choose a shipping method:
- AXRole: AXGroup AXValue:
- AXRole: AXRadioButton AXValue: 0
- AXRole: AXStaticText AXValue: Overnight
- AXRole: AXGroup AXValue:
- AXRole: AXStaticText AXValue: End of test
-PASS titleUIElement != null is true
-PASS titleUIElementText.stringValue is 'AXValue: Choose a shipping method:'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Modified: trunk/LayoutTests/platform/mac/accessibility/role-subrole-roledescription-expected.txt (157433 => 157434)
--- trunk/LayoutTests/platform/mac/accessibility/role-subrole-roledescription-expected.txt 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/LayoutTests/platform/mac/accessibility/role-subrole-roledescription-expected.txt 2013-10-15 00:23:25 UTC (rev 157434)
@@ -115,9 +115,9 @@
AXRoleDescription: group
PASS: legend
- AXRole: AXGroup
+ AXRole:
AXSubrole:
- AXRoleDescription: group
+ AXRoleDescription:
PASS: footer
AXRole: AXGroup
Modified: trunk/LayoutTests/platform/mac/accessibility/role-subrole-roledescription.html (157433 => 157434)
--- trunk/LayoutTests/platform/mac/accessibility/role-subrole-roledescription.html 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/LayoutTests/platform/mac/accessibility/role-subrole-roledescription.html 2013-10-15 00:23:25 UTC (rev 157434)
@@ -35,7 +35,7 @@
<em data-role="" data-subrole="" data-roledescription="" class="ex">X</em>
<!-- skipped <embed> -->
<fieldset data-role="AXGroup" data-subrole="" data-roledescription="group" class="ex">
- <legend data-role="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</legend>
+ <legend data-role="" data-subrole="" data-roledescription="" class="ex">X</legend>
</fieldset>
<!-- skipped figure/figcaption http://webkit.org/b/108996 -->
<footer data-role="AXGroup" data-subrole="AXLandmarkContentInfo" data-roledescription="footer" class="ex">X</footer>
Modified: trunk/Source/WebCore/ChangeLog (157433 => 157434)
--- trunk/Source/WebCore/ChangeLog 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/Source/WebCore/ChangeLog 2013-10-15 00:23:25 UTC (rev 157434)
@@ -1,3 +1,39 @@
+2013-10-14 Samuel White <[email protected]>
+
+ AX: fieldset should have GroupRole and legend should be description.
+ https://bugs.webkit.org/show_bug.cgi?id=122534
+
+ Reviewed by Chris Fleizach.
+
+ Changes fieldset to derive AXDescription from legend if one is available. Added
+ convenience method to AccessibilityObject to fetch element if available.
+
+ Test: accessibility/fieldset-element.html
+
+ * accessibility/AccessibilityNodeObject.cpp:
+ (WebCore::AccessibilityNodeObject::canHaveChildren):
+ (WebCore::AccessibilityNodeObject::alternativeText):
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::element):
+ (WebCore::AccessibilityObject::isARIAHidden):
+ (WebCore::AccessibilityObject::isDOMHidden):
+ (WebCore::AccessibilityObject::defaultObjectInclusion):
+ * accessibility/AccessibilityObject.h:
+ (WebCore::AccessibilityObject::isHidden):
+ * accessibility/AccessibilitySlider.cpp:
+ (WebCore::AccessibilitySlider::getAttribute):
+ (WebCore::AccessibilitySlider::valueForRange):
+ (WebCore::AccessibilitySlider::maxValueForRange):
+ (WebCore::AccessibilitySlider::minValueForRange):
+ (WebCore::AccessibilitySlider::setValue):
+ (WebCore::AccessibilitySlider::inputElement):
+ * accessibility/AccessibilitySlider.h:
+ * accessibility/mac/AccessibilityObjectMac.mm:
+ (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
+ * html/HTMLFieldSetElement.cpp:
+ (WebCore::HTMLFieldSetElement::legend):
+ * html/HTMLFieldSetElement.h:
+
2013-10-14 Roger Fong <[email protected]>
[Windows] Unreviewed build fix.
Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (157433 => 157434)
--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp 2013-10-15 00:23:25 UTC (rev 157434)
@@ -88,6 +88,8 @@
using namespace HTMLNames;
+static String accessibleNameForNode(Node*);
+
AccessibilityNodeObject::AccessibilityNodeObject(Node* node)
: AccessibilityObject()
, m_ariaRole(UnknownRole)
@@ -394,6 +396,9 @@
case ScrollBarRole:
case ProgressIndicatorRole:
return false;
+ case LegendRole:
+ if (Element* element = this->element())
+ return !ancestorsOfType<HTMLFieldSetElement>(element).first();
default:
return true;
}
@@ -1251,6 +1256,13 @@
if (!node)
return;
+ // The fieldset element derives its alternative text from the first associated legend element if one is available.
+ if (isHTMLFieldSetElement(node)) {
+ AccessibilityObject* object = axObjectCache()->getOrCreate(toHTMLFieldSetElement(node)->legend());
+ if (object && !object->isHidden())
+ textOrder.append(AccessibilityText(accessibleNameForNode(object->node()), AlternativeText));
+ }
+
#if ENABLE(SVG)
// SVG elements all can have a <svg:title> element inside which should act as the descriptive text.
if (node->isSVGElement())
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (157433 => 157434)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2013-10-15 00:23:25 UTC (rev 157434)
@@ -1536,6 +1536,14 @@
return false;
}
+Element* AccessibilityObject::element() const
+{
+ Node* node = this->node();
+ if (node && node->isElementNode())
+ return toElement(node);
+ return 0;
+}
+
const AtomicString& AccessibilityObject::placeholderValue() const
{
const AtomicString& placeholder = getAttribute(placeholderAttr);
@@ -1995,22 +2003,32 @@
return defaultObjectInclusion() == IgnoreObject;
}
-bool AccessibilityObject::ariaIsHidden() const
+// ARIA component of hidden definition.
+// http://www.w3.org/TR/wai-aria/terms#def_hidden
+bool AccessibilityObject::isARIAHidden() const
{
- if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "true"))
- return true;
-
- for (AccessibilityObject* object = parentObject(); object; object = object->parentObject()) {
+ for (const AccessibilityObject* object = this; object; object = object->parentObject()) {
if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true"))
return true;
}
-
return false;
}
+// DOM component of hidden definition.
+// http://www.w3.org/TR/wai-aria/terms#def_hidden
+bool AccessibilityObject::isDOMHidden() const
+{
+ RenderObject* renderer = this->renderer();
+ if (!renderer)
+ return true;
+
+ RenderStyle* style = renderer->style();
+ return style->display() == NONE || style->visibility() != VISIBLE;
+}
+
AccessibilityObjectInclusion AccessibilityObject::defaultObjectInclusion() const
{
- if (ariaIsHidden())
+ if (isARIAHidden())
return IgnoreObject;
if (isPresentationalChildOfAriaRole())
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (157433 => 157434)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.h 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h 2013-10-15 00:23:25 UTC (rev 157434)
@@ -515,6 +515,7 @@
virtual bool canSetSelectedChildrenAttribute() const { return false; }
virtual bool canSetExpandedAttribute() const { return false; }
+ Element* element() const;
virtual Node* node() const { return 0; }
virtual RenderObject* renderer() const { return 0; }
virtual bool accessibilityIsIgnored() const;
@@ -844,7 +845,12 @@
typedef Vector<pair<AccessibilityObject*, AccessibilityObject*> > AccessibilityMathMultiscriptPairs;
virtual void mathPrescripts(AccessibilityMathMultiscriptPairs&) { }
virtual void mathPostscripts(AccessibilityMathMultiscriptPairs&) { }
-
+
+ // Visibility.
+ bool isARIAHidden() const;
+ bool isDOMHidden() const;
+ bool isHidden() const { return isARIAHidden() || isDOMHidden(); }
+
#if HAVE(ACCESSIBILITY)
#if PLATFORM(GTK) || PLATFORM(EFL)
AccessibilityObjectWrapper* wrapper() const;
@@ -900,7 +906,6 @@
static bool isAccessibilityTextSearchMatch(AccessibilityObject*, AccessibilitySearchCriteria*);
static bool objectMatchesSearchCriteriaWithResultLimit(AccessibilityObject*, AccessibilitySearchCriteria*, AccessibilityChildrenVector&);
virtual AccessibilityRole buttonRoleType() const;
- bool ariaIsHidden() const;
bool isOnscreen() const;
#if PLATFORM(GTK) || (PLATFORM(EFL) && HAVE(ACCESSIBILITY))
Modified: trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp (157433 => 157434)
--- trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp 2013-10-15 00:23:25 UTC (rev 157434)
@@ -99,7 +99,7 @@
const AtomicString& AccessibilitySlider::getAttribute(const QualifiedName& attribute) const
{
- return element()->getAttribute(attribute);
+ return inputElement()->getAttribute(attribute);
}
AccessibilityObject* AccessibilitySlider::elementAccessibilityHitTest(const IntPoint& point) const
@@ -115,22 +115,22 @@
float AccessibilitySlider::valueForRange() const
{
- return element()->value().toFloat();
+ return inputElement()->value().toFloat();
}
float AccessibilitySlider::maxValueForRange() const
{
- return static_cast<float>(element()->maximum());
+ return static_cast<float>(inputElement()->maximum());
}
float AccessibilitySlider::minValueForRange() const
{
- return static_cast<float>(element()->minimum());
+ return static_cast<float>(inputElement()->minimum());
}
void AccessibilitySlider::setValue(const String& value)
{
- HTMLInputElement* input = element();
+ HTMLInputElement* input = inputElement();
if (input->value() == value)
return;
@@ -141,7 +141,7 @@
input->dispatchFormControlChangeEvent();
}
-HTMLInputElement* AccessibilitySlider::element() const
+HTMLInputElement* AccessibilitySlider::inputElement() const
{
return toHTMLInputElement(m_renderer->node());
}
Modified: trunk/Source/WebCore/accessibility/AccessibilitySlider.h (157433 => 157434)
--- trunk/Source/WebCore/accessibility/AccessibilitySlider.h 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/Source/WebCore/accessibility/AccessibilitySlider.h 2013-10-15 00:23:25 UTC (rev 157434)
@@ -46,7 +46,7 @@
explicit AccessibilitySlider(RenderObject*);
private:
- HTMLInputElement* element() const;
+ HTMLInputElement* inputElement() const;
virtual AccessibilityObject* elementAccessibilityHitTest(const IntPoint&) const OVERRIDE;
virtual AccessibilityRole roleValue() const OVERRIDE { return SliderRole; }
Modified: trunk/Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm (157433 => 157434)
--- trunk/Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm 2013-10-15 00:23:25 UTC (rev 157434)
@@ -25,6 +25,9 @@
#import "config.h"
#import "AccessibilityObject.h"
+#import "ElementAncestorIterator.h"
+#import "HTMLFieldSetElement.h"
+#import "RenderObject.h"
#if HAVE(ACCESSIBILITY)
@@ -79,6 +82,15 @@
if (roleValue() == UnknownRole && !isAttachment())
return IgnoreObject;
+ if (RenderObject* renderer = this->renderer()) {
+ // The legend element is ignored if it lives inside of a fieldset element that uses it to generate alternative text.
+ if (renderer->isLegend()) {
+ Element* element = this->element();
+ if (element && ancestorsOfType<HTMLFieldSetElement>(element).first())
+ return IgnoreObject;
+ }
+ }
+
return DefaultBehavior;
}
Modified: trunk/Source/WebCore/html/HTMLFieldSetElement.cpp (157433 => 157434)
--- trunk/Source/WebCore/html/HTMLFieldSetElement.cpp 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/Source/WebCore/html/HTMLFieldSetElement.cpp 2013-10-15 00:23:25 UTC (rev 157434)
@@ -88,9 +88,9 @@
return new (arena) RenderFieldset(*this);
}
-const HTMLLegendElement* HTMLFieldSetElement::legend() const
+HTMLLegendElement* HTMLFieldSetElement::legend() const
{
- return descendantsOfType<HTMLLegendElement>(this).first();
+ return const_cast<HTMLLegendElement*>(descendantsOfType<HTMLLegendElement>(this).first());
}
PassRefPtr<HTMLCollection> HTMLFieldSetElement::elements()
Modified: trunk/Source/WebCore/html/HTMLFieldSetElement.h (157433 => 157434)
--- trunk/Source/WebCore/html/HTMLFieldSetElement.h 2013-10-15 00:05:45 UTC (rev 157433)
+++ trunk/Source/WebCore/html/HTMLFieldSetElement.h 2013-10-15 00:23:25 UTC (rev 157434)
@@ -35,7 +35,7 @@
public:
static PassRefPtr<HTMLFieldSetElement> create(const QualifiedName&, Document&, HTMLFormElement*);
- const HTMLLegendElement* legend() const;
+ HTMLLegendElement* legend() const;
PassRefPtr<HTMLCollection> elements();
const Vector<FormAssociatedElement*>& associatedElements() const;