about summary refs log tree commit diff stats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Move gopher to adapter/bptato2023-12-123-164/+1
| | | | Also, move default urimethodmap config to res.
* Move out ftp: protocol; fix some local CGI bugsbptato2023-12-124-217/+18
|
* Move out file: protocol handling to adapter/bptato2023-12-124-130/+4
|
* local CGI improvements, move data: to cgi-binbptato2023-12-125-58/+88
| | | | error codes are WIP, not final yet...
* twtstr: import functions from gopher2htmlbptato2023-12-121-15/+10
|
* local CGI: add mapped URI env vars; move about: to adaptersbptato2023-12-124-41/+22
| | | | | | | | | | | | | | | * Add MAPPED_URI_* as environment variables when a request is coming from urimethodmap It costs us compatibility with w3m, but it seems to be a massive improvement over smuggling in the URL as a query string and then writing an ad-hoc parser for every single urimethodmap script. The variables are set for every urimethodmap request, to avoid accidental leaking of global environment variables. * Move about: to adapters (an obvious improvement over the previous solution)
* layout: rounding error correction fixesbptato2023-12-111-2/+6
| | | | | * start from 1 * divide by total - 1, since we are counting the rounding error between each line
* css: add case-insensitive matchingbptato2023-12-113-18/+96
| | | | Also case-sensitive, but for now that is the same as normal matching...
* css: add text-transformbptato2023-12-113-11/+163
| | | | | | | Probably not fully correct, but it's a good start. Includes proprietary extension -cha-half-width, which converts full-width characters to half-width ones.
* layout: do not resolve floats if grandparent position is resolvedbptato2023-12-101-2/+2
| | | | | | | | | | Instead, position them at the end of their block's layout pass. Without this, they could be positioned too early, as the grandparent's position being resolved does not guarantee that the parent's position has already been resolved as well. (Unlike the comment suggests, flushMargins is not appropriate there.)
* layout: fix rounding error correctionbptato2023-12-101-11/+8
| | | | | * Actually calculate rounding error * Skip a loop over lines by accumulating rounding error in finishLine
* Add support for gemini by default, update readmebptato2023-12-101-6/+17
| | | | | No need to leave gemini support in the bonus folder. Still TODO: proxy support.
* mailcap: add $MAILCAP_URLbptato2023-12-102-1/+3
| | | | | | This is better than %u as it is backwards compatible (i.e. does not rely on other user agents doing whatever upon encountering an unknown substitution template.)
* Separate gopher conversion from main binarybptato2023-12-103-116/+28
| | | | | | | | | | | | | | | | | | | | | Now we use a (much simplified) gopher2html binary in libexec, instead of converting gopher directories to HTML in loader/gopher. This has two advantages: * Less ugly conversion logic in the loader module; we can just convert the file line by line. (The previous converter also had some correctness issues, that is fixed now as well.) * If the user desires, they can replace the gopher converter with another binary using the mailcap mechanism. The disadvantages are: * For now, source display is broken. This is a problem with all mailcap filters in general, and should be fixed in the future. (That said, the previous version also only displayed the converted HTML source, which was not really useful anyway.) * The proper directory structure is required for this to work; OTOH plenty of work has been done so that this is as frictionless as possible, so it should not really be a problem.
* Enable finger protocol by defaultbptato2023-12-102-1/+9
| | | | | | * Add a default urimethodmap that points finger: to cha-finger * Install cha-finger to /usr/local/libexec/cha/cgi-bin by default * cha-finger: use ALL_PROXY if given, die if curl is not installed
* config: better path handling; fix array parsing bugbptato2023-12-107-35/+370
| | | | | | | | | * Paths are now parsed through an unified code path with some useful additions like environment variable substitution. * Fix a bug in parseConfigValue where strings would be appended to existing arrays (and not override them). * Fix beforeLast calling afterLast for some reason. * Add a default CGI directory.
* pager: add marksbptato2023-12-095-15/+201
| | | | | Default is vi-style, but w3m-style marks work as well; see bonus/w3m.toml.
* pager: add precnum to [, ]bptato2023-12-092-13/+27
|
* pager: add `{', `}'; document externIntobptato2023-12-092-1/+34
| | | | | | | | { & } acts like in vi (except the cursor is not moved to the line beginning). No reason to leave externInto undocumented, as it is even used in the default config.
* sheet: fix overflow in addAtRulebptato2023-12-091-1/+1
| | | | It is enough to just take the len of children there.
* cascade: simplifybptato2023-12-091-2/+1
|
* cascade: fix regressionbptato2023-12-091-18/+23
| | | | | Styled children must be added to their parents *before* they are styled, because match expects this to hold.
* selectorparser: enum-ize relbptato2023-12-092-25/+35
|
* sheet: fix a correctness issue, misc refactoringsbptato2023-12-092-51/+63
| | | | | | | * Fix a bug where rules would be sorted incorrectly if retrieved from the cache. * Use withValue where possible * camelCase some variables, de-extern some functions, etc.
* cascade: refactor & optimizebptato2023-12-091-153/+192
| | | | | | * Break up applyRules into smaller functions * Do not call calcRules for every child pseudo element separately; just use parent's DeclarationListMap
* Update chamebptato2023-12-031-1/+1
|
* event: remove ctx from CustomEventbptato2023-12-033-36/+47
| | | | | Instead, make finalizers optionally pass their runtime for resource deallocation.
* buffer: do not needlessly copy in onloadbptato2023-12-031-9/+5
|
* pager, container: add text selection/copyingbptato2023-12-039-71/+258
| | | | | | | | | | * Add select & copy selection functionality to container * Fix bug in generateSwapOutput where output could be misplaced because of zero-width cells * Add fromJSPromise, call runJSJobs in every iteration of the headed event loop * "await" pager actions that output a promise * Change default view source keybinding to `\'
* Get rid of clang 16 workaroundbptato2023-12-024-12/+29
| | | | | * bindings/quickjs: importc and use correct pointer types * add constcharp module for when it is unavoidable
* js: get rid of emitbptato2023-12-021-22/+15
| | | | now I know how to :P
* dom: fix relList setter regression, remove rel()bptato2023-12-022-6/+15
|
* js: get rid of getJSValuebptato2023-12-022-11/+11
| | | | just use an UncheckedArray in the binding
* pager: small optimization in drawBufferbptato2023-12-011-2/+2
|
* dom: redefine Node.contains to match standardbptato2023-12-012-5/+7
| | | | (and expose it as a JS function)
* dom: functionize parentElement, improve Node.documentbptato2023-12-011-7/+7
| | | | | | * parentElement is now just a function. * Remove TODO from node.document; it is useful and not going anywhere. * Check for Nim type in Node.document, not nodeType
* dom: fix `children' being available for all Nodesbptato2023-12-011-6/+17
| | | | It is only defined for Document, Element, DocumentFragment.
* html: add HTMLElement.dataset (+ some twtstr cleanup)bptato2023-12-013-32/+96
|
* js: simplify toJSP0bptato2023-11-303-33/+17
| | | | | | | * Expose js_create_from_ctor from QuickJS and directly use that (instead of badly recreating it) * Do not call defineUnforgeable twice (it is inevitably called in toJSP0, so jsctor does not need it)
* js: allow subclassing platform objects in JSbptato2023-11-303-5/+50
|
* intl: stub out Intl.PluralRulesbptato2023-11-302-0/+26
|
* twtstr: simplify expandPathbptato2023-11-291-19/+12
|
* env: add window.top, window.parentbptato2023-11-291-3/+12
| | | | | Also, func-ize some similar identity functions, and add TODOs about [Replaceable].
* buffer: do not set readyState if document is nilbptato2023-11-291-1/+2
| | | | | As the comment says, buffer.document only exists if buffer.ishtml is true.
* dom: add document.readyStatebptato2023-11-272-2/+10
|
* buffer: add DOMContentLoaded, misc event improvementsbptato2023-11-272-49/+75
| | | | | | | * Add DOMContentLoaded * Re-use the same event object for all elements * Reshape if an event was fired * Reshape on setTimeout/setInterval fired
* layout: rewrite inline box handlingbptato2023-11-273-554/+654
| | | | | | | | | | | We now have real inline boxes. * Fix nesting of inline boxes * Represent inline boxes with a hierarchical RootInlineFragment -> InlineFragment tree * Get rid of inline padding hack * Get rid of ComputedFormat * Paint inline box backgrounds properly
* js: remove nonsensical comment linebptato2023-11-261-1/+0
|
* config: add bare aliases for "8bit", "24bit"bptato2023-11-261-2/+2
| | | | | | | | | | | Without this, setting color-mode using -o required quoting the values, and then shell-quoting the quotes themselves (cha -o 'display-color-mode="24bit"'). Instead of more special casing in the TOML parser, we just add aliases for these enum values that can be parsed using TOML bare string rules. So now this works: cha -o display.color-mode=true-color
* color: fix rgbToEightBit parenthesesbptato2023-11-261-1/+1
| | | | | This was causing incorrect approximation to grayscale values for colors with a red component in 8 .. 248.