summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
AgeCommit message (Collapse)Author
2022-08-23LibWeb: Don't regenerate linear gradient data unless size changesMacDue
This is an easy check to add and seems like it makes things a tiny bit smoother.
2022-08-23LibWeb: Add missing checks to LinearGradientStyleValue::equals()MacDue
2022-08-23LibWeb: Parse double-position `linear-gradient()` color stopsMacDue
The only accepted syntax for these seems to be <color> <length percentage> <length percentage>, no other order. But that's just gathered from looking at other browsers as though these are supported by all major browsers, they don't appear in the W3C spec.
2022-08-21LibWeb: Make window.performance replaceable and configurableLuke Wilde
Required by Discord, which polyfills it by taking the existing native object, polyfilling missing functions and setting window.performance to it. This is a hard requirement as this is done in strict mode with no try/catch and thus causes their JavaScript to stop progressing.
2022-08-18LibWeb: Support painting `repeating-linear-gradient()`sMacDue
2022-08-18LibWeb: Avoid NaNs from zero-length gradient color stopsMacDue
2022-08-18LibWeb: Parse `repeating-linear-gradient()`MacDue
Including `-webkit-repeating-linear-gradient()`
2022-08-16LibWeb: Render flex line items RTL (reversed items) for FlexEndwatkinsr
This is a basic attempt at trying to handle parent container case justify-content: flex-end. Test-scenario: Head to https://ryanwatkins.me and note that now the header nav is on the right as opposed to the left in-line with how Chrome/Firefox would respectively handle it also, i.e. 'flex-end' Implementation: Move cursor to the end and render in reverse backwards shifting the cursor leftwards.
2022-08-15LibJS: Use NaN boxing to decrease the memory size of Valuesdavidot
Using the fact that there are 2^52-2 NaN representations we can "NaN-box" all the Values possible. This means that Value no longer has an explicit "Type" but that information is now stored in the bits of a double. This is done by "tagging" the top two bytes of the double. For a full explanation see the large comment with asserts at the top of Value. We can also use the exact representation of the tags to make checking properties like nullish, or is_cell quicker. But the largest gains are in the fact that the size of a Value is now halved. The SunSpider and other benchmarks have been ran to confirm that there are no regressions in performance compared to the previous implementation. The tests never performed worse and in some cases performed better. But the biggest differences can be seen in memory usage when large arrays are allocated. A simple test which allocates a 1000 arrays of size 100000 has roughly half the memory usage. There is also space in the representations for future expansions such as tuples and records. To ensure that Values on the stack and registers are not lost during garbage collection we also have to add a check to the Heap to check for any of the cell tags and extracting the canonical form of the pointer if it matches.
2022-08-14LibWeb: Remove unused member LineBuilder::m_layout_modeAndreas Kling
2022-08-14LibWeb: Add fixmes for other missing CRC2D mixinsSam Atkins
2022-08-14LibWeb: Extract CanvasPathDrawingStyles class from CRC2DSam Atkins
2022-08-14LibWeb: Extract CanvasImageData class from CRC2DSam Atkins
2022-08-14LibWeb: Extract CanvasDrawImage class from CRC2DSam Atkins
2022-08-14LibWeb: Extract CanvasText class from CRC2DSam Atkins
2022-08-14LibWeb: Extract CanvasDrawPath class from CRC2DSam Atkins
Again, this is an entirely virtual class since the methods involve direct access to the Painter. Though, maybe I could just expose the Painter...
2022-08-14LibWeb: Extract CanvasRect class from CRC2DSam Atkins
This one requires drawing to the canvas, so it doesn't make so much sense to move the implementation over.
2022-08-14LibWeb: Extract CanvasFillStrokeStyles class from CRC2DSam Atkins
2022-08-14LibWeb: Extract CanvasFillStrokeStyles class from CRC2DSam Atkins
2022-08-14LibWeb: Extract CanvasTransform class from CRC2DSam Atkins
The implementation of this got a little funky, because it has to access methods from CanvasState.
2022-08-14LibWeb: Extract CanvasState class from CRC2DSam Atkins
As with CanvasPath, this is to better match the spec IDL.
2022-08-14LibWeb: Teach CRC2D to draw Path2Ds :^)Sam Atkins
2022-08-14LibWeb: Implement Path2D classSam Atkins
2022-08-14LibWeb: Extract CanvasPath class from CRC2DSam Atkins
This better matches the spec, and makes it possible for things like Path2D to reuse the same implementation without duplicate code. :^)
2022-08-14LibWeb: Use "unrestricted float/double" where we should in IDLSam Atkins
2022-08-14LibWeb: Use parent and sibling positions for absolutely positioned divmartinfalisse
If absolutely positioned divs do not have a fixed position, then their position must be calculated based off of the position of their parent and their siblings.
2022-08-14LibWeb: Factor out compute_y_positionmartinfalisse
Factor out the code that computes the vertical position of a Box with respect to its siblings so that it can be used when computing the absolutely positioned divs as well.
2022-08-12LibWeb: Implement `linear-gradient()` transition hintsMacDue
These allow you to specify the point were the gradient transitions from one color to the next (without a transition hint the transition occurs at the point 50% of the way between the two colors). There is a little bit of guesswork in this implementation as the specification left out how hints work with the color stop fixup, though it appears that they are treated the same as color stops.
2022-08-10LibWeb: Follow `image-rendering` when painting image style valuesMacDue
2022-08-08LibWeb: Avoid painting background-images under opaque bordersMacDue
Without this the background-image can be painted up to 8 extra times, that contribute nothing to the final image.
2022-08-08LibWeb: Convert images to common AbstractImageStyleValue baseMacDue
This commit moves both the ImageStyleValue and LinearGradientStyleValue to a common base class of AbstractImageStyleValue. This abstracts getting the natural_width/height, loading/resolving, and painting the image. Now for 'free' you get: - Linear gradients working with the various background sizing/repeat properties. - Linear gradients working as list-markers :^) -- best feature ever! P.s. This commit is a little large as it's tricky to make this change incrementally without breaking things.
2022-08-08LibWeb: Don't allow mixed commas/no commas in rect() css valuesMacDue
This fixes the clip-rect-comma-002, clip-rect-comma-003, and clip-rect-comma-004 web platform tests.
2022-08-08LibWeb: Fix resolution of CSS clip rectMacDue
Previously the clip rect was not relative to the top/left egdes of the element, which lead to it being positioned incorrectly. This fixes the clip-rect-auto-004 and clip-rect-auto-005 web platform tests.
2022-08-08LibWeb: Enable CSS clip for `position: fixed` elementsMacDue
This fixes the clip-absolute-positioned-002 web platform test.
2022-08-08LibWeb: Fix RectStyleValue to_string() implementationTom
Fix implementation of to_string() for RectStyleValue so that it can be used by JS.
2022-08-07LibWeb: Allow % height of a % height parent in block-formatted elementsMacDue
With this you can start to see Francine's face in the CSS oil painting (https://diana-adrianne.com/purecss-francine/)
2022-08-07LibWeb: Allow absolute boxes to have a % height of a % height parentMacDue
Previously absolutely positioned boxes could only have a % height if their parent had a absolute height (a height in pixels, em, etc). This broke some websites/demos such as the "Francine CSS oil painting", which starts to appear after this commit. Francine: https://diana-adrianne.com/purecss-francine/
2022-08-07LibWeb: Implement clip propertyTom
Implement clip when it is defined in the css property 'clip' as a rect according to spec; only when the div is absolutely positioned.
2022-08-07LibWeb: Use rect value in CSS clip propertyTom
When a rect value is passed to the clip property via CSS, keep it in ComputedValues so that at a later stage can make use of it.
2022-08-07LibWeb: Parse rect style valueTom
Add ability to parse a rect when it is used as the value of a style property.
2022-08-07LibWeb: Support `-webkit-linear-gradient()` correctlyMacDue
The -webkit version of linear-gradient does not include the `to` before a <side or corner>. The angles of the <side or corner> for the webkit version are also opposite that of the standard one. So for the standard: linear-gradient(to left, red, blue) The webkit version is: -webkit-linear-gradient(right, red, blue) Adding the `to` in the -webkit version is invalid, omitting it in the standard one is also invalid.
2022-08-06LibJS+LibWeb: Restore type safety of Realm::set_global_object()Linus Groh
The changes from 8a03b17 to allow any JS::Value aren't a good fit, as shown by the excessive amount of verify_cast needed :^)
2022-08-05LibWeb: Port web workers to the "create a new JavaScript realm" APIAndreas Kling
2022-08-05LibWeb: Don't paint non-visible framesAndreas Kling
This fixes an issue where iframes hidden with CSS `visibility: none` would still be visible.
2022-08-05LibWeb: Support assigning to window.locationAndreas Kling
Assignments actually forward to window.location.href, as the spec requires. Since the window object is implemented by hand, this looks a little janky. Eventually we should move all this stuff to IDL.
2022-08-05LibWeb: Bring browsing context creation closer to specAndreas Kling
This patch implements the "create a new browsing context" function from the HTML spec and replaces our existing logic with it. The big difference is that browsing contexts now initially navigate to "about:blank" instead of starting out in a strange "empty" state. This makes it possible for websites to create a new iframe and start scripting inside it right away, without having to load an URL into it.
2022-08-05LibWeb: Add API for setting a document's referrerAndreas Kling
2022-08-05LibWeb: Store document origin as a HTML::Origin objectAndreas Kling
This will allow us to remember an arbitrary origin instead of deriving it from the document's URL.
2022-08-05LibWeb: Clear the "is initial about:blank" flag in Document.write()Andreas Kling
2022-08-05LibWeb: Use Document::m_type to check for XML documentsAndreas Kling
...instead of doing a string compare on the DOCTYPE node.