| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sixel can only represent transparency for fully transparent (alpha
= 0) and fully opaque (alpha = 255) pixels, i.e. we would have to
do blending ourselves to do this "properly". But what do you even
blend? Background color? Images? Clearly you can't do text...
So instead of going down the blending route, we now just approximate
the 8-bit channel with Sixel's 1-bit channel and then patch it up with
dither. It does look a bit weird, but it's not *that* bad, especially
compared to the previous strategy of "blend with some color which
hopefully happens to be the background color" (it rarely was).
Note that this requires us to handle transparent images specially
in term. That is, for opaque ones, we can leave out the "clear cells
affected by image" part, but for transparent ones, we must clear the
entire image every time.
|
|
|
|
| |
still not really great, because inline background is a mess too
|
|
|
|
|
| |
This was a bad idea that, despite my best efforts, never worked
properly.
|
|
|
|
|
| |
I've moved most image logic to adapter, so it doesn't really make
sense to have this subdir anymore.
|
|
|
|
| |
special case it in paintBackground so that it doesn't look so ugly
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
std/unicode has the following issues:
* Rune is an int32, which implies overflow checking. Also, it is
distinct, so you have to convert it manually to do arithmetic.
* QJS libunicode and Chagashi work with uint32, interfacing with these
required pointless type conversions.
* fastRuneAt is a template, meaning it's pasted into every call
site. Also, it decodes to UCS-4, so it generates two branches that
aren't even used. Overall this lead to quite some code bloat.
* fastRuneAt and lastRune have frustratingly different
interfaces. Writing code to handle both cases is error prone.
* On older Nim versions which we still support, std/unicode takes
strings, not openArray[char]'s.
Replace it with "twtuni", which includes some improved versions of
the few procedures from std/unicode that we actually use.
|
|
|
|
|
|
|
|
|
|
| |
* stream: and passFd is now client-based, and accessible for buffers
* Bitmap's width & height is now int, not uint64
* no more non-network Bitmap special case in the pager for canvas
I just shoehorned it into the static image model, so it still doesn't
render changes after page load. But at least now it doesn't crash the
browser.
|
|
|
|
|
| |
it's really min-height, not height; consistency is not CSS's strong
suit...
|
|
|
|
|
| |
avoid adding whitespace to the previous atom if it's not on the current
line
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* buffer, pager, config: add meta-refresh value, which makes it possible
to follow http-equiv=refresh META tags.
* config: clean up redundant format mode parser
* timeout: accept varargs for params to pass on to functions
* pager: add "options" dict to JS gotoURL
* twtstr: remove redundant startsWithNoCase
|
|
|
|
| |
Great performance win on large documents.
|
|
|
|
|
|
|
| |
* properly wrap inline internal table boxes in inline-table (instead
of block-level table)
* fix missing baseline in table wrapper boxes
* fix wrong wrapping of misparented table/row/row group children
|
|
|
|
|
|
|
|
|
|
| |
* support position: absolute on flex items
* proper top/bottom/left/right calculation for position: relative
* push positioned flex box sizes to positioned stack
Still not perfect: position: absolute should always resolve percentage
sizes and top/bottom/left/right, meaning absolute layout needs to be
delayed until its containing box is fully layouted.
|
|
|
|
| |
It was broken for parent boxes with indefinite sizes.
|
|
|
|
|
|
|
| |
* fix max size trumping min size
* respect min-width/max-width/min-height/max-height for images
* fix xminwidth calculation for percentage-sized images with an
indefinite containing size
|
|
|
|
|
|
| |
* fix flex column item width not being stretched
* set minimum flex column height to the layouted item's height (to avoid
overlap)
|
|
|
|
|
|
|
|
| |
Paint the background with the current color, so that it gets associated
with the owner styled node.
(I didn't want to do this because it's slow, but otherwise image-mode
gets very annoying to use.)
|
| |
|
|
|
|
|
| |
Text data is no longer stored separately in InlineFragments; instead,
we now include refs to StyledNodes.
|
|
|
|
|
| |
top/left/right/bottom should only be used in renderdocument with
position: absolute.
|
| |
|
| |
|
|
|
|
| |
reduces images spilling out of their containers
|
|
|
|
| |
I doubt this is correct, but at least it's less broken than previously
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* resize images with stb_image_resize
* use tee for output handle redirection (redirectToFile blocks)
* cache original image files
* accept lseek in sandbox
* misc stbi fixes
For now, I just pulled in stb_image_resize v1. v2 is an extra 150K in
size, not sure if it's worth the cost. (Either way, we can always switch
later if needed, since the API is almost the same.)
Next step: move sixel/kitty encoders to CGI, and cache their output in
memory instead of the intermediate RGBA representation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix text-align breaking down in the presence of floats
* improve (and simplify) background color area painting
This greatly simplifies inline layout by removing the additional
text-align atom movement code and replacing it with a full re-layout
when needed. That re-layout only occurs in (rare) cases where the text
is likely to be relatively short anyway, so it's probably a win in any
remotely realistic layout.
This has also made it possible to at last merge the last three passes
(horizontal/vertical alignment and background painting) and drop that
weird synchronized tree + vector traversal.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Not very useful yet; partial layouting and/or a new renderer is probably
necessary to replace the current FormatCell-based node placement,
otherwise it will be unbearably slow.
|
|
|
|
|
| |
See attached test case; previously, this would result in a missing space
in visual mode and a crash in dump mode.
|
|
|
|
|
| |
* get rid of BlockGroup
* unify BlockBox construction for flex, block, table
|
|
|
|
|
|
|
| |
Much cleaner than the previous solution.
Should also be somewhat less wasteful, as we no longer constantly
rebuild the same tree with new branches.
|
| |
|
|
|
|
| |
get rid of percHeight, unify min/max sizing, etc.
|
|
|
|
|
| |
* do not use inline block computed values for wrapper fragment
* fix minimum line box height calculation
|
|
|
|
|
|
|
| |
As expected, the mystery line was just hiding another bug. (In
particular, indefinite containing size constraints were not denied in
resolveContentWidth, so it only (accidentally) worked with stretched
sizes.)
|
|
|
|
| |
seems like this line is necessary after all
|
| |
|
|
|
|
|
|
| |
* merge caption sizing code path with layoutRootBlock
* fix caption margins being disregarded
* fix incorrect positioning of `caption-side: bottom'
|
|
|
|
|
| |
* use current fragment's line height for percentage baselines
* get rid of baseline calculating pass in verticalAlignLine
|
|
|
|
|
|
|
|
|
|
|
| |
As per standard:
> Adjoining vertical margins collapse, except:
> [...]
> If the top and bottom margins of an element with clearance are
> adjoining, its margins collapse with the adjoining margins of
> following siblings but that resulting margin does not collapse with
> the bottom margin of the parent block.
|
| |
|
|
|
|
| |
just merge it with InlineFragment
|
| |
|
|
|
|
| |
This avoids some unnecessary string copying.
|