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

Side by Side Diff: Source/core/rendering/InlineFlowBox.cpp

Issue 620753006: Rendering API cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 years, 2 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
« no previous file with comments | « Source/core/rendering/InlineFlowBox.h ('k') | Source/core/rendering/LayoutState.h » ('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) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 1104
1105 bool InlineFlowBox::boxShadowCanBeAppliedToBackground(const FillLayer& lastBackg roundLayer) const 1105 bool InlineFlowBox::boxShadowCanBeAppliedToBackground(const FillLayer& lastBackg roundLayer) const
1106 { 1106 {
1107 // The checks here match how paintFillLayer() decides whether to clip (if it does, the shadow 1107 // The checks here match how paintFillLayer() decides whether to clip (if it does, the shadow
1108 // would be clipped out, so it has to be drawn separately). 1108 // would be clipped out, so it has to be drawn separately).
1109 StyleImage* image = lastBackgroundLayer.image(); 1109 StyleImage* image = lastBackgroundLayer.image();
1110 bool hasFillImage = image && image->canRender(renderer(), renderer().style() ->effectiveZoom()); 1110 bool hasFillImage = image && image->canRender(renderer(), renderer().style() ->effectiveZoom());
1111 return (!hasFillImage && !renderer().style()->hasBorderRadius()) || (!prevLi neBox() && !nextLineBox()) || !parent(); 1111 return (!hasFillImage && !renderer().style()->hasBorderRadius()) || (!prevLi neBox() && !nextLineBox()) || !parent();
1112 } 1112 }
1113 1113
1114 void InlineFlowBox::constrainToLineTopAndBottomIfNeeded(LayoutRect& rect) const
1115 {
1116 bool noQuirksMode = renderer().document().inNoQuirksMode();
1117 if (!noQuirksMode && !hasTextChildren() && !(descendantsHaveSameLineHeightAn dBaseline() && hasTextDescendants())) {
1118 const RootInlineBox& rootBox = root();
1119 LayoutUnit logicalTop = isHorizontal() ? rect.y() : rect.x();
1120 LayoutUnit logicalHeight = isHorizontal() ? rect.height() : rect.width() ;
1121 LayoutUnit bottom = std::min(rootBox.lineBottom(), logicalTop + logicalH eight);
1122 logicalTop = std::max(rootBox.lineTop(), logicalTop);
1123 logicalHeight = bottom - logicalTop;
1124 if (isHorizontal()) {
1125 rect.setY(logicalTop);
1126 rect.setHeight(logicalHeight);
1127 } else {
1128 rect.setX(logicalTop);
1129 rect.setWidth(logicalHeight);
1130 }
1131 }
1132 }
1133
1134 InlineBox* InlineFlowBox::firstLeafChild() const 1114 InlineBox* InlineFlowBox::firstLeafChild() const
1135 { 1115 {
1136 InlineBox* leaf = 0; 1116 InlineBox* leaf = 0;
1137 for (InlineBox* child = firstChild(); child && !leaf; child = child->nextOnL ine()) 1117 for (InlineBox* child = firstChild(); child && !leaf; child = child->nextOnL ine())
1138 leaf = child->isLeaf() ? child : toInlineFlowBox(child)->firstLeafChild( ); 1118 leaf = child->isLeaf() ? child : toInlineFlowBox(child)->firstLeafChild( );
1139 return leaf; 1119 return leaf;
1140 } 1120 }
1141 1121
1142 InlineBox* InlineFlowBox::lastLeafChild() const 1122 InlineBox* InlineFlowBox::lastLeafChild() const
1143 { 1123 {
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1372 ASSERT(child->prevOnLine() == prev); 1352 ASSERT(child->prevOnLine() == prev);
1373 prev = child; 1353 prev = child;
1374 } 1354 }
1375 ASSERT(prev == m_lastChild); 1355 ASSERT(prev == m_lastChild);
1376 #endif 1356 #endif
1377 } 1357 }
1378 1358
1379 #endif 1359 #endif
1380 1360
1381 } // namespace blink 1361 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/InlineFlowBox.h ('k') | Source/core/rendering/LayoutState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698