OLD | NEW |
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 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 | 1199 |
1200 RenderBlock* RenderTable::firstLineBlock() const | 1200 RenderBlock* RenderTable::firstLineBlock() const |
1201 { | 1201 { |
1202 return 0; | 1202 return 0; |
1203 } | 1203 } |
1204 | 1204 |
1205 void RenderTable::updateFirstLetter() | 1205 void RenderTable::updateFirstLetter() |
1206 { | 1206 { |
1207 } | 1207 } |
1208 | 1208 |
1209 enum LineBox { FirstLineBox, LastLineBox }; | |
1210 | |
1211 static LayoutUnit getLineBoxBaseline(const RenderTable* table, LineBox lineBox) | |
1212 { | |
1213 if (table->isWritingModeRoot()) | |
1214 return -1; | |
1215 | |
1216 table->recalcSectionsIfNeeded(); | |
1217 | |
1218 const RenderTableSection* topNonEmptySection = table->topNonEmptySection(); | |
1219 if (!topNonEmptySection) | |
1220 return -1; | |
1221 | |
1222 LayoutUnit baseline = topNonEmptySection->firstLineBoxBaseline(); | |
1223 if (baseline > 0) | |
1224 return topNonEmptySection->logicalTop() + baseline; | |
1225 | |
1226 // The 'first' linebox baseline in a table in the absence of any text in the
first section | |
1227 // is the top of the table. | |
1228 if (lineBox == FirstLineBox) | |
1229 return topNonEmptySection->logicalTop(); | |
1230 | |
1231 // The 'last' linebox baseline in a table is the baseline of text in the fir
st | |
1232 // cell in the first row/section, so if there is no text do not return a bas
eline. | |
1233 return -1; | |
1234 } | |
1235 | |
1236 LayoutUnit RenderTable::lastLineBoxBaseline() const | |
1237 { | |
1238 return getLineBoxBaseline(this, LastLineBox); | |
1239 } | |
1240 | |
1241 LayoutUnit RenderTable::firstLineBoxBaseline() const | 1209 LayoutUnit RenderTable::firstLineBoxBaseline() const |
1242 { | 1210 { |
1243 return getLineBoxBaseline(this, FirstLineBox); | 1211 if (isWritingModeRoot()) |
| 1212 return -1; |
| 1213 |
| 1214 recalcSectionsIfNeeded(); |
| 1215 |
| 1216 const RenderTableSection* topNonEmptySection = this->topNonEmptySection(); |
| 1217 if (!topNonEmptySection) |
| 1218 return -1; |
| 1219 |
| 1220 return topNonEmptySection->logicalTop() + topNonEmptySection->firstLineBoxBa
seline(); |
1244 } | 1221 } |
1245 | 1222 |
1246 LayoutRect RenderTable::overflowClipRect(const LayoutPoint& location, RenderRegi
on* region, OverlayScrollbarSizeRelevancy relevancy) | 1223 LayoutRect RenderTable::overflowClipRect(const LayoutPoint& location, RenderRegi
on* region, OverlayScrollbarSizeRelevancy relevancy) |
1247 { | 1224 { |
1248 LayoutRect rect = RenderBlock::overflowClipRect(location, region, relevancy)
; | 1225 LayoutRect rect = RenderBlock::overflowClipRect(location, region, relevancy)
; |
1249 | 1226 |
1250 // If we have a caption, expand the clip to include the caption. | 1227 // If we have a caption, expand the clip to include the caption. |
1251 // FIXME: Technically this is wrong, but it's virtually impossible to fix th
is | 1228 // FIXME: Technically this is wrong, but it's virtually impossible to fix th
is |
1252 // for real until captions have been re-written. | 1229 // for real until captions have been re-written. |
1253 // FIXME: This code assumes (like all our other caption code) that only top/
bottom are | 1230 // 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 Loading... |
1314 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel
l* cell) const | 1291 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel
l* cell) const |
1315 { | 1292 { |
1316 ASSERT(cell->isFirstOrLastCellInRow()); | 1293 ASSERT(cell->isFirstOrLastCellInRow()); |
1317 if (cell->section()->hasSameDirectionAsTable()) | 1294 if (cell->section()->hasSameDirectionAsTable()) |
1318 return style()->borderEnd(); | 1295 return style()->borderEnd(); |
1319 | 1296 |
1320 return style()->borderStart(); | 1297 return style()->borderStart(); |
1321 } | 1298 } |
1322 | 1299 |
1323 } | 1300 } |
OLD | NEW |