summaryrefslogtreecommitdiff
path: root/src/dom.c
AgeCommit message (Collapse)Author
2016-03-30Startup webkit2 branch from the scratch.Daniel Carl
2015-08-23Adds support for contenteditable attribute as input mode triggerJiri Marsicek
fanglingsu/vimb#237
2015-08-02Do not blur the focused element after alt-tabbing.Benjamin Petrenko
2015-07-20give the focus to the text box after it's closed in an external editorBenjamin Petrenko
2015-07-20Removed function from public scope.Daniel Carl
The function dom_auto_insert_unless_strict_focus was only used internal and was really small, so the content was moved to the only placed where it was called. Also added a missed comment that might still be interesting.
2015-07-20respect the strict-focus variableBenjamin Petrenko
2015-04-27Allow to focus editable element in iframes (#201).Daniel Carl
This allows to use gi normal mode command to focus also editable element within iframes in case the current document contains no editable element.
2015-04-27Fixed regression of ignored strict focus in frames (#201).Daniel Carl
2015-04-26Check for dom focus/blur event on window object cleared (#201).Daniel Carl
This allows us to track also focus changes within frames and iframes also if they are loaded dynamically. The previous logic added the event listeners to the document on WEBKIT_LOAD_FINISHED, but if there where later created iframes in the dom, these where not observers for focus events. This is only a first attempt to fix the focus issue and does break the logic behind `set strict-focus=on`.
2015-04-26add HTML5 input type to dom_focus_inputSébastien Marie
Allow new HTML input type to be found by dom_focus_input as editable field. Reformat a little the xpath expression in order to have a lisible string. Close: #204
2015-04-22Fixed trailing whitespace.Daniel Carl
2015-04-22support html5 new input typesSébastien Marie
mark new input types as editable, according to the way of webkit handle these.
2015-04-20Set focus also on htm5 input type="search".Daniel Carl
Allow to focus input type search on running normal mode command 'gi'.
2015-04-20enable input-mode on input.search elementSébastien Marie
HTML5 define a new input type="search": http://www.w3.org/TR/html-markup/input.search.html declare this element to be editable, in order to switch in input-mode when use it.
2015-04-05Fixed regression against 112-editable-focus.html test (#197).Daniel Carl
2015-04-03Fixed not leaved input mode on form submit (#197).Daniel Carl
The previous logic of switching back to normal mode in webview_load_status_cb() does only work for google search or if the place where we switch back to normal mode is change for translate.google.com. But this would have never been working for both sites. This patch tries another approach and doe the switching back to normal mode also by observing dom events. In case the strict-focus is enabled the focus event callback blur the active element to keep vimb in it's current mode. If vimb is in input mode the focus is not removed from the element, which allows to to keep in input mode if this was started by user interaction like 'gi' normal mode command, hinting or click to editable element. There are two way's to obtain the input mode. 1. By user interaction: where vimb is set to input mode and after that the form element is focused, or where the input mode is set right after the dom event observer took their decision. 2. By the page: Only the focus/blur state of the editable active element changes and vimb pick this state changes up and follows this, or remove the focus in case of enabled strict-focus.
2015-04-02Use case insensitive xpath for focus input (#198).Daniel Carl
2015-02-21Merged code from mode.c into main.cDaniel Carl
2015-01-01Change year in license block.Daniel Carl
2014-12-11Don't clear focus if vimb is in input mode.Daniel Carl
If strict-focus is enabled and the user started typing into form field right before the page way fully loaded, the focus was cleared, so that vimb switched back to normal mode and executed the pressed keys as normal mode commands. No the focus is only cleared if strict-focus is enabled and vimb is not in input mode.
2014-12-05Don't switch from command to input mode if page says so.Daniel Carl
2014-11-30Fixed none working focus event observing (#112).Daniel Carl
Now the strict-focus=on prevents vimb only from switching to input mode if focus is on editable element on page load (for example set by a body onload script). Vimb follow all further focus events.
2014-11-10Don't switch to input mode on click to radio button.Daniel Carl
If a radio button was clicked vimb switched to input mode. Now the logic what element is editable is consistent within dom.c. Editable are textarea, and input elements without any type a and type text or password.
2014-08-01Don't switch from pass through mode to input mode (#95).Daniel Carl
Don't switch from pass through by click into input field nor by a reload of the page with a focused input field.
2014-01-11Change year in license block.Daniel Carl
2013-11-07Allow hinting ';e' and 'gi' also for input without type attribute.Daniel Carl
This enables to focus the search box of google, that has not type attribute.
2013-10-13Added strict-focus setting.Daniel Carl
This allows to ignore possible focused form fields on pages that forces vimb into input mode. If 'strict-focus' is on, vimb removes the focus from form fields event if the page say that say should be focussed,
2013-09-20Changed the way keys are processed.Daniel Carl
Until today vimb mapped two-part keybindings to commands. This patch changed this paradigm into a more vi like way. The commands are separated into normal mode commands that mainly consists of a single char and ex commands that can by typed into the inputbox like ':open'. This change allows us to adapt also the way keypresses and mapping are handled. Now every keypress is converted into a unsigned char and collected into a typeahead queue. The mappings are applied on the queue. So now we can use also long keymaps and run multiple commands for different modes with them like ':nmap abcdef :set scripts!<CR>:open search query<CR>50G'.
2013-08-06Renamed the insert mode to input mode.Daniel Carl
This reflects better what we are doing and we used both terms in the manual page which was confusing. So now the mode is called 'Input Mode'.
2013-08-06Focus only visible items with 'focus-input' (#47).Daniel Carl
2013-08-06Added command focus-input and new keybinding 'g-i'.Daniel Carl
The new command and keybinding are use to focus the first editable element on the page and to switch vimb into insert mode.
2013-07-29Include config.h in every c file and include it first.Daniel Carl
2013-05-20Fixed segfault on leaving the editor.Daniel Carl
2013-04-14Added command to open input boxes or text areas with editor (#15).Daniel Carl
2013-04-13Added new function to get active dom element.Daniel Carl
Change api of dom function to take the webview as parameter.
2013-04-09Fixed segmentation fault in finding active element.Daniel Carl
2013-04-07Changed TRUE to true in all files.Daniel Carl
2013-04-05Removed function prefixes of static functions.Daniel Carl
2013-03-30Use lower case boolean values.Daniel Carl
If they are lower case, vim can highlight them correct.
2013-03-30Fixed error message on leafing input mode.Daniel Carl
2013-03-29Moved variables to the top of function.Daniel Carl
2013-03-29Moved pointer * from type to the variables.Daniel Carl
2013-03-25Blur the active element if insert mode is left.Daniel Carl
If a editable form element was focussed, vimb browser switched to insert mode. But if the insert mode was left by hitting <esc> the element kept focused, so that key-presses went still into the focused element.
2013-03-22Revert to single instance per window.Daniel Carl
2013-03-18Changed function prefix from vp_ to vb_.Daniel Carl
2013-03-18Renamed the project from vimp to vimb.Daniel Carl
There is already a software calles vimp so I think it will be better to rename this little project.
2013-03-05Fixed some memory leaks in completion and dom handling.Daniel Carl
2013-03-05Use some logic together for all windows.Daniel Carl
2013-03-01Replaced hinting by javascript hinting.Daniel Carl
The previous approach to use the dom api to generate the hints was much slower than the javascript solution. I think the javascript way is also a little bit more flexible and easier to implement. But now we have to concern about data sharing between c-layer an the javascript.
2013-02-16Fixed wrong check if a fired hint is an input.Daniel Carl
We considered every html form input element as editable. This brakes the next submit element on duckduckgo's search result page. Now we exclude the input type submit, reset and image from the editable input elements.