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

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

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 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
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 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. 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 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 x = std::min(x, (maxX - caretWidth).clampNegativeToZero()); 1206 x = std::min(x, (maxX - caretWidth).clampNegativeToZero());
1207 1207
1208 const Font& font = style()->font(); 1208 const Font& font = style()->font();
1209 const SimpleFontData* fontData = font.primaryFont(); 1209 const SimpleFontData* fontData = font.primaryFont();
1210 LayoutUnit height; 1210 LayoutUnit height;
1211 // crbug.com/595692 This check should not be needed but sometimes 1211 // crbug.com/595692 This check should not be needed but sometimes
1212 // primaryFont is null. 1212 // primaryFont is null.
1213 if (fontData) 1213 if (fontData)
1214 height = LayoutUnit(fontData->getFontMetrics().height()); 1214 height = LayoutUnit(fontData->getFontMetrics().height());
1215 LayoutUnit verticalSpace = 1215 LayoutUnit verticalSpace =
1216 lineHeight(true, currentStyle.isHorizontalWritingMode() ? HorizontalLine 1216 lineHeight(true,
1217 : VerticalLine, 1217 currentStyle.isHorizontalWritingMode() ? HorizontalLine
1218 : VerticalLine,
1218 PositionOfInteriorLineBoxes) - 1219 PositionOfInteriorLineBoxes) -
1219 height; 1220 height;
1220 LayoutUnit y = paddingTop() + borderTop() + (verticalSpace / 2); 1221 LayoutUnit y = paddingTop() + borderTop() + (verticalSpace / 2);
1221 return currentStyle.isHorizontalWritingMode() 1222 return currentStyle.isHorizontalWritingMode()
1222 ? LayoutRect(x, y, caretWidth, height) 1223 ? LayoutRect(x, y, caretWidth, height)
1223 : LayoutRect(y, x, height, caretWidth); 1224 : LayoutRect(y, x, height, caretWidth);
1224 } 1225 }
1225 1226
1226 const LayoutObject* LayoutBoxModelObject::pushMappingToContainer( 1227 const LayoutObject* LayoutBoxModelObject::pushMappingToContainer(
1227 const LayoutBoxModelObject* ancestorToStopAt, 1228 const LayoutBoxModelObject* ancestorToStopAt,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1302 // parents that have inline-flow if we try later. 1303 // parents that have inline-flow if we try later.
1303 if (child->isLayoutBlockFlow() && toBoxModelObject->childrenInline() && 1304 if (child->isLayoutBlockFlow() && toBoxModelObject->childrenInline() &&
1304 !childrenInline()) { 1305 !childrenInline()) {
1305 toLayoutBlockFlow(child)->removeFloatingObjectsFromDescendants(); 1306 toLayoutBlockFlow(child)->removeFloatingObjectsFromDescendants();
1306 ASSERT(!toLayoutBlockFlow(child)->containsFloats()); 1307 ASSERT(!toLayoutBlockFlow(child)->containsFloats());
1307 } 1308 }
1308 1309
1309 if (fullRemoveInsert && isLayoutBlock() && child->isBox()) 1310 if (fullRemoveInsert && isLayoutBlock() && child->isBox())
1310 toLayoutBox(child)->removeFromPercentHeightContainer(); 1311 toLayoutBox(child)->removeFromPercentHeightContainer();
1311 1312
1312 if (fullRemoveInsert && (toBoxModelObject->isLayoutBlock() || 1313 if (fullRemoveInsert &&
1313 toBoxModelObject->isLayoutInline())) { 1314 (toBoxModelObject->isLayoutBlock() ||
1315 toBoxModelObject->isLayoutInline())) {
1314 // Takes care of adding the new child correctly if toBlock and fromBlock 1316 // Takes care of adding the new child correctly if toBlock and fromBlock
1315 // have different kind of children (block vs inline). 1317 // have different kind of children (block vs inline).
1316 toBoxModelObject->addChild(virtualChildren()->removeChildNode(this, child), 1318 toBoxModelObject->addChild(virtualChildren()->removeChildNode(this, child),
1317 beforeChild); 1319 beforeChild);
1318 } else { 1320 } else {
1319 toBoxModelObject->virtualChildren()->insertChildNode( 1321 toBoxModelObject->virtualChildren()->insertChildNode(
1320 toBoxModelObject, 1322 toBoxModelObject,
1321 virtualChildren()->removeChildNode(this, child, fullRemoveInsert), 1323 virtualChildren()->removeChildNode(this, child, fullRemoveInsert),
1322 beforeChild, fullRemoveInsert); 1324 beforeChild, fullRemoveInsert);
1323 } 1325 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 if (rootElementStyle->hasBackground()) 1369 if (rootElementStyle->hasBackground())
1368 return false; 1370 return false;
1369 1371
1370 if (node() != document().firstBodyElement()) 1372 if (node() != document().firstBodyElement())
1371 return false; 1373 return false;
1372 1374
1373 return true; 1375 return true;
1374 } 1376 }
1375 1377
1376 } // namespace blink 1378 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutCounter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698