about summary refs log tree commit diff stats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* pager: fix short error messages not being printedbptato2024-12-191-1/+1
|
* cookie: fix another regressionbptato2024-12-191-1/+1
| | | | did I ever test this?
* cookie: fix regression in cookieJar.addbptato2024-12-191-1/+5
|
* layout: apply padding to intrinsic minimum widthbptato2024-12-191-4/+3
|
* pager: fix crash on gotoURL with save + mailcapbptato2024-12-191-1/+2
| | | | this broke saveImage
* pager: do not crash browser when deleting a crashed bufferbptato2024-12-181-1/+5
|
* layout, render: implement overflow propertybptato2024-12-184-106/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Overflow pretty much requires scrollbars, but those wouldn't work in dump mode, plus of course they would be a pain to implement. So as a simple alternative: * overflow: hidden, clip works as per spec. * overflow: auto, overlay, scroll invert the intrinsic minimum size clamping logic instead of adding a scrollbar. What this concretely means, is that this <pre style="overflow: scroll; height: 1em"> test test test </pre> will, instead of creating a scroll container, just override the specified height. This hack works surprisingly well, because CSS pretty much requires setting height on scroll containers, so authors aren't incentivized to set height on the parent container too (because the contents are already sized appropriately). One issue left is how to deal with overflow: hidden ancestors. For now, I've made it so that it can spill for overflow-x, and always clips on overflow-y, because it's much less likely to bleed into other text horizontally than vertically. But there is definitely room for improvement, e.g. we could track space requested by scrolling children and expand parent boxes based on that.
* pager, select: hide menu if right click ends outsidebptato2024-12-182-45/+60
| | | | | | | | Inspired by Dillo. (Just the movement mechanism; Dillo doesn't hide the context menu on double click, but we still do.) Also, we now disable highlighting of menu items when the mouse is hovering outside.
* match: fix nested hover selectorbptato2024-12-181-1/+2
| | | | | | | I didn't get it right :( true is the default return value, and true + continue should resolve to false.
* match: optimize dependency trackingbptato2024-12-172-39/+78
| | | | | | | | | | | | | | | | | | | This is a bit tricky, but it seems to work. It optimizes selectors in the line of "div :hover" (note the space.) Previously such selectors would add a hover dependency to pretty much every element, and trigger a re-style for all elements that changed their hover status. After this patch, when :hover and friends would return false, they first try to match the element *without* pseudo selectors, and only add their dependencies if the element would match like that. (Notably, it only does this for when :hover is false. Probably it would help somewhat if we checked for the opposite with true too, but I'm not sure how much. For now, I'll keep it like this, and maybe try to further optimize it later.)
* css: add :target pseudo classbptato2024-12-174-1/+24
|
* cookie: small bugfix, misc refactoringbptato2024-12-172-30/+25
| | | | | Always override Expires with Max-Age, but never the other way (as per spec.)
* match: refactor a bitbptato2024-12-172-63/+47
| | | | | Now we use the node index to optimize next/subsequent sibling combinators.
* dom, match: optimize :nth-child, :nth-last-childbptato2024-12-173-41/+75
| | | | | | I want to use it in the UA sheet, so the loop won't cut it. (Also fix a parsing bug that prevented "of" from working.)
* default(T) -> T.default, add some strict defsbptato2024-12-1715-33/+34
|
* pager: try to always display the error messagebptato2024-12-171-1/+11
| | | | | Whether this works or not still depends on many variables, but it should be enough in most cases.
* layout: propagate intrinsic minimum heightbptato2024-12-172-126/+154
| | | | | | | | | | | | Necessary for flex. Previously we just used the actual height, but that didn't account for boxes that size themselves depending on the available height (mainly just images for now). This also irons out intrinsic min width calculation somewhat, squashing several bugs. I hope it works well. It is a significant change in size calculation, so maybe there are still new bugs lurking.
* css: resolve units to px before layoutbptato2024-12-168-228/+237
| | | | Lets us skip a couple pointless multiplications/divisions during layout.
* layout: do not allow canpx for scFitContentbptato2024-12-151-2/+2
| | | | | The test case attached is undefined in CSS 2.1, but css-sizing-3 wants us to just ignore the width property (I think).
* layout: also propagate xminwidth from table captionbptato2024-12-151-0/+1
| | | | | | | this is necessary too, now that I think of it (well, table caption sizing is still half-broken, but that's a problem for another day...)
* layout: set table intrinsic min width to specified widthbptato2024-12-151-0/+3
|
* layout: do not trust specified table cell heightbptato2024-12-151-3/+4
| | | | | If the contents are larger than the specified cell height, then it is simply ignored.
* dom, css: fix case-insensitive class/id/attr matchingbptato2024-12-156-28/+53
| | | | Uses an additional lower-case map for O(1) case-insensitive comparisons.
* select: fix height definitionbptato2024-12-151-13/+10
| | | | | now I sort of understand how it works. basically maxh and maxw represent the inner area occupied by the widget at any time.
* chabookmark fixes & improvementsbptato2024-12-156-26/+30
| | | | | | | | * correct action on M-b * add external.bookmark option * move openFileExpand functionality into unquote * add menu items * update docs
* client: document readFile, writeFile; add getenv, setenvbptato2024-12-141-7/+32
| | | | | | | | Both are quite useful. readFile and writeFile got a small makeover in error handling; in particular, readFile now returns null instead of the empty string when the file is missing and writeFile throws a TypeError on I/O errors.
* css: align h[1-6] behavior with w3mbptato2024-12-143-0/+29
| | | | | | | | | | | Implemented using proprietary selectors -cha-first-node and -cha-last-node, modeled after -moz-first-node and -moz-last-node. I think they are compatible. That does mean this is more limited than w3m's trimming, e.g. it can't really deal with nesting or empty tags. I think this is fine, as it's mainly meant for unstyled documents in the first place (which are unlikely to have e.g. MAIN tags).
* cascade: misc cleanupbptato2024-12-141-6/+3
|
* url: fix file:/ serializationbptato2024-12-141-1/+1
| | | | file:/// is the standard serialization.
* cookie: allow first-party cookies for subdomains with cookie sharingbptato2024-12-141-38/+50
| | | | | | | | Cookie jar separation is already enough to mitigate tracking issues in this case. (Also, the fact that third-party-cookie controlled this made things even more confusing.) Also, add the previously missing host-only flag.
* term: allow ANSI fgcolor + bgcolorbptato2024-12-131-6/+2
| | | | | | | | Not quite sure why I had assumed that this is broken. At least on XTerm, the previous behavior definitely was, e.g. with a white-ish background and white foreground it would end up correcting the contrast to purple even with black CSS color (thus breaking the "no fgcolor with bgcolor" assumption anyway.)
* container, cookie: simplify extractCookies, cookieJar.addbptato2024-12-132-10/+4
|
* dom: remove cached childNodes, children pointersbptato2024-12-131-34/+37
| | | | | | | Instead, just define the actual value over the getter function on the first use. Also, avoid accidentally creating the attributes NamedNodeMap on adopt.
* lunit: remove redundant codebptato2024-12-132-6/+2
| | | | | | using div instead of / is sort of weird, but it makes it clearer if we're dividing floats or layoutunits (and is already what the code uses).
* dom: queryCommandSupported, HTMLIFrameELement stubbptato2024-12-131-0/+7
|
* cookie: remove JS modulebptato2024-12-132-29/+17
| | | | I no longer need it
* twtstr: fix skipBlanksTillLFbptato2024-12-121-1/+1
|
* pager: fix casingbptato2024-12-121-1/+1
|
* url: remove dead codebptato2024-12-121-5/+0
|
* twtstr: reduce copying in atobbptato2024-12-123-10/+12
|
* mimetypes: use cmpIgnoreCase for JS typesbptato2024-12-122-5/+5
|
* mailcap: misc bugfixes & cleanupbptato2024-12-121-63/+43
| | | | | | | | | | | * fix broken newline skipping logic in consume * remove reconsume char buffer (it's not needed with mmap) * pass on backslash to unquote - this makes backslashes in unquoteCommand work as expected (since it parses the command again) * close ps on write failure * add entries even before parse error - this drops a pointless copy of mailcaps. (we could theoretically just use old behavior without the copy, but this feels more intuitive anyway)
* css: CSSComputedValue -> CSSValuebptato2024-12-126-109/+109
| | | | | "Computed" was redundant; other types of values don't have a common type.
* pager: do not prompt for text typesbptato2024-12-112-1/+10
| | | | we hadn't before, and it's annoying when using cha as a pager
* pager, mailcap: misc fixes, add prompt for global mailcapbptato2024-12-115-157/+339
| | | | | | | | | | | | | | | | | | | | | | | | In the past, Chawan would read global mailcap (/etc/mailcap, ...) too, but every now and then that would run entries that I didn't even know existed and definitely didn't intend to run. So I changed it to only use ~/.mailcap, but this meant users now had to add mailcap entries for every single mime type. At some point I also changed application/octet-stream to always save to disk, which is usually nice except when a text file is misrecognized as binary. Often times I just want to decide myself what to do. So now there are two layers. First, the global mailcap files (path as per RFC) prompt before executing. Then there is ~/.chawan/auto.mailcap (or ~/.config/chawan/auto.mailcap) which runs entries automatically. If you press shift before selecting an option in the prompt, the corresponding entry gets copied to auto.mailcap. It's also possible to type a new entry on the fly. Overall I think it's quite convenient. One unfortunate side effect is that existing users will have to migrate their entries to auto.mailcap, or redefine external.auto-mailcap to e.g. ~/.mailcap, but this seems acceptable.
* twtstr: small cleanupbptato2024-12-111-9/+7
|
* layout: small cleanupbptato2024-12-101-60/+60
|
* render: apply visibility to inline boxesbptato2024-12-101-21/+23
|
* pager: remove unused variablebptato2024-12-101-15/+3
|
* pager: fix nil derefbptato2024-12-101-2/+2
| | | | | | isearch feels quite janky in general, and I think there's still a race lurking here... for now it's ok, but like buffer display, this really belongs in a state machine (not promises)