summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav/SelectText.h
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2010-12-14 08:04:18 -0500
committerCary Clark <cary@android.com>2010-12-14 16:31:07 -0500
commitd2966aa787e0dcc4d26a10b6f0dc9f3a2f51abe4 (patch)
treee99ff47e802fe90ba5c617dce34221807598d760 /WebKit/android/nav/SelectText.h
parent0d7cec732e3f00f89749d4946fd22168d8d4111c (diff)
downloadexternal_webkit-d2966aa787e0dcc4d26a10b6f0dc9f3a2f51abe4.zip
external_webkit-d2966aa787e0dcc4d26a10b6f0dc9f3a2f51abe4.tar.gz
external_webkit-d2966aa787e0dcc4d26a10b6f0dc9f3a2f51abe4.tar.bz2
improve text selection
LayerAndroid.* Adjust the hit-test (x,y) by the layer position. Keep track of the adjusted (x,y) and store the best to be returned when the best layer is found. CachedRoot.cpp Remove code that adjusted (x,y) by layer bounds. SelectText.* Detect columns of text and prefer new characters in the same column as the existing selection. Don't extend the selection until the tap point moves past the word anchors. There's more work to do on selecting text in layers. bug:3275625 bug:3271730 bug:3191699 Change-Id: Ib3c2b35e5eebe30c6032f484cf76d388e94293e0
Diffstat (limited to 'WebKit/android/nav/SelectText.h')
-rw-r--r--WebKit/android/nav/SelectText.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/WebKit/android/nav/SelectText.h b/WebKit/android/nav/SelectText.h
index 32e1728..666cdd1 100644
--- a/WebKit/android/nav/SelectText.h
+++ b/WebKit/android/nav/SelectText.h
@@ -60,8 +60,17 @@ public:
int m_selectX;
int m_selectY;
private:
+ class FirstCheck;
+ class EdgeCheck;
void drawSelectionPointer(SkCanvas* , IntRect* );
void drawSelectionRegion(SkCanvas* , IntRect* );
+ SkIRect findClosest(FirstCheck& , const SkPicture& , int* base);
+ SkIRect findEdge(const SkPicture& , const SkIRect& area,
+ int x, int y, bool left, int* base);
+ SkIRect findLeft(const SkPicture& picture, const SkIRect& area,
+ int x, int y, int* base);
+ SkIRect findRight(const SkPicture& picture, const SkIRect& area,
+ int x, int y, int* base);
static void getSelectionArrow(SkPath* );
void getSelectionCaret(SkPath* );
bool hitCorner(int cx, int cy, int x, int y) const;
@@ -73,6 +82,7 @@ private:
SkIRect m_selEnd;
SkIRect m_lastStart;
SkIRect m_lastEnd;
+ SkIRect m_wordBounds;
int m_startBase;
int m_endBase;
int m_layerId;
@@ -86,6 +96,8 @@ private:
bool m_flipped;
bool m_hitTopLeft;
bool m_startSelection;
+ bool m_wordSelection;
+ bool m_outsideWord;
};
}