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

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

Issue 1819073004: Fix table cell background painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cr fixes, remove tiling algorithm Created 4 years, 8 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, 2010, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights 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 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 } 727 }
728 728
729 LayoutTableSection* LayoutTable::topNonEmptySection() const 729 LayoutTableSection* LayoutTable::topNonEmptySection() const
730 { 730 {
731 LayoutTableSection* section = topSection(); 731 LayoutTableSection* section = topSection();
732 if (section && !section->numRows()) 732 if (section && !section->numRows())
733 section = sectionBelow(section, SkipEmptySections); 733 section = sectionBelow(section, SkipEmptySections);
734 return section; 734 return section;
735 } 735 }
736 736
737 LayoutTableSection* LayoutTable::bottomNonEmptySection() const
738 {
739 LayoutTableSection* section = bottomSection();
740 if (section && !section->numRows())
741 section = sectionAbove(section, SkipEmptySections);
742 return section;
743 }
744
737 void LayoutTable::splitEffectiveColumn(unsigned index, unsigned firstSpan) 745 void LayoutTable::splitEffectiveColumn(unsigned index, unsigned firstSpan)
738 { 746 {
739 // We split the column at |index|, taking |firstSpan| cells from the span. 747 // We split the column at |index|, taking |firstSpan| cells from the span.
740 ASSERT(m_effectiveColumns[index].span > firstSpan); 748 ASSERT(m_effectiveColumns[index].span > firstSpan);
741 m_effectiveColumns.insert(index, firstSpan); 749 m_effectiveColumns.insert(index, firstSpan);
742 m_effectiveColumns[index + 1].span -= firstSpan; 750 m_effectiveColumns[index + 1].span -= firstSpan;
743 751
744 // Propagate the change in our columns representation to the sections that d on't need 752 // Propagate the change in our columns representation to the sections that d on't need
745 // cell recalc. If they do, they will be synced up directly with m_columns l ater. 753 // cell recalc. If they do, they will be synced up directly with m_columns l ater.
746 for (LayoutObject* child = firstChild(); child; child = child->nextSibling() ) { 754 for (LayoutObject* child = firstChild(); child; child = child->nextSibling() ) {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 colAndColGroup.adjoinsStartBorderOfColGroup = isAtStartEdge && !colAndColGroup.col->previousSibling(); 845 colAndColGroup.adjoinsStartBorderOfColGroup = isAtStartEdge && !colAndColGroup.col->previousSibling();
838 colAndColGroup.adjoinsEndBorderOfColGroup = isAtEndEdge && ! colAndColGroup.col->nextSibling(); 846 colAndColGroup.adjoinsEndBorderOfColGroup = isAtEndEdge && ! colAndColGroup.col->nextSibling();
839 } 847 }
840 } 848 }
841 return colAndColGroup; 849 return colAndColGroup;
842 } 850 }
843 } 851 }
844 return ColAndColGroup(); 852 return ColAndColGroup();
845 } 853 }
846 854
855 unsigned LayoutTable::colElementToAbsoluteColumn(const LayoutTableCol* colElemen t) const
856 {
857 unsigned col = 0;
858
859 for (LayoutTableCol* columnLayoutObject = firstColumn(); columnLayoutObject; columnLayoutObject = columnLayoutObject->nextColumn()) {
860 if (columnLayoutObject == colElement)
861 return col;
862 if (columnLayoutObject->isTableColumnGroupWithColumnChildren()) {
863 // Count spans of leaf col elements only.
864 } else {
865 col += columnLayoutObject->span();
866 }
867 }
868 ASSERT_NOT_REACHED();
869 return 0;
870 }
871
847 void LayoutTable::recalcSections() const 872 void LayoutTable::recalcSections() const
848 { 873 {
849 ASSERT(m_needsSectionRecalc); 874 ASSERT(m_needsSectionRecalc);
850 875
851 m_head = nullptr; 876 m_head = nullptr;
852 m_foot = nullptr; 877 m_foot = nullptr;
853 m_firstBody = nullptr; 878 m_firstBody = nullptr;
854 m_hasColElements = false; 879 m_hasColElements = false;
855 m_hasCellColspanThatDeterminesTableWidth = hasCellColspanThatDeterminesTable Width(); 880 m_hasCellColspanThatDeterminesTableWidth = hasCellColspanThatDeterminesTable Width();
856 881
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1461 1486
1462 LayoutUnit LayoutTable::paddingRight() const 1487 LayoutUnit LayoutTable::paddingRight() const
1463 { 1488 {
1464 if (collapseBorders()) 1489 if (collapseBorders())
1465 return LayoutUnit(); 1490 return LayoutUnit();
1466 1491
1467 return LayoutBlock::paddingRight(); 1492 return LayoutBlock::paddingRight();
1468 } 1493 }
1469 1494
1470 } // namespace blink 1495 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.h ('k') | third_party/WebKit/Source/core/layout/LayoutTableCol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698