Commit Graph

39985 Commits

Author SHA1 Message Date
MacDue
da79883b60 Base: Add the styled progress bar demo from css-tricks.com
See: https://css-tricks.com/html5-progress-element/ this is a neat
demo of a pure CSS progress bar that makes use of linear-gradients,
background-repeat, and background-size. All of which now work :^)
2022-08-08 22:39:06 +02:00
MacDue
d0511ec650 LibWeb: Avoid painting background-images under opaque borders
Without this the background-image can be painted up to 8 extra
times, that contribute nothing to the final image.
2022-08-08 22:39:06 +02:00
MacDue
6a6475673f LibWeb: Convert images to common AbstractImageStyleValue base
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-08 22:39:06 +02:00
MacDue
264543b90a LibGfx: Add Size<T>::to_rounded<I>()
Currently this is only specialized for rounding to integer types.
2022-08-08 22:39:06 +02:00
Riyyi
77f0a66d2f Documentation: Add clang-format variant to EmacsConfiguration.md
Add a variant of auto formatting using clang-format that doesn't use
additional packages. It works by adding a buffer-local hook to
`'before-save` for all C++ project files.
2022-08-08 16:36:23 -04:00
demostanis
6744402dbf Base: Replace getopt with getopt_long in man page 2022-08-08 16:35:28 -04:00
MacDue
361fc56632 LibWeb: Don't allow mixed commas/no commas in rect() css values
This fixes the clip-rect-comma-002, clip-rect-comma-003, and
clip-rect-comma-004 web platform tests.
2022-08-08 14:03:29 +02:00
MacDue
9c8aa5b777 LibWeb: Fix resolution of CSS clip rect
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-08 14:03:29 +02:00
MacDue
038017ce11 LibWeb: Enable CSS clip for position: fixed elements
This fixes the clip-absolute-positioned-002 web platform test.
2022-08-08 14:03:29 +02:00
Tom
6b2e93eb7c LibWeb: Fix RectStyleValue to_string() implementation
Fix implementation of to_string() for RectStyleValue so that it can be
used by JS.
2022-08-08 12:16:36 +02:00
Liav A
cf33d0b5f7 Kernel/FileSystem: Use a new debug flag for SysFS debug messages 2022-08-08 02:33:25 +00:00
MacDue
a6505f6e6d LibWeb: Allow % height of a % height parent in block-formatted elements
With this you can start to see Francine's face in the CSS oil painting
(https://diana-adrianne.com/purecss-francine/)
2022-08-07 22:52:22 +02:00
MacDue
0e8dafcbb8 LibWeb: Allow absolute boxes to have a % height of a % height parent
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-07 22:52:22 +02:00
Tom
5049a56d96 LibWeb: Implement clip property
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-07 22:40:11 +02:00
Tom
8163ee1500 LibWeb: Use rect value in CSS clip property
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-07 22:40:11 +02:00
Tom
b4dd477644 LibWeb: Parse rect style value
Add ability to parse a rect when it is used as the value of a style
property.
2022-08-07 22:40:11 +02:00
Tom
4d1ceaaa43 Base: Add test page for CSS clip property 2022-08-07 22:40:11 +02:00
Karol Kosek
5c4d130af5 Browser: Make Refresh action in tab context menu refresh the chosen tab
It was sending refresh requests to the current tab instead.
2022-08-07 20:49:45 +02:00
Karol Kosek
0db481c763 Browser: Make the bookmark button use an action
This merges 2 duplicated definitions (one for button, second just for
the keyboard shortcut) which also makes the button 'react' on that
shortcut. :^)
2022-08-07 20:49:45 +02:00
Karol Kosek
3b5766d078 Browser: Show bookmark and history page lists under the their buttons
Previously they were showing right under the cursor.
2022-08-07 20:49:45 +02:00
Karol Kosek
8f5968d4ad Browser: Set margins for BookmarkBarWidget
It's just what GUI::Toolbar is using. Changed this to make the bookmark
overflow button align with the bookmark button.
2022-08-07 20:49:45 +02:00
Karol Kosek
d80bc2ba32 Browser: Use overflow-menu icon for hidden bookmarks the button
97b381652a started using that icon for toolbars. Let's also use it here
for the sweet system consistency!
2022-08-07 20:49:45 +02:00
MacDue
6dd854faec Base: Add an example -webkit-linear-gradient() 2022-08-07 20:47:31 +02:00
MacDue
ca2e345cdc LibWeb: Support -webkit-linear-gradient() correctly
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-07 20:47:31 +02:00
djwisdom
834d936bbc Base: Add HexEditor manual 2022-08-07 17:31:17 +00:00
Timon Kruiper
c92e68da38 Kernel: Rounding size of bss to be a multiple of 8 for aarch64 linker.ld
This fixes a bug where the bss was not completely zeroed out. This bug
showed up when running the aarch64 Kernel baremetal on a Raspberry Pi.
2022-08-06 14:00:54 +01:00
Timon Kruiper
22aea9f659 Kernel: Add logic to RPi UART driver to emit CR when encountering LF
This makes sure that the debug message are properly aligned when running
the kernel bare-metal on a Raspberry Pi. While we are here, also move
the function out of line.
2022-08-06 14:00:54 +01:00
Andreas Kling
e0d7d3c3d5 LibJS: Teach String.prototype.concat() to create rope strings
Defer serialization of the concatenated strings until later. This is
used heavily in SunSpider's string-validate-input subtest, which
sees a small progression.
2022-08-06 13:50:39 +01:00
Linus Groh
8ed28890e4 LibJS: Correct BalanceDurationRelative algorithm
This is a normative change in the Temporal spec.

See:
- https://github.com/tc39/proposal-temporal/commit/cbf5863
- https://github.com/tc39/proposal-temporal/commit/f47d57d
2022-08-06 13:42:37 +01:00
Linus Groh
12edbb51bc LibJS: Rename PrimitiveString::m_{left,right} to m_{lhs,rhs}
The LHS/RHS naming is already widely used as parameter names and local
variables with the same meaning, so let's also use them for the members.
2022-08-06 12:02:48 +02:00
Linus Groh
885004abee LibJS: Support creation of global object in Realm::set_global_object() 2022-08-06 12:02:48 +02:00
Linus Groh
c8f1651761 LibJS+LibWeb: Restore type safety of Realm::set_global_object()
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-06 12:02:48 +02:00
Andreas Kling
64b29eb459 LibJS: Implement string concatenation using ropes
Instead of concatenating string data every time you add two strings
together in JavaScript, we now create a new PrimitiveString that points
to the two concatenated strings instead.

This turns concatenated strings into a tree structure that doesn't have
to be serialized until someone wants the characters in the string.

This *dramatically* reduces the peak memory footprint when running
the SunSpider benchmark (from ~6G to ~1G on my machine). It's also
significantly faster (1.39x) :^)
2022-08-06 00:29:15 +02:00
FrHun
cf62d08b2a Base: Add symbols that were previously emoji pngs 2022-08-05 21:47:03 +01:00
FrHun
bfe99ebc3e Base: Remove black only symbols from emojis 2022-08-05 21:47:03 +01:00
Beckett Normington
8f3639e7eb Base: Add yet more colorized emojis
This commit adds more colorized emojis.

🌻 - U+1F33B SUNFLOWER
🐌 - U+1F40C SNAIL
👑 - U+1F451 CROWN
📵 - U+1F4F5 NO MOBILE PHONES
🥇 - U+1F947 FIRST PLACE MEDAL
🥈 - U+1F948 SECOND PLACE MEDAL
🥑 - U+1F951 AVOCADO
🥕 - U+1F955 CARROT
🩸 - U+1FA78 DROP OF BLOOD
2022-08-05 21:42:21 +01:00
djwisdom
449935e096 Base: Update FontEditor manual use images with improved resolution 2022-08-05 13:56:15 +02:00
thankyouverycool
517c03f920 Minesweeper: Update GML and fix layout issues
Converts Minesweeper's main widget to GML, polishes the custom
game window, formats the clock as human readable digital time, and
defers invoking Field's callback until the main widget has finished
relayout. Fixes inability to downsize the main window when shrinking
field size.
2022-08-05 13:55:13 +02:00
thankyouverycool
4d09b5c4ba LibGUI: Register "bitmap" GML property for ImageWidget 2022-08-05 13:55:13 +02:00
thankyouverycool
75b6097c55 AK: Add human_readable_digital_time() helper
Converts seconds into a readable digital format. For example:
30 seconds	= "00:30"
90 seconds	= "01:30"
86401 seconds	= "24:00:01"
And so on.
2022-08-05 13:55:13 +02:00
thankyouverycool
a808cfa75c LibGUI+Applications: Govern Splitter resizing by opportunistic growth
This patch replaces the concept of fixed resizees with opportunistic
ones which use the new SpecialDimension::OpportunisticGrow UISize.
This lets us simplify splitter resize code and take advantage of
the layout system's automatic calculations for minimum size and
expansion. Functionally the same as before, but fixes Splitter's
unintended ability to grow window size.
2022-08-05 13:54:18 +02:00
thankyouverycool
6f2a304971 LibGUI: Calculate maximum primary size for Splitter resizees 2022-08-05 13:54:18 +02:00
Andreas Kling
aaa4f6d287 LibJS: Run clang-format on Realm.cpp 2022-08-05 12:55:25 +02:00
Andreas Kling
c77a0974ab LibWeb: Port web workers to the "create a new JavaScript realm" API 2022-08-05 12:46:42 +02:00
Andreas Kling
94d54069f4 LibWeb: Don't paint non-visible frames
This fixes an issue where iframes hidden with CSS `visibility: none`
would still be visible.
2022-08-05 12:46:42 +02:00
Andreas Kling
e2ae286132 LibJS: Actually create a new Realm in $262.createRealm() 2022-08-05 12:46:42 +02:00
Andreas Kling
95e011e2a0 LibWeb: Support assigning to window.location
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-05 12:46:42 +02:00
Andreas Kling
2a7924f96c LibWeb: Bring browsing context creation closer to spec
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-05 12:46:42 +02:00
Andreas Kling
73f77969a6 LibWeb: Add API for setting a document's referrer 2022-08-05 12:46:42 +02:00
Andreas Kling
6e71e400e6 LibWeb: Store document origin as a HTML::Origin object
This will allow us to remember an arbitrary origin instead of deriving
it from the document's URL.
2022-08-05 12:46:42 +02:00