aboutsummaryrefslogtreecommitdiffstats
path: root/resources/servo.css
Commit message (Collapse)AuthorAgeFilesLines
* layout: Add initial support for the `::marker` pseudo-element (#36317)Martin Robinson2025-04-071-8/+0
| | | | | | | | | | | | | | | This change adds support for the `::marker` pseudo-element and ensure that markers are cached into the box tree. This is only initial support, there are a few things missing such as animations, transitions, and support the `content` CSS property. Testing: There are WPT tests for this change. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Support single-value `<select>` elements (#35684)Simon Wülker2025-04-031-24/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/user-attachments/assets/9aba75ff-4190-4a85-89ed-d3f3aa53d3b0 Among other things this adds a new `EmbedderMsg::ShowSelectElementMenu` to tell the embedder to display a select popup at the given location. This is a draft because some small style adjustments need to be made: * the select element should always have the width of the largest option * the border should be part of the shadow tree Apart from that, it's mostly ready for review. <details><summary>HTML for demo video</summary> ```html <html> <body> <select id="c" name="choice"> <option value="first">First Value</option> <option value="second">Second Value</option> <option value="third">Third Value</option> </select> </body> </html> ``` </details> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] Part of https://github.com/servo/servo/issues/3551 - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* layout: Simplify and generalize the usage of pseudo-elements (#36202)Martin Robinson2025-03-291-0/+2
| | | | | | | | | | | | | | | | | | | | | - Remove the last remaining Servo-specific PseudoElement enum from layout. This was made to select `::before` and `::after` (both eager pseudo-elements), but now `traverse_pseudo_element` is called `traverse_eager_pseudo_element` and should work on any eager pseudo element. - Expose a single way of getting psuedo-element variants of ThreadSafeLayoutElement in the Layout DOM, which returns `None` when the pseudo-element doesn't apply (not defined for eager pseudo-elements or when trying to get `<details>` related pseudo-elements on elements that they don't apply to). - Ensure that NodeAndStyleInfo always refers to a node. This is done by making sure that anonymous boxes are all associated with their originating node. These changes are prepatory work for implementation of the `::marker` pseudo-element as well as ensuring that all anonymous boxes can be cached into the box tree eventually. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Fix UA style value for textarea (#35574)batu_hoang2025-03-191-6/+2
| | | Signed-off-by: batu_hoang <longvatrong111@gmail.com>
* feat: display file chosen for input file (#35789)DK Liao2025-03-101-2/+6
| | | Signed-off-by: DK Liao <dklassic@gmail.com>
* Implement the <progress> element (#35531)Simon Wülker2025-02-261-1/+16
| | | Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Allow the `<details>` element to be opened and closed (#35261)Simon Wülker2025-02-251-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement the <summary> element Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement UA shadow root for <details> Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Invalidate style when display is opened or closed Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix /_mozilla/mozilla/duplicated_scroll_ids.html This test previously assumed that <details> elements would not be rendered. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement implicit summary elements Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Remove test for duplicated scroll IDs See https://github.com/servo/servo/pull/35261#discussion_r1969328725 for reasoning. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Use Iterator::find to find implicit summary element Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Support the `<meter>` element (#35524)Simon Wülker2025-02-211-0/+24
| | | | | | | | | | | | | | | | | | | | | * Allow attaching UA shadow roots to any element Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement a UA shadow tree for the <meter> element Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add UA styles for the meter element Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Include spec text when computing meter state Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement overflow:clip (#35103)batu_hoang2025-02-121-1/+6
| | | | | | | | | | | | | | | | | | | | | | | * Implement overflow clip Signed-off-by: longvatrong111 <longvatrong111@gmail.com> * Modify test ini for overflow clip Signed-off-by: longvatrong111 <longvatrong111@gmail.com> * Update overflow_clip_rect calculation Signed-off-by: batu_hoang <longvatrong111@gmail.com> * Update overflow-clip-margin border-radius according to shadow box Signed-off-by: longvatrong111 <longvatrong111@gmail.com> --------- Signed-off-by: longvatrong111 <longvatrong111@gmail.com> Signed-off-by: batu_hoang <longvatrong111@gmail.com> Signed-off-by: batu_hoang <55729155+longvatrong111@users.noreply.github.com>
* layout: Don't let table grid boxes inherit `display: inline-table` (#35264)Oriol Brufau2025-02-031-0/+3
| | | | | | | | | | | The outer display type of a table element applies to the table wrapper box. The table grid box needs to be block-level as defined in https://drafts.csswg.org/css-tables/#table-grid-box Therefore this sets `display: table` on table grid boxes, and then when painting collapsed table borders we can use the usual logic to compute the StackingContextSection. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* style: Add support for `is()` and `where()` selectors (#34066)Martin Robinson2024-11-191-1/+0
| | | | | | | | Additionally, changes now need to be made to `servo.css` in order to ensure that `<button>` text is centered the same way that it is for `<input type=button>`. In the past the rule for centering text for the latter was ignored because it used `:is()`. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Add initial support for bidirectional text (BiDi) (#33148)Martin Robinson2024-08-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds supports for right-to-left text assigning bidi levels to all line items when necessary. This includes support for the `dir` attribute as well as corresponding CSS properties like `unicode-bidi`. It only implements right-to-left rendering for inline layout at the moment and doesn't include support for `dir=auto`. Because of missing features, this causes quite a few tests to start failing, as references become incorrect due to right-to-left rendering being active in some cases, but not others (before it didn't exist at all). Analysis of most of the new failures: ``` - /css/css-flexbox/gap-001-rtl.html /css/css-flexbox/gap-004-rtl.html - Require implementing BiDi in Flexbox, because the start and end inline margins are opposite the order of items. - /css/CSS2/bidi-text/direction-applies-to-*.xht /css/CSS2/bidi-text/direction-applies-to-002.xht /css/CSS2/bidi-text/direction-applies-to-003.xht /css/CSS2/bidi-text/direction-applies-to-004.xht - Broken due to a bug in tables, not allocating the right amount of width for a column. - /css/css-lists/inline-list.html - This fails because we wrongly insert a soft wrap opportunity between the start of an inline box and its first content. - /css/css-text/bidi/bidi-lines-001.html /css/css-text/bidi/bidi-lines-002.html /css/CSS2/text/bidi-flag-emoji.html - We do not fully support unicode-bidi: plaintext - /css/css-text/text-align/text-align-end-010.html /css/css-text/text-align/text-align-justify-006.html /css/css-text/text-align/text-align-start-010.html /html/dom/elements/global-attributes/* - We do not support dir=auto yet. - /css/css-text/white-space/tab-bidi-001.html - Servo doesn't support tab stops - /css/CSS2/positioning/abspos-block-level-001.html /css/css-text/word-break/word-break-normal-ar-000.html - Do not yet support RTL layout in block - /css/css-text/white-space/pre-wrap-018.html - Even in RTL contexts, spaces at the end of the line must hang and not be reordered - /css/css-text/white-space/trailing-space-and-text-alignment-rtl-002.html - We are letting spaces hang with white-space: pre, but they shouldn't hang. ``` Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
* Upgrade stylo to 2024-07-16 (#32812)Martin Robinson2024-07-241-1/+1
| | | | | | | | | | | | | | * Upgrade stylo to 2024-07-16 Signed-off-by: Martin Robinson <mrobinson@igalia.com> * Use the new `dom` crate from stylo Signed-off-by: Martin Robinson <mrobinson@igalia.com> --------- Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: Add support for table captions (#32657)Martin Robinson2024-07-031-0/+35
| | | | | | | | | | | | | This adds initial support for table captions. To do this, the idea of the table wrapper becomes a bit more concrete. Even so, the wrapper is still reponsible for allocating space for the grid's border and padding, as those properties are specified on the wrapper and not grid in CSS. In order to account for this weirdness of HTML/CSS captions and grid are now laid out and placed with a negative offset in the table wrapper content rect. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: Add very basic support for showing text in input boxes (#32365)Martin Robinson2024-06-201-11/+0
| | | | | | | | | | | | | | | | | | This only paints text in input fields. Selection and cursor are still not painted. In addition to adding this feature, the change also updates the user-agent.css with the latest from the HTML specification. Extra padding and extraneous settings (such as a bogus line-height and min-height) are also removed from servo.css. This leads to some new passes. There are some new passes, this introduces failures as inserting text reveals issues that were hidden before. Notably: - failures in `/html/editing/editing-0/spelling-and-grammar-checking/`: We do not support spell-checking. - Most of the rest of the new failures are missing features of input boxes that are also missing in legacy layout.
* Cleanup UA styles for anonymous table rows and cells (#31661)Oriol Brufau2024-03-141-8/+0
| | | | | These properties were being set to their initial value, this wasn't needed because they are non-inherited properties and there isn't anything else setting them.
* layout: Fix the pseudo for anonymous tables (#31578)Martin Robinson2024-03-081-0/+4
| | | | | | | Anonymous tables should not use legacy pseudos, as the legacy layout engine had them inherit lots of random properites that lead to bad layout in the new layout engine. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Add support for table fixups (#30868)Martin Robinson2023-12-221-2/+2
| | | | | | | | | | | | | | | | This adds support for fixing up tables so that internal table elements that are not properly parented in the DOM have the correct box tree structure according to the CSS Table specification [1]. Note that this only comes into play when building the DOM via script, as HTML 5 has its own table fixups that mean that the box tree construction fixups here are not necessary. There are no tests for this change. In general, it's hard to write tests against the shape of the box tree, because it depends on the DOM. We plan to test this via WPT tests once layout is complete. 1. https://drafts.csswg.org/css-tables/#table-internal-element Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Anonymous boxes that wrap inlines should not inherit overflow (#30579)Martin Robinson2023-10-191-15/+15
| | | | | | | | | | | | | | In legacy layout, anonymous text wrappers were inheriting the `overflow` and `text-overflow` properties. This results in the creation of extra clipping for these anonymous wrappers which could clip away floats. We will likely implement `text-overflow` differently in non-legacy layout. This change marks all legacy layout pseudo elements as "legacy" and also adds a new pseudo element for non-legacy layout that does not inherit `overflow`. Fixes #30562. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* net: Add option to temporarily accept certs that failed the handshake.Josh Matthews2020-06-091-0/+4
|
* style: Re-enable the rule that was accidentally disabled by a typo in the ↵Emilio Cobos Álvarez2018-10-191-7/+1
| | | | | | | | | | CSS parser. In #21946 I commented out this rule because before that patch we were accidentally ignoring it because of a typo in the CSS parser, since that PR didn't intend to change behavior. This PR does though, and re-enables the rule.
* style: Remove useless declarations in servo.css.Emilio Cobos Álvarez2018-10-151-6/+0
| | | | | Margin is a reset property, there's no point in setting it to zero since it's zero by default.
* style: Stop using PseudoElement::inherits_all.Emilio Cobos Álvarez2018-10-151-1/+34
| | | | | | | | | This was done that way just because Servo didn't support the `all` property at the time. We should do it this way and optimize it if it's slow. Though I suspect that most of stuff doesn't actually need to be inherited, my patch at bug 1498943 should make it much faster than what it would otherwise be.
* Wait as late as possible to assign ClipIdsMartin Robinson2017-10-241-0/+8
| | | | | | | | | This will allow Servo to create ClipScrollNodes later during display list construction, which will be necessary once rounded rectangles are removed from the LocalClip structure. Instead of keeping track of the ClipId of each ClipScrollNode, we keep track of its index in an array of ClipScrollNodes. This will allow us to access them without a hash lookup.
* Inherit 'text-overflow' and 'overflow' in text fragmentPu Xingyu2017-04-051-0/+2
| | | | | This is an implementation detail that is necessary for 'text-overflow' to work properly.
* Use empty pseudo to cascade only inheritable properties for textPu Xingyu2017-04-011-0/+6
| | | | | | Since for nested inline elements non-inheritable properties are properly stored in the inline context of an inline fragment, so get rid of them on the style.
* Use Servo-specific pseudo element for InlineAbsolute fragmentPu Xingyu2017-03-311-0/+8
|
* Use Servo-specific pseudo element for InlineBlock fragmentPu Xingyu2017-03-311-0/+7
|
* resources: Style anonymous blocks and anonymous table flowsPatrick Walton2016-10-261-0/+44
| | | | appropriately in the UA stylesheet.
* resources: Remove the `vertical-align: middle` rule for buttons fromPatrick Walton2016-10-111-1/+0
| | | | | | | Servo's style sheet. This doesn't vertically center the contents of buttons as it's intended to and breaks layouts once `vertical-align: middle` is implemented.
* resources: Give button elements `white-space: normal` again.Patrick Walton2016-09-261-1/+4
| | | | | | Fixes Twitter. Originally regressed in 0a86543e6decf02860a5a98c46e01940e79af6fa.
* Style input-text pseudo with user-agent CSSJonathan Schuster2016-09-211-0/+4
|
* Auto merge of #12388 - kilobtye:textarea2, r=pcwaltonbors-servo2016-07-261-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let textarea wrap lines <!-- Please describe your changes on the following line: --> 1. Change textarea's style from white-space: pre to white-space: pre-wrap. 2. Display insertion point when a line is wrapped. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #10053 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12388) <!-- Reviewable:end -->
| * Let textarea wrap lineskilobtye2016-07-261-2/+2
| |
* | Make textarea scrollablekilobtye2016-07-161-0/+4
|/
* Use proper comment syntax in servo.cssConnor Brewster2016-06-301-1/+1
|
* add button for file-type input elementZhen Zhang2016-06-261-0/+11
|
* Change the font-size property for input and textareaTara2016-06-011-2/+2
| | | | | Change the `font-size` property for `input` and `textarea` from 0.7em to 0.8333em.
* Reformatted servo.cssPer Lundberg2016-05-151-10/+93
| | | | | | As discussed in #10553, we should consider splitting the long lines in this file onto separate lines (one per css attribute), to make it more readable and maintainable in general. I also added blank lines where I felt it was applicable.
* Changed cursor for labels to "default" so their text doesn't use the text ↵Zaggy10242016-05-081-0/+2
| | | | cursor.
* Auto merge of #10809 - perlun:sendoushi-master, r=jdmbors-servo2016-05-011-2/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed line-height for input and textarea + use correct font Fixes #10532. Replaces #10553 since @Sendoushi had problems getting a proper rebase locally, so helping him out to get this merged. (Credits to Sendoushi who did the actual changes; I'm just helping out to getting things into a mergeable state.) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10809) <!-- Reviewable:end -->
| * Fixed test failures.Per Lundberg2016-05-011-0/+1
| |
| * Fixed line-height for input and textarea + use correct fontJoel Santos2016-04-291-2/+2
| | | | | | | | | | | | | | * [fix] Input line height and styling * [new] Input line height ref test * [fix] Test for input in manifest * Updated CSS tests with new expected failures.
* | layout: Don't force to overwrite display for pseudo-elements.Emilio Cobos Álvarez2016-04-291-0/+1
| |
* | layout: Stop storing PrecomputedStyleData in LayoutNodeEmilio Cobos Álvarez2016-04-291-1/+0
| | | | | | | | Use the SharedStyleContext instead.
* | style: Use precomputation for the -servo-details-content pseudo-elementEmilio Cobos Álvarez2016-04-291-5/+1
|/
* do not render svg children, fixes #10646Arpad Borsos2016-04-251-0/+8
|
* Auto merge of #10299 - mbrubeck:selection-style, r=jdmbors-servo2016-04-011-0/+2
|\ | | | | | | | | | | | | | | | | | | | | Set a default ::selection style Since we no longer have a hard-coded default after #10252. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10299) <!-- Reviewable:end -->
| * Set a default ::selection styleMatt Brubeck2016-03-301-0/+2
| |
* | Make input elements not inherit parent containers alignmentNazım Can Altınova2016-03-311-1/+1
|/ | | | | | | | Added a reftest for input element's alignment Added float: left beacause text-align: center centers the input's itself. Removed 'rtl' alignment