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

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

Issue 672953002: Convert first letter into a pseudo element. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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
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 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 layouter.setNeedsLayout(this); 227 layouter.setNeedsLayout(this);
228 228
229 setLogicalWidth(tableLayoutLogicalWidth); 229 setLogicalWidth(tableLayoutLogicalWidth);
230 setCellWidthChanged(true); 230 setCellWidthChanged(true);
231 } 231 }
232 232
233 void RenderTableCell::layout() 233 void RenderTableCell::layout()
234 { 234 {
235 ASSERT(needsLayout()); 235 ASSERT(needsLayout());
236 236
237 updateFirstLetter();
238
239 int oldCellBaseline = cellBaselinePosition(); 237 int oldCellBaseline = cellBaselinePosition();
240 layoutBlock(cellWidthChanged()); 238 layoutBlock(cellWidthChanged());
241 239
242 // If we have replaced content, the intrinsic height of our content may have changed since the last time we laid out. If that's the case the intrinsic paddi ng we used 240 // If we have replaced content, the intrinsic height of our content may have changed since the last time we laid out. If that's the case the intrinsic paddi ng we used
243 // for layout (the padding required to push the contents of the cell down to the row's baseline) is included in our new height and baseline and makes both 241 // for layout (the padding required to push the contents of the cell down to the row's baseline) is included in our new height and baseline and makes both
244 // of them wrong. So if our content's intrinsic height has changed push the new content up into the intrinsic padding and relayout so that the rest of 242 // of them wrong. So if our content's intrinsic height has changed push the new content up into the intrinsic padding and relayout so that the rest of
245 // table and row layout can use the correct baseline and height for this cel l. 243 // table and row layout can use the correct baseline and height for this cel l.
246 if (isBaselineAligned() && section()->rowBaseline(rowIndex()) && cellBaselin ePosition() > section()->rowBaseline(rowIndex())) { 244 if (isBaselineAligned() && section()->rowBaseline(rowIndex()) && cellBaselin ePosition() > section()->rowBaseline(rowIndex())) {
247 int newIntrinsicPaddingBefore = std::max<LayoutUnit>(0, intrinsicPadding Before() - std::max<LayoutUnit>(0, cellBaselinePosition() - oldCellBaseline)); 245 int newIntrinsicPaddingBefore = std::max<LayoutUnit>(0, intrinsicPadding Before() - std::max<LayoutUnit>(0, cellBaselinePosition() - oldCellBaseline));
248 setIntrinsicPaddingBefore(newIntrinsicPaddingBefore); 246 setIntrinsicPaddingBefore(newIntrinsicPaddingBefore);
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 1261
1264 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render Object* parent) 1262 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render Object* parent)
1265 { 1263 {
1266 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen t()); 1264 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen t());
1267 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( parent->style(), TABLE_CELL); 1265 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( parent->style(), TABLE_CELL);
1268 newCell->setStyle(newStyle.release()); 1266 newCell->setStyle(newStyle.release());
1269 return newCell; 1267 return newCell;
1270 } 1268 }
1271 1269
1272 } // namespace blink 1270 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698