mirror of
https://github.com/servo/servo.git
synced 2025-10-03 01:59:14 +01:00
Auto merge of #27216 - pcwalton:floats-2020, r=Manishearth
Implement core float layout for layout 2020 <!-- Please describe your changes on the following line: --> Add an implementation of the core float and clear placement logic in layout 2020, not yet wired to the rest of layout. This commit implements an object that handles the 10 rules in CSS 2.1: https://www.w3.org/TR/CSS2/visuren.html#float-position The implementation strategy is that of a persistent balanced binary search tree of float bands. Binary search trees are commonly used for implementing float positioning; e.g. by WebKit. Persistence enables each object that interacts with floats to efficiently contain a snapshot of the float list at the time that object was laid out. That way, incremental layout can invalidate and start reflow at any point in a containing block. This commit features extensive use of [QuickCheck](https://github.com/BurntSushi/quickcheck) to ensure that the rules of the CSS specification are followed. Because this is not yet connected to layout, floats will not actually be laid out in Web pages yet. Note that unit tests as set up in Servo currently require types that they access to be public. Therefore, some internal layout 2020 types that were previously private have been made public. This is somewhat unfortunate. --- <!-- 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. -->
This commit is contained in:
commit
132d8b4601
10 changed files with 1354 additions and 20 deletions
14
Cargo.lock
generated
14
Cargo.lock
generated
|
@ -2912,12 +2912,14 @@ dependencies = [
|
|||
"gfx_traits",
|
||||
"html5ever",
|
||||
"ipc-channel",
|
||||
"lazy_static",
|
||||
"libc",
|
||||
"log",
|
||||
"mitochondria",
|
||||
"msg",
|
||||
"net_traits",
|
||||
"parking_lot 0.10.2",
|
||||
"quickcheck",
|
||||
"range",
|
||||
"rayon",
|
||||
"rayon_croissant",
|
||||
|
@ -4365,6 +4367,18 @@ version = "1.2.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eda5fe9b71976e62bc81b781206aaa076401769b2143379d3eb2118388babac4"
|
||||
|
||||
[[package]]
|
||||
name = "quickcheck"
|
||||
version = "0.9.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a44883e74aa97ad63db83c4bf8ca490f02b2fc02f92575e720c8551e843c945f"
|
||||
dependencies = [
|
||||
"env_logger",
|
||||
"log",
|
||||
"rand",
|
||||
"rand_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "0.6.13"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue