| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
* 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.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Handling text/plain as ANSI colored text was problematic for two
reasons:
* You couldn't actually look at the real source of HTML pages or text
files that used ANSI colors in the source. In general, I only want
ANSI colors when piping something into my pager, not when viewing any
random file.
* More importantly, it introduced a separate rendering mode for
plaintext documents, which resulted in the problem that only some
buffers had DOMs. This made it impossible to add functionality
that would operate on the buffer's DOM, to e.g. implement w3m's
MARK_URL. Also, it locked us into the horribly inefficient line-based
rendering model of entire documents.
Now we solve the problem in two separate parts:
* text/x-ansi is used automatically for documents received through
stdin. A text/x-ansi handler ansi2html converts ANSI formatting to
HTML. text/x-ansi is also used for .ans, .asc file extensions.
* text/plain is a separate input mode in buffer, which places all text
in a single <plaintext> tag. Crucially, this does not invoke the HTML
parser; that would eat NUL characters, which we should avoid.
One blind spot still remains: copiousoutput used to display ANSI colors,
and now it doesn't. To solve this, users can put the x-ansioutput
extension field to their mailcap entries, which behaves like
x-htmloutput except it first pipes the output into ansi2html.
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Crucially, *only* between full-width characters.
So "あ\nあ" is rendered as "ああ", but "あ\na" remains "あ a" (with a
space inbetween).
|
|
|
|
|
|
| |
* move out half width <-> full width converters
* snake_case -> camelCase
* improve toScreamingSnakeCase slicing
|
| |
|
|
|
|
|
| |
When an absolute block is a descendant of an inline box, its positioned
ancestor must be set to that box.
|
| |
|
|
|
|
|
|
|
| |
* Makefile: fix parallel build, add new binaries to install target
* twtstr: split out libunicode-related stuff to luwrap
* config: quote default gopher2html URL env var for unquote
* adapter/: get rid of types/url dependency, use CURL url in all cases
|
|
|
|
|
| |
Avoid computing e.g. charwidth data for http which does not need it
at all.
|
|
|
|
|
| |
* start from 1
* divide by total - 1, since we are counting the rounding error between each line
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
| |
* Actually calculate rounding error
* Skip a loop over lines by accumulating rounding error in finishLine
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
* Add clear CSS property
* Fix some margin resolution bugs
* Apply min-height, max-height to inner inline outer block boxes
|
|
|
|
| |
No need for the options.
|
|
|
|
|
|
|
|
| |
* Merged float and inline-block size calculation
* Set min-height, max-height for floats
* Fix incorrect positioning of inline atoms with margins
* Respect box-sizing in more places
* Do not flush remaining margins in layoutRootBlock as top margin
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
yay!!!!
* Add support for float: left, float: right
Also, misc stuff:
* Add support for display: flow-root
* Set line width to the maximum allowed width on line wrap
* Various refactorings
Still todo: support clear
|
|
|
|
|
|
|
|
|
| |
* Blocks are now positioned before their text contents would be
layouted
* Untangle calcAvailableSpaceSizes's results from BlockBox
* Move a couple of objects from box -> engine
* Use Size in a few more places
* Set display to block if float is not none
|
|
|
|
| |
merge positionBlocks with buildBlocks
|
|
|
|
|
|
| |
* remove Viewport reference from BlockBox
* Viewport -> LayoutState (call it what it really is)
* move more stuff from box -> engine
|
|
|
|
|
| |
Viewport at this point is basically just the layout state, so it
makes no sense to store it in buffer.
|
| |
|
| |
|
|
|
|
| |
bugfix, bugfix...
|
| |
|
| |
|
|
|
|
|
|
| |
* rename module (window -> winattrs, to avoid conflict with env/window)
* do not use result
* remove unused cell_ratio
|