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

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

Issue 1577433003: Statistics of LayoutBox rare data reasons Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 3 years, 9 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, 2008, 2009 Apple Inc. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 LayoutTableCell::LayoutTableCell(Element* element) 59 LayoutTableCell::LayoutTableCell(Element* element)
60 : LayoutBlockFlow(element), 60 : LayoutBlockFlow(element),
61 m_absoluteColumnIndex(unsetColumnIndex), 61 m_absoluteColumnIndex(unsetColumnIndex),
62 m_cellWidthChanged(false), 62 m_cellWidthChanged(false),
63 m_intrinsicPaddingBefore(0), 63 m_intrinsicPaddingBefore(0),
64 m_intrinsicPaddingAfter(0) { 64 m_intrinsicPaddingAfter(0) {
65 // We only update the flags when notified of DOM changes in 65 // We only update the flags when notified of DOM changes in
66 // colSpanOrRowSpanChanged() so we need to set their initial values here in 66 // colSpanOrRowSpanChanged() so we need to set their initial values here in
67 // case something asks for colSpan()/rowSpan() before then. 67 // case something asks for colSpan()/rowSpan() before then.
68 updateColAndRowSpanFlags(); 68 updateColAndRowSpanFlags();
69 m_rareStat.addReason(ReasonLTCAll);
69 } 70 }
70 71
71 LayoutTableCell::CollapsedBorderValues::CollapsedBorderValues( 72 LayoutTableCell::CollapsedBorderValues::CollapsedBorderValues(
72 const LayoutTableCell& layoutTableCell, 73 const LayoutTableCell& layoutTableCell,
73 const CollapsedBorderValue& startBorder, 74 const CollapsedBorderValue& startBorder,
74 const CollapsedBorderValue& endBorder, 75 const CollapsedBorderValue& endBorder,
75 const CollapsedBorderValue& beforeBorder, 76 const CollapsedBorderValue& beforeBorder,
76 const CollapsedBorderValue& afterBorder) 77 const CollapsedBorderValue& afterBorder)
77 : m_layoutTableCell(layoutTableCell), 78 : m_layoutTableCell(layoutTableCell),
78 m_startBorder(startBorder), 79 m_startBorder(startBorder),
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 if (changed) { 1365 if (changed) {
1365 ObjectPaintInvalidator(*table()) 1366 ObjectPaintInvalidator(*table())
1366 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient( 1367 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(
1367 *this, PaintInvalidationStyleChange); 1368 *this, PaintInvalidationStyleChange);
1368 } 1369 }
1369 1370
1370 addBorderStyle(borderValues, newValues.startBorder()); 1371 addBorderStyle(borderValues, newValues.startBorder());
1371 addBorderStyle(borderValues, newValues.endBorder()); 1372 addBorderStyle(borderValues, newValues.endBorder());
1372 addBorderStyle(borderValues, newValues.beforeBorder()); 1373 addBorderStyle(borderValues, newValues.beforeBorder());
1373 addBorderStyle(borderValues, newValues.afterBorder()); 1374 addBorderStyle(borderValues, newValues.afterBorder());
1375
1376 m_rareStat.addReason(ReasonLTCCollapsedBorders);
1377 if (!newValues.startBorder().isVisible() &&
1378 !newValues.endBorder().isVisible() &&
1379 !newValues.beforeBorder().isVisible() &&
1380 !newValues.afterBorder().isVisible())
1381 m_rareStat.addReason(ReasonLTCInvisibleCollapsedBorders);
1374 } 1382 }
1375 1383
1376 void LayoutTableCell::sortBorderValues( 1384 void LayoutTableCell::sortBorderValues(
1377 LayoutTable::CollapsedBorderValues& borderValues) { 1385 LayoutTable::CollapsedBorderValues& borderValues) {
1378 std::sort(borderValues.begin(), borderValues.end(), compareBorders); 1386 std::sort(borderValues.begin(), borderValues.end(), compareBorders);
1379 } 1387 }
1380 1388
1381 void LayoutTableCell::paintBoxDecorationBackground( 1389 void LayoutTableCell::paintBoxDecorationBackground(
1382 const PaintInfo& paintInfo, 1390 const PaintInfo& paintInfo,
1383 const LayoutPoint& paintOffset) const { 1391 const LayoutPoint& paintOffset) const {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1498 } 1506 }
1499 1507
1500 bool LayoutTableCell::hasLineIfEmpty() const { 1508 bool LayoutTableCell::hasLineIfEmpty() const {
1501 if (node() && hasEditableStyle(*node())) 1509 if (node() && hasEditableStyle(*node()))
1502 return true; 1510 return true;
1503 1511
1504 return LayoutBlock::hasLineIfEmpty(); 1512 return LayoutBlock::hasLineIfEmpty();
1505 } 1513 }
1506 1514
1507 } // namespace blink 1515 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTableRow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698