aboutsummaryrefslogtreecommitdiff
path: root/src/html.cc
AgeCommit message (Collapse)Author
2025-02-05Fix several typosGevel Tekens
See: https://lists.mailman3.com/hyperkitty/list/dillo-dev@mailman3.com/thread/L3FFAINJJMIOZQNID5HC2DHKJIIIHEYH/
2024-12-17Add support for user actions in the link menuRodrigo Arias Mallo
Allows the user to define additional entries in the link menu which will execute the given program/script. Each actions is defined using the "link_action" option. The link URL is stored in the $url enviroment variable and the current page in $origin, so the user can customize how do the handling. Here is a simple example to add three new entries: link_action="Debug variables:echo url=$url origin=$origin" link_action="Open in MPV:mpv $url" link_action="Open in Firefox:firefox $url" The command is spawned in a forked process using the system() call, which uses the shell to expand any variable. In particular, the $url variable is set to the current URL being opened. Fixes: https://github.com/dillo-browser/dillo/issues/3
2024-10-05Define CssLength as struct instead of intRodrigo Arias Mallo
The int type doesn't have a fixed size, and is only guarantee to hold 16 bits. The current implementation assumes a size of at least 32 bits, an uses three bits to encode the type of information stored in the rest. To add more types of lengths we would need to take more bits from the value itself. A simpler approach is just to use a enumeration to take care of the type of length and a union to encapsulate the different lengths values.
2024-10-01Trigger a close of td, th and tr tags on tbodyRodrigo Arias Mallo
When previous TD, TH or TR tags were left open, close them when a TBODY tag is found.
2024-08-07Use d_isascii() instead of isascii()Rodrigo Arias Mallo
Reviewed-by: dogma Tested-by: Alex (on OpenBSD)
2024-08-07Fix pedantic warningsRodrigo Arias Mallo
Reviewed-by: dogma
2024-07-27Add SVG support for currentColorRodrigo Arias Mallo
The currentColor special value for the fill and stroke attributes allows an image to follow the same foreground color of the surounding text.
2024-06-25Ignore meta refresh content without URLRodrigo Arias Mallo
The content="0" attribute was wrongly parsed as the URL "0". The change makes the parser ignore a redirect with a content value that doesn't have ";" or "url=" after the delay number. Fixes: https://github.com/dillo-browser/dillo/issues/204
2024-06-25Add support for zoom factorRodrigo Arias Mallo
Allows zooming in and out of pages by changing the size of all elements, including font size, images and tables. The initial zoom is specified in the "zoom_factor" option of dillorc. Use the new shortcuts Ctrl+ and Ctrl- to adjust the zoom of the current page and Ctrl 0 to reset it to 100%. When a new tab or window is opened, the current zoom factor is inherited. Each tab retains its own zoom factor. Fixes: https://github.com/dillo-browser/dillo/issues/21
2024-06-21Only enable static_assert if supportedRodrigo Arias Mallo
Standards below C++11 don't support it, so we simply disable the static assert. It is only required to be enabled in the CI in one build. Reported-by: dogma
2024-06-11Ignore empty page title for tab labelsRodrigo Arias Mallo
When a page has an empty title like <title></title>, don't use it to set the tab label, but instead rely on the default tab label, which is computed from the file name.
2024-06-09Allow empty URLs with base URL setRodrigo Arias Mallo
They are used for href="" in links or action="" in forms. Fixes: https://github.com/dillo-browser/dillo/issues/190
2024-06-07Ensure the same number of tags for CSS and HTMLRodrigo Arias Mallo
The Tags array can be modified without changing the "ntags" number in the CSS side. To prevent errors, an static assert ensures the same number is used in both sides, which is known at compilation time. Fixes: https://github.com/dillo-browser/dillo/issues/184
2024-03-31Add support for the main HTML tagRodrigo Arias Mallo
Fixes: https://github.com/dillo-browser/dillo/issues/109
2024-03-09Use Doxygen comments for C filesRodrigo Arias Mallo
2023-12-11Add support for thead, tbody and tfootwalley
2016-07-02Attribute 'float' defines a floating Textblock even if 'display' is 'inline'.Sebastian Geerken
2016-06-24Changed a bug meter message for clarity.Jorge Arellano Cid
2016-06-24Temporary fix for links in HTML5.Jorge Arellano Cid
Avoid closing the <A> element until HTML5 rules are in place for the parser.
2016-06-21Remove TagLevel from the TagInfo structure.Jorge Arellano Cid
No longer necessary after the redesign of the parser's cleanup process for tag nesting.
2016-06-21Make the Tags array in html.cc a "static const".Jorge Arellano Cid
This needed moving around some functions, nothing else. FWIW, we had it declared extern because that's C++ way to declare a forward variable, the side effect of it being extern linkage.
2016-06-21New design for the nesting-cleanup process within the parser.Jorge Arellano Cid
* Forbidden nesting now is handled by cleanup_at_open. (it previously used an ad-hoc function hooked into the process) Much safer and versatile now. [1],[2],[4] * Heuristical cleanup at close is no longer used. cleanup_at_close is now based on block/inline element/container semantics, and also cosiders special nesting rules expressed in the DTD for HTML-4.01. Note: this design is easy to tailor for HTML5. [2] * Bug reporting changed and is now is more centralized in cleanup_to_idx. * The bug meter gives more accurate and concise messages. [4] * Page rendering improved as now the cleanup process strives to produce a correct tree out of Tag Soup, before feeding it to Dw. [4] * Better handling/recovery from Tag Soup (even in the worst cases). [5] * The w3c_plus_heuristics=FALSE mode was removed (not necessary anymore) * Elements with optional close also follow Firefox de facto rules. * Special case logic is now isolated in helper functions. A few examples: [1] http://dillo.org/test/cross-nesting-simple.html [2] http://slashdot.org/ [3] http://apod.nasa.gov/apod/ap160604.html [4] http://www.mypetchicken.com:80/catalog/Day-Old-Baby-Chicks/Olive-Eggers-p1478.aspx [5] http://dillo.org/test/sd3.html
2016-06-21Remove the "block element" flag from the TagInfo structure.Jorge Arellano Cid
It was redundant with the "inline element" flag. i.e. "block element" = ~"inline element"
2016-06-15BUG_MSGcorvid
2016-06-14BUG_MSG can give false positives with HTML5corvid
2016-06-04Avoid nesting of the A element (part2 of changeset 5a410962c77e).Jorge Arellano Cid
This is the cleanup at open time (the other patch is the cleanup at close time); they catch different problems. e.g. <a href="1.html">Word1 <a href="2.html">Word2</a> Fixes http://apod.nasa.gov/apod/ap160604.html
2016-05-31comment out BUG_MSGcorvid
2016-05-27Set iframe as an inline element.Jorge Arellano Cid
This avoids false-positive nesting messages from the bug meter.
2016-05-27Don't allow nesting of the A element (fixes slashdot.org).Jorge Arellano Cid
A lingering open A element can lead to invisible content. e.g. http://slashdot.org/ Note: slashdot_a_bug.html testcase in my HD.
2016-05-11Fixed handling of BODY and HTML tags. Also improved their html-bug messages.Jorge Arellano Cid
BODY and HTML have optional open and close, making them tricky to handle. Even more when considering Tag soup pages with multiple body or html sections, and corner cases. This patch tackles the problems by leaving the first HTML and BODY stack elements open, until EOF. There's also better html-bug detection and messages, and more accurate comments in the code. Beware: it may look simple, but it's not!
2016-01-07Set proper display for textblocks.Sebastian Geerken
2015-07-06Merge with main repo.Sebastian Geerken
2015-06-18use [IMG] placeholder even if prefs.load_images is truecorvid
2015-06-03Merge with main repo.Sebastian Geerken
2015-06-01rm the old-style url alt stuffcorvid
2015-05-10Merge with main repo.Sebastian Geerken
2015-05-05html5 coords don't permit percentagescorvid
2015-04-28BUG_MSGcorvid
2015-04-27html5 permits relative BASE urlcorvid
2015-04-26in html5, ADDRESS may contain certain elements that we classify as block.corvid
Not heading/sectioning ones, but P is legal, for example.
2015-04-12more html5 doctype stringscorvid
Followed a link to instructables.com and found that they use one of these. I'm a little surprised to see one of these strings around. A minute of research shows: Apparently it generally has something to do with xslt restrictions.
2015-04-01limit size when copying strings to find character referencescorvid
https://github.com/torvalds/linux/pull/17 has a five-megabyte title attribute, which is just a bit excessive. Since it has tons of &lt; and &gt;, dillo couldn't cope with it. Over five minutes to parse as much of it as it got before the connection broke. With this change, it's about fifty seconds (on this old computer) to get/show the full 24 megs, which is an improvement, at least.
2015-02-21update some urls in commentscorvid
2015-01-31Merge with main repo.Sebastian Geerken
2015-01-30Relative positions, part 1.Sebastian Geerken
2015-01-25HTML 5.1 draft permits LINK with itemprop in body, so we might as well be ↵corvid
quiet about it.
2015-01-24Merge with main repo.Sebastian Geerken
2015-01-24html5 inside PRE don't complain about html4's pre.exclusion setcorvid
2015-01-18HTML 5.1 draft permits META with itemprop in body, and its use is ↵corvid
widespread, so let's not complain
2015-01-16don't inheritBackgroundColor for html5 sectioning stuffcorvid
At least by default when that stuff's all block display, it's unnecessary and it restarts whatever background image the parent has. _That's_ why one part of arstechnica.com has been hard to read forever.