Commit graph

46374 commits

Author SHA1 Message Date
bors-servo
eebb0a5746
Auto merge of #29969 - mrobinson:refactor-android-scripts, r=jdm
Collect android build setup into two methods

This is small refactor which tries to isolate all of the Android setup
into a couple methods, so that it is easier to reason about in the
scripts. This doesn't change any behavior but does fix a few small
linting errors in the existing code.

Note: The Android build is currently broken and this change doesn't fix
it. It shouldn't break it any more though.

<!-- Please describe your changes on the following line: -->

---
<!-- 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 do not require tests because they are refactorings.

<!-- 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. -->
2023-07-05 16:03:17 +02:00
bors-servo
2d72a74b05
Auto merge of #29971 - mrobinson:correct-webrender-vendor, r=atbrakhi
Remove some debugging code in vendored WebRender

This slipped in when importing the source code.

<!-- Please describe your changes on the following line: -->

---
<!-- 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 do not require tests because they don't really change observable behavior.

<!-- 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. -->
2023-07-05 14:35:38 +02:00
Martin Robinson
ca477c03b8
Remove some debugging code in vendored WebRender
This slipped in when importing the source code.
2023-07-05 10:14:32 +02:00
Martin Robinson
c58d74fe62
Remove UWP / Hololens support 2023-07-05 09:12:09 +02:00
Martin Robinson
1eb3e85d69
Collect android build setup into two methods
This is small refactor which tries to isolate all of the Android setup
into a couple methods, so that it is easier to reason about in the
scripts. This doesn't change any behavior but does fix a few small
linting errors in the existing code.

Note: The Android build is currently broken and this change doesn't fix
it. It shouldn't break it any more though.
2023-07-05 07:47:00 +02:00
bors-servo
041d95e0f4
Auto merge of #29961 - mrobinson:vendor-webrender, r=atbakhi
Vendor the current version of WebRender

This is a step toward upgrading WebRender, which will be upgraded and
patched in the `third_party` directory. This change vendors the current
private branch of WebRender that we use and adds a `patches` directory
which tracks the changes on top of the upstream WebRender commit
described by third_party/webrender/patches/head.

<!-- Please describe your changes on the following line: -->

---
<!-- 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 do not require tests because they do not change behavior.

<!-- 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. -->
2023-07-04 15:10:14 +02:00
bors-servo
d931cf49aa
Auto merge of #29963 - mrobinson:run-unit-tests-when-using-try-platform, r=atbrakhi
When using "try-<platform>" trigger unit tests

There is currently no way to trigger unit tests using the bors-servo try
infrastructure. This change makes it so that using try-<platform>
triggers unit tests for that platform. This will be especially useful
when testing changes for Windows before trying to land them.

<!-- Please describe your changes on the following line: -->

---
<!-- 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 do not require tests because they are just GitHub Actions changes.

<!-- 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. -->
2023-07-04 13:51:28 +02:00
bors-servo
dea28b51a2
Auto merge of #29964 - mukilan:enable-merge-queue-action, r=mrobinson
Run main workflow for merge queue events

This PR configures the main workflow (currently used by bors via auto & try branches) to run
on 'merge_group' events emitted when pull requests are added to GitHub merge queue.

---
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they just extend merge checks.

<!-- 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. -->
2023-07-04 12:01:19 +02:00
Mukilan Thiyagarajan
5f36dcf9cc Run main workflow for merge queue events
This PR configures the main workflow (currently
used by bors via auto & try branches) to run
on 'merge_group' events emitted when pull requests
are added to GitHub merge queue.

Signed-off-by: Mukilan Thiyagarajan <me@mukilan.in>
2023-07-04 15:30:15 +05:30
Martin Robinson
69c830a6e0
When using "try-<platform>" trigger unit tests
There is currently no way to trigger unit tests using the bors-servo try
infrastructure. This change makes it so that using try-<platform>
triggers unit tests for that platform. This will be especially useful
when testing changes for Windows before trying to land them.
2023-07-04 11:36:16 +02:00
Martin Robinson
3c4328f3dc
Use the WebRender clip chain API
The old clipping API has been removed from WebRender, so this switches
both legacy and new layout over to use the clip chain API in preparation
for the WebRender upgrade.
2023-07-04 11:24:00 +02:00
bors-servo
66abb1dfc4
Auto merge of #29954 - mrobinson:windows-bootstrap, r=mukilan
Windows bootstrap support

<!-- Please describe your changes on the following line: -->

---
<!-- 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 #25224
- [x] These changes do not require tests because they are just support script changes.

<!-- 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. -->
2023-07-04 00:40:11 +02:00
Martin Robinson
633d9b0eb9 Windows bootstrap support 2023-07-03 21:40:24 +02:00
Martin Robinson
49277f5c3f
Vendor the current version of WebRender
This is a step toward upgrading WebRender, which will be upgraded and
patched in the `third_party` directory. This change vendors the current
private branch of WebRender that we use and adds a `patches` directory
which tracks the changes on top of the upstream WebRender commit
described by third_party/webrender/patches/head.
2023-07-03 17:55:17 +02:00
bors-servo
35ab311635
Auto merge of #29959 - mrobinson:split-layout-in-flow-non-replaced-block-level, r=Loirooriol
Split layout_in_flow_non_replaced_block_level

This function is already quite big and the changes necessary for
properly laying out independent formatting contexts next to floats will
make it even more unwieldy. Split the function in two and add a helper
for calculating the containing block for children and the margin. As
time goes on the independent formatting case is probably going to be
more like the replaced case anyway.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>

<!-- Please describe your changes on the following line: -->

---
<!-- 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 do not require tests because they are a simple refactoring.

<!-- 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. -->
2023-07-03 16:12:59 +02:00
Martin Robinson
fa40c22122
Split layout_in_flow_non_replaced_block_level
This function is already quite big and the changes necessary for
properly laying out independent formatting contexts next to floats will
make it even more unwieldy. Split the function in two and add a helper
for calculating the containing block for children and the margin. As
time goes on the independent formatting case is probably going to be
more like the replaced case anyway.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2023-07-03 16:11:44 +02:00
bors-servo
c19eb800de
Auto merge of #29957 - Loirooriol:optimize-collapsible-margin-lookahead, r=mrobinson
Layout 2020: Optimize collapsible margin lookahead

Every time that we would lay out a block box that could collapse its top margin with its contents, we would do a lookahead to compute the resulting margin in order to place floats correctly.

The problem is that this lookahead could iterate several descendants, but then when laying these we would run the lookahead again.

This patch restricts the lookahead to boxes that either aren't collapsing their top margin with their parent, or that have 'clear' different than 'none' (since clearance prevents collapsing margins with the parent).

Since the lookahead stops iterating when it finds a box that doesn't collapse its top margin with its parent, or whose 'clear' isn't 'none', this should ensure that lookahead never handles the same box twice.

<!-- Please describe your changes on the following line: -->

---
<!-- 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 do not require tests because there shouldn't be any change in behavior

<!-- 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. -->
2023-07-03 11:55:43 +02:00
Oriol Brufau
a4c4550e3b Layout 2020: Optimize collapsible margin lookahead
Every time that we would lay out a block box that could collapse its
top margin with its contents, we would do a lookahead to compute the
resulting margin in order to place floats correctly.

The problem was that this lookahead could iterate several descendants,
but then when laying these we would run the lookahead again.

This patch restricts the lookahead to boxes that either aren't collapsing
their top margin with their parent, or that have 'clear' different than
'none' (since clearance prevents collapsing margins with the parent).

Since the lookahead stops iterating when it finds a box that doesn't
collapse its top margin with its parent, or whose 'clear' isn't 'none',
this should ensure that lookahead never handles the same box twice.
2023-07-03 11:53:43 +02:00
bors-servo
4365d9a646
Auto merge of #29958 - servo:wpt_update_02-07-2023, r=servo-wpt-sync
Sync WPT with upstream (02-07-2023)

Automated downstream sync of changes from upstream as of 02-07-2023
[no-wpt-sync]
r? @servo-wpt-sync
2023-07-02 04:11:45 +02:00
WPT Sync Bot
e594552299 Update web-platform-tests to revision b'f513c41310ebb13de9a0c5ea5e1c22544e0b5000' 2023-07-02 01:24:53 +00:00
bors-servo
ed72efa154
Auto merge of #29956 - mrobinson:update-mozangle, r=jdm
Update mozangle

This should allow servo to take advantage of faster compilation times on Windows.

<!-- Please describe your changes on the following line: -->

---
<!-- 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

<!-- 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. -->
2023-07-02 02:23:26 +02:00
bors-servo
a1dfadc4fa
Auto merge of #29951 - Loirooriol:margin-collapse-use-computed, r=mrobinson
Check computed (min-)block-size when determining margin collapse

To collapse margins through, CSS2 requires "zero or auto computed height" and "zero computed min-height" (the latter should also also include auto, which was introduced in CSS3 as the new initial value).

Similarly, "auto computed height" is required to collapse the bottom margin with the bottom margin of the contents.

Therefore this patch stops collapsing when the used height is clamped to zero by max-height, but the computed value is not zero. Same for non-zero percentages that are indefinite or that resolve to 0px.

Note that 0% and calc(0% + 0px) are still considered to be zero (so they allow margin collapse), this may a bit inconsistent but matches Firefox (for the collapsing through case).

This also matches the heuristics in find_block_margin_collapsing_with_parent(). We could change the heuristics instead, but then they would have to track block sizes in order to be able to resolve percentages.

The change makes margin-collapse-through-percentage-height-block.html fail, that test is only passing on Blink, which did a different interpretation of the spec. To be fair, various places of CSS2 loosely consider that indefinite percentages compute to auto, and even Firefox does so when determining whether to collapse the top margin with the contents.

Since the spec isn't particularly clear and interoperability is lacking, I filed https://github.com/w3c/csswg-drafts/issues/8919.

<!-- Please describe your changes on the following line: -->

---
<!-- 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 #29907
- [X] There are tests for these changes (1 test fails, see above)

<!-- 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. -->
2023-07-01 19:38:30 +02:00
Martin Robinson
96eeb5865c Update mozangle
This should allow servo to take advantage of faster compilation speeds
on Windows.
2023-07-01 18:41:54 +02:00
bors-servo
c41334ee3d
Auto merge of #29955 - servo:windows-subsystem, r=jdm
Set the Windows subsystem using a rust directive

This is one less thing that mach has to do now.

<!-- Please describe your changes on the following line: -->

---
<!-- 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 do not require tests because they do not change behavior.

<!-- 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. -->
2023-07-01 17:33:20 +02:00
bors-servo
82b37df3be
Auto merge of #29952 - Loirooriol:resolve-percentages, r=mrobinson
Resolve percentages in find_block_margin_collapsing_with_parent

<!-- Please describe your changes on the following line: -->

Padding percentages weren't being resolved, this function would think
that margins wouldn't collapse even if the percentage resolved to 0px.
And margin percentages were always resolved to 0px.

So now the function takes a ContainingBlock parameter that is used to
resolve these percentages properly.

---
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] 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. -->
2023-07-01 15:27:28 +02:00
Martin Robinson
e681e2b3f3 Set the Windows subsystem using a rust directive
This is one less thing that mach has to do now.
2023-07-01 15:04:26 +02:00
bors-servo
f034eb6032
Auto merge of #29953 - Loirooriol:remove-unused-variable, r=jdm
Remove unused variable

Just a remnant from #29850, it was causing a build warning.

<!-- Please describe your changes on the following line: -->

---
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] 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. -->
2023-07-01 04:43:34 +02:00
Oriol Brufau
fe37b89b95 Remove unused variable
Just a remnant from #29850, it was causing a build warning.
2023-07-01 03:24:09 +02:00
Oriol Brufau
995d607608 Resolve percentages in find_block_margin_collapsing_with_parent
Padding percentages weren't being resolved, this function would think
that margins wouldn't collapse even if the percentage resolved to 0px.
And margin percentages were always resolved to 0px.

So now the function takes a ContainingBlock parameter that is used to
resolve these percentages properly.
2023-07-01 03:18:11 +02:00
Oriol Brufau
7d8122b264 Check computed (min-)block-size when determining margin collapse
To collapse margins through, CSS2 requires "zero or auto computed height"
and "zero computed min-height" (the latter should also also include auto,
which was introduced in CSS3 as the new initial value).

Similarly, "auto computed height" is required to collapse the bottom margin
with the bottom margin of the contents.

Therefore this patch stops collapsing when the used height is clamped
to zero by max-height, but the computed value is not zero. Same for
non-zero percentages that are indefinite or that resolve to 0px.

Note that 0% and calc(0% + 0px) are still considered to be zero (so they
allow margin collapse), this may a bit inconsistent but matches Firefox
(for the collapsing through case).

This also matches the heuristics in find_block_margin_collapsing_with_parent().
We could change the heuristics instead, but then they would have to track
block sizes in order to be able to resolve percentages.

The change makes margin-collapse-through-percentage-height-block.html fail,
that test is only passing on Blink, which did a different interpretation
of the spec. To be fair, various places of CSS2 loosely consider that
indefinite percentages compute to auto, and even Firefox does so when
determining whether to collapse the top margin with the contents.

Since the spec isn't particularly clear and interoperability is lacking,
I filed https://github.com/w3c/csswg-drafts/issues/8919.
2023-07-01 03:00:53 +02:00
bors-servo
fe5b494e3f
Auto merge of #29949 - Loirooriol:proper-clearance, r=mrobinson
Layout 2020: Properly calculate clearance

<!-- Please describe your changes on the following line: -->
calculate_clearance() was not taking into account that adding clearance prevents top margin from collapsing with earlier margins.

---
<!-- 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 #29885 and #29919
- [X] There are tests for these changes

<!-- 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. -->
2023-06-30 23:06:24 +02:00
bors-servo
3f7e5b15f8
Auto merge of #29850 - servo:css-viewport-removal, r=mrobinson
CSS viewport removal

It was removed from the spec and it's disabled everywhere.

This also removes the meta viewport support (which was implemented on top), but that also had a single test and is disabled everywhere, so I'm not too concerned, it can be implemented again if / when needed.

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #26349
- [x] There are tests for these changes
2023-06-30 20:54:11 +02:00
bors-servo
cc54fbca90
Auto merge of #29836 - stshine:newline, r=mrobinson
layout_2020: Do linebreak for atomic inline-level elements

<!-- Please describe your changes on the following line: -->

---
<!-- 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 #29591 (GitHub issue number if applicable)

<!-- Either: -->
- [x] There are tests for these changes OR

<!-- 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. -->
2023-06-30 17:45:19 +02:00
Oriol Brufau
95832c999b Layout 2020: Properly calculate clearance
calculate_clearance() was not taking into account that adding clearance
prevents top margin from collapsing with earlier margins.
2023-06-30 16:51:39 +02:00
Emilio Cobos Álvarez
349edff768
It was removed from the spec and it's disabled everywhere.
This also removes the meta viewport support (which was implemented on top), but that also had a single test and is disabled everywhere, so I'm not too concerned, it can be implemented again if / when needed.
2023-06-30 16:28:21 +02:00
bors-servo
9b79547b87
Auto merge of #29934 - mrobinson:move-third-party, r=atbrakhi
Create a top-level "third_party" directory

This directory now contains third_party software that is vendored into
the Servo source tree. The idea is that it would eventually hold
webrender and other crates from mozilla-central as well with a standard
patch management approach for each.

<!-- Please describe your changes on the following line: -->

---
<!-- 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 do not require tests because this should not change behavior.

<!-- 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. -->
2023-06-30 15:26:55 +02:00
Martin Robinson
8be014ee46
Create a top-level "third_party" directory
This directory now contains third_party software that is vendored into
the Servo source tree. The idea is that it would eventually hold
webrender and other crates from mozilla-central as well with a standard
patch management approach for each.
2023-06-30 09:51:31 +02:00
bors-servo
47faf83a1e
Auto merge of #29947 - mrobinson:update-mozangle, r=jdm
Update mozangle, cc, and cmake

This also moves some environment variable configuration to the shared
`build_env()` method, because previously clang was only being chosen for
running `./mach build` and not `./mach test-unit` which was leading to
rebuilds and thus build failures when running `test-unit`. I guess the
cmake crate does not expect the compiler to change between subsequent
runs.

Fixes #29674

---
<!-- 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 do not require tests because they do not change behavior.

<!-- 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. -->
2023-06-30 09:47:08 +02:00
Martin Robinson
ddc7994673
Update mozangle, cc, and cmake
This also moves some environment variable configuration to the shared
`build_env()` method, because previously clang was only being chosen for
running `./mach build` and not `./mach test-unit` which was leading to
rebuilds and thus build failures when running `test-unit`. I guess the
cmake crate does not expect the compiler to change between subsequent
runs.
2023-06-30 09:46:45 +02:00
Pu Xingyu
65445ad742 Update test expectations 2023-06-30 10:40:33 +08:00
Pu Xingyu
c4a27f5208 layout_2020: Do line break for atomic inline-level elements 2023-06-30 10:40:33 +08:00
Pu Xingyu
6303d652a9 layout_2020: Add 'finish_line_and_reset' to InlineFormattingContextState
This method finish layout of the current line and start a new one.
2023-06-30 10:39:43 +08:00
bors-servo
7412e28349
Auto merge of #29945 - Loirooriol:fix-float-placement-with-future-margins-2, r=mrobinson
Properly position floats when subsequent boxes collapse margins with containing block (2)

PR #29939 tried to address this but missed various cases.

<!-- Please describe your changes on the following line: -->

---
<!-- 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 #29944
- [X] There are tests for these changes

<!-- 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. -->
2023-06-30 02:28:37 +02:00
bors-servo
57d34605e9
Auto merge of #29923 - mrobinson:test-scripts, r=jdm
Combine all script tests into `test-scripts`

Remove:
    - tidy self test support from `./mach test`
    - `./mach test-idl`

Adds a `./mach test-scripts` command that is responsible for running all
Python script tests. Run this during the CI to catch regressions in
changes to scripts. The WebIDL tests are still *very* slow and there are
from Gecko, so only run them when "-a" is passed meaning all tests.

<!-- Please describe your changes on the following line: -->

---
<!-- 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] There are tests for these changes

<!-- 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. -->
2023-06-30 00:18:58 +02:00
bors-servo
3257414385
Auto merge of #29940 - mrobinson:servo-2013-superset, r=Loirooriol
Make Layout 2013 style a superset of Layout 2020 style

This is the first step toward removing the compile-time difference in
style between Layout 2020 and Layout 2013. This change:

- Adds `attr()` CSS content support to legacy layout
- Adds parsing support for some unsupported features such as `display: flow-root` and `display: contents`.

<!-- Please describe your changes on the following line: -->

---
<!-- 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] There are tests for these changes

<!-- 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. -->
2023-06-29 21:45:48 +02:00
Martin Robinson
ae9a9e1d17
Combine all script tests into test-scripts
Remove:
    - tidy self test support from `./mach test`
    - `./mach test-idl`

Adds a `./mach test-scripts` command that is responsible for running all
Python script tests. Run this during the CI to catch regressions in
changes to scripts. The WebIDL tests are still *very* slow and there are
from Gecko, so only run them when "-a" is passed meaning all tests.
2023-06-29 19:09:33 +02:00
bors-servo
a07ff91cfb
Auto merge of #29946 - Loirooriol:clearance-option, r=mrobinson
Layout 2020: implement clearance as Option<Length>

Clearance was implemented as a Length, where zero meant no clearance. However, having a clearance of 0px should be different than having no clearance, since the former can still prevent margin collapse.

This patch keeps the existing behavior, so it won't be possible to get a clearance of Some(Length::zero()), but it prepares the terrain for a follow-up to fix calculate_clearance to return the proper thing.

<!-- Please describe your changes on the following line: -->

---
<!-- 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 do not require tests because there should be no change in behavior

<!-- 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. -->
2023-06-29 14:14:55 +02:00
Oriol Brufau
6b2bbdd02d Layout 2020: implement clearance as Option<Length>
Clearance was implemented as a Length, where zero meant no clearance.
However, having a clearance of 0px should be different than having
no clearance, since the former can still prevent margin collapse.

This patch keeps the existing behavior, so it won't be possible to get
a clearance of Some(Length::zero()), but it prepares the terrain for
a follow-up to fix calculate_clearance to return the proper thing.
2023-06-29 11:00:45 +02:00
Oriol Brufau
a435e02b78 Properly position floats when subsequent boxes collapse margins with containing block (2)
PR #29939 tried to address this but missed various cases.
2023-06-29 05:49:01 +02:00
Pu Xingyu
6f377a9262 layout_2020: Add 'white_space' field to InlineNestingLevelState
Indicate current white-space property of current nesting context.
2023-06-29 11:25:41 +08:00