| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
negative z-index and inline positioning are still not respected, but
better than nothing I guess.
|
|
|
|
|
|
|
|
| |
* fix min-width, max-width, etc. not being accounted for properly on the
main axis
* fix fit-content sizing being overridden for flex items
* fix baseline not being set
* somewhat unrelated: fix firstBaseline not being set for block boxes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before, the initial layout of a flex item would have inherited the
parent's sizing constraint. This almost worked, except when a descendant
of a flex item with an unspecified width would resolve its percentage
against this incorrectly inherited width - per standard, this must
resolve to auto.
Also, the shrink case was wrong, because it did not scale the unit to
the respective widths; the standard mandates this as well. Hopefully I
got it right this time.
Finally, this fixes positioned inline container blocks not being set
as the absolute container.
|
| |
|
|
|
|
|
|
|
|
|
| |
It broke styles like "margin-top: -5px; padding-top: 5px", because the
margin would be taken as-is, and the padding rounded to 0. Now they
cancel each other out again.
(I think I had added this to reduce error caused by line-height, but we
don't have line-height anymore.)
|
|
|
|
| |
+ clean up a bit
|
|
|
|
|
|
|
|
|
| |
you can't just set the BFC offset to your own offset when the BFC's
origin is your inner offset.
(in block layout, this is addressed by initBlockPositionStates & co,
but we don't call that for inline because the offset is already resolved
there anyway. so this is a special case)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* simplify "positioned" value calculation:
- don't include it in ResolvedSizes, since it's unused in most
layouts
- resolvePositioned for both absolute and relative positioning
- use "size" instead of "space" for absolute positioning
- include parent width in layout so that renderdocument does not
have to account for it
* return bottom margins as regular return values instead of var
* fix child bottom margins being discarded in inline floats
* fix inline float not including the parent block position in its BFC
position
|
|
|
|
|
|
|
|
|
|
|
|
| |
* factor out `margin' field from box state
* get rid of RootInlineFragment
* `nested' -> `children'
* get rid of repositionChildren pass; now we handle relative positioning
and -cha-center/-cha-right separately
* cha-center, cha-right no longer applies to floats
* use consistent naming scheme for tests
* fix float bottom margin strut not being flushed
* fix inline floats changing non-fit-content width
|
| |
|
|
|
|
|
| |
Found this because the 5th largest tech company on Earth cannot bother
itself with trivial matters such as "writing valid CSS".
|
|
|
|
|
|
| |
This isn't exactly clear from the standard's wording, but e.g. *display:
inline must be discarded (because it incorrectly starts with a delim
token).
|
|
|
|
|
|
|
|
|
|
| |
Nested position: absolute was broken, so fix it.
Also, it makes no sense to dispatch inside layoutBlockChild when we
know the expected resolution algorithm upon calling it anyway, so now we
do that statically.
Finally, fix some bugs in position: absolute size resolution.
|
|
|
|
|
| |
As per standard, float "only applies to elements that [...] are not
absolutely positioned."
|
|
|
|
|
|
| |
also fixes a bug in the previous commit where whitespacenum would be
reset on absolute positioning + missing absolute margin handling without
top/left/etc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a) resolution of `position: absolute' percentage sizes with
an indefinite containing block size (wait what?), and b) positioning of
`position: absolute' inner block boxes inside inline boxes.
a) is possible because `position: absolute' does not affect its
parent's layout. I would love to have a long talk with whoever
thought that specifying it like this is a good idea. You know, just
because you can... anyways, shockingly enough, this was still the more
straightforward part.
b) forced me to change the box tree to allow blocks inside inlines,
which is ugly, but no big deal. Two questions then remained:
1. *where* to put such boxes, and
2. *how large* these boxes should be; this is hardly obvious since
an inline box does not have an unambiguous width or height.
Of course the CSS standard, never too eager to fulfill my basic
expectations, says nothing about this (other than "it's not defined").
So I first tried to reverse engineer what Gecko does, and after hours of
pain and suffering I realized... that it's broken LOL
https://bugzilla.mozilla.org/show_bug.cgi?id=489100
Therefore I ended up (partially) copying Blink behavior, which, while
equally nonsensical as Gecko (and of course divergent), at least does
not change after a partial layout. Thank you LayoutNG for saving my
sanity.
As for the practical benefits: this fixes the bug where Invidious
[video] tags wouldn't show up. Hey, it's something!
Still left to-do: `position: absolute' for `display: inline' boxes.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Substitute tabs with one of eight PUA characters based on their width,
and convert them back in the pager:
* TUI mode always prints spaces, but now handles tabs appropriately on
cursor movement
* dump mode tries to preserve hard tabs, but uses soft tabs when that is
not possible (e.g. tabs after a margin, tab with background color,
etc)
* selection mode always outputs hard tabs.
|
| |
|
|
|
|
| |
+ some misc refactorings
|
|
|
|
|
| |
This was a bad idea that, despite my best efforts, never worked
properly.
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
* add responseText, response
* add net tests
-> currently sync XHR only; should find a way to do async
tests...
* update monoucha
-> simplified & updated some related code that no longer worked
properly
|
| |
|
|
|
|
|
|
|
| |
* cssvalues, twtstr: unify enum parsing code paths, parse enums by
bisearch instead of hash tables
* mediaquery: refactor (long overdue), fix range comparison syntax
parsing, make ident comparisons case-insensitive (as they should be)
|
|
|
|
|
|
|
| |
* 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)
|
|
|
|
|
| |
top/left/right/bottom should only be used in renderdocument with
position: absolute.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
| |
|
| |
|
|
|
|
| |
this one is weird but I'm sure the standard is technically right
|
|
|
|
|
| |
See attached test case; previously, this would result in a missing space
in visual mode and a crash in dump mode.
|
|
|
|
|
|
|
| |
Much cleaner than the previous solution.
Should also be somewhat less wasteful, as we no longer constantly
rebuild the same tree with new branches.
|
|
|
|
|
| |
I would prefer it to not cut off the canvas background color, but the
current output is just as valid.
|
|
|
|
|
| |
* 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.)
|
|
|
|
|
|
| |
* merge caption sizing code path with layoutRootBlock
* fix caption margins being disregarded
* fix incorrect positioning of `caption-side: bottom'
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Instead of allocating a separate object for each box, just re-use
a single BlockBox on re-layouts.
This means that now the (block-level) tree is built in its final form in
the first pass.
(Inline boxes remain the same as before for now.)
|
|
|
|
|
| |
* fix list-style-position: inside
* get rid of ListItemBoxBuilder
|
|
|
|
| |
Both outputs suck, but it probably doesn't matter much.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the following printed "2" instead of "12":
<div style=float:left>1</div><div style=display:flow-root>2</div>
This fixes the above problem in the laziest possible way: we relayout once
in the smallest possible space the BFC fits in when floats exist. See the
comment in the code for details.
As a nice bonus, this also fixes tables overlapping with floated boxes,
by pretending that they establish a BFC.
|