| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
|
|
|
|
| |
If the total specified column width is larger than the table's allowed
width, we now resize them proportionally to the specified width.
This is quite important because many tables set the width to e.g. 50%
for "give me half of the table", instead of its true meaning "give me
half of the page".
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* png: add missing filters, various decoder fixes
* term: fix kitty response interpretation, add support for kitty image
detection
* buffer, pager: initial image display support
Emphasis on "initial"; it only "works" with kitty output and PNG input.
Also, it's excruciatingly slow, and repaints images way too often.
Left undocumented intentionally it for now, until it actually becomes
useful. In the meantime, adventurous users can find out themselves why:
[[siteconf]]
url = "https://.*"
images = true
|
|
|
|
|
|
| |
* use rootProperties so the root fragment does not color its children
* assert if the root gets inline blocks; this can (hopefully) no longer
happen.
|
| |
|
|
|
|
| |
Still far from perfect, but it's an improvement.
|
|
|
|
|
|
|
|
| |
sizes.space regulates content-box width, in which padding is not
included, so we must to subtract padding here.
(Neither is margin, but margin is applied by outer layout, in this case
flex itself, so it's not relevant here. Not to say it isn't broken...)
|
|
|
|
|
|
| |
If we are going to move out the child's offset, then we must also tell
the child where it starts so it can behave correctly when it encounters
exclusions.
|
|
|
|
|
|
|
|
|
|
|
| |
Turns out our shrink-to-fit emulation was inadequate: it assumed all
floats are positioned on a separate line, which is the *opposite* of
what we want, as that would be the behavior of min-content.
Now we instead sum together the width of all floats and the widest
non-floating child, and then clamp that to the target fitContent width.
This correctly gives us max-content width in the first pass, still
without having to actually position the floats.
|
| |
|
|
|
|
|
|
| |
* separate params with ; (semicolon) instead of , (colon)
* reduce screaming snake case use
* wrap long lines
|
|
|
|
| |
we also have to move the inner box offset to the parent
|
|
|
|
|
| |
This allows us to unify BlockBox instantiation and block-level inner
layout calls.
|
|
|
|
|
|
| |
* fix percHeight not being passed down properly
* simplify addTableCaption; get rid of hack that turned caption outer
height into inner height
|
|
|
|
|
|
|
|
| |
it's better than nothing. I suppose.
(Two-value flex syntax is encouraged even by the standard, so it gets
used a lot, and that sets 0, not flex-basis: auto, so not having
flex-basis breaks too many things.)
|
|
|
|
|
|
|
| |
* do not re-resolve FlexPendingItem sizes; it's pointless and it breaks
percentage sizes
* fix some bugs in `flex' shorthand parsing
* add `flex-flow' shorthand
|
| |
|
|
|
|
|
|
|
|
|
| |
Still far from being fully standards-compliant, or even complete, but it
seems to work slightly less horribly than having no flexbox support at
all on sites that do use it.
(Also includes various refactorings in layout to make it possible at all
to add flexbox.)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
It seems I never properly converted the table cell (pre-)sizing code
to use SizeConstraints, so it was still in a half-working state where
it broke down e.g. on nested tables.
* move auto check to canpx
* simplify convoluted and broken table cell size calculation into
something that actually works
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Here we are restricting the float to the same width constraint as its
parent, so we must add offset.x both when the float is larger than this
constraint *and* when the float fits into the constraint.
An example of what this fixes:
<div style="padding-left: 10em; background: green">
<div style="float: right; background: red">
wat
^ previously the float was positioned as if the padding had been on the
*right*, because it did not take into account offset.x.
|
|
|
|
|
|
|
| |
aaaaa
(this was even worse than the previous one, of course caused by the
fix...)
|
|
|
|
| |
it would get into an infinite loop with line-height: 0 and floats
|
|
|
|
|
| |
it's pointless to do otherwise, and results in inconsistencies between
line positioning and background coloring.
|
|
|
|
|
|
| |
This is still a more conservative approach than completely disabling
line-height. It seems to work better than preserving rounded line-height
in all cases, anyway.
|
|
|
|
|
|
|
| |
Instead of adding a new area for every single line, extend already
existing areas when possible.
(This was my original plan but I got lazy.)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Specifying the background area as three LayoutUnit pairs sounds clever,
but breaks down for text-align: center.
* store line Y offset in LineBox - this is necessary to pass down areas
we need to paint
* refactor addHorizontalLine loop; remove mystery "If necessary, update ictx's
width" line that used to be labeled "TODO this seems meaningless" and indeed
seems meaningless now (I am prepared to deeply regret this later)
* replace broken & convoluted startOffset/endOffset/size with a simple
seq of offsets + sizes
|
|
|
|
|
|
|
| |
* remove unnecessarily duplicated code (probably a copy-paste error)
* apply UNIT_PERC computed widths for table cells too (just base it on
sizes the table receives)
* remove unnecessary parameters in some procs
|
|
|
|
|
|
|
|
| |
* extern -> gone, runproc absorbed by pager, others moved into io/
* display -> local/ (where else would we display?)
* xhr -> html/
* move out WindowAttributes from term, so we don't depend on local
from server
|
|
|
|
| |
this was a bad idea
|
|
|
|
|
| |
we just treat them as img tags. lazy, but works suprisingly well -- so
long as the server sends us a Content-Type, anyway.
|
|
|
|
|
|
| |
* put attrs pointer in state
* simplify width()
* use unsigned int as ptint to avoid UB
|
|
|
|
|
|
|
|
| |
so that e.g.
a<span style="background-color: red"> </span>b
makes the span width exactly one space.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
> The right outer edge of a left-floating box may not be to the right
> of the left outer edge of any right-floating box that is next to
> it. Analogous rules hold for right-floating elements.
says the standard
therefore it does not really matter where the beginning of the float is;
if it's float: left, then `left' must be set to the right edge, and if
it's float: right, then `right' must be set to the left edge.
(this was breaking some negative margin float abominations such that
floats were suddenly overlapping and that's certainly not what we want)
|
|
|
|
|
|
|
|
| |
left/right never really worked correctly, is non-standard, and the
only browser that supported it (Firefox) removed it years ago.
bottom was adding the table width to its offset instead of the height,
that is now fixed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we are going to round things in layout, let's do it properly. Adding
fake height has negative utility (things get more annoying to read),
so now we don't.
TODO: finding the correct positioning of the baseline after adding
padding is an open question. Probably have to revise the algorithm
somewhat to get it right.
(This should also fix the bug where error correction would make inline
box backgrounds shift into unrelated text, causing much confusion for
the reader.)
|
|
|
|
|
| |
it is useful to round them so that they don't get positioned somewhere
in the middle of a line (which is rounded to the same precision as well)
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous retrofitting of the old renderdocument error correction
usually worked, but it still had a horrible flaw in that it assumed that
all line boxes are of equal height. So if error was lower for some line
than another, it would move *all* lines by a somewhat lower error, and
that resulted in overlapping lines.
Now we do something much simpler: in flushLine, round each line's height
downwards before moving on to the next line. This gets rid of any blanks
inbetween lines, and also works much better with cleared floats.
|
|
|
|
|
|
|
|
|
|
| |
It is in fact quite simple to calculate: charwidth is the width
of printing characters until now, and whitespacenum the number of
(non-flushed) spaces. So we just have to subtract this from the target
width to get the number of spaces missing from the next tab stop.
(Of course, it gets much harder to understand when the whole thing is
formatted as a convoluted multi-line equation...)
|
|
|
|
|
|
|
|
|
| |
Some terminal emulators (AKA vte) refuse to set ws_xpixel and ws_ypixel
in the TIOCGWINSZ ioctl, so we now query for CSI 14 t as well. (Also CSI
18 t for good measure, just in case we can't ioctl for some reason.)
Also added some fallback (optionally forced) config values for width,
height, ppc, and ppl. (This is especially useful in dump mode.)
|
|
|
|
| |
aaaaaa
|
|
|
|
| |
:/
|
|
|
|
|
|
|
|
| |
It's better to not implement them at all than to implement them badly.
(In particular, making fixed act like absolute breaks horribly on
websites that actually use it. Fixing it is not really possible without
changinge the way we currently draw things to the screen.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Without this we were wrapping on the last dash (if any) inside CJK
sentences.
|