| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
This isn't great, but neither was passing around a pointer that pointed
to a single object.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For now, the skeleton remains in layout. Eventually it should be
lazily constructed during the actual layout pass (thereby making layout
"single-pass" (sometimes :p))
The end goal is to do it all in styledNode.children, so that caching can
be as simple as "next box = find next matching cached box ?? make new".
This does mean that the internal structure of cached boxes will always
have to be reconstructed, but I don't see a better way. (I suppose it
still remains possible to optimize out the unnecessary layout pass when
only a repaint is needed (e.g. color change) by modifying computed
values in-place.)
|
| |
|
|
|
| |
The marker placement in that test is wrong, but that isn't really a
result of this change.
|
| |
|
|
|
|
|
| |
* remove inlineGroup - it was completely pointless now, and was the
cause of some whitespace collapsing bugs
* fix a float bug made visible by the above change
* fix non-standard list item counter behavior
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* normalize flow baseline computation
* fix various margin collapsing bugs
* eliminate inlineStack
* eliminate push*
* derive BlockBox and InlineBox from CSSBox
This removes a pointer from BlockBox, and adds a pointer to both
BlockBox and InlineBox (type field). A net loss, but it makes the code
more manageable.
Plus, inline groups now need one less allocation, so overall it's not
that bad.
|
| |
|
|
| |
Now select[multiple] options have the same coloring as w3m.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Anonymous inline boxes were blocking progress on layout caching, so they
are now gone. Instead, we handle them in layoutInline (which meanwhile
has spaghettified to beyond comprehension... now it's a special case
of inner BlockBox (kind of?) - incredibly, it still passes tests :P)
This seems to match what major browsers do as well; some test cases were
updated to reflect the "improved" rendering this brings.
Next I'd like to remove anonymous table boxes by generating them in
cascade. Then it should be straightforward enough to at least reuse
flow roots on relayout.
(And clean up flow layout...)
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Most calc calls I've seen look something like "calc(100% - 2em)",
i.e. just a percentage value offset by a pixel value.
As it happens, we also had 24 bits available in CSSLength objects
because of padding. Just enough to smuggle in that offset :)
Very limited of course, but it does fix layout on a couple of websites.
|
| |
|
|
| |
hsl is quite popular these days.
|
| |
|
|
| |
I'm not convinced that anybody even knows these exist, but whatever.
|
| | |
|
| |
|
|
| |
...and refactor applyValue in the process.
|
| |
|
|
|
| |
We now compute styles on-demand, which is both more efficient and
simpler than the convoluted tree diffing logic we previously used.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
font-size isn't very useful, but some scripts assume it exists.
opacity: 0 for now is special cased: it inhibits rendering of further
boxes. This isn't quite right, as it should just behave as a pseudo
visibility: hidden... nonetheless it's quite effective at hiding
garbage.
(Also, remove incorrect comment - it can be nil if the branch has no
variables.)
|
| |
|
|
|
|
|
|
|
|
|
| |
and once again, there was light...
Well, it barely works, but it's enough to get colors back on most sites.
Nested variables aren't supported for now, and shorthand expansion only
"works" for `background' (it's a hack).
Props to the W3C for introducing the C preprocessor to CSS - I was
starting to confuse it with JSSS after calc().
|
| | |
|
| |
|
|
|
|
|
|
|
| |
Untangled some nested arrays to reduce the number of intermediary seqs
in cascade, and collapsed the two rule def sorts into just one (per
pseudo element). This should make cascading somewhat faster.
Also, we now parse variables, but they aren't resolved yet.
Probably a seq won't cut it for var lookup...
|
| |
|
|
| |
they fit into 8 and 64 bits respectively
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* switch from float64 -> float32; other browsers use 32-bit floats too
* specify integer size as 32-bit
* use NetworkBitmap for background-image value (currently just an
invalid dummy value)
* remove "none" property & value types
CSSValue's payload is always one word (plus another for the type tag).
CSSValues keeps its size, but no longer has to heap-alloc + refcount
word-sized CSSValues.
(On 32-bit systems, CSSValues might actually be larger than before,
but I expect it's still a net benefit with the removal of refcounting
and the switch to 32-bit floats.)
|
| | |
|
| |
|
|
| |
less work for memset
|
| |
|
|
| |
better than nothing
|
| |
|
|
| |
@media (grid: 1) works again.
|
| |
|
|
|
| |
This must not be handled by the tree builder, as that needlessly
complicates tree caching.
|
| |
|
|
| |
We do not support sticky scrolling, but this much should still work.
|
| |
|
|
|
| |
sticky, ruby, writing-mode: lots of complexity for little gain, and the
fallback works just as well (if not better)
|
| |
|
|
| |
Only available in "app" mode.
|
| | |
|
| |
|
|
|
|
| |
you can't bisearch an unsorted map...
(also, turn on text styling for colored layout tests because it would
have caught this)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Overflow pretty much requires scrollbars, but those wouldn't work in
dump mode, plus of course they would be a pain to implement. So as a
simple alternative:
* overflow: hidden, clip works as per spec.
* overflow: auto, overlay, scroll invert the intrinsic minimum size
clamping logic instead of adding a scrollbar.
What this concretely means, is that this
<pre style="overflow: scroll; height: 1em">
test
test
test
</pre>
will, instead of creating a scroll container, just override the
specified height.
This hack works surprisingly well, because CSS pretty much requires
setting height on scroll containers, so authors aren't incentivized to
set height on the parent container too (because the contents are already
sized appropriately).
One issue left is how to deal with overflow: hidden ancestors. For now,
I've made it so that it can spill for overflow-x, and always clips
on overflow-y, because it's much less likely to bleed into other
text horizontally than vertically. But there is definitely room
for improvement, e.g. we could track space requested by scrolling
children and expand parent boxes based on that.
|
| |
|
|
| |
Lets us skip a couple pointless multiplications/divisions during layout.
|
| |
|
|
|
| |
"Computed" was redundant; other types of values don't have a common
type.
|
| |
|
|
|
|
|
|
| |
Roughly halves the object's size, and gets rid of a large number of
allocations.
It could be compressed further into a bitmap, but I'm not sure if it's
worth the complexity.
|
| |
|
|
|
|
| |
so for max-width it's called "none", but for min-width it's "auto".
why :(
|
| | |
|
| | |
|
| |
|
|
| |
only the most basic form; no media queries yet
|
| |
|
|
|
| |
This couldn't get into system.nim for technical reasons, but it's still
pretty useful when iterating over non-mutable openArrays.
|
| |
|
|
|
|
|
| |
far from perfect, but it's something.
(ideally, we should store enums in a bitmap instead of allocating a
GC'ed property for each of them.)
|
| |
|
|
| |
as much as I wish it weren't, layout *is* css.
|
| |
|
|
|
| |
negative z-index and inline positioning are still not respected, but
better than nothing I guess.
|
| |
|
|
|
| |
* line, vector, matrix -> path
* twtuni, charcategory -> twtstr
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Called -cha-reverse.
Mostly to solve the problem that code tags are indistinguishable from
regular text - on a graphical browser this is normally served by
monospace font, but we always use monospace...
So now the default ua.css adds reverse video to code and xmp. pre
remains as it was, because it means "preformatted", not "monospaced".
Also, it would mess with our whatever-to-HTML converter output.
|
| |
|
|
|
|
| |
* split out CSSColor from CellColor; now CellColor is just 4 bytes
(which helps reduce FormatCell size)
* unify color function naming (still not perfect)
|
| |
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
Do it like parseEnumNoCase0, so we no longer instantiate a gazillion
different binary searches for the same type.
While we're at it, make matchNameProduction's searchInMap use uint32
too.
|