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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 1876123002: Absolute positioned child with percent should include containing block padding (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update commit message Created 4 years, 8 months 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
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 1609 matching lines...) Expand 10 before | Expand all | Expand 10 after
1620 height -= cb->paddingLogicalHeight(); 1620 height -= cb->paddingLogicalHeight();
1621 return height; 1621 return height;
1622 } 1622 }
1623 1623
1624 LayoutUnit LayoutBox::containingBlockLogicalWidthForContent() const 1624 LayoutUnit LayoutBox::containingBlockLogicalWidthForContent() const
1625 { 1625 {
1626 if (hasOverrideContainingBlockLogicalWidth()) 1626 if (hasOverrideContainingBlockLogicalWidth())
1627 return overrideContainingBlockContentLogicalWidth(); 1627 return overrideContainingBlockContentLogicalWidth();
1628 1628
1629 LayoutBlock* cb = containingBlock(); 1629 LayoutBlock* cb = containingBlock();
1630 if (!isTable() && styleRef().position() == AbsolutePosition)
mstensho (USE GERRIT) 2016/05/11 08:36:22 Why not for tables? And rather than "styleRef().p
Deokjin Kim 2016/05/11 14:10:04 In case of tables, even though the absolute positi
mstensho (USE GERRIT) 2016/05/12 09:34:03 That's weird. I don't think there's anything in th
Deokjin Kim 2016/05/12 11:24:20 In updateLogicalWidth() of LayoutTable.cpp, if abs
1631 return cb->clientLogicalWidth();
mstensho (USE GERRIT) 2016/05/11 08:36:22 Right, the padding box (and not the content box) o
Deokjin Kim 2016/05/11 14:10:04 First time I thought that this code is only used f
1630 return cb->availableLogicalWidth(); 1632 return cb->availableLogicalWidth();
1631 } 1633 }
1632 1634
1633 LayoutUnit LayoutBox::containingBlockLogicalHeightForContent(AvailableLogicalHei ghtType heightType) const 1635 LayoutUnit LayoutBox::containingBlockLogicalHeightForContent(AvailableLogicalHei ghtType heightType) const
1634 { 1636 {
1635 if (hasOverrideContainingBlockLogicalHeight()) 1637 if (hasOverrideContainingBlockLogicalHeight())
1636 return overrideContainingBlockContentLogicalHeight(); 1638 return overrideContainingBlockContentLogicalHeight();
1637 1639
1638 LayoutBlock* cb = containingBlock(); 1640 LayoutBlock* cb = containingBlock();
1639 return cb->availableLogicalHeight(heightType); 1641 return cb->availableLogicalHeight(heightType);
(...skipping 3097 matching lines...) Expand 10 before | Expand all | Expand 10 after
4737 4739
4738 void LayoutBox::clearPercentHeightDescendants() 4740 void LayoutBox::clearPercentHeightDescendants()
4739 { 4741 {
4740 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) { 4742 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) {
4741 if (curr->isBox()) 4743 if (curr->isBox())
4742 toLayoutBox(curr)->removeFromPercentHeightContainer(); 4744 toLayoutBox(curr)->removeFromPercentHeightContainer();
4743 } 4745 }
4744 } 4746 }
4745 4747
4746 } // namespace blink 4748 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698