about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
...
* buffer: only set new buffer's target on clonebptato2024-12-203-8/+10
|
* nanosvg, myaddr: fix obuf type and myaddr shimbptato2024-12-202-3/+3
| | | | | | | this is exactly why I shimmed in unsafeAddr, but the compiler isn't cooperating... :( well, it seems to work with auto.
* layout, render: image sizing fixes/workaroundsbptato2024-12-203-13/+17
| | | | | | | | * fix clip for image * switch back img's display to inline * fix image width calculation without specified width/height I'm not 100% sure if this is correct, but it certainly looks better.
* dom: add inline SVG supportbptato2024-12-206-90/+207
|
* nanosvg: fix preserveAspectRatio parsingbptato2024-12-191-3/+3
|
* response: automatically resume before closebptato2024-12-193-9/+4
| | | | doing it manually is too error prone
* 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
|
* img: add nanosvgbptato2024-12-1910-7/+4679
| | | | | | | | | | | | | | | | | | Only for SVG in image tags for now. Plus it comes with NanoSVG's limitations, i.e. no text. Still, better than nothing. I've gone through open tickets and PRs at upstream to check for known security issues. As a recurring theme I found that parseTransform fails to check the result of parseTransformArgs, so I fixed and refactored that part. (Probably not a security issue, but still UB.) Also, I've added a fix for an OOB read in parseColorRGB. Future directions: * replace nanosvgrast with our own rasterizer in canvas (will have to be extended somewhat...) * add text rendering (with unifont, which canvas already includes)
* layout: apply padding to intrinsic minimum widthbptato2024-12-193-4/+8
|
* pager: fix crash on gotoURL with save + mailcapbptato2024-12-192-2/+2
| | | | this broke saveImage
* pager: do not crash browser when deleting a crashed bufferbptato2024-12-181-1/+5
|
* layout, render: implement overflow propertybptato2024-12-185-112/+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-183-1/+12
| | | | | | | 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.
* ua.css: add margins to list items with high indicesbptato2024-12-171-0/+3
| | | | | | This is roughly what w3m does. Gecko instead adds enough space for roughly 4 digits and cuts off afterwards, but I believe this is a better solution.
* dom, match: optimize :nth-child, :nth-last-childbptato2024-12-175-41/+166
| | | | | | 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.)
* Fix test casebptato2024-12-171-1/+1
|
* default(T) -> T.default, add some strict defsbptato2024-12-1719-44/+45
|
* 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-1715-126/+234
| | | | | | | | | | | | 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.
* gemini: fix known hosts not being read on *BSDbptato2024-12-161-0/+1
| | | | Only glibc starts from the file's beginning with "a+".
* ua.css: fix checkbox decorationbptato2024-12-151-1/+1
|
* layout: do not allow canpx for scFitContentbptato2024-12-153-2/+8
| | | | | 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-153-0/+21
|
* quirk.css: remove unimplemented propertiesbptato2024-12-151-4/+1
|
* Unify assert.js for testsbptato2024-12-153-37/+15
| | | | | judging from the symlink, I probably meant to do this but forgot to finish it
* layout: do not trust specified table cell heightbptato2024-12-153-3/+14
| | | | | If the contents are larger than the specified cell height, then it is simply ignored.
* Fix typobptato2024-12-151-1/+1
|
* chabookmark: fix new item placement, better error handlingbptato2024-12-151-18/+25
| | | | it should put it after the old items, not before them.
* dom, css: fix case-insensitive class/id/attr matchingbptato2024-12-158-28/+74
| | | | Uses an additional lower-case map for O(1) case-insensitive comparisons.
* md2html: add heading class to heading anchorsbptato2024-12-152-6/+9
| | | | makes it easier to hide them
* 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-159-29/+55
| | | | | | | | * correct action on M-b * add external.bookmark option * move openFileExpand functionality into unquote * add menu items * update docs
* config.toml: move cmd definitionsbptato2024-12-151-228/+228
|
* Add chabookmark scriptbptato2024-12-146-19/+250
| | | | | | | | | | Finally it's done. It's basically w3mbookmark, but using Markdown instead of HTML and in POSIX shell instead of C. As a bonus, it can also (sort of) import w3mbookmark's output. Well, at least it worked on my bookmark file, but there is a known issue with bracket escaping... if it goes wrong, it's simple enough to edit it manually :P
* client: document readFile, writeFile; add getenv, setenvbptato2024-12-142-7/+62
| | | | | | | | 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-144-0/+30
| | | | | | | | | | | 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
|
* md2html: fix newline after list before EOFbptato2024-12-143-1/+5
|
* ua.css: underline all text typesbptato2024-12-141-13/+13
| | | | Since text is the fallback, just make it the default.
* url: fix file:/ serializationbptato2024-12-142-1/+2
| | | | file:/// is the standard serialization.
* cookie: allow first-party cookies for subdomains with cookie sharingbptato2024-12-142-43/+56
| | | | | | | | 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.