mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Rename MozLength to Size, and MaxLength to MaxSize.
MozLength is not a very descriptive name. If we're going to use it in both Gecko and Servo we may as well name it something more accurate. I would've chosen `ContentSize` per CSS2[1][2] if it wasn't a lie in presence of box-sizing. I don't have better ideas than `Size`, given that. [1]: https://drafts.csswg.org/css2/visudet.html#propdef-width [2]: https://drafts.csswg.org/css2/box.html#content-width Differential Revision: https://phabricator.services.mozilla.com/D19280
This commit is contained in:
parent
7ed6b9d3ce
commit
c2819365f0
26 changed files with 280 additions and 333 deletions
|
@ -61,9 +61,7 @@ use style::selector_parser::RestyleDamage;
|
|||
use style::servo::restyle_damage::ServoRestyleDamage;
|
||||
use style::str::char_is_whitespace;
|
||||
use style::values::computed::counters::ContentItem;
|
||||
use style::values::computed::{
|
||||
LengthPercentage, LengthPercentageOrAuto, NonNegativeLengthPercentageOrAuto,
|
||||
};
|
||||
use style::values::computed::{LengthPercentage, LengthPercentageOrAuto, Size};
|
||||
use style::values::generics::box_::{Perspective, VerticalAlign};
|
||||
use style::values::generics::transform;
|
||||
use webrender_api::{self, LayoutTransform};
|
||||
|
@ -991,7 +989,13 @@ impl Fragment {
|
|||
.content_inline_size()
|
||||
.to_used_value(Au(0))
|
||||
.unwrap_or(Au(0));
|
||||
specified = max(style.min_inline_size().to_used_value(Au(0)), specified);
|
||||
specified = max(
|
||||
style
|
||||
.min_inline_size()
|
||||
.to_used_value(Au(0))
|
||||
.unwrap_or(Au(0)),
|
||||
specified,
|
||||
);
|
||||
if let Some(max) = style.max_inline_size().to_used_value(Au(0)) {
|
||||
specified = min(specified, max)
|
||||
}
|
||||
|
@ -1615,10 +1619,8 @@ impl Fragment {
|
|||
SpecificFragmentInfo::Iframe(_) |
|
||||
SpecificFragmentInfo::Svg(_) => {
|
||||
let inline_size = match self.style.content_inline_size() {
|
||||
NonNegativeLengthPercentageOrAuto::Auto => None,
|
||||
NonNegativeLengthPercentageOrAuto::LengthPercentage(ref lp) => {
|
||||
lp.maybe_to_used_value(None)
|
||||
},
|
||||
Size::Auto => None,
|
||||
Size::LengthPercentage(ref lp) => lp.maybe_to_used_value(None),
|
||||
};
|
||||
|
||||
let mut inline_size = inline_size.unwrap_or_else(|| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue