[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
cfleizach at apple.com
cfleizach at apple.com
Wed Dec 22 13:55:34 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit edd8483ea22597e97b6cd6b61b8d667bcded5408
Author: cfleizach at apple.com <cfleizach at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Sep 29 19:59:56 2010 +0000
AX: implement CSS3 Speech "speak"
https://bugs.webkit.org/show_bug.cgi?id=46827
Reviewed by Darin Adler.
WebCore:
Support the "speak" style as defined in
http://www.w3.org/TR/css3-speech/#speak
This puts all the pieces in place for a platform to support this ability, but there's no platform implementation yet.
Test: platform/mac/accessibility/css-speech-speak.html
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::speakProperty):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::speakProperty):
* accessibility/AccessibilityRenderObject.h:
* accessibility/mac/AccessibilityObjectWrapper.mm:
(-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ESpeak):
* css/CSSPropertyNames.in:
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty):
* css/CSSValueKeywords.in:
* rendering/style/RenderStyle.h:
(WebCore::InheritedFlags::speak):
(WebCore::InheritedFlags::setSpeak):
(WebCore::InheritedFlags::initialSpeak):
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):
* rendering/style/StyleRareInheritedData.h:
WebKitTools:
* DumpRenderTree/AccessibilityUIElement.cpp:
(speakCallback):
(AccessibilityUIElement::speak):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::speak):
LayoutTests:
* platform/mac/accessibility/css-speech-speak-expected.txt: Added.
* platform/mac/accessibility/css-speech-speak.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68680 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 03fc736..6fbdea7 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-09-29 Chris Fleizach <cfleizach at apple.com>
+
+ Reviewed by Darin Adler.
+
+ AX: implement CSS3 Speech "speak"
+ https://bugs.webkit.org/show_bug.cgi?id=46827
+
+ * platform/mac/accessibility/css-speech-speak-expected.txt: Added.
+ * platform/mac/accessibility/css-speech-speak.html: Added.
+
2010-09-29 David Hyatt <hyatt at apple.com>
Reviewed by Sam Weinig.
diff --git a/LayoutTests/platform/mac/accessibility/css-speech-speak-expected.txt b/LayoutTests/platform/mac/accessibility/css-speech-speak-expected.txt
new file mode 100644
index 0000000..943a652
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/css-speech-speak-expected.txt
@@ -0,0 +1,25 @@
+Initial
+No speech
+Normal
+Spellout
+Digits
+Literal
+No punctuation
+test
+This tests that using the CSS3-speech property 'speak' works as from a WebCore level (not a platform level, that is up to the platforms)
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS accessibilityController.focusedElement.childAtIndex(0).speak is 'normal'
+PASS accessibilityController.focusedElement.childAtIndex(0).speak is 'none'
+PASS accessibilityController.focusedElement.childAtIndex(0).speak is 'normal'
+PASS accessibilityController.focusedElement.childAtIndex(0).speak is 'spell-out'
+PASS accessibilityController.focusedElement.childAtIndex(0).speak is 'digits'
+PASS accessibilityController.focusedElement.childAtIndex(0).speak is 'literal-punctuation'
+PASS accessibilityController.focusedElement.childAtIndex(0).speak is 'no-punctuation'
+PASS accessibilityController.focusedElement.childAtIndex(0).speak is 'digits'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/css-speech-speak.html b/LayoutTests/platform/mac/accessibility/css-speech-speak.html
new file mode 100644
index 0000000..1b7507a
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/css-speech-speak.html
@@ -0,0 +1,76 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script>
+var successfullyParsed = false;
+</script>
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<style>
+div.speech-none { speak: none; }
+div.speech-normal { speak: normal; }
+div.speech-spellout { speak: spell-out; }
+div.speech-digits { speak: digits; }
+div.speech-literalpunc { speak: literal-punctuation; }
+div.speech-nopunc { speak: no-punctuation; }
+</style>
+</head>
+<body id="body">
+
+
+<div tabindex="0" id="initial" >Initial</div>
+<div tabindex="0" id="speech-none" class="speech-none">No speech</div>
+<div tabindex="0" id="speech-normal" class="speech-normal">Normal</div>
+<div tabindex="0" id="speech-spellout" class="speech-spellout">Spellout</div>
+<div tabindex="0" id="speech-digits" class="speech-digits">Digits</div>
+<div tabindex="0" id="speech-literalpunc" class="speech-literalpunc">Literal</div>
+<div tabindex="0" id="speech-nopunc" class="speech-nopunc">No punctuation</div>
+
+<div style='speak: digits;'>
+ <div>
+ <div>
+ <a id="testlink" tabindex="0" href="#">test</a>
+ </div>
+ </div>
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+ description("This tests that using the CSS3-speech property 'speak' works as from a WebCore level (not a platform level, that is up to the platforms)");
+
+ if (window.accessibilityController) {
+
+ document.getElementById("initial").focus();
+ shouldBe("accessibilityController.focusedElement.childAtIndex(0).speak", "'normal'");
+
+ document.getElementById("speech-none").focus();
+ shouldBe("accessibilityController.focusedElement.childAtIndex(0).speak", "'none'");
+
+ document.getElementById("speech-normal").focus();
+ shouldBe("accessibilityController.focusedElement.childAtIndex(0).speak", "'normal'");
+
+ document.getElementById("speech-spellout").focus();
+ shouldBe("accessibilityController.focusedElement.childAtIndex(0).speak", "'spell-out'");
+
+ document.getElementById("speech-digits").focus();
+ shouldBe("accessibilityController.focusedElement.childAtIndex(0).speak", "'digits'");
+
+ document.getElementById("speech-literalpunc").focus();
+ shouldBe("accessibilityController.focusedElement.childAtIndex(0).speak", "'literal-punctuation'");
+
+ document.getElementById("speech-nopunc").focus();
+ shouldBe("accessibilityController.focusedElement.childAtIndex(0).speak", "'no-punctuation'");
+
+ document.getElementById("testlink").focus();
+ shouldBe("accessibilityController.focusedElement.childAtIndex(0).speak", "'digits'");
+ }
+
+ successfullyParsed = true;
+</script>
+
+<script src="../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f64a77d..be84cd4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,43 @@
+2010-09-29 Chris Fleizach <cfleizach at apple.com>
+
+ Reviewed by Darin Adler.
+
+ AX: implement CSS3 Speech "speak"
+ https://bugs.webkit.org/show_bug.cgi?id=46827
+
+ Support the "speak" style as defined in
+ http://www.w3.org/TR/css3-speech/#speak
+
+ This puts all the pieces in place for a platform to support this ability, but there's no platform implementation yet.
+
+ Test: platform/mac/accessibility/css-speech-speak.html
+
+ * accessibility/AccessibilityObject.h:
+ (WebCore::AccessibilityObject::speakProperty):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::speakProperty):
+ * accessibility/AccessibilityRenderObject.h:
+ * accessibility/mac/AccessibilityObjectWrapper.mm:
+ (-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+ (WebCore::CSSPrimitiveValue::operator ESpeak):
+ * css/CSSPropertyNames.in:
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+ * css/CSSValueKeywords.in:
+ * rendering/style/RenderStyle.h:
+ (WebCore::InheritedFlags::speak):
+ (WebCore::InheritedFlags::setSpeak):
+ (WebCore::InheritedFlags::initialSpeak):
+ * rendering/style/RenderStyleConstants.h:
+ * rendering/style/StyleRareInheritedData.cpp:
+ (WebCore::StyleRareInheritedData::StyleRareInheritedData):
+ (WebCore::StyleRareInheritedData::operator==):
+ * rendering/style/StyleRareInheritedData.h:
+
2010-09-29 João Paulo Rechi Vita <jprvita at profusion.mobi>
Reviewed by Antonio Gomes.
diff --git a/WebCore/accessibility/AccessibilityObject.h b/WebCore/accessibility/AccessibilityObject.h
index e8f6d1b..bcf09d2 100644
--- a/WebCore/accessibility/AccessibilityObject.h
+++ b/WebCore/accessibility/AccessibilityObject.h
@@ -536,6 +536,9 @@ public:
bool supportsARIAAttributes() const;
+ // CSS3 Speech properties.
+ virtual ESpeak speakProperty() const { return SpeakNormal; }
+
#if HAVE(ACCESSIBILITY)
#if PLATFORM(GTK)
AccessibilityObjectWrapper* wrapper() const;
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index 5ca78ca..d6bec4f 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -1487,6 +1487,14 @@ AccessibilityObject* AccessibilityRenderObject::internalLinkElement() const
return firstAccessibleObjectFromNode(linkedNode);
}
+ESpeak AccessibilityRenderObject::speakProperty() const
+{
+ if (!m_renderer)
+ return AccessibilityObject::speakProperty();
+
+ return m_renderer->style()->speak();
+}
+
void AccessibilityRenderObject::addRadioButtonGroupMembers(AccessibilityChildrenVector& linkedUIElements) const
{
if (!m_renderer || roleValue() != RadioButtonRole)
diff --git a/WebCore/accessibility/AccessibilityRenderObject.h b/WebCore/accessibility/AccessibilityRenderObject.h
index b7b85fe..c62e98d 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.h
+++ b/WebCore/accessibility/AccessibilityRenderObject.h
@@ -301,6 +301,8 @@ private:
String accessibilityDescriptionForElements(Vector<Element*> &elements) const;
void elementsFromAttribute(Vector<Element*>& elements, const QualifiedName& name) const;
+ virtual ESpeak speakProperty() const;
+
virtual const AtomicString& ariaLiveRegionStatus() const;
virtual const AtomicString& ariaLiveRegionRelevant() const;
virtual bool ariaLiveRegionAtomic() const;
diff --git a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
index cb983eb..e4b7d8e 100644
--- a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
+++ b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
@@ -1908,6 +1908,26 @@ static NSString* roleValueToNSString(AccessibilityRole value)
if ([attributeName isEqualToString:@"AXClickPoint"])
return [NSValue valueWithPoint:m_object->clickPoint()];
+ // This is used by DRT to verify CSS3 speech works.
+ if ([attributeName isEqualToString:@"AXDRTSpeechAttribute"]) {
+ ESpeak speakProperty = m_object->speakProperty();
+ switch (speakProperty) {
+ case SpeakNone:
+ return @"none";
+ case SpeakSpellOut:
+ return @"spell-out";
+ case SpeakDigits:
+ return @"digits";
+ case SpeakLiteralPunctuation:
+ return @"literal-punctuation";
+ case SpeakNoPunctuation:
+ return @"no-punctuation";
+ default:
+ case SpeakNormal:
+ return @"normal";
+ }
+ }
+
return nil;
}
diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp
index 1cc7996..e50e190 100644
--- a/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -123,6 +123,7 @@ static const int computedProperties[] = {
CSSPropertyPosition,
CSSPropertyResize,
CSSPropertyRight,
+ CSSPropertySpeak,
CSSPropertyTableLayout,
CSSPropertyTextAlign,
CSSPropertyTextDecoration,
@@ -1409,6 +1410,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
rect->setLeft(zoomAdjustedPixelValue(style->clip().left().value(), style.get()));
return CSSPrimitiveValue::create(rect.release());
}
+ case CSSPropertySpeak:
+ return CSSPrimitiveValue::create(style->speak());
case CSSPropertyWebkitTransform:
return computedTransform(renderer, style.get());
case CSSPropertyWebkitTransformOrigin: {
diff --git a/WebCore/css/CSSPrimitiveValueMappings.h b/WebCore/css/CSSPrimitiveValueMappings.h
index 14afdf6..8369155 100644
--- a/WebCore/css/CSSPrimitiveValueMappings.h
+++ b/WebCore/css/CSSPrimitiveValueMappings.h
@@ -2730,6 +2730,53 @@ template<> inline CSSPrimitiveValue::operator EVectorEffect() const
}
}
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ESpeak e)
+ : m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
+{
+ switch (e) {
+ case SpeakNone:
+ m_value.ident = CSSValueNone;
+ break;
+ case SpeakNormal:
+ m_value.ident = CSSValueNormal;
+ break;
+ case SpeakSpellOut:
+ m_value.ident = CSSValueSpellOut;
+ break;
+ case SpeakDigits:
+ m_value.ident = CSSValueDigits;
+ break;
+ case SpeakLiteralPunctuation:
+ m_value.ident = CSSValueLiteralPunctuation;
+ break;
+ case SpeakNoPunctuation:
+ m_value.ident = CSSValueNoPunctuation;
+ break;
+ }
+}
+
+template<> inline CSSPrimitiveValue::operator ESpeak() const
+{
+ switch (m_value.ident) {
+ case CSSValueNone:
+ return SpeakNone;
+ case CSSValueNormal:
+ return SpeakNormal;
+ case CSSValueSpellOut:
+ return SpeakSpellOut;
+ case CSSValueDigits:
+ return SpeakDigits;
+ case CSSValueLiteralPunctuation:
+ return SpeakLiteralPunctuation;
+ case CSSValueNoPunctuation:
+ return SpeakNoPunctuation;
+ default:
+ ASSERT_NOT_REACHED();
+ return SpeakNormal;
+ }
+}
+
#endif
}
diff --git a/WebCore/css/CSSPropertyNames.in b/WebCore/css/CSSPropertyNames.in
index 8584e5f..dba0069 100644
--- a/WebCore/css/CSSPropertyNames.in
+++ b/WebCore/css/CSSPropertyNames.in
@@ -123,6 +123,7 @@ resize
right
size
src
+speak
table-layout
text-align
text-decoration
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index ae9d912..eafa250 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -5483,6 +5483,12 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
case CSSPropertySize:
applyPageSizeProperty(value);
return;
+
+ case CSSPropertySpeak:
+ HANDLE_INHERIT_AND_INITIAL(speak, Speak);
+ m_style->setSpeak(*primitiveValue);
+ return;
+
case CSSPropertyInvalid:
return;
diff --git a/WebCore/css/CSSValueKeywords.in b/WebCore/css/CSSValueKeywords.in
index 556d0bc..b8d01b8 100644
--- a/WebCore/css/CSSValueKeywords.in
+++ b/WebCore/css/CSSValueKeywords.in
@@ -714,6 +714,14 @@ stroke
#none
#
+# CSS_PROP_SPEECH
+#
+spell-out
+digits
+literal-punctuation
+no-punctuation
+
+#
# -webkit-font-smoothing
#
# auto
diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h
index 480fdb6..920d485 100644
--- a/WebCore/rendering/style/RenderStyle.h
+++ b/WebCore/rendering/style/RenderStyle.h
@@ -745,6 +745,8 @@ public:
EBlockFlowDirection blockFlow() const { return static_cast<EBlockFlowDirection>(inherited_flags._blockFlow); }
bool isVerticalBlockFlow() const { return blockFlow() == TopToBottomBlockFlow || blockFlow() == BottomToTopBlockFlow; }
+ ESpeak speak() { return static_cast<ESpeak>(rareInheritedData->speak); }
+
// attribute setter methods
void setDisplay(EDisplay v) { noninherited_flags._effectiveDisplay = v; }
@@ -1037,6 +1039,7 @@ public:
void setTransformOriginX(Length l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_x, l); }
void setTransformOriginY(Length l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_y, l); }
void setTransformOriginZ(float f) { SET_VAR(rareNonInheritedData.access()->m_transform, m_z, f); }
+ void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); }
// End CSS3 Setters
// Apple-specific property setters
@@ -1226,6 +1229,7 @@ public:
static EKHTMLLineBreak initialKHTMLLineBreak() { return LBNORMAL; }
static EMatchNearestMailBlockquoteColor initialMatchNearestMailBlockquoteColor() { return BCNORMAL; }
static const AtomicString& initialHighlight() { return nullAtom; }
+ static ESpeak initialSpeak() { return SpeakNormal; }
static Hyphens initialHyphens() { return HyphensManual; }
static const AtomicString& initialHyphenationString() { return nullAtom; }
static const AtomicString& initialHyphenationLocale() { return nullAtom; }
diff --git a/WebCore/rendering/style/RenderStyleConstants.h b/WebCore/rendering/style/RenderStyleConstants.h
index 94d30d5..d751aa8 100644
--- a/WebCore/rendering/style/RenderStyleConstants.h
+++ b/WebCore/rendering/style/RenderStyleConstants.h
@@ -415,6 +415,8 @@ enum ELineClampType { LineClampLineCount, LineClampPercentage };
enum Hyphens { HyphensNone, HyphensManual, HyphensAuto };
+enum ESpeak { SpeakNone, SpeakNormal, SpeakSpellOut, SpeakDigits, SpeakLiteralPunctuation, SpeakNoPunctuation };
+
} // namespace WebCore
#endif // RenderStyleConstants_h
diff --git a/WebCore/rendering/style/StyleRareInheritedData.cpp b/WebCore/rendering/style/StyleRareInheritedData.cpp
index 71e5252..326c4ee 100644
--- a/WebCore/rendering/style/StyleRareInheritedData.cpp
+++ b/WebCore/rendering/style/StyleRareInheritedData.cpp
@@ -44,6 +44,7 @@ StyleRareInheritedData::StyleRareInheritedData()
, resize(RenderStyle::initialResize())
, userSelect(RenderStyle::initialUserSelect())
, colorSpace(DeviceColorSpace)
+ , speak(SpeakNormal)
, hyphens(HyphensManual)
{
}
@@ -70,6 +71,7 @@ StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o)
, resize(o.resize)
, userSelect(o.userSelect)
, colorSpace(o.colorSpace)
+ , speak(o.speak)
, hyphens(o.hyphens)
, hyphenationString(o.hyphenationString)
, hyphenationLocale(o.hyphenationLocale)
@@ -112,6 +114,7 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const
&& resize == o.resize
&& userSelect == o.userSelect
&& colorSpace == o.colorSpace
+ && speak == o.speak
&& hyphens == o.hyphens
&& hyphenationString == o.hyphenationString
&& hyphenationLocale == o.hyphenationLocale;
diff --git a/WebCore/rendering/style/StyleRareInheritedData.h b/WebCore/rendering/style/StyleRareInheritedData.h
index 6d2e55d..3a78976 100644
--- a/WebCore/rendering/style/StyleRareInheritedData.h
+++ b/WebCore/rendering/style/StyleRareInheritedData.h
@@ -77,6 +77,7 @@ public:
unsigned resize : 2; // EResize
unsigned userSelect : 1; // EUserSelect
unsigned colorSpace : 1; // ColorSpace
+ unsigned speak : 3; // ESpeak
unsigned hyphens : 2; // Hyphens
AtomicString hyphenationString;
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index fc0850e..fb6dc73 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,18 @@
+2010-09-29 Chris Fleizach <cfleizach at apple.com>
+
+ Reviewed by Darin Adler.
+
+ AX: implement CSS3 Speech "speak"
+ https://bugs.webkit.org/show_bug.cgi?id=46827
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (speakCallback):
+ (AccessibilityUIElement::speak):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::speak):
+
2010-09-29 Mihai Parparita <mihaip at chromium.org>
Reviewed by Adam Barth.
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
index 13c642a..31488e5 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
@@ -679,6 +679,12 @@ static JSValueRef isIgnoredCallback(JSContextRef context, JSObjectRef thisObject
return JSValueMakeBoolean(context, toAXElement(thisObject)->isIgnored());
}
+static JSValueRef speakCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
+{
+ JSRetainPtr<JSStringRef> speakString(Adopt, toAXElement(thisObject)->speak());
+ return JSValueMakeString(context, speakString.get());
+}
+
static JSValueRef getHasPopupCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
{
return JSValueMakeBoolean(context, toAXElement(thisObject)->hasPopup());
@@ -737,6 +743,11 @@ static JSValueRef removeNotificationListenerCallback(JSContextRef context, JSObj
// Implementation
+// Unsupported methods on various platforms.
+#if !PLATFORM(MAC)
+JSStringRef AccessibilityUIElement::speak() { return 0; }
+#endif
+
#if !SUPPORTS_AX_TEXTMARKERS
AccessibilityTextMarkerRange AccessibilityUIElement::textMarkerRangeForElement(AccessibilityUIElement*)
@@ -837,6 +848,7 @@ JSClassRef AccessibilityUIElement::getJSClass()
{ "ariaIsGrabbed", getARIAIsGrabbedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "ariaDropEffects", getARIADropEffectsCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "isIgnored", isIgnoredCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "speak", speakCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ 0, 0, 0, 0 }
};
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
index 5170f20..aec6d61 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
@@ -147,6 +147,9 @@ public:
JSStringRef documentURI();
JSStringRef url();
+ // CSS3-speech properties.
+ JSStringRef speak();
+
// Table-specific attributes
JSStringRef attributesOfColumnHeaders();
JSStringRef attributesOfRowHeaders();
diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
index 5f9705a..13c9fa1 100644
--- a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
@@ -780,6 +780,17 @@ int AccessibilityUIElement::hierarchicalLevel() const
return 0;
}
+JSStringRef AccessibilityUIElement::speak()
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ id value = [m_element accessibilityAttributeValue:@"AXDRTSpeechAttribute"];
+ if ([value isKindOfClass:[NSString class]])
+ return [value createJSStringRef];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
bool AccessibilityUIElement::ariaIsGrabbed() const
{
BEGIN_AX_OBJC_EXCEPTIONS
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list