about summary refs log tree commit diff stats
path: root/src/layout
Commit message (Collapse)AuthorAgeFilesLines
...
* layout: avoid wrapping on dash inside double-width linesbptato2024-02-161-0/+4
| | | | | Without this we were wrapping on the last dash (if any) inside CJK sentences.
* layout: skip newlines between full-width charactersbptato2024-02-111-0/+19
| | | | | | Crucially, *only* between full-width characters. So "あ\nあ" is rendered as "ああ", but "あ\na" remains "あ a" (with a space inbetween).
* twtstr: misc refactoringsbptato2024-02-091-0/+1
| | | | | | * move out half width <-> full width converters * snake_case -> camelCase * improve toScreamingSnakeCase slicing
* layout: more consistent namingbptato2024-01-291-79/+41
|
* layout: consider inline positioning for absolute blocksbptato2024-01-292-19/+15
| | | | | When an absolute block is a descendant of an inline box, its positioned ancestor must be set to that box.
* Use std/* imports everywherebptato2024-01-071-4/+4
|
* Various fixesbptato2023-12-131-0/+1
| | | | | | | * 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
* break up twtstr somewhatbptato2023-12-131-0/+1
| | | | | Avoid computing e.g. charwidth data for http which does not need it at all.
* layout: rounding error correction fixesbptato2023-12-111-2/+6
| | | | | * start from 1 * divide by total - 1, since we are counting the rounding error between each line
* css: add text-transformbptato2023-12-111-3/+21
| | | | | | | 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.
* layout: do not resolve floats if grandparent position is resolvedbptato2023-12-101-2/+2
| | | | | | | | | | 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.)
* layout: fix rounding error correctionbptato2023-12-101-11/+8
| | | | | * Actually calculate rounding error * Skip a loop over lines by accumulating rounding error in finishLine
* layout: rewrite inline box handlingbptato2023-11-272-395/+475
| | | | | | | | | | | 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
* layout: clamp size constraints to min/max sizes for floatsbptato2023-11-231-7/+12
|
* layout: add clear, etc.bptato2023-11-231-35/+91
| | | | | | * Add clear CSS property * Fix some margin resolution bugs * Apply min-height, max-height to inner inline outer block boxes
* layout: simplify max width/height calculationbptato2023-11-211-41/+43
| | | | No need for the options.
* layout: fix some sizing bugsbptato2023-11-211-103/+124
| | | | | | | | * 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
* css: add box-sizingbptato2023-11-211-12/+39
|
* layout: move charwidth into LineBoxStatebptato2023-11-171-9/+8
|
* layout: add floatsbptato2023-11-171-218/+555
| | | | | | | | | | | | | 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
* layout: refactor flow margin propagation, sizingbptato2023-11-122-610/+619
| | | | | | | | | * 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
* layout: refactor block layoutingbptato2023-10-281-151/+165
| | | | merge positionBlocks with buildBlocks
* layout: refactorbptato2023-10-282-273/+278
| | | | | | * remove Viewport reference from BlockBox * Viewport -> LayoutState (call it what it really is) * move more stuff from box -> engine
* buffer: remove viewport referencebptato2023-10-282-12/+12
| | | | | Viewport at this point is basically just the layout state, so it makes no sense to store it in buffer.
* layout/engine: refactor inline atoms etc.bptato2023-10-262-227/+240
|
* layout/engine: reformatbptato2023-10-261-26/+45
|
* layout/engine: add table row group/caption to anon tablebptato2023-10-261-0/+2
| | | | bugfix, bugfix...
* reduce new() usagebptato2023-10-251-27/+34
|
* Remove trailing spacesbptato2023-10-231-1/+1
|
* WindowAttributes: refactorbptato2023-10-192-2/+2
| | | | | | * rename module (window -> winattrs, to avoid conflict with env/window) * do not use result * remove unused cell_ratio
* layout: move Strut from box -> enginebptato2023-10-142-13/+14
|
* layout: remove unused InlineAtom membersbptato2023-10-141-2/+0
|
* layout: add LineBoxStatebptato2023-10-142-64/+82
| | | | Makes LineBox objects a bit smaller.
* layout: get rid of baseline, firstBaseline functionsbptato2023-10-142-25/+22
|
* fix commentbptato2023-10-131-1/+1
|
* layout: refactor InlineContextbptato2023-10-132-162/+187
| | | | | Most InlineContext members may be discarded after layout, and thus belong in InlineState.
* layout: fix table cell sizing with specified widthsbptato2023-09-202-19/+59
| | | | | | | | | | | | | | | | | | | Say we have a table <TABLE> <TR> <TD WIDTH=20>a</TD> </TR> <TR> <TD>aklsdfjaskdfjkl</TD> </TR> </TABLE> This should be 20 pixels wide, not as wide as the second row. Also, larger specified widths now always override previous widths specified on the column. (I think this was a regression, but the previous solution to this problem was an ugly hack.)
* move around more modulesbptato2023-09-142-2/+2
| | | | | | | | | | * ips -> io/ * loader related stuff -> loader/ * tempfile -> extern/ * buffer, forkserver -> server/ * lineedit, window -> display/ * cell -> types/ * opt -> types/
* layout: make table rowspan occupy several rowsbptato2023-09-112-20/+51
| | | | | Now cells with a rowspan > 1 actually occupy several rows. The implementation is quite ugly but it should work for now.
* layout: fix table row group regressionbptato2023-09-101-9/+29
| | | | | Turns out we had the row groups separated for a reason: we need them so we can implicitly sort rows based on their row group type.
* layout: simplify preBuildTableRowsbptato2023-09-091-36/+13
| | | | the iterator here was rather pointless
* layout: remove commented out hackbptato2023-09-091-10/+0
| | | | | | Specifically, we used to set the width computed value of table cells manually in the past. It was a hack that never worked very well, and has been unnecessary ever since we switched to SizeConstraints.
* layout: add table rowspanbptato2023-09-092-11/+57
|
* layout: count spacing before inline padding toobptato2023-07-281-2/+10
|
* layout: remove incorrect commentbptato2023-07-271-2/+0
|
* layout: distinguish padding from spacingbptato2023-07-272-5/+23
| | | | | Re-consideration of 1e0506adb: we do need to explicitly specify padding after all, so the rendering engine knows of it too.
* layout: fix incorrect parenthesesbptato2023-07-271-1/+1
| | | | | | In the tab width case, only whitespacenum was being divided instead of charwidth + whitespacenum, which resulted in an exponential growth of both charwidth and whitespacenum.
* layout: do not treat inline padding as spacingbptato2023-07-271-5/+6
| | | | | So e.g. padding: 1px does not inhibit automatic addition of spaces for inline blocks.
* layout: remove unused variablesbptato2023-07-271-3/+0
|
* layout: refactor absolute positioning width calcbptato2023-07-271-13/+84
| | | | Still not perfect, but at least not completely broken.