summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav/CacheBuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
* compute cursor rings when layers are transparentCary Clark2010-10-181-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Google search suggestions are drawn in a popup menu (a div with a small amount of transparency). This can partially or complete obscure links underneath the popup, and can present touchable targets which may be much larger than the text contained by the link. CachedRoot::checkRings() determines if a larger bounding box can be used for the ring around the link. CachedRoot::maskIfHidden() determines if the ring needs to be cut down in size because it is only partially visible, or fully obscured. Both routines share the implementation that gathers information about the link, which uses RingCanvas to parse the picture, and RingCheck to build layers describing the text and rectangles drawn in the area around the ring. The basic strategy is to find the text contained by the link under consideration, and see if subsequent drawing obscures the text, or if other text would be enclosed by enlarging the ring. Since maskIfHidden() works better now than before, this CL enabled checking for hidden links when recomputing the current selection after the picture updates. It also checks to see if the link can be larger when maskIfHidden() determines that it is unclipped. Also, if a tap is inside the larger ring, but not on the text itself, treat that as a valid hit. (In CachedFrame::findBestHitAt) And, this fixes CacheBuilder debugging code, and the CacheBuilder array crasher described by bug: 3043268 bug: 2661613 Change-Id: I751f6539f6c840889a58de8c4611364442b3e37c
* resolved conflicts for merge of 1457b739 to masterKenny Root2010-10-141-0/+4
|\ | | | | | | Change-Id: I5e5460ec4afde9a229c3f73255f4d40322eb7166
| * Provide padding + border values for textfields.Leon Scroggins2010-10-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-301-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | check for columns before looking at column dataCary Clark2010-10-111-2/+4
| | | | | | | | | | | | | | | | Also, fix some debug info to sync up with latest webkit. Change-Id: Iea8f019619b701fc2d3267228b9412379334b66e http://b/3074179
* | Merge WebKit at r67908: ColumnInfo no longer provides columnRectAt()Steve Block2010-09-291-3/+3
| | | | | | | | | | | | See http://trac.webkit.org/changeset/67660 Change-Id: Ia3c17881d27919b20d62a47218cdb95293736b2e
* | Merge WebKit at r67908: HTMLInputElement::InputType renamedSteve Block2010-09-291-1/+1
| | | | | | | | | | | | | | | | InputType renamed to DeprecatedInputType See http://trac.webkit.org/changeset/67903 Change-Id: I9efb9889588523dd2b9489809fb2c44bd799d2ba
* | Merge WebKit at r67178 : Fix CacheBuilder.Iain Merrick2010-09-161-7/+8
| | | | | | | | | | | | | | The internal representation of column rects was changed in http://trac.webkit.org/changeset/66903 Change-Id: I774c9fc487c0c88f7dec60e90f4096ba3cf657a7
* | clip img elements the same as textCary Clark2010-09-131-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The nav cache builds the cursor ring by collecting the bounds of the text and images contained by the clickable node. The clip described by the parent node is available when the bounds are collected. The current code clips the text. Generalize this to clip the images also. Also, print whether the node is transparent in the node dumper. Change-Id: I44d6cbacb95211f191cf11b6abd5273e0712930f http://b/2463829
* | Add CSS cursor ring definitionsCary Clark2010-08-181-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows web pages to have fine-grain control over the appearance of the rings drawn around nodes. Generated links (email, addresses, phone numbers) are no longer given unique colors. To preserve this feature, a separate change could add an HTML extension similar to vlink to provide the cursor ring defintions for theses links. The mechanism implemented below isn't appropriate since these links don't necessarily correspond to single DOM nodes or other DOM elements. ------------ CSS examples ------------ The CSS to specify the ring looks like: -webkit-ring-fill-color:rgba(0,0,255,0.4); -webkit-ring-inner-width:2 px; -webkit-ring-outer-width:3.5 px; -webkit-ring-outset: 8 px; -webkit-ring-pressed-inner-color:rgba(0,0,255,0.8); -webkit-ring-pressed-outer-color:rgba(0,0,127,0.3); -webkit-ring-radius: 10 px; -webkit-ring-selected-inner-color:rgba(63,63,255,0.8); -webkit-ring-selected-outer-color:rgba(63,63,127,0.3); and may be alternately defined with a property shortcut: -webkit-ring:rgba(255,0,0,0.4) 5px 7px rgba(255,0,0,0.8) rgba(127,0,0,0.3) 20px rgba(255,63,63,0.8) rgba(127,63,63,0.3); -------------------- Property definitions -------------------- A vertical cross-section of the ring corresponds to these parameters as shown: ______ R / ___O_ R = corner radius / / __I_ o I = inner ring / / / _O_ ^ O = outer ring | | | / F | F = fill |O|I|O| L o = outset | | | \_F_ | L = original link \ \ \__O_ V \ \___I_ o R \____O_ The fill color specifies what to draw inside the ring when the link is followed. The fill area consists of the original link area plus the outset. The inner and outer widths specify the stoke width of the inner and outer rings, respectively. The widths may be specified in fractional pixels. The implementation captures 4 bits of the fraction. The outset specifies the distance from the edge of the original link to the rings' center. Both rings are drawn at the same center location. The radius specifies the curvature of the corners at the center of the rings. ------------- Data lifetime ------------- The selected colors specify the colors of the inner and outer rings when the trackball or D-pad hovers over the link. The pressed colors specify the colors of the rings when the trackball center is pressed or the link is tapped. The CSS data is recorded in the RenderStyle when the DOM is parsed. The widths are scaled up by 16 to preserve the fraction. When the nav cache is built, the CSS style information is recorded in the CachedColor class. Only unique style sets are recorded; many CachedNode instances can share the same CachedColor instance. When the cursor ring is drawn, the CachedColor is retrieved by getting the index from the CachedNode, and looking up the entry in the CachedFrame. The widths are scaled down by 16 since Lengths are stored by the webkit as integers. ---------- File Edits ---------- WebCore/Android.derived.mk - Build the CSS data property tables by concatentating Android specific data and optionally SVG data. WebCore/config.h - Add switch for these rings. This switch is meant as a convenience for finding the code in WebKit that was added to enable this feature. Since the old code in DrawCursor has been removed, it does not revert to the old behavior if the switch is turned off. WebCore/css/AndroidCSSPropertyNames.in - The new ring properties, plus an old one we added before. WebCore/css/CSSComputedStyleDeclaration.cpp WebCore/css/CSSMutableStyleDeclaration.cpp WebCore/css/CSSParser.cpp WebCore/css/CSSStyleSelector.cpp - I can guess what these functions are for as well as anyone, but I really don't know. Do I need all of them? Do I need to modify Mutable at all? WebCore/css/CSSPropertyNames.in - Moved Android addition to AndroidCSSPropertyNames.in WebCore/platform/graphics/Color.h - Added initial color values here. WebCore/platform/graphics/android/android_graphics.* - This draws the cursor ring. The code that draws 'synthetic' links has been discarded. WebCore/rendering/style/RenderStyle.h - Functions to get, set, and initialize the style data. WebCore/rendering/style/StyleRareInheritedData.* - The storage for the style data and an equivalence function. WebKit/Android.mk - Added CachedColor to the build. WebKit/android/nav/CacheBuilder.cpp - Record the color from the DOM into the cache. WebKit/android/nav/CachedColor.* - Store the cached color info. WebKit/android/nav/CachedFrame.* - Where the array of colors is stored. WebKit/android/nav/CachedNode.* - Where the index to the colors is stored. Change-Id: Ia3a931f41d6545e47678e245aafe7c84d4658f94 http://b/2603197
* | Update navigation in scrollable layers.Patrick Scott2010-08-161-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the foreground clip after drawing. Use the absolute bounds to compute the local foreground clip in order to compensate for any outline. Consolidate the check for overflow scrolling into RenderLayer. Request a compositing update after computing the scroll dimensions. Only change the foregroundRect of the layer during paint so that the outline rect (and background/layerBounds) are correct. Draw the outline as part of the background phase. During painting of a layer, scroll to (0,0), paint, then scroll back. When clicking on an element in a layer, scroll to the position of the element but do not scroll back. This makes text input fields visible to the tree and will properly update when typing. Record the original scroll position of layers in order to offset the bounds of nodes when checking the nav cache. Make sure to reset all cached layers during setRootLayer. Otherwise we were reaching into layers from the wrong thread. Change-Id: Id9827ec461989b0869a8252d4d2563ecd12c5fac
* | Merge WebKit at r65072: String class has moved to the WTF namespace.Ben Murdoch2010-08-131-2/+2
| | | | | | | | | | | | See http://trac.webkit.org/changeset/65021 Change-Id: I779a8ec0c3e1e0aed8f8d1894cfc1e5ca33ee549
* | Enable navigation in scrollable layers.Patrick Scott2010-08-021-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EventHandler: * Added IgnoreClipping in order to touch nodes that are clipped out. android_graphics: * Remember the absolute bounds of the node for invals. RenderBox: * Fix a compiler warning. RenderLayer: * Do not record the entire layer contents unless the scroll dimensions are larger than the client dimensions. * Change isSelfPaintingLayer to check for an overflow clip instead of the scrollable dimensions since it can be too early to check at this point. RenderLayerCompositor: * Same as RenderLayer for checking the overflow clip. WebViewCore: * Scroll the containing layer to the node bounds and offset the mouse position if scrolled. Once the mouse event is processed, restore the layer to 0,0. CacheBuilder: * The body position is no longer used. * Do not clip out nodes if the layer is scrollable. CachedFrame: * Add unadjustBounds to restore adjusted bounds to their original position (fixed position elements). * Call unadjustBounds when a node has been found. This new set of bounds is passed over to WebViewCore to handle clicks. * Reject empty node bounds. CachedLayer: * Document adjustBounds and add unadjustBounds. Add in the scroll position to the node bounds. CachedRoot: * Unadjust the mouse bounds. WebView: * Unadjust the mouse bounds and use the absolute bounds of the ring during inval. Bug: 1566791 Change-Id: Ia55f2cbb61869087176d3ff61882e40324614c6a
* | Revert "Add CSS cursor ring definitions"Cary Clark2010-07-301-55/+0
| | | | | | | | This reverts commit 0ed6485271097ecf1b4cf4e790f9cfdbb57d921c.
* | Add CSS cursor ring definitionsCary Clark2010-07-301-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows web pages to have fine-grain control over the appearance of the rings drawn around nodes. Generated links (email, addresses, phone numbers) are no longer given unique colors. To preserve this feature, a separate change could add an HTML extension similar to vlink to provide the cursor ring defintions for theses links. The mechanism implemented below isn't appropriate since these links don't necessarily correspond to single DOM nodes or other DOM elements. ------------ CSS examples ------------ The CSS to specify the ring looks like: -webkit-ring-fill-color:rgba(0,0,255,0.4); -webkit-ring-inner-width:2 px; -webkit-ring-outer-width:3.5 px; -webkit-ring-outset: 8 px; -webkit-ring-pressed-inner-color:rgba(0,0,255,0.8); -webkit-ring-pressed-outer-color:rgba(0,0,127,0.3); -webkit-ring-radius: 10 px; -webkit-ring-selected-inner-color:rgba(63,63,255,0.8); -webkit-ring-selected-outer-color:rgba(63,63,127,0.3); and may be alternately defined with a property shortcut: -webkit-ring:rgba(255,0,0,0.4) 5px 7px rgba(255,0,0,0.8) rgba(127,0,0,0.3) 20px rgba(255,63,63,0.8) rgba(127,63,63,0.3); -------------------- Property definitions -------------------- A vertical cross-section of the ring corresponds to these parameters as shown: ______ R / ___O_ R = corner radius / / __I_ o I = inner ring / / / _O_ ^ O = outer ring | | | / F | F = fill |O|I|O| L o = outset | | | \_F_ | L = original link \ \ \__O_ V \ \___I_ o R \____O_ The fill color specifies what to draw inside the ring when the link is followed. The fill area consists of the original link area the outset. The inner and outer widths specify the stoke width of the inner and outer rings, respectively. The widths may be specified in fractional pixels. The implementation captures 4 bits of the fraction. The outset specifies the distance from the edge of the original link to the rings' center. Both rings are drawn at the same center location. The radius specifies the curvature of the corners at the center of the rings. ------------- Data lifetime ------------- The selected colors specify the colors of the inner and outer rings when the trackball or D-pad hovers over the link. The pressed colors specify the colors of the rings when the trackball center is pressed or the link is tapped. The CSS data is recorded in the RenderStyle when the DOM is parsed. The widths are scaled up by 16 to preserve the fraction. When the nav cache is built, the CSS style information is recorded in the CachedColor class. Only unique style sets are recorded; many CachedNode instances can share the same CachedColor instance. When the cursor ring is drawn, the CachedColor is retrieved by getting the index from the CachedNode, and looking up the entry in the CachedFrame. The widths are scaled down by 16 since Lengths are stored by the webkit as integers. ---------- File Edits ---------- WebCore/Android.derived.mk - Build the CSS data property tables by concatentating Android specific data and optionally SVG data. WebCore/config.h - Add switch for these rings. This switch is meant as a convenience for finding the code in WebKit that was added to enable this feature. Since the old code in DrawCursor has been removed, it does not revert to the old behavior if the switch is turned off. WebCore/css/AndroidCSSPropertyNames.in - The new ring properties, plus an old one we added before. WebCore/css/CSSComputedStyleDeclaration.cpp WebCore/css/CSSMutableStyleDeclaration.cpp WebCore/css/CSSParser.cpp WebCore/css/CSSStyleSelector.cpp - I can guess what these functions are for as well as anyone, but I really don't know. Do I need all of them? Do I need to modify Mutable at all? WebCore/css/CSSPropertyNames.in - Moved Android addition to AndroidCSSPropertyNames.in WebCore/platform/graphics/Color.h - Added initial color values here. WebCore/platform/graphics/android/android_graphics.* - This draws the cursor ring. The code that draws 'synthetic' links has been discarded. WebCore/rendering/style/RenderStyle.h - Functions to get, set, and initialize the style data. WebCore/rendering/style/StyleRareInheritedData.* - The storage for the style data and an equivalence function. WebKit/Android.mk - Added CachedColor to the build. WebKit/android/nav/CacheBuilder.cpp - Record the color from the DOM into the cache. WebKit/android/nav/CachedColor.* - Store the cached color info. WebKit/android/nav/CachedFrame.* - Where the array of colors is stored. WebKit/android/nav/CachedNode.* - Where the index to the colors is stored. Change-Id: Ia3a931f41d6545e47678e245aafe7c84d4658f94 http://b/2603197
* | Merge Webkit at r63859 : PluginWidget class has been renamed and moved to ↵Ben Murdoch2010-07-271-1/+1
| | | | | | | | | | | | WebKit. See http://trac.webkit.org/changeset/63638 Change-Id: I97784c98b694f28804421637716afa649aa09a6e
* | don't walk off the end of the DOM when looking for textCary Clark2010-07-021-3/+4
| | | | | | | | | | | | | | | | Also, fix a couple of minor changes in debugging code to stay sync'd with webkit. Change-Id: If4263bab97715e2a2d12f06f2359554740bf5dbc http://b/2816549
* | Merge WebKit at r60074: Remove ANDROID_EXPOSE_COLUMN_GAP as ↵Steve Block2010-05-271-2/+0
| | | | | | | | | | | | | | | | RenderBlock::columnGap() is now public See http://trac.webkit.org/changeset/59784 Change-Id: I06ab20401e79c8b9c8104bb6a81c5891ef36d717
* | Merge WebKit at r60074: RenderStyle color accessors are now privateSteve Block2010-05-271-1/+1
| | | | | | | | | | | | See http://trac.webkit.org/changeset/59956 Change-Id: If1839f65ad960250c7dda5b565bd47278aa7df14
* | suppress partial screen updates if a canvas element is visibleCary Clark2010-05-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A PictureSet contains a list of pictures. Each picture draws part of the screen. If the picture contains a Canvas element, the corresponding bitmap is not shared. Small partial invalidates can create a dozen or so pictures, each of which may be quite small, a few hundred bytes. But the bitmap referenced by the picture may be large, several meg. The backing bitmap is unique to the Canvas element. Since a canvas rarely benefits from small updates, disable the partial invalidates if CacheBuilder detects a canvas. Change-Id: I5761667db3d037d7363dcb01f8a26f7f62e2eabc http://b/2678787
* | clean up nav cache debuggingCary Clark2010-05-141-9/+35
| | | | | | | | | | | | | | | | | | This adds additional content to the nav cache dump, and cleans up a few formatting problems. This has no effect on code that does not have nav cache debugging enabled. Change-Id: Ice2c4bb33138a8ddc96739d95ead58fbe328bfa8
* | Enable contentEditable.Leon Scroggins2010-05-051-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WebViewCore.cpp: Open the keyboard when a contentEditable element is put into focus by a click. In key(), return whether the selection changed if a contentEditable element is in focus. CacheBuilder.cpp: Add root contentEditable elements to the navigation tree. CachedNode.h: Include contentEditable elements as elements that want key events. CachedNodeType.h Add a type for contentEditable. WebView.cpp: Do not call setFollowedLink for contentEditable, so that the orange selection ring stays around the field. Add a check to determine whether the page should handle shift and arrow keys. Bug 1788820 Caveats: Does not ensure that the caret remains on screen. Frame::revealSelection is called, but we ignore it for other reasons. Need to investigate that. The cursor will blink if the contentEditable node has focus, even if the user has not clicked on it or has moved to a different input field. Further, while in this state, the user can input text. Requires a change to frameworks/base Change-Id: Ife39254f46dcc1046a075eee2fda6cf4879b4ee8
* | Do not hide the cursor ring when clicking on a <select> element.Leon Scroggins2010-04-271-0/+2
|/ | | | | | | | | | Add a CachedNodeType for <select> elements. If the cursor node is a <select> element, do not call setFollowedLink, which would hide the cursor ring. Bug 1694023 Change-Id: I2df2e70391b5f5969683b71b1e69bc24cba8946f
* don't track layer node twiceCary Clark2010-03-251-1/+8
| | | | | | | | 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
* 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