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

Side by Side Diff: Source/WebCore/rendering/RenderTable.cpp

Issue 10807056: Revert 117339 - CSS 2.1 failure: inline-table-001 fails (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 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/WebCore/rendering/RenderTable.h ('k') | Source/WebCore/rendering/RenderTableSection.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 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights 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 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 1210
1211 RenderBlock* RenderTable::firstLineBlock() const 1211 RenderBlock* RenderTable::firstLineBlock() const
1212 { 1212 {
1213 return 0; 1213 return 0;
1214 } 1214 }
1215 1215
1216 void RenderTable::updateFirstLetter() 1216 void RenderTable::updateFirstLetter()
1217 { 1217 {
1218 } 1218 }
1219 1219
1220 enum LineBox { FirstLineBox, LastLineBox };
1221
1222 static LayoutUnit getLineBoxBaseline(const RenderTable* table, LineBox lineBox)
1223 {
1224 if (table->isWritingModeRoot())
1225 return -1;
1226
1227 table->recalcSectionsIfNeeded();
1228
1229 const RenderTableSection* topNonEmptySection = table->topNonEmptySection();
1230 if (!topNonEmptySection)
1231 return -1;
1232
1233 LayoutUnit baseline = topNonEmptySection->firstLineBoxBaseline();
1234 if (baseline > 0)
1235 return topNonEmptySection->logicalTop() + baseline;
1236
1237 // The 'first' linebox baseline in a table in the absence of any text in the first section
1238 // is the top of the table.
1239 if (lineBox == FirstLineBox)
1240 return topNonEmptySection->logicalTop();
1241
1242 // The 'last' linebox baseline in a table is the baseline of text in the fir st
1243 // cell in the first row/section, so if there is no text do not return a bas eline.
1244 return -1;
1245 }
1246
1247 LayoutUnit RenderTable::lastLineBoxBaseline() const
1248 {
1249 return getLineBoxBaseline(this, LastLineBox);
1250 }
1251
1252 LayoutUnit RenderTable::firstLineBoxBaseline() const 1220 LayoutUnit RenderTable::firstLineBoxBaseline() const
1253 { 1221 {
1254 return getLineBoxBaseline(this, FirstLineBox); 1222 if (isWritingModeRoot())
1223 return -1;
1224
1225 recalcSectionsIfNeeded();
1226
1227 const RenderTableSection* topNonEmptySection = this->topNonEmptySection();
1228 if (!topNonEmptySection)
1229 return -1;
1230
1231 return topNonEmptySection->logicalTop() + topNonEmptySection->firstLineBoxBa seline();
1255 } 1232 }
1256 1233
1257 LayoutRect RenderTable::overflowClipRect(const LayoutPoint& location, RenderRegi on* region, OverlayScrollbarSizeRelevancy relevancy) 1234 LayoutRect RenderTable::overflowClipRect(const LayoutPoint& location, RenderRegi on* region, OverlayScrollbarSizeRelevancy relevancy)
1258 { 1235 {
1259 LayoutRect rect = RenderBlock::overflowClipRect(location, region, relevancy) ; 1236 LayoutRect rect = RenderBlock::overflowClipRect(location, region, relevancy) ;
1260 1237
1261 // If we have a caption, expand the clip to include the caption. 1238 // If we have a caption, expand the clip to include the caption.
1262 // FIXME: Technically this is wrong, but it's virtually impossible to fix th is 1239 // FIXME: Technically this is wrong, but it's virtually impossible to fix th is
1263 // for real until captions have been re-written. 1240 // for real until captions have been re-written.
1264 // FIXME: This code assumes (like all our other caption code) that only top/ bottom are 1241 // FIXME: This code assumes (like all our other caption code) that only top/ bottom are
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel l* cell) const 1302 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel l* cell) const
1326 { 1303 {
1327 ASSERT(cell->isFirstOrLastCellInRow()); 1304 ASSERT(cell->isFirstOrLastCellInRow());
1328 if (cell->section()->hasSameDirectionAsTable()) 1305 if (cell->section()->hasSameDirectionAsTable())
1329 return style()->borderEnd(); 1306 return style()->borderEnd();
1330 1307
1331 return style()->borderStart(); 1308 return style()->borderStart();
1332 } 1309 }
1333 1310
1334 } 1311 }
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/RenderTable.h ('k') | Source/WebCore/rendering/RenderTableSection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698