summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav
Commit message (Collapse)AuthorAgeFilesLines
* Provide padding + border values for textfields.Leon Scroggins2010-10-124-7/+44
| | | | | | | | | | | | | | Bug:3085564 They are used by WebView.java to align the WebTextView's text positioning with the page below. This allows the selection and insertion arrow handlers to line up better with the actual selection on the page. Requires a change in frameworks/base: https://android-git.corp.google.com/g/#change,73565 Change-Id: Ia100286016a780abd5f30e32975f8ad566a6ed74
* Do not merge: fix array overwrite crasherCary Clark2010-09-302-5/+8
| | | | | | | | | | | | | | | | If two nodes have the same coordinates, one is deleted. If either has focus, the focus needs to be transfered to the other, and the focus index recomputed, so the index won't point to the wrong node. If the two nodes are at the end of the list, the index may point off the end of the array, subsequently crashing on access. This is a possible security issue. Change-Id: I1ca934074637fbf68e40318fbc354e28c6b474ba http://b/3043268
* Do not merge -- restrict text selection to the main layerCary Clark2010-09-151-0/+6
| | | | | | | | | Gmail causes layers to appear as a message is scrolled. This confuses the text selection logic. To workaround this in Gingerbread, text selection is only allowed to be drawn in the main layer. Change-Id: Idd814bcb5dfeef2fc12d6b0d586a63f711351d96 http://b/2998882
* DO NOT MERGE make the text selection easier to hitCary Clark2010-08-261-1/+4
| | | | | Change-Id: I47b7aa04ebc2a8f0bf2c6b4399ef65e5f4c58d4e http://b/2626451
* check for null pictures when selecting textCary Clark2010-08-241-0/+9
| | | | | | | | | | | | | | The LayerAndroid supplied to SelectText may have no picture associated with it. If that's the case, ignore it. This change was original uploaded as https://android-git.corp.google.com/g/#change,62627 in master, but then I realized it should go into gingerbread as well, and get merged into master automagically. http://b/2930142 Change-Id: If6332d81f1f9baba804131caae124dd18e0b0799
* DO NOT MERGE Refactor find and select dialogsCary Clark2010-08-204-220/+1430
| | | | | | | | | | | | | | | | | (Change imported by hand from master, based on https://android-git.corp.google.com/g/#change,53489 ) SelectText now permits incremental extension of the selection using either touch or trackball data. SelectText adds word selection and select all interfaces. SelectText has been rewritten to do a better job of finding space characters and selecting text outside of the visible window. Companion changes in frameworks/base and packages/apps/Browser Change-Id: I28a815375345d842f79464edbf0cb3a2019b7fe8 http://b/2626451
* Migrate to new keycode constants in keycodes.h.Jeff Brown2010-07-131-6/+6
| | | | Change-Id: I523d6fab2964cec4610424f6fd7bbe86d38b7306
* Fix the 'wobbling fixed elements' bug.Nicolas Roard2010-05-101-9/+19
| | | | | | | | Cherry-picked from master. This CL has a corresponding java counterpart (https://android-git.corp.google.com/g/#change,51150). Bug:2665696 Change-Id: I408a3e2f089a491c340e0f9eb8633870dae84997
* 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-225-34/+44
| | | | | | | | | | | 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-063-5/+9
| | | | | | | | | | 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
* Merge "Create a method to check to see if the focus has a following ↵Cary Clark2010-04-051-0/+10
|\ | | | | | | textfield." into froyo
| * Create a method to check to see if the focus has a following textfield.Leon Scroggins2010-03-311-0/+10
| | | | | | | | | | | | | | | | Fixes http://b/issue?id=2559070 Requires a change to frameworks/base. Change-Id: I450cb8ee109e9a1f38a7290032fb3ca948dcc71a
* | If there is no find location then return early in findNext.Ben Murdoch2010-03-311-1/+1
|/ | | | | | Fix b/2558960 Change-Id: I1cc723913ab1e3eccb21eb60ab2fe2a458eb420c
* don't track layer node twiceCary Clark2010-03-252-1/+12
| | | | | | | | If a cache node is both in a layer and contains a layer, don't add it the second time. Change-Id: I45cc302e234565bfbc87649ca503f515b1f487e8 http://b/2543736
* Merge "Renders fixed layers with the root canvas matrix. Fix some ↵Nicolas Roard2010-03-241-1/+12
|\ | | | | | | positioning issues."
| * Renders fixed layers with the root canvas matrix. Fix some positioning issues.Nicolas Roard2010-03-241-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug:2526966 Bug:1818168 The current rendering code exposes some issues with the fact that we have fixed layers in the layers hierarchy -- parents transformations are also applied to the fixed layers, which is not what we want (fixed layers should be applied on the original canvas, with the original transform -- e.g. toolbar present or not -- but no more). One previously discussed solution was to move the fixed layers to their own hierarchy; but doing so would mean to also redo all the z-index management that we already have in the current system. The simplest way is therefore to use the original matrix (the canvas' matrix) when we have a fixed layer. The way we do this is by inserting a new LayerAndroid before the LayerAndroid root, setting the matrix of that new root to be the canvas' matrix. The drawing is then unaffected, but we can ask skia to draw using the root's matrix. The second issue solved in the CL is some positioning troubles; layers may have different dimensions than their render view, and the previous code was considering that the views were always drawn at the origin in the layer. By removing the parents layers transforms, this is not the case anymore, and we therefore need to take the render view offset into account. Finally there is some additional debug code in LayerAndroid. Change-Id: Id353ad3dfd9808252643f0e4f0140dde67480719
* | Add on-demand plugin support.Patrick Scott2010-03-231-2/+1
|/ | | | | | | | | | | | | | | | The Settings object now has an on-demand flag for plugins (this was to avoid more edits to webkit code). If plugins are on-demand and a plugin is installed that can handle the content, insert a placeholder widget. If the user clicks on the placeholder, the plugin will be enabled. The widget currently does not clip the context correctly. It only clips based on the widget frame. This is due to a bug (already filed) where the scroll offset is producing bad clip rectangles. Requires a framework change. Bug: 2411524 Change-Id: If3931da8da2339a2385ae78b609c49fa069892ab
* get bounds of focused nodeCary Clark2010-03-181-0/+23
| | | | | | | companion fix in framework/base Change-Id: I7d9191ea9c95dafac7f7e91a70d02c7d055c6967 http://b/2521087
* read old focus before it's thrown awayCary Clark2010-03-151-4/+12
| | | | | Change-Id: Iab6a64aec5f146e8b0286d1249d353567b49ea49 http://b/2515977
* adjust cache layer position by offsetsCary Clark2010-03-122-5/+11
| | | | | | | | | | | | | | Nodes in layers need to know where they are relative to the layers so that the cursor rings are correctly positioned as the layer moves (in document coordinates). In addition to tracking the global offset to make the coordinates relative to any parent frames, the node is offset relative to the body. Sometimes layers have zero height or width; in this case, don't treat them as clips. Change-Id: Id2811c31a4a0674d316aadda210570ec93311013 http://b/2503096
* Merge "Outset the rectangle containing the match after checking the clip."Leon Scroggins2010-03-121-2/+6
|\
| * Outset the rectangle containing the match after checking the clip.Leon Scroggins2010-03-111-2/+6
| | | | | | | | | | | | | | | | | | | | When considering whether a match is contained by the current clip, do not outset it first. Check to see if it is contained by the clip, and then add the outset so the drawn rectangle is larger. Fix for http://b/issue?id=2507893 Change-Id: I900d92432d412396e8c5b9e9e341085656ed0a2f
* | 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
* Fix bug 'Children of fixed elements do not always remain fixed themselves'Nicolas Roard2010-03-091-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was twofold: - webkit didn't create composited layers of the children div unless they were intersecting with the fixed layer - the children divs layers are siblings, not children of the fixed layer The solution is to: 1/ mark layers as needed to be composited if their ancestor is a fixed element (in RenderLayerCompositor) 2/ as the GraphicsLayer/LayerAndroid hierarchy is based on the RenderLayer hierarchy (z-order..) and not the display hierarchy, we need to a way of updating the position of the contained layers when a fixed layer move. We do that by: - marking layers contained in a fixed layer as being linked to the fixed layer (GraphicsLayerAndroid::syncFixedDescendants), and set the offset between the layer and the fixed layer. - when pushing the layers tree to the UI side, we ensure that such layers are linked to their corresponding fixed layer (LayerAndroid::ensureFixedLayersForDescendants) - when we draw, we do a first pass to update the fixed layers position (LayerAndroid::updateFixedLayersPositions) then update the rest of the layers (LayerAndroid::updatePositions). The layers that are linked to the fixed layers will then update their position relative to it, using the original offset between the fixed layer and the layer. Bug:2470701 Change-Id: I512966df94de6a5f84aff335c5d09b3f027bc2c3
* build-fix for the no-layers configMike Reed2010-03-091-0/+4
| | | | Change-Id: I4994cb5dc61cb845db76060fbd7680f6f5f9ab88
* 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-083-50/+54
| | | | | | | | | | | | | | | | | | | | | 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
* fixes with find drawing in layersCary Clark2010-03-051-0/+5
| | | | | | | | | | | | | | | Clipping the match picture before drawing prevents layer pictures from drawing outside of their intended bounds. Rearranging the layer picture draw call causes it to restore the canvas matrix, which causes extras like finds and cursor rings to draw correctly. Also, added more layer debugging, and a function to show layer state in the console window. http://b/2488516 http://b/2488509
* stop parsing text for addresses if input element is foundCary Clark2010-03-031-1/+3
| | | | http://b/2420076
* refactor find state and scrollingCary Clark2010-03-032-18/+29
| | | | | | | | | | 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
* allow anchor containing layer to be mapped to navable layerCary Clark2010-03-023-13/+61
| | | | | | | | | | | | | | | | 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
* Merge "use advance widths to deduce spaces in selected text"Cary Clark2010-03-011-15/+41
|\
| * 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
* | Make nativeMoveCursorToNextTextInput return a value based on success.Leon Scroggins2010-03-013-14/+11
|/ | | | | | | | | 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-2413-384/+429
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* disable webkit layersCary Clark2010-02-211-0/+2
| | | | | With layers enabled, servicing timers saturate the CPU at times. This also fixes a compile-time switch in FindCanvas to disable layers.
* move viewport into just this subclassMike Reed2010-02-192-5/+9
|
* fix nav layer bugsCary Clark2010-02-193-9/+20
| | | | | | | 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
|
* check for layer containing final nodes in DOMCary Clark2010-02-181-1/+6
| | | | | | This fix prevents a crash in http://webkit.org/blog-files/leaves/ http://b/2369549
* Merge "minor fixes to layer nav"Cary Clark2010-02-187-29/+28
|\
| * minor fixes to layer navCary Clark2010-02-177-29/+28
| | | | | | | | | | | | | | | | | | | | | | - 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
* | 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-1716-443/+1167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-093-54/+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.