summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav/CacheBuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* adjust cache layer position by offsetsCary Clark2010-03-121-4/+10
| | | | | | | | | | | | | | 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
* stop parsing text for addresses if input element is foundCary Clark2010-03-031-1/+3
| | | | http://b/2420076
* allow anchor containing layer to be mapped to navable layerCary Clark2010-03-021-8/+37
| | | | | | | | | | | | | | | | 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
* fix nav layer bugsCary Clark2010-02-191-4/+10
| | | | | | | 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
* 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
* minor fixes to layer navCary Clark2010-02-171-5/+5
| | | | | | | | | | | - 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-23/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* allow text node boundaries to delimit addressesCary Clark2010-01-251-1/+3
| | | | | | | | | The current boundary condition for a state without a trailing zip code is a couple of spaces or a non-alphanumeric character, like punctuation. Add allowing the end of the text node as a termination condition. Fixes http://b/2384326
* Bring up the IME after receiving a response from webkit.Leon Scroggins2010-01-111-2/+0
| | | | | | Fix for http://b/issue?id=2361658 Requires a change to frameworks/base.
* Request <label> info only when accessing a textfield.Leon Scroggins2010-01-071-22/+0
| | | | | | | Previously, we were storing the label info each time we build the navigation cache. Requires a change to frameworks/base.
* Store label information to be used for hint text.Leon Scroggins2010-01-061-1/+23
| | | | | | Fix for http://b/issue?id=2331526 Requires a change to frameworks/base.
* check to see if nav cache is up to date on tapCary Clark2009-12-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Show "Go" for the last textfield in a form.Leon Scroggins2009-12-081-0/+2
| | | | Fixes http://b/issue?id=2210152
* exclude from cache nodes that are entirely clipped outCary Clark2009-12-081-6/+3
| | | | | | | Google's real time search has many results outside of an overflow div that should be ignored by the nav cache. Make it so. fixes http://b/2298478
* Provide <input> type information to Java side.Leon Scroggins2009-12-071-0/+1
| | | | | | | | | | | | | | | | | 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-3/+7
| | | | | | | 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-52/+42
| | | | | | | | | | | | | 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
* skip nodes when building nav cache if parents are clipped outCary Clark2009-12-021-4/+8
| | | | | | | | This is a fairly conservative fix, since it actually checks to see if a parent element is clipped out, rather than the bounds of the element itself. fixes http://b/2291936
* navigate preferably between children of the same parentCary Clark2009-11-301-6/+11
| | | | | | | | | | | | The nav cache attempts to take advantage of the order that the dom is walked to know when multiple nodes have the same parent. The old implementation doesn't always work, and a simpler non-cached version makes more sense. The algorithm now walks nodes until the parent has more than one child, and assigns that parent as the 'parent group'. On the other end, nodes with no parent group are never allowed to get preferential matching treatment.
* fix bugs in nav cache dumpCary Clark2009-11-301-4/+10
| | | | | | | Fix errors in empty frames, escape character sequences, and characters outside the ascii range. These fixes are specific to dumping the nav cache and are commented out in all builds.
* 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
* Store the Node's text rather than the renderer's text.Leon Scroggins2009-11-061-2/+4
| | | | | | | | The renderer may be displaying a placeholder (attribute on HTMLInputElement and HTMLTextAreaElement), which will be deleted when the field gains focus, so take the text directly from the node instead. Fixes http://b/issue?id=2163427
* fix multiple text areas, and text areas without focus ringsCary Clark2009-10-211-8/+5
| | | | | | | | | | | Separate nodes that are hidden from nodes that disable drawing the focus ring. If a node draws its own focus state, other than not drawing the ring, it should be indistinguishable from other focusable nodes. Fix the nav cache dump to be in line with the latest webkit. fixes http://b/issue?id=2201049
* Merge webkit.org at R49305 : Update rendering to use new overflow methods.Steve Block2009-10-201-1/+1
| | | | | | See http://trac.webkit.org/changeset?new=47440 Change-Id: I140b6be130c1fb175c653f5ba2ba19fdc323bbc9
* Merge webkit.org at R49305 : Update CacheBuilder to use new event listener ↵Steve Block2009-10-201-8/+3
| | | | | | | | methods. See http://trac.webkit.org/changeset/48701 Change-Id: I627b40265f2aff72fdd4ad5884596be9820b642d
* Merge webkit.org at R49305 : Text::string renamed to dataImpl.Steve Block2009-10-201-5/+5
| | | | | | See http://trac.webkit.org/changeset/47313 Change-Id: Ic33083eedfc8468c171cd7af6f112aca0eeef615
* Merge webkit.org at R49305 : Update String::copy call sites to use new copy ↵Steve Block2009-10-201-3/+5
| | | | | | | | method. See http://trac.webkit.org/changeset/49160 Change-Id: I75e1d6701f4d16fab7513f5924abf00e958e865c
* Do not bring up the soft keyboard for readonly input fields.Leon Scroggins2009-10-151-3/+9
| | | | | | | Partial fix for http://b/issue?id=2159869. Add a field to CachedNode for readonly. In WebView.cpp, only call displaySoftKeyboard if the node is not readonly. Also call displaySoftKeyboard in nativeTextMotionUp to replace a call being removed in WebView.touchUpOnTextField(java).
* File upload.Leon Scroggins2009-10-091-2/+1
| | | | | | | | Webkit implementation for passing in the data for file uploads. Requires a change to frameworks/base to not break things; also requires a change to packages/apps/Browser to work. Fixes http://b/issue?id=675743
* address detection may look at uninitialized memoryCary Clark2009-10-061-19/+8
| | | | | | | | | Address detection on web pages creates arrays of pointers to words, and compares them against a set of permitted street types. This change adds the array of end pointers so that the check does not look past the end of the word. Fixes http://b/issue?id=2166591
* Fix a few crashes with assertions enabled.Patrick Scott2009-09-291-1/+1
| | | | | KURL::protocolIs no longer likes "javascript" and has a different method called protocolIsJavaScript.
* fix address detection when the city and state are both valid statesCary Clark2009-08-251-4/+25
| | | | | | | | | | | | | | | This fixes detecting "4 E. 86th St New York, NY" The old logic found 'New York' and assumed that St was the city name. Since 86th is not a valid street suffix, the test failed. The new logic looks for a valid street suffix instead of skipping 'city'. If it finds one, and the subsequent street suffix test fails, it resets to search again for a valid state name while retaining the starting point for the address (the street number). Fixing this exposed a bug in the zip code detection code where it dropped the first character of the actual state name.
* am b116c1a0: Make deep copy of the String when use them in the UI thread as ↵Grace Kloba2009-07-061-2/+2
|\ | | | | | | | | | | | | | | | | AtomicString is not thread safe. Merge commit 'b116c1a08412db8a748998c7e8a2ce851cbacacd' * commit 'b116c1a08412db8a748998c7e8a2ce851cbacacd': Make deep copy of the String when use them in the UI thread as AtomicString is not thread safe.
| * Make deep copy of the String when use them in the UI thread as AtomicString ↵Grace Kloba2009-07-061-3/+3
| | | | | | | | is not thread safe.
* | Don't clip out nodes if the clip is an empty rectangleCary Clark2009-06-291-1/+1
| | | | | | | | http://b/issue?id=1945476
* | set trackball click to the edge of the text field, not the middleCary Clark2009-06-241-1/+1
| | | | | | | | | | | | | | | | 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
* | add WebView.FindAddress option to ignore case sensitivityCary Clark2009-06-171-1/+5
| | | | | | | | | | | | | | | | New public interface is set @hide for now. Old interface uses the new one. Requires a companion change to frameworks/base http://b/issue?id=1649036
* | fix webkit hidden cursor, address crashCary Clark2009-06-161-1/+1
| | | | | | | | | | | | | | | | http://b/issue?id=1918891 set cursor node hidden to 'true' to hide it also fixing crash if detecting text address runs out of text to look at
* | more (browser) trackball-is-a-mouse work in progressCary Clark2009-06-111-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | use absolute bounds, not node bounds, for all webkit nodesCary Clark2009-06-041-24/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several years ago, the absolute bounds reported by webkit for nodes other than anchors were sometimes wildly different than the node bounds. Nowadays, the absolute bounds are used by iPhone to show hot spots and are more accurate. When nodes are added on the fly, their node bounds may be uncomputed, so the added nodes may not show up in the nav cache. Using the absolute bounds instead makes these nodes visible. Also, removed a special case for Bank of America, tied to the node bounds (not absolute bounds) since it is no longer applicable. Remove unused local min focusable width and height.
* | remove unneeded text parameters from WebViewCary Clark2009-06-031-1/+3
| | | | | | | | | | | | | | | | | | Add convenience routines to consolidate cache builder and current focus fetches into one place. Remove unused functions. Use wantsKeyEvents attribute where applicable.
* | in the browser, make the trackball more like a mouseCary Clark2009-06-011-43/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Fix some unexpected cases of image maps.Leon Scroggins2009-04-231-83/+29
| | | | | | | | Fix for buganizer issue 1800613: Image map not accessible. We were attempting to cache associtations of <area> elements to their RenderImages so we would not have to search for them. However, we were storing them in CacheBuilder. When we search for them, we search in the <area> element's frame, even though when we built the cache, we stored it in the main frame. Another issue arose on a page where <area> elements show up before their RenderImages. In this case, we were storing an empty rectangle for the bounds, and caching the associations afterwards, when it was too late. In order to clean up/simplify things, while fixing both bugs, I have changed validNode into a static function which takes the starting Frame as a parameter. Any time we need to find the rectangle of an <area> element, we have to traverse the DOM to find its associated RenderImage. This may be slower, but it will always get the correct answer. In the future, we may need to investigate a universal location for caching the associations for better performance.
* | remove obsolete browser nav cache debug dumpCary Clark2009-04-201-61/+0
| | | | | | | | | | | | The render tree has changed and the old dump logic no longer compiles. This output isn't used anymore, so remove it.
* | AI 145877: Fix the sim-debug build due to the changes in the new WebKit.Grace Kloba2009-04-131-3/+5
| | | | | | | | Automated import of CL 145877
* | AI 145796: Land the WebKit merge @r42026.Feng Qian2009-04-101-59/+88
| | | | | | | | Automated import of CL 145796
* | Automated import from //branches/master/...@142932,142932Patrick Scott2009-03-261-1/+1
|/
* auto import from //depot/cupcake/@136594The Android Open Source Project2009-03-051-64/+25
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+3076
|