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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTableCell.h

Issue 2861773004: Move border-*-width out of BorderValue and store on SurroundData in ComputedStyle instead (Closed)
Patch Set: meade@'s suggestion Created 3 years, 7 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) 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, 2009, 2013 Apple Inc. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2013 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 } 244 }
245 245
246 // This function is used to unify which table part's style we use for 246 // This function is used to unify which table part's style we use for
247 // computing direction and writing mode. Writing modes are not allowed on row 247 // computing direction and writing mode. Writing modes are not allowed on row
248 // group and row but direction is. This means we can safely use the same style 248 // group and row but direction is. This means we can safely use the same style
249 // in all cases to simplify our code. 249 // in all cases to simplify our code.
250 // FIXME: Eventually this function should replaced by style() once we support 250 // FIXME: Eventually this function should replaced by style() once we support
251 // direction on all table parts and writing-mode on cells. 251 // direction on all table parts and writing-mode on cells.
252 const ComputedStyle& StyleForCellFlow() const { return Row()->StyleRef(); } 252 const ComputedStyle& StyleForCellFlow() const { return Row()->StyleRef(); }
253 253
254 const BorderValue& BorderAdjoiningTableStart() const { 254 BorderValue BorderAdjoiningTableStart() const {
255 #if DCHECK_IS_ON() 255 #if DCHECK_IS_ON()
256 DCHECK(IsFirstOrLastCellInRow()); 256 DCHECK(IsFirstOrLastCellInRow());
257 #endif 257 #endif
258 if (Section()->HasSameDirectionAs(Table())) 258 if (Section()->HasSameDirectionAs(Table()))
259 return Style()->BorderStart(); 259 return Style()->BorderStart();
260 260
261 return Style()->BorderEnd(); 261 return Style()->BorderEnd();
262 } 262 }
263 263
264 const BorderValue& BorderAdjoiningTableEnd() const { 264 BorderValue BorderAdjoiningTableEnd() const {
265 #if DCHECK_IS_ON() 265 #if DCHECK_IS_ON()
266 DCHECK(IsFirstOrLastCellInRow()); 266 DCHECK(IsFirstOrLastCellInRow());
267 #endif 267 #endif
268 if (Section()->HasSameDirectionAs(Table())) 268 if (Section()->HasSameDirectionAs(Table()))
269 return Style()->BorderEnd(); 269 return Style()->BorderEnd();
270 270
271 return Style()->BorderStart(); 271 return Style()->BorderStart();
272 } 272 }
273 273
274 const BorderValue& BorderAdjoiningCellBefore(const LayoutTableCell* cell) { 274 BorderValue BorderAdjoiningCellBefore(const LayoutTableCell* cell) {
275 DCHECK_EQ(Table()->CellAfter(cell), this); 275 DCHECK_EQ(Table()->CellAfter(cell), this);
276 // FIXME: https://webkit.org/b/79272 - Add support for mixed directionality 276 // FIXME: https://webkit.org/b/79272 - Add support for mixed directionality
277 // at the cell level. 277 // at the cell level.
278 return Style()->BorderStart(); 278 return Style()->BorderStart();
279 } 279 }
280 280
281 const BorderValue& BorderAdjoiningCellAfter(const LayoutTableCell* cell) { 281 BorderValue BorderAdjoiningCellAfter(const LayoutTableCell* cell) {
282 DCHECK_EQ(Table()->CellBefore(cell), this); 282 DCHECK_EQ(Table()->CellBefore(cell), this);
283 // FIXME: https://webkit.org/b/79272 - Add support for mixed directionality 283 // FIXME: https://webkit.org/b/79272 - Add support for mixed directionality
284 // at the cell level. 284 // at the cell level.
285 return Style()->BorderEnd(); 285 return Style()->BorderEnd();
286 } 286 }
287 287
288 #if DCHECK_IS_ON() 288 #if DCHECK_IS_ON()
289 bool IsFirstOrLastCellInRow() const { 289 bool IsFirstOrLastCellInRow() const {
290 return !Table()->CellAfter(this) || !Table()->CellBefore(this); 290 return !Table()->CellAfter(this) || !Table()->CellBefore(this);
291 } 291 }
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 return ToLayoutTableCell(FirstChild()); 471 return ToLayoutTableCell(FirstChild());
472 } 472 }
473 473
474 inline LayoutTableCell* LayoutTableRow::LastCell() const { 474 inline LayoutTableCell* LayoutTableRow::LastCell() const {
475 return ToLayoutTableCell(LastChild()); 475 return ToLayoutTableCell(LastChild());
476 } 476 }
477 477
478 } // namespace blink 478 } // namespace blink
479 479
480 #endif // LayoutTableCell_h 480 #endif // LayoutTableCell_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698