Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1186)

Unified Diff: content/renderer/accessibility/blink_ax_tree_source.cc

Issue 1130733006: Adds color, font size, text direction and text styles to the accessibility tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt at exposing style info to the native APIs. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/accessibility/blink_ax_tree_source.cc
diff --git a/content/renderer/accessibility/blink_ax_tree_source.cc b/content/renderer/accessibility/blink_ax_tree_source.cc
index c0a1ef58de51b636c0d52b190f8cb7e640d796e3..8ae828e97ed634b76b2567f3a32e6905dc35e660 100644
--- a/content/renderer/accessibility/blink_ax_tree_source.cc
+++ b/content/renderer/accessibility/blink_ax_tree_source.cc
@@ -234,13 +234,20 @@ void BlinkAXTreeSource::SerializeNode(blink::WebAXObject src,
dst->AddStringAttribute(ui::AX_ATTR_VALUE, UTF16ToUTF8(src.stringValue()));
}
- if (dst->role == ui::AX_ROLE_COLOR_WELL) {
- int r, g, b;
- src.colorValue(r, g, b);
- dst->AddIntAttribute(ui::AX_ATTR_COLOR_VALUE_RED, r);
- dst->AddIntAttribute(ui::AX_ATTR_COLOR_VALUE_GREEN, g);
- dst->AddIntAttribute(ui::AX_ATTR_COLOR_VALUE_BLUE, b);
- }
+ if (dst->role == ui::AX_ROLE_COLOR_WELL)
+ dst->AddIntAttribute(ui::AX_ATTR_COLOR_VALUE, src.colorValue());
+
+
+ // Text attributes.
+ if (src.backgroundColor())
+ dst->AddIntAttribute(ui::AX_ATTR_BACKGROUND_COLOR, src.backgroundColor());
+
+ if (src.color())
+ dst->AddIntAttribute(ui::AX_ATTR_COLOR, src.color());
+
+ // Font size is in pixels.
+ if (src.fontSize())
+ dst->AddFloatAttribute(ui::AX_ATTR_FONT_SIZE, src.fontSize());
if (src.invalidState()) {
dst->AddIntAttribute(ui::AX_ATTR_INVALID_STATE,
@@ -251,10 +258,18 @@ void BlinkAXTreeSource::SerializeNode(blink::WebAXObject src,
UTF16ToUTF8(src.ariaInvalidValue()));
}
- if (dst->role == ui::AX_ROLE_INLINE_TEXT_BOX) {
+ if (src.textDirection()) {
dst->AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION,
AXTextDirectionFromBlink(src.textDirection()));
+ }
+
+ if (src.textStyle()) {
+ dst->AddIntAttribute(ui::AX_ATTR_TEXT_STYLE,
+ AXTextStyleFromBlink(src.textStyle()));
+ }
+
+ if (dst->role == ui::AX_ROLE_INLINE_TEXT_BOX) {
WebVector<int> src_character_offsets;
src.characterOffsets(src_character_offsets);
std::vector<int32> character_offsets;
« no previous file with comments | « content/renderer/accessibility/blink_ax_enum_conversion.cc ('k') | content/shell/renderer/test_runner/web_ax_object_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698