summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav/SelectText.cpp
Commit message (Collapse)AuthorAgeFilesLines
* use advance widths to deduce spaces in selected textCary Clark2010-03-011-15/+41
| | | | | | | | | | | | | The earlier method of using bounding boxes does not work if the characters have sufficiently large kerning, such as 'A Java' or sufficiently small kerning, such as '16'. Also, don't add spaces after hyphens or dashes, and detect baseline changes correctly. Reset the first space condition once text is clipped out. http://b/2457350 http://b/2165553
* refactor drawing to support layersCary Clark2010-02-241-0/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drawing elements that appear atop or below layers need to be drawn both in the proper order and with the correct canvas to respect clipping and the matrix. Drawing the find results, text selection, or the cursor ring, interleaves with any layers that may be drawn. The main picture is treated as owned by a LayerAndroid so each component can decide when to draw. This change leave the main picture in WebViewCore.cpp, and draws everything else in WebView.cpp -- in the future, additional refactoring can put all drawing in one place. The logic of what to draw is still in WebView.java, but the actual drawing calls are now triggered inside the layer code. Android.mk - Add rule to trigger building without layers from buildspec.mk. LayerAndroid.* - Replace FindOnPage reference with abstract DrawExtra class to draw adornments in the layers' canvas context. - Add a LayerAndroid constructor to create a dummy layer with a SkPicture* and a uniqueId==-1 so that extras can detect when they are drawn by the main picture. android_graphics.* - Move cursor ring drawing out of WebView.cpp to here. - Separate cursor ring setup from actual drawing. - Get the cursor ring metrics in local coordinates. ChromeClientAndroid.cpp - Fix compiler warnings. WebViewCore.* - Move updateCursorBounds from WebView.cpp. This permits it to be called from CursorRing::setup. CachedFrame.* CachedNode.* CachedLayer.* - Add local bounds getters. CachedRoot.h - Move class FindCanvas to the android namespace. DrawExtra.h - Add an abstract class called by LayerAndroid to optionally draw extra elements in its canvas context. FindCanvas.* SelectText.* - Refactor drawing to draw in layers context. WebView.cpp - Move drawing from WebView.java. - Remove selection code to SelectText.cpp. - Use inverseScale to simplify viewPort metrics. - Simplify layer root so java doesn't need to know about it. Requires companion change in frameworks/base http://b/2457316 http://b/2454127 http://b/2454149
* extract selected text from the pictureCary Clark2010-01-051-4/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The deleted code extracted the selected text from the WebKit DOM by looking for text in the render tree that matched the selection region. This has never worked well. The replacement approach matches the glyphs in the picture instead. - WebViewCore.* Remove getSelection() and supporting routines. Part of the deleted code looked for punctuation between segments to add space characters that might not be present in the markup. There's no equivalent in the replacement code; it uses spacial gaps to detect the need to add extra spaces. - SelectText.* Match the text to the selected region and convert the glyph to unicode. The tricky part is that spaces need to be inserted into the string when there are gaps in the text. - WebView.cpp Return the selection as a string to the java caller instead of a region. To convert the glyphs into text, a companion change was made to external/skia. To update the UI thread/webkit thread messaging, a companion change was also made to frameworks/base. Fixes http://b/2166748
* Fixes license headers for all files in WebKit/android, other than those in stl/.Steve Block2009-11-131-1/+2
| | | | | | | | | | | | | These files have not yet been upstreamed to webkit.org. WebKit requires either a BSD-style or LGPL 2.1 license for all code. We use a BSD-style 2-clause license for Android-specific files that will be upstreamed to webkit.org. This change adds licenses where absent or simply fixes the names of copyright holders in the license text to 'THE COPYRIGHT OWNER' and cleans up formatting. Files in stl/ currently use licenses other than BSD-style and will require more careful treatment. Change-Id: I67ad4b8932e432d3eaaeecdfeb0d09418496228d
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+263
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-263/+0
|
* auto import from //branches/cupcake/...@126645The Android Open Source Project2009-01-151-10/+19
|
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-171-0/+254