Commit Graph

63 Commits

Author SHA1 Message Date
Bastiaan van der Plaat
110e74b9c1 LibWeb: Move textarea cols rows attr size from css to create_layout_node 2024-03-07 10:38:17 +00:00
Bastiaan van der Plaat
7e76358a99 LibWeb: Move input size attr width from css to create_layout_node 2024-03-07 10:38:17 +00:00
Timothy Flynn
435c2c24d1 LibWeb: Create a shadow tree for <input type=file> elements
This creates a button to prompt users to select a file, and a label to
show information about the selected file(s). Clicking either shadow
element will activate the input element.
2024-02-26 14:18:49 +01:00
Timothy Flynn
debb5690ce LibWeb: Begin implementing the HTMLInputElement 'image' type state
This implements enough to represent <input type=image> with its loaded
source image (or fallback to its alt text, if applicable). This does not
implement acquring coordinates from user-activated click events on the
image.
2024-02-19 11:07:30 +01:00
Tim Ledbetter
ea9bc8ed6b LibWeb: Set cursor: default for button and select elements
This prevents an IBeam cursor being shown when these elements are
moused over.
2024-02-18 15:44:49 -05:00
Bastiaan van der Plaat
5ba8a5ba13 LibWeb: Fix bug where input range thumb is not centered 2024-01-19 19:36:28 +01:00
Bastiaan van der Plaat
52397d01bd LibWeb: Add textarea placeholder 2024-01-07 10:22:32 +01:00
Bastiaan van der Plaat
c30911ab10 LibWeb: Hide select chevron icon when appearance: none; 2023-12-23 10:12:36 +01:00
Bastiaan van der Plaat
0f37e0ee89 LibWeb: Add basic input range rendering 2023-12-21 13:17:51 +01:00
Bastiaan van der Plaat
3b3558865c LibWeb: Improve select element CSS stylebility 2023-12-10 20:56:19 +01:00
Bastiaan van der Plaat
4966c083df LibWeb: Remove progress element custom paintable use shadow dom instead 2023-12-07 11:37:01 +01:00
Bastiaan van der Plaat
2107ab823d LibWeb: Add basic HTML meter element support 2023-12-04 19:54:43 +00:00
Bastiaan van der Plaat
3175557cb8 LibWeb: Update progressbar colors to be more pleasant 2023-12-04 19:54:43 +00:00
Bastiaan van der Plaat
fb7b03d162 LibWeb: Add support for the input size attribute 2023-12-03 20:29:14 +01:00
circl
a1cce69db0 LibWeb/HTMLInputElement: Improve appearance of color picker
Instead of a plain ButtonBox, it now appears as a color well styled
after the buttons.
2023-10-16 12:46:30 +01:00
circl
63cd6b0d3c LibWeb: Make Default.css clearer about the style of input elements
Previously, all input elements were given a textbox-like style by
default, this was then undone by another CSS rule in the case of certain
types of input element. This commit makes it so that the first rule
simply ignores those types instead.

Co-authored-by: Sam Atkins <atkinssj@serenityos.org>
2023-10-16 12:46:30 +01:00
Sam Atkins
9e227dfc16 LibWeb: Flesh out HTMLTextAreaElement
Give it a shadow tree, similar to HTMLInputElement's, so that we can
actually edit its contents at a basic level. Add some CSS to use the
`rows` and `cols` attributes as the size if they are present.
2023-09-09 07:45:05 +02:00
Andreas Kling
c6cb876851 LibWeb: Use a serif font in the default UA style sheet
This matches how most/all other browsers behave today.
2023-08-26 12:13:00 +02:00
Sam Atkins
cd273f2312 LibWeb: Use system-color keywords in Default.css 2023-08-25 20:30:20 +01:00
Sam Atkins
565ed9b06c LibWeb: Comment out invalid display-outside rules from Default.css
This property was removed from the CSS specs, and efforts to correct the
HTML spec have stalled. For now, let's comment them out so that I don't
get spammed with the meaningless log warnings that they didn't parse,
every time I launch Ladybird. :^)
2023-08-24 22:51:11 +01:00
Dominique Liberda
4dc98af419 LibWeb: Make table headings centered by default 2023-07-24 02:28:21 +02:00
kamp
c476ff10a5 LibWeb/CSS: Update Default.css from the HTML specification 2023-06-17 06:31:28 +02:00
MacDue
cfc9966654 LibWeb: Add scaleable checkboxes (with theme/accent-color support)
This reworks checkboxes to use a tiny 16x16 SDF for the tick icon along
with an antialiased background/border.

The checkbox now works well at any scale, shows the various checkbox
state (enabled, disabled, being pressed), and supports using the colors
from the active system theme and/or the accent-color property.
2023-03-23 08:27:51 +00:00
Srikavin Ramkumar
3c49e24977 LibWeb: Scale checkbox image instead of repeating on large checkboxes 2023-03-20 10:15:58 +00:00
Srikavin Ramkumar
def08bcfcf LibWeb: Add indeterminate checkbox styling to useragent stylesheet 2023-03-20 10:15:58 +00:00
Linus Groh
2ad9c1fd6c LibWeb: Re-implement checkbox painting using the UA stylesheet
The checkbox provided by ClassicStylePainter is not scaling-aware and
generally unflexible, instead use the UA default stylesheet with a
handful of properties, the same way we already style buttons and text
inputs.

Thanks to Xexxa for the nice checkmark image!

Co-Authored-By: Xexxa <93391300+Xexxa@users.noreply.github.com>
2023-02-12 00:15:52 +00:00
implicitfield
25af1b33f6 LibWeb: Add spec-mandated rules for embedded content to Default.css 2023-01-04 11:50:03 +01:00
Timothy Flynn
4a30446999 LibWeb: Support displaying HTMLInputElement placeholder values
This adds support for parsing the ::placeholder pseudo-element and
injecting an anonymous layout node with that element when the input
element's data is empty.
2022-12-01 11:18:11 -05:00
Luke Wilde
081a617d8d LibWeb: Use the default CSS attributes for embedded content from HTML
The main benefit of this is respecting the iframe frameborder
attribute, as frameborder="0" is a pretty common way of removing
the default <iframe> border.

For example, it's on all YouTube embeds by default and on some
ReCAPTCHA embeds.
2022-10-10 19:33:34 +02:00
Andreas Kling
8a3ca6416d LibWeb: Make labels be display: inline-block in the default UA style
This is weird, but matches the behavior we've had so far. Leaving a
FIXME about how this doesn't seem right.
2022-10-06 15:29:38 +02:00
Andreas Kling
34a2797211 LibWeb: Remove ad-hoc <hr> element rule from default UA style
This element is already covered by spec rules. :^)
2022-10-06 15:29:38 +02:00
Andreas Kling
0cd82d2da7 LibWeb: Add a little header to the top of the default UA stylesheet
Since all the spec sections are annotated with comments already, let's
also have a comment mentioning that the file starts with ad-hoc rules.
2022-10-06 15:29:38 +02:00
Andreas Kling
d1dac8695c LibWeb: Don't set initial font+color on both HTML and BODY elements
It's enough to set it on the HTML element. That way, it doesn't get
reset in content that sets its own font on HTML but not on BODY.
2022-09-15 16:16:56 +02:00
Andreas Kling
57ad99ef16 LibWeb: Don't show pointer (hand) cursor over non-linked a elements
This is already handled by the :link and :visited style.
2022-09-14 15:05:10 +02:00
Andreas Kling
d27136fcb0 LibWeb: Replace most of our default UA stylesheet with spec rules
The HTML spec provides a set of suitable default CSS rules for our UA
stylesheet, so let's use those instead of inventing our own. :^)

Note that I had to replace "foo-block-start" properties with "foo-top"
since we don't support the block/inline direction based properties yet.
2022-09-14 14:43:17 +02:00
Andreas Kling
8f0a48ef23 LibWeb: Make default CSS font settings match other browsers better
Let's make 16px the default font size instead of 10px. This makes our
layout results match those of other engines in many more cases.

Also make the h1-h6 element styles use relative (em) font sizes, also
matching other browsers.
2022-09-08 12:43:49 +02:00
Karol Kosek
a0546318f9 LibWeb: Make <th> elements bold by default 2022-07-30 22:32:29 +02:00
MacDue
9768cda634 LibWeb: Tidy up <progress> element default CSS
This is a very minor thing, but one being `background:` and
the other being `background-color:` bugged me (and not using
the named colors).
2022-07-24 13:31:01 +01:00
MacDue
226d3fba79 LibWeb: Use the palette "button text" on buttons in the default CSS
This fixes some legibility issues when using dark themes.
2022-07-24 13:31:01 +01:00
MacDue
980964d8f3 LibWeb: Add a default style for primitive progress bars
This style is the same as what is used in WebKit/Blink, it is a bit
ugly, but you're expected to override it. Adding more than a
background color here could cause some issues, as sites don't
expect to have to unset the styles.
2022-07-23 01:45:49 +02:00
Andreas Kling
f6a97ff7d5 LibWeb: Tweak padding on button elements match other engines 2022-07-11 18:57:45 +02:00
Linus Groh
1e23fd94b1 LibWeb: Use ThreedShadow1 palette color for input border in Default.css
This is a bit easier on the eye than black.
2022-03-26 01:35:39 +00:00
Daniel Lemos
3eb6016dda LibWeb: Add some default style for <textarea> elements and a test 2022-03-18 19:59:19 +01:00
Sam Atkins
c148ed50bb LibWeb: Implement the :is() selector
This lets us finally get rid of a FIXME in the default style sheet. :^)
2022-03-18 11:34:02 +01:00
Sam Atkins
aa48dda3a4 LibWeb: Add missing MEDIAQUERIES-5 media-features
This adds (or at least stubs-out) the following:
- display-mode
- dynamic-range
- environment-blending
- forced-colors
- horizontal-viewport-segments
- vertical-viewport-segments
- inverted-colors
- nav-controls
- prefers-contrast
- prefers-reduced-data
- prefers-reduced-motion
- prefers-reduced-transparency
- scripting
- video-color-gamut
- video-dynamic-range

The `@media (inverted-colors)` CSS that the spec requires we add to the
UA style sheet does not actually do anything for us yet since we don't
support `filter`, but it seemed sensible to include it now to avoid
forgetting later. :^)
2022-03-16 22:07:53 +01:00
Lady Gegga
2a898a7e4a LibWeb: Add explicit color to mark element 2022-03-08 18:52:16 +01:00
Lady Gegga
2c1f5cd310 LibWeb: Add default styling to abbr, acronym, mark, strike and tt 2022-03-08 18:52:16 +01:00
Linus Groh
bc1b33eb22 LibWeb: Add border style for iframe to default UA stylesheet
Wouldn't be the true <iframe> experience if you didn't have to get rid
of the default inset border :^)
2022-03-06 23:05:18 +01:00
Karol Kosek
32bd57bdc9 LibWeb: Use monospace font for <kbd> and <samp> elements 2022-03-05 21:25:14 +01:00
Karol Kosek
049abbc417 LibWeb: Strike-through <s> and <del> elements by default 2022-03-05 21:25:14 +01:00