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

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

Issue 1211523002: Table cells, rows, sections or column (groups) don't support margins. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/layout/LayoutTableRow.cpp » ('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 2112 matching lines...) Expand 10 before | Expand all | Expand 10 after
2123 } 2123 }
2124 2124
2125 bool LayoutBox::autoWidthShouldFitContent() const 2125 bool LayoutBox::autoWidthShouldFitContent() const
2126 { 2126 {
2127 return node() && (isHTMLInputElement(*node()) || isHTMLSelectElement(*node() ) || isHTMLButtonElement(*node()) 2127 return node() && (isHTMLInputElement(*node()) || isHTMLSelectElement(*node() ) || isHTMLButtonElement(*node())
2128 || isHTMLTextAreaElement(*node()) || (isHTMLLegendElement(*node()) && !s tyle()->hasOutOfFlowPosition())); 2128 || isHTMLTextAreaElement(*node()) || (isHTMLLegendElement(*node()) && !s tyle()->hasOutOfFlowPosition()));
2129 } 2129 }
2130 2130
2131 void LayoutBox::computeMarginsForDirection(MarginDirection flowDirection, const LayoutBlock* containingBlock, LayoutUnit containerWidth, LayoutUnit childWidth, LayoutUnit& marginStart, LayoutUnit& marginEnd, Length marginStartLength, Length marginEndLength) const 2131 void LayoutBox::computeMarginsForDirection(MarginDirection flowDirection, const LayoutBlock* containingBlock, LayoutUnit containerWidth, LayoutUnit childWidth, LayoutUnit& marginStart, LayoutUnit& marginEnd, Length marginStartLength, Length marginEndLength) const
2132 { 2132 {
2133 // First assert that we're not calling this method on box types that don't s upport margins.
2134 ASSERT(!isTableCell());
2135 ASSERT(!isTableRow());
2136 ASSERT(!isTableSection());
2137 ASSERT(!isLayoutTableCol());
2133 if (flowDirection == BlockDirection || isFloating() || isInline()) { 2138 if (flowDirection == BlockDirection || isFloating() || isInline()) {
2134 if (isTableCell() && flowDirection == BlockDirection) {
2135 // FIXME: Not right if we allow cells to have different directionali ty than the table. If we do allow this, though,
2136 // we may just do it with an extra anonymous block inside the cell.
2137 marginStart = 0;
2138 marginEnd = 0;
2139 return;
2140 }
2141
2142 // Margins are calculated with respect to the logical width of 2139 // Margins are calculated with respect to the logical width of
2143 // the containing block (8.3) 2140 // the containing block (8.3)
2144 // Inline blocks/tables and floats don't have their margins increased. 2141 // Inline blocks/tables and floats don't have their margins increased.
2145 marginStart = minimumValueForLength(marginStartLength, containerWidth); 2142 marginStart = minimumValueForLength(marginStartLength, containerWidth);
2146 marginEnd = minimumValueForLength(marginEndLength, containerWidth); 2143 marginEnd = minimumValueForLength(marginEndLength, containerWidth);
2147 return; 2144 return;
2148 } 2145 }
2149 2146
2150 if (containingBlock->isFlexibleBox()) { 2147 if (containingBlock->isFlexibleBox()) {
2151 // We need to let flexbox handle the margin adjustment - otherwise, flex box 2148 // We need to let flexbox handle the margin adjustment - otherwise, flex box
(...skipping 2617 matching lines...) Expand 10 before | Expand all | Expand 10 after
4769 bool LayoutBox::canRenderBorderImage() const 4766 bool LayoutBox::canRenderBorderImage() const
4770 { 4767 {
4771 if (!style()->hasBorderDecoration()) 4768 if (!style()->hasBorderDecoration())
4772 return false; 4769 return false;
4773 4770
4774 StyleImage* borderImage = style()->borderImage().image(); 4771 StyleImage* borderImage = style()->borderImage().image();
4775 return borderImage && borderImage->canRender(*this, style()->effectiveZoom() ) && borderImage->isLoaded(); 4772 return borderImage && borderImage->canRender(*this, style()->effectiveZoom() ) && borderImage->isLoaded();
4776 } 4773 }
4777 4774
4778 } // namespace blink 4775 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/layout/LayoutTableRow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698