about summary refs log tree commit diff stats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* buffer: clean up contentTypebptato2024-02-223-44/+40
| | | | | | | | | | This fixes a bug where setContentType would call setHTML twice, which messed up charsets and probably a couple more things. As a bonus, it allows us to pass around the content type less. In fact, buffer does not have to know its exact content type, just whether it is in HTML mode or not. So that's all we tell it now; only container still keeps track of the content type (as it should).
* config: replace default-flags with ignore-casebptato2024-02-222-5/+11
| | | | | | default-flags was overly complicated for its purpose. Also, ignore-case is quite useful, so enable it by default.
* Replace Chakasu with Chagashibptato2024-02-2218-341/+378
| | | | | | The API is horrid :( but at least it copies less. TODO: think of a better API.
* layout: remove justifybptato2024-02-221-20/+1
| | | | | | | | | | | | | | | | | | The way `justify' was implemented just made text annoying to read. (The algorithm of distributing spacing evenly does not really work on a cell-based screen because of rounding errors.) CSS 2.1 says: > Conforming user agents may interpret the value 'justify' as 'left' or > 'right', depending on whether the element's default writing direction > is left-to-right or right-to-left, respectively. Since we have no bidi yet, just interpret it as `left'. Maybe in the future we could add an implementation that tries to align line box lengths instead of their contents, but this will probably be difficult to get right.
* layout: do not apply error correction to first linebptato2024-02-221-5/+4
| | | | | | The first line is already ignored in the calculations, but it was still being re-positioned in positionAtoms, which made lines overlap in some cases.
* Update chamebptato2024-02-211-1/+1
|
* container: fix crash on clone -> view sourcebptato2024-02-191-5/+9
| | | | | * set loaderPid in clones too * handle URL in container the same way as in buffer
* buffer: fix broken jump-to-anchorbptato2024-02-181-1/+1
| | | | | source.request.url is not used after buffer initialization (because it may be replaced later), so we must set buffer.url instead.
* regex: compileSearchRegex improvementsbptato2024-02-181-9/+7
| | | | | * do not eat \\c, \\C * emulate vi-style word boundary matching (\<, \>) with \b
* libregexp: cast flags to the right sizebptato2024-02-181-1/+1
| | | | We have less than 8 flags, so the set's size is 1.
* client: fix EOF error for estreambptato2024-02-181-0/+2
|
* pager: fix compilation on 1.6.14bptato2024-02-171-1/+1
|
* regex: re-work compileSearchRegexbptato2024-02-179-79/+127
| | | | | | | I've gotten tired of not being able to search for forward slashes. Now it works like in vim, and you can also set default ignore case in the config.
* term: fix coloring messbptato2024-02-173-32/+178
| | | | | | | | | | | | | | | | | | | | | | | | | Until now, the config file required manual adjustment for the output to look bearable on terminals colored differently than {bgcolor: black, fgcolor: white}. Also, it only detected RGB when COLORTERM was set, but this is not done by most (any?) terminal emulators (sad). To improve upon the situation, we now query the terminal for some attributes on startup: * OSC(10/11, ?) -> get the terminal's bg/fgcolor * DCS(+, q, 524742) -> XTGETTCAP for the "RGB" capability (only supported by a few terminals, but better than nothing) * Primary device attributes -> check if ANSI colors are supported, also make sure we don't block indefinitely even if the previous queries fail If primary device attributes does not return anything, we hang until the user types something, then notify the user that something went wrong, and tell them how to fix it. Seems like an OK fallback. (The DA1 idea comes from notcurses; since this is implemented by pretty much every terminal emulator, we don't have to rely on slow timing hacks to skip non-supported queries.)
* winattrs: remove unnecessary call, fix height_px fallbackbptato2024-02-173-6/+6
| | | | no need for every new buffer to query the window size
* css: reduce CSSComputedValue sizebptato2024-02-172-118/+96
| | | | | | | The `t' field was completely redundant, as it's already included in the CSSComputedValues index. + removed some unused functions
* More bgcolor fixesbptato2024-02-171-10/+7
| | | | | | * fix accidental dependency on previously chosen bgcolor (ouch) * also draw empty background boxes for bgcolor-is-canvas boxes * remove unused variable
* layout: use html/body bgcolor as canvas bgcolorbptato2024-02-176-46/+74
| | | | | | This is required by the standard. (Without this, lots of websites have incorrect background colors, because they set the body height to 100% of the viewport.)
* layout: only reset charwidth on non-word atomsbptato2024-02-161-1/+1
| | | | | | | | charwidth is specifically intended to represent the width of all characters until the current one, so resetting it for words makes no sense. Originally it was reset for all atoms *except* words; 9fdea97d simplified the code incorrectly (flipped the logic) and thus introduced a regression.
* container: set color on double width char + tab fillersbptato2024-02-161-7/+10
|
* layout: avoid wrapping on dash inside double-width linesbptato2024-02-161-0/+4
| | | | | Without this we were wrapping on the last dash (if any) inside CJK sentences.
* so close!bptato2024-02-151-5/+7
| | | | but I forgot to ensure the output stream gets closed. :(
* loader: fix crash on file redirection inputsbptato2024-02-152-16/+60
| | | | | | | | cha -d <some-file was crashing loader, because it was trying to register the regular file in the selector. this patch fixes the problem, but the control flow of loader looks like spaghetti now
* pager: increase numload for stdinbptato2024-02-151-0/+1
| | | | otherwise pages from stdin have a race condition in dump
* dom: fix href stringifierbptato2024-02-151-0/+2
| | | | Return the empty string if it's unset.
* pager: enable wait in runMailcapWritePipebptato2024-02-141-1/+1
| | | | | | Otherwise, container will just happily kill the buffer and with it the loader process before it would have had the chance to stream out the input into the external process.
* Various refactorings & fixesbptato2024-02-1413-243/+127
| | | | | | | | * disallow Stream interface usage on non-blocking PosixStreams * do not read estream of forkserver byte-by-byte (it's slow) * do not call writeData with a zero len in formdata * do not quote numbers in mailcap quoteFile * remove some unused stuff
* buffer: improve style invalidationbptato2024-02-144-7/+9
|
* buffer: fix regression on htmloutput document baseURLbptato2024-02-141-3/+2
| | | | | readFromFd replacing the base URL of the buffer turns out to be a very bad idea.
* pager: reduce boilerplatebptato2024-02-143-35/+26
| | | | also spawn less processes in some cases
* pager: warn on protocol switching redirectsbptato2024-02-141-4/+16
| | | | TODO should be configurable
* css: hide noscript tags when scripting is enabledbptato2024-02-132-3/+25
|
* buffer: skip rewind after the first readbptato2024-02-131-7/+17
| | | | | Speeds up processing of pretty much all documents, because we rarely need to switch the charset after having downloaded the first chunk.
* loader: fix delOutput bug, remove ErrorWouldBlockbptato2024-02-133-28/+15
|
* loader: fixes & improvementsbptato2024-02-135-176/+125
| | | | | | | | * factor out pushBuffer to make loadFromCache async * fix incorrect cache path * replace rewind with loadFromCache (it does the same thing except actually works) * remove rewindImpl callback, rewind in buffer instead
* buffer: more form fixesbptato2024-02-134-26/+45
|
* buffer: fix wrong click behavior with JSbptato2024-02-131-1/+1
| | | | | do_reshape could move the target element, and thus call click on the wrong clickable.
* container: allow dismissing loadinfobptato2024-02-132-8/+15
| | | | it broke line info in console since it's never fully loaded
* container: do not reshape twice on loading documentsbptato2024-02-121-18/+18
|
* buffer: form fixesbptato2024-02-123-54/+50
| | | | | * show submission URL on hover for all form-associated elements * skip non-checked checkbox/radio inputs
* stricter typingbptato2024-02-121-3/+4
|
* buffersource: remove location fieldbptato2024-02-124-31/+33
|
* io: remove multistream, teestreambptato2024-02-122-74/+0
| | | | unused (hopefully forever)
* Add pager.externFilterSourcebptato2024-02-125-16/+85
| | | | useful for filtering stuff through commands like rdrview
* Remove CLONE BufferSource; cache document sources in tmpdirbptato2024-02-1218-338/+443
| | | | | | | | | | | | | | | | | | | | | | | At last all BufferSources are unified. To achieve the same effect as the previous CLONE source type, we now use the "fromcache" flag in Request. This *forces* the document to be streamed from the disk; if the file no longer exists for some reason, an error is returned (i.e. the document is not re-downloaded). For a document to be cached, it has to be the main document of the buffer (i.e. no additional resources requested with fetch()), and also not an x-htmloutput HTML file (for those, the original source is saved). The result is that toggleSource now always returns the actual source for e.g. markdown files, not the HTML-transformed version. Also, it is now possible to view the source of a document that is still being downloaded. buffer.sstream has almost been eliminated; it still exists, but only as a pseudo-buffer to interface with EncoderStream and DecoderStream. It no longer holds the entire source of a buffer at any point, and is cleared as soon as the buffer is completely loaded.
* fix rejection of readFromFd urlsbptato2024-02-111-1/+1
|
* pager: fix discardTreebptato2024-02-111-4/+6
|
* container: fix cursorToggleSelection on double-width charactersbptato2024-02-111-3/+4
|
* layout: skip newlines between full-width charactersbptato2024-02-111-0/+19
| | | | | | Crucially, *only* between full-width characters. So "あ\nあ" is rendered as "ああ", but "あ\na" remains "あ a" (with a space inbetween).
* simplify newLoaderBufferbptato2024-02-111-4/+3
|