| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
| |
Signed-off-by: batu_hoang <longvatrong111@gmail.com>
|
|
|
| |
Signed-off-by: DK Liao <dklassic@gmail.com>
|
|
|
| |
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Margin is a reset property, there's no point in setting it to zero since it's
zero by default.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This is an implementation detail that is necessary for 'text-overflow'
to work properly.
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
appropriately in the UA stylesheet.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Fixes Twitter.
Originally regressed in 0a86543e6decf02860a5a98c46e01940e79af6fa.
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 -->
|
| | |
|
|/ |
|
| |
|
| |
|
|
|
|
|
| |
Change the `font-size` property for `input` and `textarea` from 0.7em
to 0.8333em.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
cursor.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 -->
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
* [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.
|
| | |
|
| |
| |
| |
| | |
Use the SharedStyleContext instead.
|
|/ |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 -->
|
| | |
|
|/
|
|
|
|
|
|
| |
Added a reftest for input element's alignment
Added float: left beacause text-align: center centers the input's itself.
Removed 'rtl' alignment
|