Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Side by Side Diff: sky/engine/core/rendering/RenderBox.cpp

Issue 700743002: Remove margin collapsing. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/rendering/RenderBox.h ('k') | sky/tests/layout/margins.sky » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 3663 matching lines...) Expand 10 before | Expand all | Expand 10 after
3674 LayoutRect RenderBox::logicalLayoutOverflowRectForPropagation(RenderStyle* paren tStyle) const 3674 LayoutRect RenderBox::logicalLayoutOverflowRectForPropagation(RenderStyle* paren tStyle) const
3675 { 3675 {
3676 // FIXME(sky): Remove 3676 // FIXME(sky): Remove
3677 return layoutOverflowRectForPropagation(parentStyle); 3677 return layoutOverflowRectForPropagation(parentStyle);
3678 } 3678 }
3679 3679
3680 LayoutRect RenderBox::layoutOverflowRectForPropagation(RenderStyle* parentStyle) const 3680 LayoutRect RenderBox::layoutOverflowRectForPropagation(RenderStyle* parentStyle) const
3681 { 3681 {
3682 // Only propagate interior layout overflow if we don't clip it. 3682 // Only propagate interior layout overflow if we don't clip it.
3683 LayoutRect rect = borderBoxRect(); 3683 LayoutRect rect = borderBoxRect();
3684 // We want to include the margin, but only when it adds height. Quirky margi ns don't contribute height 3684 rect.expand(LayoutSize(LayoutUnit(), marginAfter()));
3685 // nor do the margins of self-collapsing blocks.
3686 if (!style()->hasMarginAfterQuirk() && !isSelfCollapsingBlock())
3687 rect.expand(LayoutSize(LayoutUnit(), marginAfter()));
3688 3685
3689 if (!hasOverflowClip()) 3686 if (!hasOverflowClip())
3690 rect.unite(layoutOverflowRect()); 3687 rect.unite(layoutOverflowRect());
3691 3688
3692 bool hasTransform = hasLayer() && layer()->transform(); 3689 bool hasTransform = hasLayer() && layer()->transform();
3693 if (isRelPositioned() || hasTransform) { 3690 if (isRelPositioned() || hasTransform) {
3694 if (hasTransform) 3691 if (hasTransform)
3695 rect = layer()->currentTransform().mapRect(rect); 3692 rect = layer()->currentTransform().mapRect(rect);
3696 3693
3697 if (isRelPositioned()) 3694 if (isRelPositioned())
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
3852 3849
3853 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) 3850 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style)
3854 { 3851 {
3855 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); 3852 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor);
3856 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); 3853 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage();
3857 ASSERT(hasBackground == style.hasBackground()); 3854 ASSERT(hasBackground == style.hasBackground());
3858 hasBorder = style.hasBorder(); 3855 hasBorder = style.hasBorder();
3859 } 3856 }
3860 3857
3861 } // namespace blink 3858 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBox.h ('k') | sky/tests/layout/margins.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698