diff --git a/src/components/main/layout/block.rs b/src/components/main/layout/block.rs index 0ba75a4a53b..a4757042e49 100644 --- a/src/components/main/layout/block.rs +++ b/src/components/main/layout/block.rs @@ -766,7 +766,8 @@ impl BlockFlow { /// If this is the root flow, shifts all kids down and adjusts our size to account for /// collapsed margins. /// - /// TODO(pcwalton): This is somewhat inefficient (traverses kids twice); can we do better? + /// TODO(#2017, pcwalton): This is somewhat inefficient (traverses kids twice); can we do + /// better? fn adjust_boxes_for_collapsed_margins_if_root(&mut self) { if !self.is_root() { return @@ -1519,7 +1520,7 @@ impl BlockFlow { // Per CSS 2.1 ยง 16.3.1, text decoration propagates to all children in flow. // - // TODO(pcwalton): When we have out-of-flow children, don't unconditionally propagate. + // TODO(#2018, pcwalton): Do this in the cascade instead. let child_base = flow::mut_base(kid); child_base.flags_info.propagate_text_decoration_from_parent(&flags_info); child_base.flags_info.propagate_text_alignment_from_parent(&flags_info) diff --git a/src/components/style/properties.rs.mako b/src/components/style/properties.rs.mako index 030f02cb908..18c8d49a38e 100644 --- a/src/components/style/properties.rs.mako +++ b/src/components/style/properties.rs.mako @@ -97,29 +97,29 @@ pub mod longhands { % endif pub use self::computed_value::*; ${caller.body()} - pub fn parse_declared(input: &[ComponentValue], base_url: &Url) - -> Option> { - match CSSWideKeyword::parse(input) { - Some(Some(keyword)) => Some(CSSWideKeyword(keyword)), - Some(None) => Some(CSSWideKeyword(${ - "Inherit" if THIS_STYLE_STRUCT.inherited else "Initial"})), - None => parse_specified(input, base_url), + % if derived_from is None: + pub fn parse_declared(input: &[ComponentValue], base_url: &Url) + -> Option> { + match CSSWideKeyword::parse(input) { + Some(Some(keyword)) => Some(CSSWideKeyword(keyword)), + Some(None) => Some(CSSWideKeyword(${ + "Inherit" if THIS_STYLE_STRUCT.inherited else "Initial"})), + None => parse_specified(input, base_url), + } } - } + % endif } <%def name="longhand(name, no_super=False, derived_from=None)"> <%self:raw_longhand name="${name}" derived_from="${derived_from}"> ${caller.body()} - pub fn parse_specified(_input: &[ComponentValue], _base_url: &Url) - -> Option> { - % if derived_from is None: + % if derived_from is None: + pub fn parse_specified(_input: &[ComponentValue], _base_url: &Url) + -> Option> { parse(_input, _base_url).map(super::SpecifiedValue) - % else: - None - % endif - } + } + % endif @@ -1328,12 +1328,16 @@ impl PropertyDeclaration { let name_lower = tmp_for_lifetime.as_str_ascii(); match name_lower.as_slice() { % for property in LONGHANDS: - "${property.name}" => result_list.push(${property.ident}_declaration( - match longhands::${property.ident}::parse_declared(value, base_url) { - Some(value) => value, - None => return InvalidValue, - } - )), + % if property.derived_from is None: + "${property.name}" => result_list.push(${property.ident}_declaration( + match longhands::${property.ident}::parse_declared(value, base_url) { + Some(value) => value, + None => return InvalidValue, + } + )), + % else: + "${property.name}" => {} + % endif % endfor % for shorthand in SHORTHANDS: "${shorthand.name}" => match CSSWideKeyword::parse(value) {