Title: [132949] trunk/Source/WebCore
- Revision
- 132949
- Author
- [email protected]
- Date
- 2012-10-30 15:37:58 -0700 (Tue, 30 Oct 2012)
Log Message
Teach RenderTable how to use Vector::insert and Vector::append instead of its own custom memmove code
https://bugs.webkit.org/show_bug.cgi?id=100428
Reviewed by Julien Chaffraix.
RenderTable is now like all other clients of Vector instead of being
needlessly different. :)
insert, append and grow all use the same expandCapacity logic under the covers
and Vector::insert uses TypeOperations::moveOverlapping which should use memmove
by default for unknown types.
* rendering/RenderTable.cpp:
(WebCore::RenderTable::splitColumn):
(WebCore::RenderTable::appendColumn):
* rendering/RenderTable.h:
(WebCore::RenderTable::ColumnStruct::ColumnStruct):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (132948 => 132949)
--- trunk/Source/WebCore/ChangeLog 2012-10-30 22:28:49 UTC (rev 132948)
+++ trunk/Source/WebCore/ChangeLog 2012-10-30 22:37:58 UTC (rev 132949)
@@ -1,3 +1,23 @@
+2012-10-30 Eric Seidel <[email protected]>
+
+ Teach RenderTable how to use Vector::insert and Vector::append instead of its own custom memmove code
+ https://bugs.webkit.org/show_bug.cgi?id=100428
+
+ Reviewed by Julien Chaffraix.
+
+ RenderTable is now like all other clients of Vector instead of being
+ needlessly different. :)
+
+ insert, append and grow all use the same expandCapacity logic under the covers
+ and Vector::insert uses TypeOperations::moveOverlapping which should use memmove
+ by default for unknown types.
+
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::splitColumn):
+ (WebCore::RenderTable::appendColumn):
+ * rendering/RenderTable.h:
+ (WebCore::RenderTable::ColumnStruct::ColumnStruct):
+
2012-10-30 Vincent Scheib <[email protected]>
Unreviewed, rolling out r132927.
Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (132948 => 132949)
--- trunk/Source/WebCore/rendering/RenderTable.cpp 2012-10-30 22:28:49 UTC (rev 132948)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp 2012-10-30 22:37:58 UTC (rev 132949)
@@ -716,14 +716,10 @@
void RenderTable::splitColumn(unsigned position, unsigned firstSpan)
{
- // we need to add a new columnStruct
- unsigned oldSize = m_columns.size();
- m_columns.grow(oldSize + 1);
- unsigned oldSpan = m_columns[position].span;
- ASSERT(oldSpan > firstSpan);
- m_columns[position].span = firstSpan;
- memmove(m_columns.data() + position + 1, m_columns.data() + position, (oldSize - position) * sizeof(ColumnStruct));
- m_columns[position + 1].span = oldSpan - firstSpan;
+ // We split the column at "position", taking "firstSpan" cells from the span.
+ ASSERT(m_columns[position].span > firstSpan);
+ m_columns.insert(position, ColumnStruct(firstSpan));
+ m_columns[position + 1].span -= firstSpan;
// Propagate the change in our columns representation to the sections that don't need
// cell recalc. If they do, they will be synced up directly with m_columns later.
@@ -744,10 +740,8 @@
void RenderTable::appendColumn(unsigned span)
{
- unsigned pos = m_columns.size();
- unsigned newSize = pos + 1;
- m_columns.grow(newSize);
- m_columns[pos].span = span;
+ unsigned newColumnIndex = m_columns.size();
+ m_columns.append(ColumnStruct(span));
// Propagate the change in our columns representation to the sections that don't need
// cell recalc. If they do, they will be synced up directly with m_columns later.
@@ -759,7 +753,7 @@
if (section->needsCellRecalc())
continue;
- section->appendColumn(pos);
+ section->appendColumn(newColumnIndex);
}
m_columnPos.grow(numEffCols() + 1);
Modified: trunk/Source/WebCore/rendering/RenderTable.h (132948 => 132949)
--- trunk/Source/WebCore/rendering/RenderTable.h 2012-10-30 22:28:49 UTC (rev 132948)
+++ trunk/Source/WebCore/rendering/RenderTable.h 2012-10-30 22:37:58 UTC (rev 132949)
@@ -127,8 +127,8 @@
virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
struct ColumnStruct {
- ColumnStruct()
- : span(1)
+ explicit ColumnStruct(unsigned initialSpan = 1)
+ : span(initialSpan)
{
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes