summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav/WebView.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* requestChildRectangleOnScreen takes layers into accountCary Clark2010-03-091-0/+20
| | | | | | | | | | | Make native LayerAndroid::subtractLayers visible to java so the layers can be removed from the visible portion of the screen when computing how much to scroll. companion fix in frameworks/base Change-Id: I3bc0760aaeb515415e90996ec1257d24f9f8705a http://b/2453841
* scroll into view considers layersCary Clark2010-03-081-50/+46
| | | | | | | | | | | | | | | | | | | | | LayerAndroid.* - Add a utility that takes the given rectangle and subtracts layers that overlay it. FindCanvas.* - Add function that returns if the current match is on the main page or in a layer. WebView.cpp - Add jni caller for WebView.java calcOurContentVisibleRect. Call it instead of getVisibleRect, which has the side effect of sending messages back to webkit. - Remove jni caller for getViewMetrics, since it is redundant. - Only call scrollRectOnScreen for non-layers. companion fix in framework/base http://b/2485168
* refactor find state and scrollingCary Clark2010-03-031-17/+28
| | | | | | | | | | Separate out state when find is up and is empty. Request a scroll when setting a match, rather than when drawing. Don't draw if there's no match. Companion fix in frameworks/base http://b/2370069
* Make nativeMoveCursorToNextTextInput return a value based on success.Leon Scroggins2010-03-011-7/+7
| | | | | | | | | Also no longer differentiate between textfields and areas for the purpose of the next action. Part of fix for http://b/issue?id=2478052 Requires a change to frameworks/base
* ignore rootlayer when drawing (fixes regression)Mike Reed2010-02-261-1/+6
| | | | dump layers contents in displayTree.txt
* refactor drawing to support layersCary Clark2010-02-241-361/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* move viewport into just this subclassMike Reed2010-02-191-4/+8
|
* fix nav layer bugsCary Clark2010-02-191-4/+9
| | | | | | | Clip the nodes inside the layer to the layer's bounds Don't crash if the layer with the matching id can't be found. http://b/2453945
* refactorMike Reed2010-02-181-5/+5
|
* Changes to remove WebTextView at end of touch/press rather than during.Leon Scroggins2010-02-171-8/+4
| | | | | | | | | Remove calls to clearTextEntry during a touch/press, and move them to the end. Requires a change to frameworks/base Fix for http://b/issue?id=2340871
* Add UI considerations to layersCary Clark2010-02-171-233/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | companion fix is in framework/base With fixed layers, parts of the web page are now in motion relative to the document when the page scrolls. Many routines that formerly read static coordinates need to compute locations. In some cases, new computations are cached for speed -- for instance, the current cursor position is cached when it is frequently compared. The cursor rings and other drawing elements like finding text on the page now to be drawn in the correct order so that they appear both under and over layers. There's quite a bit more work to be done. Major pieces are drawing the text selection in the correct order, and computing locations based on nest layers. With this checkin, only the position of the child- most layer is considered when computing bounds. http://b/2369549 JavaScriptCore/wtf/Platform.h - Turn compositing on. All routines that reference LayerAndroid are bracketed by this condition. WebCore/platform/graphics/android/LayerAndroid.h WebCore/platform/graphics/android/LayerAndroid.cpp - Add a unique id to each layer. The unique id is used to associate a layer created when the DOM is parsed in the webkit thread with its copy in the UI thread. - Add: draw the text found on the page, as a call out in the primary draw. The call out must follow the drawing the layers' contents to show the found text correctly. Note that this adds a new slot with identical contents in every child LayerAndroid. In a future optimization, a RootLayerAndroid could hold data common for all child layers. - Add: clipArea(), which returns an array of rectangles describing the clip for this LayerAndroid and its children. Generally, this is the part of the webpage which is covered by one or more fixed layers. - Add: find(FloatPoint) that returns the deepest layer that contains this point. This is used to match taps to the layer that is tapped on. - Add: draw all layer pictures and identify which layer is being drawn. This is used to analyze the picture contents for finding and selecting text. - Add: find the layer that matches a given id; this is used to map cached DOM node data back to the layer that contains it. - Fix up includes, delete unused interfaces WebKit/android/jni/WebViewCore.h WebKit/android/jni/WebViewCore.cpp - Remove local mRootLayer; use the one in WebView.cpp instead (which is in sync with WebView.java) WebKit/Android.mk WebKit/android/nav/CachedLayer.h WebKit/android/nav/CachedLayer.cpp - CacheLayer associates the cached node with the LayerAndroid instance. It contains the index to the node in the cached frame, the LayerAndroid's unique id, and the spacial offset of the node within the layer when the DOM information was captured. It also caches a pointer to the LayerAndroid instance. CacheLayer computes the node's location each time it is called, since the fixed layer may be constantly moving relative to the document's coordinates. WebKit/android/nav/CacheBuilder.h WebKit/android/nav/CacheBuilder.cpp - Track the active layer while building the nav cache. The 'Tracker' structs were refactored to share common code, and a new 'LayerTracker' struct identifies when the node walker is inside a layer. - Added code to dump layer information for debugging. - Note that CachedNode::cursorRingsPtr can only be called during nav data construction - The cache builder can limit or exclude nodes that are clipped out -- but until I have more understanding of layer clipping, treat contained nodes as unclipped. WebKit/android/nav/CachedDebug.h - Add a variant that can dump either to a log file or the console including the function it was dumped from. WebKit/android/nav/CachedFrame.h WebKit/android/nav/CachedFrame.cpp - Add an array of CacheLayer instances. - Protect bounds from direct access since they must always be computed. - Remove misnamed focus parameter from many routines since the cursor node can be read from the root frame. - Add: adjustBounds(), which computes the bounds as the layer moves. - Add: checkRings(), which gets the appropriate picture for the node. - Remove disabled code - Find the layer list for the matching node by using a binary search - Add: resetLayers() to reset the LayerAndroid pointer in CachedLayers when the layer world changes. WebKit/android/nav/CachedHistory.h WebKit/android/nav/CachedHistory.cpp - Update history data to have matching frame and node WebKit/android/nav/CachedNode.h WebKit/android/nav/CachedNode.cpp - Refactor functions that directly read coordinates to compute them. In some cases, pass the frame in so that the layer coordinates can be found. - Add a bit to note that the node belongs to a layer. - Remove duplicate bounds interfaces. - Add methods to get cursor ring data at runtime. - Update debugging info. WebKit/android/nav/CachedRoot.h WebKit/android/nav/CachedRoot.cpp - Isolate direct picture access so that the layer picture can be returned. - Add knowledge of how the base is covered by layers. - Add a pointer to the root LayerAndroid. - delete disabled code. - Move the cursor ring into view if it is obscured by a layer (this isn't totally working) - Before finding the next node to move to, set up 'cursor cache' data, including the visible picture. WebKit/android/nav/FindCanvas.h WebKit/android/nav/FindCanvas.cpp - Move find code here so that it can be called from layers. WebKit/android/nav/WebView.cpp - Add java interface to get viewport metrics on demand. - Pass frame with the node. - Remove the find on page code (now in FindCanvas). - Compute focus rings instead of reading them directly. - Transfer layer id when getting new nav cache. - Set up root LayerAndroid. - Add utility to track if cursor is in a layer. - Simplify drawLayers() to use common view metrics.
* checkpoint for refactoringMike Reed2010-02-151-2/+11
|
* Add dump layers capability (triggered the same way as the dump tree trick,Nicolas Roard2010-02-121-0/+11
| | | | saving the layres tree in /sdcard/layersTree.plist)
* Put back the animations in the UI threadNicolas Roard2010-02-121-40/+4
|
* Remove code which retrieves the action associated with a textfield.Leon Scroggins2010-02-091-11/+0
| | | | | | This code was written because we previously only had one action button on the IME for textfields. Now that textfields can always have a next button, we no longer need it.
* Fix memory leak with layers.Nicolas Roard2010-01-261-5/+2
| | | | | | | | | | | | | | | This fix bug http://b/2394813 This is a two-parts CL (need a java modif) - The main leak is in WebView.cpp -- nativeUpdateLayers could bail out if the root layer was nil, without deallocating the vector of updates. - fix a leak in LayerAndroid::evaluateAnimations() - adoptRef() for the contentLayer in GraphicsLayerAndroid - simplify AndroidAnimation: remove the reference to the layer (the layer already has a reference to AndroidAnimation) - modify the AndroidAnimation copy() methods to return directly a PassRefPtr, for consistency.
* Call nextTextfield on the CachedFrame that contains the cursor/focus.Leon Scroggins2010-01-221-3/+5
| | | | Fixes http://b/issue?id=2359748
* Cherry-pick WebKit change 53497 to rename jni_utility and ↵Steve Block2010-01-201-7/+6
| | | | | | | | | | | jni_utility_private to JNIUtility and JNIUtilityPrivate See http://trac.webkit.org/changeset/53497 This is required to sync the Android tree with webkit.org to allow unforking in WebCore/bridge. This change required updating headers in Android-specific files in WebCore and WebKit. Change-Id: I4b80eb3eadcff66cbd261aa6ccef0f37927250b1
* am 93f808ab: am 388e461f: Add proper support for fixed position elementsNicolas Roard2010-01-141-3/+4
|\ | | | | | | | | | | | | Merge commit '93f808abccaf6f09c5c0226c01942c3be445031a' * commit '93f808abccaf6f09c5c0226c01942c3be445031a': Add proper support for fixed position elements
| * Add proper support for fixed position elementsNicolas Roard2010-01-141-3/+4
| | | | | | | | | | | | | | this is two-part change, see http://android-git.corp.google.com/g/#change,37092 for the java counterpart. This CL implements fixed position elements (css position: fixed) using layers, supporting pixels and percent lengths. It addresses http://b/1914365
* | am ddd2f469: am ab9c9800: Merge "Compare Node pointers rather than ↵Leon Scroggins2010-01-121-2/+2
|\ \ | |/ | | | | | | | | | | | | | | CachedNode pointers." into eclair-mr2 Merge commit 'ddd2f469835ed5402cb3edfa6c2865536011fbab' * commit 'ddd2f469835ed5402cb3edfa6c2865536011fbab': Compare Node pointers rather than CachedNode pointers.
| * Compare Node pointers rather than CachedNode pointers.Leon Scroggins2010-01-121-2/+2
| | | | | | | | Fixes http://b/issue?id=2369028
* | rebuild the nav cache if the clicked on node is invalidCary Clark2010-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | Before, the slop parameter was set to zero if the node was invalid, and used to skip searching for the node. Now, the cache is rebuilt on the java side before the C side is called. requires a companion fix in frameworks/base fixes http://b/2362334
* | resolved conflicts for merge of 9653e7ce to masterLeon Scroggins2010-01-111-30/+1
|\ \ | |/
| * Bring up the IME after receiving a response from webkit.Leon Scroggins2010-01-111-35/+1
| | | | | | | | | | | | Fix for http://b/issue?id=2361658 Requires a change to frameworks/base.
* | am e44f974f: am 15f1e443: In motionUp, update the CachedHistory\'s mMouseBounds.Leon Scroggins2010-01-071-1/+3
|\ \ | |/ | | | | | | | | | | Merge commit 'e44f974f1d7e25a2823901e0f34c04aa924b7527' * commit 'e44f974f1d7e25a2823901e0f34c04aa924b7527': In motionUp, update the CachedHistory's mMouseBounds.
| * In motionUp, update the CachedHistory's mMouseBounds.Leon Scroggins2010-01-071-1/+3
| | | | | | | | | | | | mMouseBounds is later used to determine the point of clicking. Fixes http://b/issue?id=2313991
* | am 6864ec3c: am 1ccac4c1: remove unused jni interfacesCary Clark2010-01-071-8/+0
|\ \ | |/ | | | | | | | | | | Merge commit '6864ec3c0bb8b5cc0dfa126546419113e946661a' * commit '6864ec3c0bb8b5cc0dfa126546419113e946661a': remove unused jni interfaces
| * remove unused jni interfacesCary Clark2010-01-071-8/+0
| | | | | | | | companion change is in frameworks/base
* | resolved conflicts for merge of 174cd118 to masterLeon Scroggins2010-01-071-11/+0
|\ \ | |/
| * Request <label> info only when accessing a textfield.Leon Scroggins2010-01-071-11/+0
| | | | | | | | | | | | | | Previously, we were storing the label info each time we build the navigation cache. Requires a change to frameworks/base.
* | am 3146e9ee: am 62d9c8e5: Store label information to be used for hint text.Leon Scroggins2010-01-061-0/+11
|\ \ | |/ | | | | | | | | | | Merge commit '3146e9ee4d8f6114a97ceb01d6fd54db77d99538' * commit '3146e9ee4d8f6114a97ceb01d6fd54db77d99538': Store label information to be used for hint text.
| * Store label information to be used for hint text.Leon Scroggins2010-01-061-0/+11
| | | | | | | | | | | | Fix for http://b/issue?id=2331526 Requires a change to frameworks/base.
| * webkit layers supportNicolas Roard2010-01-041-0/+92
| |
* | extract selected text from the pictureCary Clark2010-01-051-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | resolved conflicts for merge of 870689c8Nicolas Roard2010-01-041-0/+92
| |
* | resolved conflicts for merge of 66367cf8 to masterLeon Scroggins2010-01-041-14/+25
|\ \ | |/
| * If the DOM changes textfield focus, make the IME work properly.Leon Scroggins2010-01-041-13/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for http://b/issue?id=2219166 Requires a change to frameworks/base Remove the old change to update the WebTextView when a key is pressed, since the IME does not generate key events. Instead, when the focus changes, and the IME is serving the WebTextView, immediately clear the cursor and update the WebTextView, so the user can continue typing. Also, allow "Next" to work on the currently focused textfield, even if it's not the cursor. Further, check for a new action if there is a focus but not a cursor.
* | am 14357090: am d4924af1: check to see if nav cache is up to date on tapCary Clark2009-12-161-4/+56
|\ \ | |/ | | | | | | | | | | Merge commit '14357090e9d4ac9ad1be6147cf9c7e3ff83cdda4' * commit '14357090e9d4ac9ad1be6147cf9c7e3ff83cdda4': check to see if nav cache is up to date on tap
| * check to see if nav cache is up to date on tapCary Clark2009-12-151-4/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - WebKit/android/jni/WebViewCore.cpp - WebKit/android/jni/WebViewCore.h Add validNodeAndBounds() to determine if the clicked cached node is good. First check to see if the pointer to the frame and node still exist in the DOM. If they do, see if the hit test bounds they point to is the same as when the cache was recorded. - WebKit/android/nav/CacheBuilder.cpp - WebKit/android/nav/CachedNode.h Record the original absolute bounds for later comparison. - WebKit/android/nav/CacheBuilder.h Make getAreaRect() public so it can be called by validation. - WebKit/android/nav/WebView.cpp Enhance motionUp() with additional validation: use pointInNavCache() to see if there's a cached node; wait for message from webkit to see if bounds is unchanged; then use motionUp() to pass the original or altered click. This is a two-part change with frameworks/base. Fixes http://b/2249425
* | Like other callers of Java methods, do not check for the object to be null.Leon Scroggins2009-12-111-7/+2
| |
* | am 58a731c8: am bf16ddc1: Pass a message to move the focus when user hits ↵Leon Scroggins2009-12-101-4/+18
|\ \ | |/ | | | | | | | | | | | | | | "Next". Merge commit '58a731c8a7beeda67d174e8a325594bc81e80a0f' * commit '58a731c8a7beeda67d174e8a325594bc81e80a0f': Pass a message to move the focus when user hits "Next".
| * Pass a message to move the focus when user hits "Next".Leon Scroggins2009-12-091-4/+18
| | | | | | | | | | | | | | | | Directly move the focus rather than passing a click. Fixes http://b/issue?id=2292683 Requires a change to frameworks/base
* | am c0812354: am 74757b62: Provide <input> type information to Java side.Leon Scroggins2009-12-071-8/+37
|\ \ | |/ | | | | | | | | | | Merge commit 'c08123548374ec7cdcf0d1ef8857807c6eda8293' * commit 'c08123548374ec7cdcf0d1ef8857807c6eda8293': Provide <input> type information to Java side.
| * Provide <input> type information to Java side.Leon Scroggins2009-12-071-8/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Help to fix http://b/issue?id=1890360 and http://b/issue?id=2150538 CacheBuilder.cpp: Explicitly set isTextField to false for textareas. CachedRoot: Remove the code which checks to see if the textfield is a search, since if it is, we can avoid this path altogether. WebView: Return a single integer which tells what type the current text input field is. Requires a change to frameworks/base.
* | am 9a00fbd6: am 34bca311: fix crash reading readonly node stateCary Clark2009-12-071-4/+4
|\ \ | |/ | | | | | | | | | | Merge commit '9a00fbd61c8699856620bca057e06efca4425015' * commit '9a00fbd61c8699856620bca057e06efca4425015': fix crash reading readonly node state
| * fix crash reading readonly node stateCary Clark2009-12-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Something about rebuildTextView() invalidates the current cached frame -- reading the last obtained frame after calling it may crash. Why, I don't know. Until I figure that out, read the cached state first. Also remove some tests for null frame and node since the null case has already been handled earlierin motionUp(). fixes http://b/2307964
* | am 3a360998: am dcbb033a: Store InputType information for <input> fields, ↵Leon Scroggins2009-12-071-1/+2
|\ \ | |/ | | | | | | | | | | | | | | return SEARCH action for SEARCH <input> Merge commit '3a360998e7aa91c194fa97a40131bf837f2bba1b' * commit '3a360998e7aa91c194fa97a40131bf837f2bba1b': Store InputType information for <input> fields, return SEARCH action for SEARCH <input>
| * Store InputType information for <input> fields, return SEARCH action for ↵Leon Scroggins2009-12-071-1/+2
| | | | | | | | | | | | | | SEARCH <input> Fixes http://b/issue?id=2299660 and http://b/issue?id=2299650 Also remove isPassword, which is redundant.
* | am 021228f2: am 1d330120: move input-related fields out of CachedNode to expandCary Clark2009-12-041-28/+54
|\ \ | |/ | | | | | | | | | | Merge commit '021228f27b1399df5a45f3f1e7f1f12126e86e3c' * commit '021228f27b1399df5a45f3f1e7f1f12126e86e3c': move input-related fields out of CachedNode to expand