Auto merge of #18300 - emilio:die-hvp-die, r=nox

style: Remove HasViewportPercentage.

It's not needed since #18268, let's kill it.

<!-- 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/18300)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-08-30 04:31:11 -05:00 committed by GitHub
commit 5dee83d54d
61 changed files with 73 additions and 437 deletions

View file

@ -2,21 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use app_units::Au;
use cssparser::{Parser, ParserInput};
use style::context::QuirksMode;
use style::parser::ParserContext;
use style::stylesheets::{CssRuleType, Origin};
use style::values::specified::{AbsoluteLength, NoCalcLength, Number, ViewportPercentageLength};
use style_traits::{PARSING_MODE_ALLOW_ALL_NUMERIC_VALUES, HasViewportPercentage};
#[test]
fn length_has_viewport_percentage() {
let l = NoCalcLength::ViewportPercentage(ViewportPercentageLength::Vw(100.));
assert!(l.has_viewport_percentage());
let l = NoCalcLength::Absolute(AbsoluteLength::Px(Au(100).to_f32_px()));
assert!(!l.has_viewport_percentage());
}
use style::values::specified::Number;
use style_traits::PARSING_MODE_ALLOW_ALL_NUMERIC_VALUES;
#[test]
fn test_parsing_allo_all_numeric_values() {

View file

@ -61,4 +61,3 @@ macro_rules! assert_roundtrip_with_context {
mod background;
mod scaffolding;
mod serialization;
mod viewport;

View file

@ -1,27 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use app_units::Au;
use style::properties::PropertyDeclaration;
use style::values::specified::{AbsoluteLength, Length, NoCalcLength, ViewportPercentageLength};
use style::values::specified::border::BorderSideWidth;
use style_traits::HasViewportPercentage;
#[test]
fn has_viewport_percentage_for_specified_value() {
//TODO: test all specified value with a HasViewportPercentage impl
let pvw = PropertyDeclaration::BorderTopWidth(
BorderSideWidth::Length(
Length::NoCalc(NoCalcLength::ViewportPercentage(ViewportPercentageLength::Vw(100.)))
)
);
assert!(pvw.has_viewport_percentage());
let pabs = PropertyDeclaration::BorderTopWidth(
BorderSideWidth::Length(
Length::NoCalc(NoCalcLength::Absolute(AbsoluteLength::Px(Au(100).to_f32_px())))
)
);
assert!(!pabs.has_viewport_percentage());
}