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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java

Issue 1137393003: Add style information to the snapshot node (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address code review (dependency and non-existent style) 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/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

Powered by Google App Engine
This is Rietveld 408576698