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

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

Issue 926193003: Move rendering/RenderBox to layout/LayoutBox. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | « Source/core/layout/LayoutTable.h ('k') | Source/core/layout/LayoutTableAlgorithmFixed.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) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 wrapInAnonymousSection = true; 165 wrapInAnonymousSection = true;
166 } 166 }
167 167
168 if (child->isTableSection()) 168 if (child->isTableSection())
169 setNeedsSectionRecalc(); 169 setNeedsSectionRecalc();
170 170
171 if (!wrapInAnonymousSection) { 171 if (!wrapInAnonymousSection) {
172 if (beforeChild && beforeChild->parent() != this) 172 if (beforeChild && beforeChild->parent() != this)
173 beforeChild = splitAnonymousBoxesAroundChild(beforeChild); 173 beforeChild = splitAnonymousBoxesAroundChild(beforeChild);
174 174
175 RenderBox::addChild(child, beforeChild); 175 LayoutBox::addChild(child, beforeChild);
176 return; 176 return;
177 } 177 }
178 178
179 if (!beforeChild && lastChild() && lastChild()->isTableSection() && lastChil d()->isAnonymous() && !lastChild()->isBeforeContent()) { 179 if (!beforeChild && lastChild() && lastChild()->isTableSection() && lastChil d()->isAnonymous() && !lastChild()->isBeforeContent()) {
180 lastChild()->addChild(child); 180 lastChild()->addChild(child);
181 return; 181 return;
182 } 182 }
183 183
184 if (beforeChild && !beforeChild->isAnonymous() && beforeChild->parent() == t his) { 184 if (beforeChild && !beforeChild->isAnonymous() && beforeChild->parent() == t his) {
185 LayoutObject* section = beforeChild->previousSibling(); 185 LayoutObject* section = beforeChild->previousSibling();
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 454
455 LayoutUnit totalSectionLogicalHeight = 0; 455 LayoutUnit totalSectionLogicalHeight = 0;
456 LayoutUnit oldTableLogicalTop = 0; 456 LayoutUnit oldTableLogicalTop = 0;
457 for (unsigned i = 0; i < m_captions.size(); i++) 457 for (unsigned i = 0; i < m_captions.size(); i++)
458 oldTableLogicalTop += m_captions[i]->logicalHeight() + m_captions[i] ->marginBefore() + m_captions[i]->marginAfter(); 458 oldTableLogicalTop += m_captions[i]->logicalHeight() + m_captions[i] ->marginBefore() + m_captions[i]->marginAfter();
459 459
460 bool collapsing = collapseBorders(); 460 bool collapsing = collapseBorders();
461 461
462 for (LayoutObject* child = firstChild(); child; child = child->nextSibli ng()) { 462 for (LayoutObject* child = firstChild(); child; child = child->nextSibli ng()) {
463 if (!child->needsLayout() && child->isBox()) 463 if (!child->needsLayout() && child->isBox())
464 toRenderBox(child)->markForPaginationRelayoutIfNeeded(layouter); 464 toLayoutBox(child)->markForPaginationRelayoutIfNeeded(layouter);
465 if (child->isTableSection()) { 465 if (child->isTableSection()) {
466 LayoutTableSection* section = toLayoutTableSection(child); 466 LayoutTableSection* section = toLayoutTableSection(child);
467 if (m_columnLogicalWidthChanged) 467 if (m_columnLogicalWidthChanged)
468 layouter.setChildNeedsLayout(section); 468 layouter.setChildNeedsLayout(section);
469 section->layoutIfNeeded(); 469 section->layoutIfNeeded();
470 totalSectionLogicalHeight += section->calcRowLogicalHeight(); 470 totalSectionLogicalHeight += section->calcRowLogicalHeight();
471 if (collapsing) 471 if (collapsing)
472 section->recalcOuterBorder(); 472 section->recalcOuterBorder();
473 ASSERT(!section->needsLayout()); 473 ASSERT(!section->needsLayout());
474 } else if (child->isLayoutTableCol()) { 474 } else if (child->isLayoutTableCol()) {
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 int LayoutTable::baselinePosition(FontBaseline baselineType, bool firstLine, Lin eDirectionMode direction, LinePositionMode linePositionMode) const 1245 int LayoutTable::baselinePosition(FontBaseline baselineType, bool firstLine, Lin eDirectionMode direction, LinePositionMode linePositionMode) const
1246 { 1246 {
1247 ASSERT(linePositionMode == PositionOnContainingLine); 1247 ASSERT(linePositionMode == PositionOnContainingLine);
1248 int baseline = firstLineBoxBaseline(); 1248 int baseline = firstLineBoxBaseline();
1249 if (baseline != -1) { 1249 if (baseline != -1) {
1250 if (isInline()) 1250 if (isInline())
1251 return beforeMarginInLineDirection(direction) + baseline; 1251 return beforeMarginInLineDirection(direction) + baseline;
1252 return baseline; 1252 return baseline;
1253 } 1253 }
1254 1254
1255 return RenderBox::baselinePosition(baselineType, firstLine, direction, lineP ositionMode); 1255 return LayoutBox::baselinePosition(baselineType, firstLine, direction, lineP ositionMode);
1256 } 1256 }
1257 1257
1258 int LayoutTable::inlineBlockBaseline(LineDirectionMode) const 1258 int LayoutTable::inlineBlockBaseline(LineDirectionMode) const
1259 { 1259 {
1260 // Tables are skipped when computing an inline-block's baseline. 1260 // Tables are skipped when computing an inline-block's baseline.
1261 return -1; 1261 return -1;
1262 } 1262 }
1263 1263
1264 int LayoutTable::firstLineBoxBaseline() const 1264 int LayoutTable::firstLineBoxBaseline() const
1265 { 1265 {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 return rect; 1307 return rect;
1308 } 1308 }
1309 1309
1310 bool LayoutTable::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu lt, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOf fset, HitTestAction action) 1310 bool LayoutTable::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu lt, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOf fset, HitTestAction action)
1311 { 1311 {
1312 LayoutPoint adjustedLocation = accumulatedOffset + location(); 1312 LayoutPoint adjustedLocation = accumulatedOffset + location();
1313 1313
1314 // Check kids first. 1314 // Check kids first.
1315 if (!hasOverflowClip() || locationInContainer.intersects(overflowClipRect(ad justedLocation))) { 1315 if (!hasOverflowClip() || locationInContainer.intersects(overflowClipRect(ad justedLocation))) {
1316 for (LayoutObject* child = lastChild(); child; child = child->previousSi bling()) { 1316 for (LayoutObject* child = lastChild(); child; child = child->previousSi bling()) {
1317 if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child->isTableCaption())) { 1317 if (child->isBox() && !toLayoutBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child->isTableCaption())) {
1318 LayoutPoint childPoint = flipForWritingModeForChild(toRenderBox( child), adjustedLocation); 1318 LayoutPoint childPoint = flipForWritingModeForChild(toLayoutBox( child), adjustedLocation);
1319 if (child->nodeAtPoint(request, result, locationInContainer, chi ldPoint, action)) { 1319 if (child->nodeAtPoint(request, result, locationInContainer, chi ldPoint, action)) {
1320 updateHitTestResult(result, toLayoutPoint(locationInContaine r.point() - childPoint)); 1320 updateHitTestResult(result, toLayoutPoint(locationInContaine r.point() - childPoint));
1321 return true; 1321 return true;
1322 } 1322 }
1323 } 1323 }
1324 } 1324 }
1325 } 1325 }
1326 1326
1327 // Check our bounds next. 1327 // Check our bounds next.
1328 LayoutRect boundsRect(adjustedLocation, size()); 1328 LayoutRect boundsRect(adjustedLocation, size());
(...skipping 27 matching lines...) Expand all
1356 const BorderValue& LayoutTable::tableEndBorderAdjoiningCell(const LayoutTableCel l* cell) const 1356 const BorderValue& LayoutTable::tableEndBorderAdjoiningCell(const LayoutTableCel l* cell) const
1357 { 1357 {
1358 ASSERT(cell->isFirstOrLastCellInRow()); 1358 ASSERT(cell->isFirstOrLastCellInRow());
1359 if (hasSameDirectionAs(cell->row())) 1359 if (hasSameDirectionAs(cell->row()))
1360 return style()->borderEnd(); 1360 return style()->borderEnd();
1361 1361
1362 return style()->borderStart(); 1362 return style()->borderStart();
1363 } 1363 }
1364 1364
1365 } 1365 }
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTable.h ('k') | Source/core/layout/LayoutTableAlgorithmFixed.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698