summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-03-13LibWeb: Mark input elements for style update in set_checked()Andreas Kling
When the checkedness changes, :checked selectors may yield different results, so we have to update style.
2022-03-13LibWeb: Make StyleProperties::operator==(StyleProperties) actually workAndreas Kling
It was comparing against itself, oopsie!
2022-03-13LibWeb: Fix calculation of hypothetical cross size in column flex layoutAndreas Kling
Simplify automatic cross sizing of items in flex-direction:column by using the fit-content width directly. There's obviously a lot more nuance to this, but for now this makes flex items with both width:auto and height:auto actually get some height in column flex layouts.
2022-03-13LibWeb: Swap min-content and max-content intrinsic sizes if neededAndreas Kling
I'm a little confused about intrinsic heights *really* work, and I'm struggling to extract that information from the spec. In the meantime, let's ensure that min-content is always smaller than (or equal to) max-content so that other math works as expected.
2022-03-13LibWeb: Support the CSS 'unset' valueAndreas Kling
This works as 'inherit' for inherited properties and 'initial' for everything else.
2022-03-13LibWeb: Make Layout::FormattingState copies shallowAndreas Kling
Previously, each NodeState in a FormattingState was shared with the parent FormattingState, but the HashMap of NodeState had to be copied when making FormattingState copies. This patch makes copying instant by keeping a pointer to the parent FormattingState instead. When fetching immutable state via get(), we may now return a reference to a NodeState owned by a parent FormattingState. get_mutable() will copy any NodeState found in the ancestor chain before making a brand new one.
2022-03-13LibWeb: Add fast_is<SVG::SVGSVGElement>()Andreas Kling
2022-03-13LibWeb: Handle many more cases with intrinsic/auto sizing in flex layoutAndreas Kling
The flexbox specification barely even handwaves about automatically sized items, but there's actually a lot of work to do in order for them to get the correct size. This patch is messy, but does make significant progress on supporting flex items with indefinite width and/or height. There's a fair amount of nested layout going on here, but do note that we'll be hitting the intrinsic sizes cache whenever possible.
2022-03-13LibWeb: Add functions for calculating intrinsic sizes of a Layout::BoxAndreas Kling
FormattingContext can now calculate the intrinsic sizes (min-content and max-content in both axes) for a given Layout::Box. This is a rather expensive operation, as it necessitates performing two throwaway layouts of the subtree rooted at the box. Fortunately, we can cache the results of these calculations, as intrinsic sizes don't change based on other context around the box. They are intrinsic after all. :^)
2022-03-13LibWeb: Make Layout::SVGBox a BlockContainer againAndreas Kling
This wasn't worth the headache of trying to make SVG boxes work together with BFC right now. Let's just make it a block container once again, and have its corresponding SVGPaintable inherit from PaintableWithLines. We'll have to revisit this as SVG support improves.
2022-03-13LibWeb: Add FFC helpers for resolving definite main/cross sizesAndreas Kling
Although something has a definite size, we may still have to "resolve" it, since FFC is quite liberal in what it considers to be definite. Let's put that logic in a set of helper functions.
2022-03-13LibWeb: Remove ad-hoc setup step from FFC layout algorithmAndreas Kling
This step will not be necessary when we implement indefinite size calculations more correctly.
2022-03-13LibWeb: Improve how layout nodes decide whether they have definite sizesAndreas Kling
1. Make this decision *after* we've inserted the layout node into the layout tree. Otherwise, we can't reach its containing block! 2. Per css-sizing-3, consider auto-sized blocks whose sizes resolve solely against other definite sizes as definite themselves. In particular, (2) makes us consider width:auto block children of a definite-size containing block as having definite size. This becomes very important in flex layout.
2022-03-13LibWeb: Apply non-CSS presentational hints before author stylesAndreas Kling
According to css-cascade-4, we should apply presentational hints from content attributes *before* author styles.
2022-03-13LibWeb: Only collapse vertical margin between BlockContainer siblingsAndreas Kling
If there's some non-block-level box (like an SVG element of some kind) between to blocks, just skip over the non-block for purposes of margin collapsing. This is basically a hack, and something we'll need to improve as part of our general SVG support.
2022-03-13LibWeb: Support indefinite flex container cross sizesAndreas Kling
Instead of assuming that any indefinite cross size must be "auto", check what is actually is, and resolve it accordingly.
2022-03-13LibWeb: Fix flex line alignment in single-line flex containersAndreas Kling
For single-line flex containers, center the only flex line along the cross axis. Alignment of multi-line flex containers are left as a FIXME. This patch also moves out the assignment of final metrics to the FormattingState from align_all_flex_lines() to a separate function.
2022-03-13LibWeb: Remove FFC::cross_size_is_absolute_or_resolved_nicely()Andreas Kling
This is now answered authoritatively by Layout::Box itself.
2022-03-13LibWeb: Improve FFC step 7 (hypothetical cross size)Andreas Kling
- Avoid performing inside layout on definite-size flex items (since their computed size can be used as-is.) - Use FormattingState::clone() to generate a throwaway layout instead of mutating the tree in-place. - Update spec link & comments based on current CSSWG draft. The latest version is quite a bit clearer on how this should work.
2022-03-13LibWeb: Put available space information in an FFC memberAndreas Kling
This makes it easier for each step of the flex layout algorithm to access this information.
2022-03-13LibWeb: Layout inside of flex items at the end of FFC layoutAndreas Kling
Instead of doing internal child layout incrementally as we go, save it for the end of flex layout. The code will become simpler if we can focus on simply computing the dimensions of each flex item while we're doing the main FFC algorithm.
2022-03-13LibWeb: Move unrelated things out of FFC step 1Andreas Kling
Setting some initial width and height on the flex container is totally unrelated to the "generate anonymous flex items" step.
2022-03-13LibWeb: Avoid unnecessary layout_inside() in FFC step 1Andreas Kling
We don't need to perform inside layout here. The only information we need in this step is whether an anonymous block container has nothing but empty-or-whitespace text children. This information is already accurate after the initial layout tree construction. Performing a layout does not change the answer. It does however have many other side effects, so let's defer those.
2022-03-12Kernel: Move aarch64 Prekernel into KernelJakub V. Flasar
As there is no need for a Prekernel on aarch64, the Prekernel code was moved into Kernel itself. The functionality remains the same. SERENITY_KERNEL_AND_INITRD in run.sh specifies a kernel and an inital ramdisk to be used by the emulator. This is needed because aarch64 does not need a Prekernel and the other ones do.
2022-03-12Kernel: Create a stub mcontext for aarch64Jakub V. Flasar
The struct only has a stub integer so that the size is the same for C and C++. Something caught by CLion. This commit was made with mrkct's help!
2022-03-12LibWeb: Implement HTMLTableSectionElement::deleteRow()Idan Horowitz
2022-03-12LibWeb: Implement HTMLTableSectionElement::insertRow()Idan Horowitz
2022-03-12LibWeb: Correct invalid index check in HTMLTableElement::insertRow()Idan Horowitz
As well as change the matching error message in deleteRow(), which likely caused this mistake in the first place.
2022-03-12Libraries: Use default constructors/destructors in LibGUILenny Maiorani
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
2022-03-12LibWeb: Apply the current text-justify value when justifyingsin-ack
This implements at least some of the specification. inter-character is not yet handled. However as our current algorithm only considers whitespace as word breaks, inter-word could technically be considered to be handled. :^)
2022-03-12LibWeb: Add support for the text-justify propertysin-ack
This commit adds the text-justify property as defined in: https://drafts.csswg.org/css-text/#propdef-text-justify
2022-03-12LibWeb: Refactor text justification code + only justify below thresholdsin-ack
All the justification-related code is now in InlineFormattingContext::apply_justification_to_fragments and is performed after all the line boxes have been added. Text justification now only happens on the last line if the excess space including whitespace is below a certain threshold. 10% seemed reasonable since it prevents the "over-justification" of text. Note that fragments in line boxes before the last one are always justified.
2022-03-12LibWeb: Keep SVG elliptical arc shape when applying viewboxSimon Danner
When doing viewbox transforms, elliptical always had large arc and sweep flag set to false. Preserve these flags so they can be set correctly when applying viewbox transformations.
2022-03-12AK: Properly parse unimplemented format length specifiersTim Schumacher
This keeps us from stopping early and not rendering the argument at all.
2022-03-12Base: Finish Misc Technical glyphs in Katica 10diogenes
I finished off the Miscellaneous Technical section, that is U+2300 - U+23FF, itemized below. Now we have a bunch of APL glyphs :^) 2205 2300 - 2313 2319 231C - 2325 2329 - 232A 232C - 237F 238D - 2395 239B - 23CC 23D0 - 23E8 23AE 23FF 2B21
2022-03-12LibWeb: Let paintables cache their containing block and absolute rectAndreas Kling
The absolute rect of a paintable is somewhat expensive to compute. This is because all coordinates are relative to the nearest containing block, so we have to traverse the containing block chain and apply each offset to get the final rect. Paintables will never move between containing blocks, nor will their absolute rect change. If anything changes, we'll simpl make a new paintable and replace the old one. Take advantage of this by caching the containing block and absolute rect after first access.
2022-03-11LibJS: Apply source's byte offset in TA#set when both TAs have same typeLuke Wilde
On the code path where we are setting a TypedArray from another TypedArray of the same type, we forgo the spec text and simply do a memmove between the two ArrayBuffers. However, we forgot to apply source's byte offset on this code path. This meant if we tried setting a TypedArray from a TypedArray we got from .subarray(), we would still copy from the start of the subarray's ArrayBuffer. This is because .subarray() returns a new TypedArray with the same ArrayBuffer but the new TypedArray has a smaller length and a byte offset that the rest of the codebase is responsible for applying. This affected pako when it was decompressing a zlib stream that has multiple zlib chunks in it. To read from the second chunk, it would set the zlib window TypedArray from the .subarray() of the chunk offset in the stream's TypedArray. This effectively made the decompressed data from the second chunk a mis-mash of old data that looked completely scrambled. It would also cause all future decompression using the same pako Inflate instance to also appear scrambled. As a pako comment aptly puts it: > Call updatewindow() to create and/or update the window state. > Note: a memory error from inflate() is non-recoverable. This allows us to properly decompress the large compressed payloads that Discord Gateway sends down to the Discord client. For example, for an account that's only in the Serenity Discord, one of the payloads is a 20 KB zlib compressed blob that has two chunks in it. Surprisingly, this is not covered by test262! I imagine this would have been caught earlier if there was such a test :^)
2022-03-11Meta: Update hashes in Port's READMETobias Christiansen
Only 'sha256' or 'sig' are allowed in the 'auth_type' field in order for the linter to pass. Reflect that into the README and give a description on what to do to create a hash. Also expand the examples to include a SHA256 hash.
2022-03-11Ports: Specify sha256sum for the GNU APL portTobias Christiansen
2022-03-11Ports: Add GNU APLTobias Christiansen
Since the glyphs are being worked on, a APL interpreter seems like a good way to use them.
2022-03-11Browser: Don't crash when selecting nothing in the Inspector DOM treeSam Atkins
2022-03-11LibWeb: Stub getting the initial font instead of the root oneSam Atkins
Previously this queried the root layout-node's font, which was both wrong and could crash if the layout wasn't ready yet. Now, it's just wrong. But at least all the font-related wrongness is grouped together in StyleComputer. :^)
2022-03-11LibGfx+LibSoftGPU: Allow indexed reads into `Gfx::Vector`Jelle Raaijmakers
2022-03-11LibSoftGPU: Remove unused vector types from `Device`Jelle Raaijmakers
2022-03-11LibGfx: Abort draw_circle_arc_intersecting with 0 radiusJoe Petrus
In testing a particular website (https://www.icpms.com), WebContent was crashing with infinite recursion in draw_circle_arc_intersecting. Presumably, radius must be > 0 to paint something, so this trivial patch simply returns if radius <= 0. The website in question no longer crashes WebContent.
2022-03-11Shell: Stop parsing options after the script nameTim Schumacher
2022-03-10LibCore: Verify that EventLoop is initialized in its static APIjavabird25
2022-03-10Libraries: Use default constructors/destructors in LibGLLenny Maiorani
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
2022-03-10Libraries: Use default constructors/destructors in LibELFLenny Maiorani
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
2022-03-10Libraries: Use default constructors/destructors in LibDlLenny Maiorani
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."