summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav
Commit message (Collapse)AuthorAgeFilesLines
* Enable navigation in scrollable layers.Patrick Scott2010-08-027-25/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-307-216/+0
| | | | This reverts commit 0ed6485271097ecf1b4cf4e790f9cfdbb57d921c.
* Add CSS cursor ring definitionsCary Clark2010-07-307-0/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Enable scrollable divs.Patrick Scott2010-07-221-0/+70
| | | | | | | | | | | | | | Force a composite layer when the style says the content is scrollable. Record the border and background in the main content picture. When the contents of the layer are bigger than the size, record the foreground contents in a separate picture which is clipped by the border and size. When updating the base layer, remember the scroll position of each layer and update the new layer with the same position. Bug: 1566791 Change-Id: If440e4f215db6bda9df32a781d754d1f5a238162
* select text out of orderCary Clark2010-07-211-117/+246
| | | | | | | | | | | | | | | | | | | | | | | | | | When the selected text visual order doesn't match the picture order, the text is selected spacially. The rectangle described by the start and end points limits what text is selected. This can fail when the rectangle described is too narrow to enclose all the lines between the top and bottom. This change extends the lines by including the text adjacent to the start and end when computing the limit bounds. And: - Refactor the code so that drawing the region and selecting the text can share this logic. - Add slashes as characters that prevent inserting spaces at the ends of lines. (ASCII characters space, dash, slash, and backslash cause lines to wrap.) - Narrow the error term for detecting spaces. The 1/2 value before inserted spaces incorrectly. Change-Id: I645f38dc246c61b1bc7c94e61553e5e6e36e3f85 http://b/2817635
* am b47b5d4a: am 652e9a01: Migrate to new keycode constants in keycodes.h.Jeff Brown2010-07-131-6/+6
|\ | | | | | | | | | | | | Merge commit 'b47b5d4ad21fc9f19fc8e6c0f453032658cad4cf' * commit 'b47b5d4ad21fc9f19fc8e6c0f453032658cad4cf': Migrate to new keycode constants in keycodes.h.
| * 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
* | Merge "handle out of order selections"Cary Clark2010-07-092-108/+298
|\ \
| * | handle out of order selectionsCary Clark2010-07-092-108/+298
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usually, the text on a webpage is drawn from top to bottom but sometimes it is drawn out of order. In these cases the picture finds the select end before it finds the select start. When the select start and end are ordered, all of the text in the picture between the two are selected. This allows selecting all of the text on the page, even if the start isn't spacially before the end. When the select start and end are flipped, select the text spacially between the two. The flipped page scenario was found by http://code.google.com/p/android/issues/detail?id=8533 Change-Id: Ia22d49396d68fefc3d64fad438c4b0c02f668c1c
* | | Combine base PictureSet with composite layers intoGrace Kloba2010-07-091-53/+110
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | one SkLayer tree. The BaseLayerAndroid is the root of the composite layers and it has the PictureSet as its base content. Before, WebViewCore uses m_contentMutex and both UI and WebCore threads access the m_content. Now we use the layer approach. When WebCore thread updates its content in recordContent, it creates a new BaseLayerAndroid and copy both PictureSet and composite layers into it. Then it is sent to be consumed by UI thread. Clean up sync layer in both ChromeClientAndroid and GraphicsLayerAndroid. splitContent can be a little tricky with this change. Now UI has its own copy of PictureSet. When it takes too long to draw, it will send a request to WebCore to split the PictureSet. When it is done, a copy of the new PictureSet will be sent back to UI. There is a matching change in framework/base
* | Merge "don't walk off the end of the DOM when looking for text"Cary Clark2010-07-021-3/+4
|\ \
| * | 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
* | | refine text selectionCary Clark2010-06-291-24/+26
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change 'select all' to begin with the first character and end with the last rather than relying on the top left and bottom right. The old algorithm failed for pages broken into multiple columns. Similarly, capture the text from the beginning selection to the ending selection, rather than relying on the characters contained by the selection region. Reduce the gap required to add a linebreak from twice the lineheight to 1.5x the lineheight. Change-Id: Ib90a719ea3353feeaa3a6cc692d0dd9cff498cb5 http://b/262451
* | Refactor find and select dialogsCary Clark2010-06-253-173/+937
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: I917a14124a41a3c9bd72ffa48fe36e55e7c4e543 http://b/2626451
* | 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
* | reverse RTL characters in copyCary Clark2010-05-212-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Text is copied from the picture in visual left-to-right order. Reverse right-to-left substrings before returning the result. This algorithm for reversal is also used by webkit to draw text, and has the same limitations. This fixes text pasted into the title bar, but does not work correctly for text pasted into an input field -- LTR text is placed incorrectly -- but that's another bug. Change-Id: I4709b74e32495d4b77d33910ac8da34d4a88edd0 http://b/2525085
* | suppress partial screen updates if a canvas element is visibleCary Clark2010-05-142-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-144-11/+39
| | | | | | | | | | | | | | | | | | 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
* | Merge webkit.org at r58033 : Update location of CString.hSteve Block2010-05-112-2/+2
| | | | | | | | | | | | See http://trac.webkit.org/changeset/56825 Change-Id: I8ba6a9685dcd1d8c4dec3400fba81e19fcbfe74d
* | Fix the 'wobbling fixed elements' bug.Nicolas Roard2010-05-101-9/+19
| | | | | | | | | | | | | | This CL has a corresponding java counterpart (https://android-git.corp.google.com/g/#change,51150). Bug:2665696 Change-Id: I397100ac1b7ea9e0ecf799902d9ba04fba970cce
* | Provide access to current match highlighted.Leon Scroggins2010-05-062-0/+15
| | | | | | | | | | | | | | | | Part of fix for issue 2663680 Requires a change to frameworks/base. Change-Id: I79e460867973cbfcb3105d46058de705877f0aa9
* | Enable contentEditable.Leon Scroggins2010-05-054-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Fix a return type bug which is complained by gcc-4.6. If compile this ↵Jing Yu2010-05-031-2/+1
|\ \ | | | | | | | | | function iwht gcc-4.6, gcc complains that "error: 'GlyphSet::GlyphSet' names the constructor, not the type"."
| * | Fix a return type bug which is complained by gcc-4.6.Jing Yu2010-05-021-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If compile this function iwht gcc-4.6, gcc complains that "error: 'GlyphSet::GlyphSet' names the constructor, not the type". Change-Id: I34f3a66dc33f8dca93e4c0db1d87236bf3efc6ae Tested: With the patch, gcc-4.4.0 is still working correctly. With the patch, gcc-4.6 works well too.
* | | Merge "Do not hide the cursor ring when clicking on a <select> element."Leon Scroggins2010-04-274-5/+13
|\ \ \
| * | | Do not hide the cursor ring when clicking on a <select> element.Leon Scroggins2010-04-274-5/+13
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "move CachedInput::init() to cpp"Cary Clark2010-04-272-4/+6
|\ \ \ | |/ / |/| |
| * | move CachedInput::init() to cppCary Clark2010-04-262-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation of init() calls bzero, which is defined in CachedPrefix.h. if CachedInput.h is included directly bzero may not be defined. It is always defined for CachedInput.cpp. http://b/2535696 enter the commit message for your changes. Lines starting Change-Id: I995498cd4bc611f0f1a45aadf27a1fd330e62410
* | | am 29189dc4: am 6ec27fea: am 5076efcd: don\'t hide transparent nodesCary Clark2010-04-221-1/+1
|\ \ \ | | |/ | |/|
| * | 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
* | | am 68b8e349: am 0f92e845: am 55ab51c0: Merge "nextTextField may walk off the ↵Cary Clark2010-04-225-34/+44
|\ \ \ | |/ / | | / | |/ |/| end or try invalid frames" into froyo
| * 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
* | Merge "add portable bzero interface"Cary Clark2010-04-071-0/+7
|\ \ | |/ |/|
| * add portable bzero interfaceCary Clark2010-03-301-0/+7
| | | | | | | | | | Change-Id: I513c7bb5278202447ae8a270b4f30d699fd4dda6 http://2535696
* | 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