Index: content/shell/renderer/test_runner/web_ax_object_proxy.cc |
diff --git a/content/shell/renderer/test_runner/web_ax_object_proxy.cc b/content/shell/renderer/test_runner/web_ax_object_proxy.cc |
index bf77fe13344fe59cea9621d87001b40e74a30c4b..c47df9b8c25db7c124051b34dc136eb44aef7e4e 100644 |
--- a/content/shell/renderer/test_runner/web_ax_object_proxy.cc |
+++ b/content/shell/renderer/test_runner/web_ax_object_proxy.cc |
@@ -268,10 +268,12 @@ std::string DeprecatedGetHelpText(const blink::WebAXObject& object) { |
std::string GetStringValue(const blink::WebAXObject& object) { |
std::string value; |
if (object.role() == blink::WebAXRoleColorWell) { |
- int r, g, b; |
- object.colorValue(r, g, b); |
- value = base::StringPrintf("rgb %7.5f %7.5f %7.5f 1", |
- r / 255., g / 255., b / 255.); |
+ unsigned int color = object.colorValue(); |
+ unsigned int red = (color >> 16) & 0xFF; |
+ unsigned int green = (color >> 8) & 0xFF; |
+ unsigned int blue = color & 0xFF; |
+ value = base::StringPrintf("rgba(%d, %d, %d, 1)", |
+ red, green, blue); |
} else { |
value = object.stringValue().utf8(); |
} |
@@ -509,6 +511,10 @@ WebAXObjectProxy::GetObjectTemplateBuilder(v8::Isolate* isolate) { |
.SetProperty("hasPopup", &WebAXObjectProxy::HasPopup) |
.SetProperty("isValid", &WebAXObjectProxy::IsValid) |
.SetProperty("isReadOnly", &WebAXObjectProxy::IsReadOnly) |
+ .SetProperty("backgroundColor", &WebAXObjectProxy::BackgroundColor) |
+ .SetProperty("color", &WebAXObjectProxy::Color) |
+ .SetProperty("colorValue", &WebAXObjectProxy::ColorValue) |
+ .SetProperty("fontSize", &WebAXObjectProxy::FontSize) |
.SetProperty("orientation", &WebAXObjectProxy::Orientation) |
.SetProperty("posInSet", &WebAXObjectProxy::PosInSet) |
.SetProperty("setSize", &WebAXObjectProxy::SetSize) |
@@ -822,6 +828,29 @@ bool WebAXObjectProxy::IsReadOnly() { |
return accessibility_object_.isReadOnly(); |
} |
+unsigned int WebAXObjectProxy::BackgroundColor() { |
+ accessibility_object_.updateLayoutAndCheckValidity(); |
+ return accessibility_object_.backgroundColor(); |
+} |
+ |
+unsigned int WebAXObjectProxy::Color() { |
+ accessibility_object_.updateLayoutAndCheckValidity(); |
+ unsigned int color = accessibility_object_.color(); |
+ // Remove the alpha because it's always 1 and thus not informative. |
+ return color & 0xFFFFFF; |
+} |
+ |
+// For input elements of type color. |
+unsigned int WebAXObjectProxy::ColorValue() { |
+ accessibility_object_.updateLayoutAndCheckValidity(); |
+ return accessibility_object_.colorValue(); |
+} |
+ |
+float WebAXObjectProxy::FontSize() { |
+ accessibility_object_.updateLayoutAndCheckValidity(); |
+ return accessibility_object_.fontSize(); |
+} |
+ |
std::string WebAXObjectProxy::Orientation() { |
accessibility_object_.updateLayoutAndCheckValidity(); |
if (accessibility_object_.orientation() == blink::WebAXOrientationVertical) |