summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav/CachedRoot.cpp
Commit message (Collapse)AuthorAgeFilesLines
* don't hide transparent nodesCary Clark2010-04-221-1/+1
| | | | | | | | | | | A node may be transparent if the body of the node is drawn earlier. In this case, the node may not be tested to see if it has been occluded by later drawing, since no drawing inside the scope of the node is actually visible. So, skip the hidden test for transparent nodes. Change-Id: Ib748e9e7b86252f791ee68198d1d794fb4591a88 http://b/2582455
* nextTextField may walk off the end or try invalid framesCary Clark2010-04-221-0/+7
| | | | | | | | | | | Rewrote nextTextField() to check range and frame, and to more resemble other node walkers. Caller no longer passes uninitialized frame in focused case, and looks at parent frames after the target node. Change-Id: I7ea9dffb75d28bdd9d71d83921058feca6baf928 http://b/2607250
* keep frames associated with regular hits and direct hitsCary Clark2010-04-061-1/+2
| | | | | | | | | | The hit test on the nav cache returns a node/frame pair. It looks for the closest hit, but gives priority to a direct hit. Track the frame associated with the direct hit separately, so that the correct node/frame pair is returned. Change-Id: Icb1e3de4a0aad3c6dd9b2b81669f9c7bbb260282 http://b/2316138
* fix nav algorithm when node is clippedCary Clark2010-03-111-1/+0
| | | | | | | | | | | | A fix for http://b/2319610 incorrectly retried finding nodes if the node was clipped, possibly causing infinite recursion. Leave all of the prior fix but only try once. I tested the prior test case and ensured that it still works. Change-Id: Ib229b6fc0ba57c131a8c1f33350982ac22a445c0 http://b/2501914
* allow anchor containing layer to be mapped to navable layerCary Clark2010-03-021-4/+23
| | | | | | | | | | | | | | | | A layer may be inside or outside of an anchor. If it is inside, the corresponding CachedNode has already been created, but is being tracked. These tracked nodes need their layer and unclipped bits set. For now, node in layers are assumed to draw last in their layer, and aren't obscured by other drawing. We may allow nodes in layers to be obscured one day. Preparing for that, translate the layer picture by its global position when testing to see if the node is hidden. Fix debugging by allowing CachedLayer to see inside LayerAndroid. http://b/2453974
* minor fixes to layer navCary Clark2010-02-171-3/+6
| | | | | | | | | | | - get rid of the FloatPoint interface in LayerAndroid; use (x, y) instead - make CachedFrame a friend of CachedRoot and CacheBuilder a friend of CachedNode so they alone can access private fields. - assume the LayerAndroid picture can sometimes be null. If it is, use the main page's picture instead. http://b/2369549
* Add UI considerations to layersCary Clark2010-02-171-38/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove code which retrieves the action associated with a textfield.Leon Scroggins2010-02-091-32/+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.
* clip the cursor rings if occludedCary Clark2010-01-131-4/+6
| | | | | | | Also, if a smaller object, like text, is drawn over a occluding rectangle, ignore it, and don't reset the occluded state. fixes http://b/2319610
* Ensure that the current textfield is actually a textfield before treating it ↵Leon Scroggins2010-01-121-2/+2
| | | | | | like one. Fix for http://b/issue?id=2368868
* In findBestHitAt, set x and y to the intersection of slop and cursor.Leon Scroggins2010-01-061-1/+1
| | | | Fixes http://b/issue?id=2201866
* If the DOM changes textfield focus, make the IME work properly.Leon Scroggins2010-01-041-9/+12
| | | | | | | | | | | | | | 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.
* Show "Go" for the last textfield in a form.Leon Scroggins2009-12-081-3/+7
| | | | Fixes http://b/issue?id=2210152
* Provide <input> type information to Java side.Leon Scroggins2009-12-071-5/+0
| | | | | | | | | | | | | | | | | 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.
* Store InputType information for <input> fields, return SEARCH action for ↵Leon Scroggins2009-12-071-0/+6
| | | | | | | SEARCH <input> Fixes http://b/issue?id=2299660 and http://b/issue?id=2299650 Also remove isPassword, which is redundant.
* move input-related fields out of CachedNode to expandCary Clark2009-12-041-2/+2
| | | | | | | | | | | | | Some of the fields in CachedNode are relevant only to input fields and text areas. Move these into their own vector so that we can add more data without making all CacheNodes bigger. Remove CacheNode entries that are no longer used, or can be consolidated into the node type. Alphabetize some interfaces and implementations. Update the debugging output. part of http://b/2299660
* Fixes license headers for all files in WebKit/android, other than those in stl/.Steve Block2009-11-131-1/+1
| | | | | | | | | | | | | 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
* Fix a clicking bug.Leon Scroggins2009-10-281-10/+1
| | | | | | | | | | | Remove some code that simulates a mouse click at the beginning of a textarea and the end of a textfield. The original goal was to make the click change the selection to be at the beginning or end of the field, respectively. However, we actually make another call which prevents this click from the selection. Further, the selection actually gets changed elsewhere. Fixes http://b/issue?id=2219233
* pass the current cursor when computing the mouse positionCary Clark2009-10-281-2/+2
| | | | | | | | | Most of the time, the simulated mouse position can be computed from the current cursor. But when the cursor is changed, the current cursor info could be out of date and generate a bus error. fixes http://b/issue?id=2061211
* Whether or not a textfield is the last or only, make its action GO.Leon Scroggins2009-09-231-3/+2
| | | | | | Fix for http://b/issue?id=2136097 Change-Id: I8ca00498dd5a8d611bc0de5a941faaf596d9f76d
* fix parent index of focus when building nav cacheCary Clark2009-09-151-1/+1
| | | | | | | | | | | When a focused node is found while walking the DOM, the CachedFrame tree doesn't have its parent pointer set. Fix the focus index in the parent when fixing the parent pointer. Also fix a debug statement so that it doesn't depend on the focus parent. Fixes http://b/issue?id=2048186
* start in the proper subframe when finding the next text fieldCary Clark2009-09-031-1/+1
| | | | fixes http://b/issue?id=2048180
* when finding left edge of text block, don't merge in tall bitmapCary Clark2009-08-261-52/+61
| | | | | | | | | | Zooming in to yahoo.com fails sometimes if the block of text has a large bitmap on the left. This change prevents the bitmap from being seen as a part of the text paragraph. Also, cleaned up the debugging statements. Fixes http://b/issue?id=2066236
* rebuild the nav cache on mouse clicks during page loadCary Clark2009-07-311-16/+30
| | | | | | | | | | | | | | | While the page is loading, the nav cache is not rebuilt. Double-click zooms out the web page by using the nav cache to find the left edge of the column -- but fails to work during page load. This change rebuilds the nav cache (if the page is loading) each time a mouse click is sent to webkit. This doesn't fix the bug where the first double click doesn't align the column correctly, but helps with subsequent clicks. Also, pass scale information to getBlockLeftEdge so it can restrict its search to the area that will be zoomed to. Default to the point clicked if no alignment info can be found.
* Allow user to jump to the next textfield.Leon Scroggins2009-07-311-0/+26
| | | | | | | | In CachedFrame, add methods to find the next textfield and to determine which ImeAction should be associated with a given textfield. In WebView, uses these apis to determine the ImeAction and jump to the next textfield and scroll it on screen. Requires a change to frameworks/base.
* Find left edge of column using nav cache data.Cary Clark2009-07-281-0/+120
| | | | | The function is currently unused, but will be used by Grace's double-tap experiment.
* set trackball click to the edge of the text field, not the middleCary Clark2009-06-241-3/+16
| | | | | | | | Add clicking, key debug statements in WebViewCore.cpp. Fix dumping nav tree to use NamedNodeMap. Set click point to be start of text field, end of text area, middle of others. Make CachedRoot::getSimulatedMousePosition, callers const
* more (browser) trackball-is-a-mouse work in progressCary Clark2009-06-111-31/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WebViewCore.cpp: Add parameter to CachedRoot::findAt to suppress check for hidden nodes. This helps find a best match for newly built nav caches. Require that the new cursor node closely match the bounds of the prior cursor node. This may need tuning. CacheBuilder.cpp: Remove isInput flag on cached nodes (no longer used) CachedFrame.cpp: Add hideCursor to complement clearCursor. Hide prevents the cursor from drawing but does not move it. Clear removes it altogether so that the next movement starts from the viewPort edge. CachedHistory.cpp: Don't special case text fields when doing history navigation. This special casing in part allowed setting the focus to the homepage input, but since focus is no longer set by nav, it is not required. CachedNode.cpp: Add hideCursor; clean up debugging CachedRoot.cpp: Use navBounds from history instead of cursor bounds to determine next move. Clean up some obsolete code. WebView.cpp: Add hideCursor; call it when appropriate.
* in the browser, make the trackball more like a mouseCary Clark2009-06-011-124/+147
| | | | | | | | | | | | | | Older code treated the trackball as a four way dpad with equivalents to moving up, down, left and right by generating arrow key events. This change makes the trackball solely generate mousemove events. The old arrow keys in turn were mapped to be as close as possible to tab-key events that moved the focus. The new model leaves focus-changes to the DOM. Clicking the dpad is distinguished from pressing the enter key to be more compatible with desktop-authored web pages.
* skip rectangular focus ring check in browser if no pictureCary Clark2009-05-181-0/+2
|
* remove printf error in private browser nav cache debugCary Clark2009-05-141-1/+1
|
* use one rectangle for browser focus ringCary Clark2009-05-131-0/+49
| | | | | | | | | | | | Check to see if the potentially larger hit-test bounds can be used in place of the normal bounds, or if the normal bounds can be used in place of the individual text bounds. Construct a region out of the individual focus ring rectangles, then see if any text is drawn inside the bounds but outside of the focus ring. If not, use one rectangle instead of the rings.
* auto import from //depot/cupcake/@136594The Android Open Source Project2009-03-051-1/+2
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+1087
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-1087/+0
|
* auto import from //branches/cupcake/...@130745The Android Open Source Project2009-02-101-11/+21
|
* 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/+1068