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

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

Issue 1379213002: Remove LayoutTable::m_currentBorder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment Created 5 years, 2 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 | « no previous file | third_party/WebKit/Source/core/layout/LayoutTable.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, 2009, 2010 Apple Inc. All rights reserv ed. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2009, 2010 Apple Inc. All rights reserv ed.
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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 LayoutTableSection* sectionBelow(const LayoutTableSection*, SkipEmptySection sValue = DoNotSkipEmptySections) const; 297 LayoutTableSection* sectionBelow(const LayoutTableSection*, SkipEmptySection sValue = DoNotSkipEmptySections) const;
298 298
299 LayoutTableCell* cellAbove(const LayoutTableCell*) const; 299 LayoutTableCell* cellAbove(const LayoutTableCell*) const;
300 LayoutTableCell* cellBelow(const LayoutTableCell*) const; 300 LayoutTableCell* cellBelow(const LayoutTableCell*) const;
301 LayoutTableCell* cellBefore(const LayoutTableCell*) const; 301 LayoutTableCell* cellBefore(const LayoutTableCell*) const;
302 LayoutTableCell* cellAfter(const LayoutTableCell*) const; 302 LayoutTableCell* cellAfter(const LayoutTableCell*) const;
303 303
304 typedef Vector<CollapsedBorderValue> CollapsedBorderValues; 304 typedef Vector<CollapsedBorderValue> CollapsedBorderValues;
305 void invalidateCollapsedBorders(); 305 void invalidateCollapsedBorders();
306 306
307 // TODO(wangxianzhu): This method should be moved into TablePainter.
308 const CollapsedBorderValue* currentBorderValue() const { return m_currentBor der; }
309 void setCurrentBorderValue(const CollapsedBorderValue* val) const { m_curren tBorder = val; }
310
311 bool hasSections() const { return m_head || m_foot || m_firstBody; } 307 bool hasSections() const { return m_head || m_foot || m_firstBody; }
312 308
313 void recalcSectionsIfNeeded() const 309 void recalcSectionsIfNeeded() const
314 { 310 {
315 if (m_needsSectionRecalc) 311 if (m_needsSectionRecalc)
316 recalcSections(); 312 recalcSections();
317 } 313 }
318 314
319 static LayoutTable* createAnonymousWithParent(const LayoutObject*); 315 static LayoutTable* createAnonymousWithParent(const LayoutObject*);
320 LayoutBox* createAnonymousBoxWithSameTypeAs(const LayoutObject* parent) cons t override 316 LayoutBox* createAnonymousBoxWithSameTypeAs(const LayoutObject* parent) cons t override
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 373
378 void addOverflowFromChildren() override; 374 void addOverflowFromChildren() override;
379 375
380 void recalcSections() const; 376 void recalcSections() const;
381 void layoutCaption(LayoutTableCaption&); 377 void layoutCaption(LayoutTableCaption&);
382 378
383 void distributeExtraLogicalHeight(int extraLogicalHeight); 379 void distributeExtraLogicalHeight(int extraLogicalHeight);
384 380
385 void recalcCollapsedBordersIfNeeded(); 381 void recalcCollapsedBordersIfNeeded();
386 382
387 // TODO(layout-dev): All mutables in this class (except for m_currentBorder) are lazily updated by recalcSections() 383 // TODO(layout-dev): All mutables in this class are lazily updated by recalc Sections()
388 // which is called by various getter methods (e.g. borderBefore(), borderAft er()). They allow dirty layout even after 384 // which is called by various getter methods (e.g. borderBefore(), borderAft er()).
389 // DocumentLifecycle::LayoutClean which seems not proper. crbug.com/538236. 385 // They allow dirty layout even after DocumentLifecycle::LayoutClean which s eems not proper. crbug.com/538236.
390 386
391 mutable Vector<int> m_columnPos; 387 mutable Vector<int> m_columnPos;
392 388
393 // This Vector holds the columns counts over the entire table. 389 // This Vector holds the columns counts over the entire table.
394 // 390 //
395 // To save memory at the expense of massive code complexity, the code tries 391 // To save memory at the expense of massive code complexity, the code tries
396 // to coalesce columns. This means that we try to the wider column grouping 392 // to coalesce columns. This means that we try to the wider column grouping
397 // seen over the LayoutTableSections. 393 // seen over the LayoutTableSections.
398 // 394 //
399 // Note that this is also a defensive pattern as <td colspan="6666666666"> 395 // Note that this is also a defensive pattern as <td colspan="6666666666">
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 // 428 //
433 // The layout algorithm is delegated to TableLayoutAlgorithm. This enables 429 // The layout algorithm is delegated to TableLayoutAlgorithm. This enables
434 // changing 'table-layout' without having to reattach the <table>. 430 // changing 'table-layout' without having to reattach the <table>.
435 // 431 //
436 // As the algorithm is dependent on the style, this field is nullptr before 432 // As the algorithm is dependent on the style, this field is nullptr before
437 // the first style is applied in styleDidChange(). 433 // the first style is applied in styleDidChange().
438 OwnPtr<TableLayoutAlgorithm> m_tableLayout; 434 OwnPtr<TableLayoutAlgorithm> m_tableLayout;
439 435
440 // A sorted list of all unique border values that we want to paint. 436 // A sorted list of all unique border values that we want to paint.
441 CollapsedBorderValues m_collapsedBorders; 437 CollapsedBorderValues m_collapsedBorders;
442 // Used by TablePainter during painting.
443 // TODO(wangxianzhu): Move it into painter.
444 mutable const CollapsedBorderValue* m_currentBorder;
445 bool m_collapsedBordersValid : 1; 438 bool m_collapsedBordersValid : 1;
446 439
447 mutable bool m_hasColElements : 1; 440 mutable bool m_hasColElements : 1;
448 mutable bool m_needsSectionRecalc : 1; 441 mutable bool m_needsSectionRecalc : 1;
449 442
450 bool m_columnLogicalWidthChanged : 1; 443 bool m_columnLogicalWidthChanged : 1;
451 mutable bool m_columnLayoutObjectsValid: 1; 444 mutable bool m_columnLayoutObjectsValid: 1;
452 mutable bool m_hasCellColspanThatDeterminesTableWidth : 1; 445 mutable bool m_hasCellColspanThatDeterminesTableWidth : 1;
453 bool hasCellColspanThatDeterminesTableWidth() const 446 bool hasCellColspanThatDeterminesTableWidth() const
454 { 447 {
(...skipping 18 matching lines...) Expand all
473 if (m_firstBody) 466 if (m_firstBody)
474 return m_firstBody; 467 return m_firstBody;
475 return m_foot; 468 return m_foot;
476 } 469 }
477 470
478 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTable, isTable()); 471 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTable, isTable());
479 472
480 } // namespace blink 473 } // namespace blink
481 474
482 #endif // LayoutTable_h 475 #endif // LayoutTable_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutTable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698