Chromium Code Reviews| Index: content/browser/web_contents/web_contents_android.cc |
| diff --git a/content/browser/web_contents/web_contents_android.cc b/content/browser/web_contents/web_contents_android.cc |
| index 054aaffdaf89e1223c51cbe97b0bc4d8f44091b4..55afbdd649f26c0f472ea288a3b4c660e27e4f9e 100644 |
| --- a/content/browser/web_contents/web_contents_android.cc |
| +++ b/content/browser/web_contents/web_contents_android.cc |
| @@ -106,8 +106,15 @@ ScopedJavaLocalRef<jobject> WalkAXTreeDepthFirst( |
| if (node->HasFloatAttribute(ui::AX_ATTR_FONT_SIZE)) { |
| color = node->GetIntAttribute(ui::AX_ATTR_COLOR); |
| bgcolor = node->GetIntAttribute(ui::AX_ATTR_BACKGROUND_COLOR); |
| - size = node->GetFloatAttribute(ui::AX_ATTR_FONT_SIZE); |
| text_style = node->GetIntAttribute(ui::AX_ATTR_TEXT_STYLE); |
| + |
| + // The font size is just the computed style for that element; apply |
| + // transformations to get the actual pixel size. |
| + size = node->GetFloatAttribute(ui::AX_ATTR_FONT_SIZE); |
|
boliu
2016/10/25 17:20:19
nit: can you pass this directly into RectF constru
dmazzoni
2016/10/25 17:31:16
Done.
|
| + gfx::RectF text_size_rect(0, 0, 1, size); |
| + gfx::Rect scaled_text_size_rect = node->RelativeToAbsoluteBounds( |
| + text_size_rect, false); |
| + size = scaled_text_size_rect.height(); |
| } |
| const gfx::Rect& absolute_rect = node->GetPageBoundsRect(); |