Auto merge of #7276 - pcwalton:inline-absolute-hypothetical-clip, r=mbrubeck

layout: Make inline absolute hypothetical boxes not clip their contents.

Improves the logo on ebay.com.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7276)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-08-19 03:54:10 -06:00
commit 195d267e23
5 changed files with 49 additions and 1 deletions

View file

@ -978,7 +978,13 @@ impl<'a> FlowConstructor<'a> {
let fragment_info = SpecificFragmentInfo::InlineAbsoluteHypothetical(
InlineAbsoluteHypotheticalFragmentInfo::new(block_flow));
let fragment = Fragment::new(node, fragment_info);
let mut style = node.style().clone();
properties::modify_style_for_inline_absolute_hypothetical_fragment(&mut style);
let fragment = Fragment::from_opaque_node_and_style(node.opaque(),
PseudoElementType::Normal,
style,
node.restyle_damage(),
fragment_info);
let mut fragment_accumulator = InlineFragmentsAccumulator::from_inline_node(node);
fragment_accumulator.fragments.fragments.push_back(fragment);

View file

@ -6533,6 +6533,16 @@ pub fn modify_style_for_input_text(style: &mut Arc<ComputedValues>) {
margin_style.margin_left = computed::LengthOrPercentageOrAuto::Length(Au(0));
}
/// Adjusts the `clip` property so that an inline absolute hypothetical fragment doesn't clip its
/// children.
pub fn modify_style_for_inline_absolute_hypothetical_fragment(style: &mut Arc<ComputedValues>) {
if style.get_effects().clip.0.is_some() {
let mut style = Arc::make_unique(style);
let effects_style = Arc::make_unique(&mut style.effects);
effects_style.clip.0 = None
}
}
pub fn is_supported_property(property: &str) -> bool {
match_ignore_ascii_case! { property,
% for property in SHORTHANDS + LONGHANDS[:-1]: