Index: content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java |
diff --git a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java |
index be0c55d4a09d0890ca779f9b926b760cd42c5eb6..2e549b5fad482dc9224de16f411dc895708a0df7 100644 |
--- a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java |
+++ b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java |
@@ -15,6 +15,7 @@ import org.chromium.content_public.browser.NavigationController; |
import org.chromium.content_public.browser.NavigationTransitionDelegate; |
import org.chromium.content_public.browser.WebContents; |
import org.chromium.content_public.browser.WebContentsObserver; |
+import org.chromium.ui.accessibility.AXTextStyle; |
/** |
* The WebContentsImpl Java wrapper to allow communicating with the native WebContentsImpl |
@@ -356,9 +357,19 @@ import org.chromium.content_public.browser.WebContentsObserver; |
@CalledByNative |
private static AccessibilitySnapshotNode createAccessibilitySnapshotNode(int x, |
int y, int scrollX, int scrollY, int width, int height, String text, |
- String className) { |
- return new AccessibilitySnapshotNode(x, y, scrollX, scrollY, width, height, text, |
- className); |
+ int color, int bgcolor, float size, int textStyle, String className) { |
+ |
+ AccessibilitySnapshotNode node = new AccessibilitySnapshotNode(x, y, scrollX, |
+ scrollY, width, height, text, className); |
+ // if size is smaller than 0, then style information does not exist. |
+ if (size >= 0.0) { |
+ boolean bold = (textStyle & AXTextStyle.text_style_bold) > 0; |
+ boolean italic = (textStyle & AXTextStyle.text_style_italic) > 0; |
+ boolean underline = (textStyle & AXTextStyle.text_style_underline) > 0; |
+ boolean lineThrough = (textStyle & AXTextStyle.text_style_line_through) > 0; |
+ node.setStyle(color, bgcolor, size, bold, italic, underline, lineThrough); |
+ } |
+ return node; |
} |
@Override |