From 595c726f51f052aba3ed58d7de99a7986683f358 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 2 Jun 2015 15:28:14 +0200 Subject: [PATCH] Revert "Add support for 'padding-box' value for 'box-sizing' property (fixes #6032)" This reverts commit 945adabd48e9b71f1df1b66c7ff7b432cc3188d8. The CSS Working Group resolved to drop this value from the spec: http://log.csswg.org/irc.w3.org/css/2015-05-20/#e555680 The group was unable to come up with even a theoretical use case. Gecko only implemented this value for completeness. Other browsers vendors have clearly expressed they have no interest in implementing this. --- components/layout/block.rs | 7 ------- components/layout/fragment.rs | 4 ---- components/style/properties.mako.rs | 2 +- tests/ref/basic.list | 1 - tests/ref/box_sizing_padding_box_a.html | 7 ------- tests/ref/box_sizing_padding_box_ref.html | 7 ------- 6 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 tests/ref/box_sizing_padding_box_a.html delete mode 100644 tests/ref/box_sizing_padding_box_ref.html diff --git a/components/layout/block.rs b/components/layout/block.rs index dccee7cfe27..a064e031211 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -347,10 +347,8 @@ impl CandidateBSizeIterator { }; // If the style includes `box-sizing: border-box`, subtract the border and padding. - // If the style includes `box-sizing: padding-box`, subtract the border. let adjustment_for_box_sizing = match fragment.style.get_box().box_sizing { box_sizing::T::border_box => fragment.border_padding.block_start_end(), - box_sizing::T::padding_box => fragment.padding_width().block_start_end(), box_sizing::T::content_box => Au(0), }; @@ -2060,12 +2058,7 @@ pub trait ISizeAndMarginsComputer { computed_inline_size = MaybeAuto::Specified(size - block.fragment.border_padding.inline_start_end()) } - (MaybeAuto::Specified(size), box_sizing::T::padding_box) => { - computed_inline_size = - MaybeAuto::Specified(size - block.fragment.padding_width().inline_start_end()) - } (MaybeAuto::Auto, box_sizing::T::border_box) | - (MaybeAuto::Auto, box_sizing::T::padding_box) | (_, box_sizing::T::content_box) => {} } diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index db4a8c9c54a..373a11eab80 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -1029,10 +1029,6 @@ impl Fragment { } } - pub fn padding_width(&self) -> LogicalMargin { - self.border_padding - self.border_width() - } - /// Computes the margins in the inline direction from the containing block inline-size and the /// style. After this call, the inline direction of the `margin` field will be correct. /// diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs index 69d14fad990..c304fe9f9a4 100644 --- a/components/style/properties.mako.rs +++ b/components/style/properties.mako.rs @@ -2176,7 +2176,7 @@ pub mod longhands { // http://dev.w3.org/csswg/css-ui/ ${switch_to_style_struct("Box")} - ${single_keyword("box-sizing", "content-box padding-box border-box")} + ${single_keyword("box-sizing", "content-box border-box")} ${new_style_struct("Pointing", is_inherited=True)} diff --git a/tests/ref/basic.list b/tests/ref/basic.list index 4c3679508da..bbab27e3738 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -70,7 +70,6 @@ flaky_cpu == append_style_a.html append_style_b.html == box_shadow_paint_order_a.html box_shadow_paint_order_ref.html == box_shadow_spread_a.html box_shadow_spread_ref.html == box_sizing_border_box_a.html box_sizing_border_box_ref.html -== box_sizing_padding_box_a.html box_sizing_padding_box_ref.html == box_sizing_sanity_check_a.html box_sizing_sanity_check_ref.html == br.html br-ref.html == canvas_as_block_element_a.html canvas_as_block_element_ref.html diff --git a/tests/ref/box_sizing_padding_box_a.html b/tests/ref/box_sizing_padding_box_a.html deleted file mode 100644 index 991037bd7dd..00000000000 --- a/tests/ref/box_sizing_padding_box_a.html +++ /dev/null @@ -1,7 +0,0 @@ - - - -
-
- - diff --git a/tests/ref/box_sizing_padding_box_ref.html b/tests/ref/box_sizing_padding_box_ref.html deleted file mode 100644 index 5fc5b649ace..00000000000 --- a/tests/ref/box_sizing_padding_box_ref.html +++ /dev/null @@ -1,7 +0,0 @@ - - - -
-
- -