aboutsummaryrefslogtreecommitdiff
path: root/src/form.cc
AgeCommit message (Collapse)Author
2025-08-30Don't show form inputs with display:noneRodrigo Arias Mallo
When the current element or a parent has display:none, the display_none flag is set and no new element should be added to the viewport. For form inputs, instead of always adding the Embed to the viewport, we only do it if display_none is not set. The Embed is still registered as an input in the form, so it will continue to send the proper form values to the server. For complex buttons that can contain nested elements inside, we switch to a dummy button that doesn't have a Textbox and rely on the logic at html.cc to avoid creating more child elements until the display_none is unset. Fixes: https://github.com/dillo-browser/dillo/issues/433
2025-08-30Use uppercase Submit by default in buttonsRodrigo Arias Mallo
2024-09-10Generate boundary by choosing a random characterRodrigo Arias Mallo
Instead of rejecting random characters that are not in the boundary character set, draw a random index and select the character at that position. The probability distribution is not perfectly uniform with this method, but reduces the number of calls to rand() by 4 times on average.
2024-09-02Restrict boundary to alphanum charactersRodrigo Arias Mallo
Makes it less likely that server implementations may break due to unexpected boundary characters. It also allows us to avoid quotes around the boundary.
2024-09-02Avoid searching for boundary in file contentXavier Del Campo Romero
Making the boundary string very unlikely to collide with the file to upload allows Dillo to assume it would never be found and avoids the expensive memmem() check. Even if major implementations tend to add several '-' characters to multipart/form-data boundaries, this is not enforced by RFC 2046, so it can be increase to 70 random characters. See: https://lists.mailman3.com/hyperkitty/list/dillo-dev@mailman3.com/thread/VUB5PIOPJZ2VTCVGQPBZMGOYEISTXCFX/
2024-08-07Use dStrdup instead of strdupRodrigo Arias Mallo
The strdup function is not available in POSIX-2001, so we use our own implementation in dlib: dStrdup. Reviewed-by: dogma
2024-08-07Fix pedantic warningsRodrigo Arias Mallo
Reviewed-by: dogma
2024-03-09Use Doxygen comments for C filesRodrigo Arias Mallo
2016-06-18Fix <button> size (treat as inline).Sebastian Geerken
2016-04-18Set fallback value for textarea rows to 3.Sebastian Geerken
2015-07-03pop up dialog when an HTTPS page's form submission is insecurecorvid
2015-02-02TEXTAREA placeholder attributecorvid
2015-01-23TEXTAREA, html5 wants default for rows to be 2.corvid
We already have it that way for rows < 1, but not for when rows was not specified.
2015-01-22INPUT placeholder attributecorvid
2014-08-04bring some consistency to the bug messages.corvid
I generally tried to: - start with a capital letter. - end with a period. - put elements inside <>. - bring element names close to the beginning of the message.
2014-08-04bug messages: '\n' as separator instead of terminatorcorvid
Now no extra line at the bottom of the bugs, plus shorter strings.
2014-08-02<button>'s are now inline.Sebastian Geerken
2014-02-15input image shouldn't recognize hspace,vspace,border attrscorvid
2013-11-29Use img_rndr instead of img_rnd to avoid associating "rnd" suffex with random.Jorge Arellano Cid
2013-11-18Merge with main repo.Sebastian Geerken
2013-10-28Handle properly when Html_get_current_input() returns NULLJorge Arellano Cid
May happen with ill formed HTML.
2013-10-14Merge with main repo.Sebastian Geerken
2013-09-20Refactoring: some useful shortcuts in DilloHtml.Sebastian Geerken
2013-09-10html5, action not required for FORMcorvid
2013-09-10Some refactoring: the image decoding code now only accesses ↵Sebastian Geerken
dw::core::ImgRenderer, not dw::Image (which now implements the former) anymore.
2013-09-06html5, cols/rows not required for TEXTAREAcorvid
2013-09-05rm optgroup MSGcorvid
2013-09-05html5, don't complain about unknown input typecorvid
...now that there's tel, url, email, datetime, date, month, week, time, datetime-local, number, range, color (all of which I imagine we will continue to regard as 'text').
2013-08-07Add nested inputs cleanup and handling.Jorge Arellano Cid
This patch avoids a family of problems that arise from handling nested inputs. from invalid memory access up to crashes. e.g. details in bof-read-47_attachView.html.asan. This patch is much wider than the above referred instance.
2013-04-20OPTION label attributecorvid
It is said that this is typically only useful when OPTGROUP is working (OPTGROUP gives context, and label will be something shorter than the OPTION's contents). It is also said that browsers don't or didn't tend to use an OPTION's label. *shrugs*
2013-04-20implement OPTGROUP in src/corvid
I wrote nearly all of this last year, and I've just been going back over it now. As I recall, I initially also tried: select holds optgroups and options, and optgroups hold options (instead of this flat array of options, optgroups, and close-optgroups), but the code wasn't coming out any cleaner, so...
2013-01-14Remove ancient commented-out GTK code.Jeremy Henty
2012-12-15finish option as soon as we see the close tagcorvid
I was just looking at distrowatch, and noticed that a menu looked odd. It turns out that their code goes like Amarok Live<option value="amaroklive">Amarok Live</option> Amber<option value="amber">Amber</option> Ankur Bangla<option value="ankur">Ankur Bangla</option> Annvix<option value="annvix">Annvix</option> AnNyung<option value="annyung">AnNyung</option> Anonym.OS<option value="anonymos">Anonym.OS</option> for some crazy reason. This led to dillo showing labels like "AnNyung Anonym.OS".
2012-12-10background style for <button> widgetcorvid
To fix box colors...
2012-12-04form submission: try to transliterate datacorvid
Unilaterally changing user data is consistently a bad idea, but when browser users aren't given any idea what they are permitted to type, it's better than leaving out the chars, or replacing with '?' or whatever.
2012-12-04form encoding MSGscorvid
2012-12-04update form-data commentarycorvid
As of a couple of years ago, there was talk and confusion over whether rfc 2231 should be used, or rfc 2047. But now... *sigh*
2012-11-28Merge.Sebastian Geerken
2012-11-28don't require an item selected for SELECT size>1 non-multiplecorvid
This had been discussed a bit a few years ago. At the time, the html4 spec's idea was that you probably should require one but that implementations varied on the details. These days, firefox doesn't, and html5 mostly tells you not to (and is clear that you can deselect the only selected one). (The world's biggest document, practically a browser written in english at the instruction level, and it still has many cases that aren't considered and spelled out carefully at this point.)
2012-11-27Merge.Sebastian Geerken
2012-11-26rm unused arg to TagCloseFunctcorvid
2012-11-25rm old commentcorvid
2012-11-25and now we can implement maxlengthcorvid
2012-11-24reset for <select>corvid
2012-11-14Cleaned up preferences.Sebastian Geerken
2012-11-08Making hyphen penalties configurable.Sebastian Geerken
2012-09-20BUG_MSG consistencycorvid
2012-09-13tooltips on some other elements where they are commonly foundcorvid
(span, div, select, button)
2012-01-30rework image handling codeJohannes Hofmann
Properly separate common image handling functions in CSS relevant attribute parsing (a_Html_image_attrs) and image creation (a_Html_image_new()). This should also bring the code back a bit to what we had before 8214199c2703.
2012-01-21add support for the CSS display: propertyJohannes Hofmann