mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #14394 - jcdyer:jcdyer/either-column-width, r=Wafflespeanut
Convert column-width to use Either <!-- Please describe your changes on the following line: --> * Converted column-width to use `Either<Length, Auto>` * Added gecko glue code * Cleaned up old column-width glue code --- <!-- 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 #14350 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because tests already surround the refactored code. <!-- 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/14394) <!-- Reviewable:end -->
This commit is contained in:
commit
a913815a4d
8 changed files with 38 additions and 97 deletions
|
@ -24,6 +24,7 @@ use std::sync::Arc;
|
|||
use style::context::{StyleContext, SharedStyleContext};
|
||||
use style::logical_geometry::LogicalSize;
|
||||
use style::properties::ServoComputedValues;
|
||||
use style::values::Either;
|
||||
use style::values::computed::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
|
||||
|
||||
pub struct MulticolFlow {
|
||||
|
@ -102,7 +103,7 @@ impl Flow for MulticolFlow {
|
|||
let column_gap = column_style.column_gap.0.unwrap_or_else(||
|
||||
self.block_flow.fragment.style.get_font().font_size);
|
||||
let mut column_count;
|
||||
if let Some(column_width) = column_style.column_width.0 {
|
||||
if let Either::First(column_width) = column_style.column_width {
|
||||
column_count =
|
||||
max(1, (content_inline_size + column_gap).0 / (column_width + column_gap).0);
|
||||
if let Some(specified_column_count) = column_style.column_count.0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue