Unreviewed, rolling out r157916.

http://trac.webkit.org/changeset/157916
https://bugs.webkit.org/show_bug.cgi?id=123274

Broke Layout/flexbox-lots-of-data.html on perfbot (Requested
by ap on #webkit).

PerformanceTests:

* Layout/flexbox-lots-of-data.html: Removed.

Source/WebCore:

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::OrderHashTraits::emptyValue):
(WebCore::RenderFlexibleBox::OrderHashTraits::constructDeletedValue):
(WebCore::RenderFlexibleBox::OrderHashTraits::isDeletedValue):
(WebCore::RenderFlexibleBox::OrderIterator::setOrderValues):
(WebCore::RenderFlexibleBox::layoutBlock):
(WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes):
* rendering/RenderFlexibleBox.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 92d195d6
2013-10-24 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r157916.
http://trac.webkit.org/changeset/157916
https://bugs.webkit.org/show_bug.cgi?id=123274
Broke Layout/flexbox-lots-of-data.html on perfbot (Requested
by ap on #webkit).
* Layout/flexbox-lots-of-data.html: Removed.
2013-10-14 Sergio Villar Senin <svillar@igalia.com>
Use a Vector instead of HashSet to computed the orderValues in RenderFlexibleBox
......
This diff is collapsed.
2013-10-24 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r157916.
http://trac.webkit.org/changeset/157916
https://bugs.webkit.org/show_bug.cgi?id=123274
Broke Layout/flexbox-lots-of-data.html on perfbot (Requested
by ap on #webkit).
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::OrderHashTraits::emptyValue):
(WebCore::RenderFlexibleBox::OrderHashTraits::constructDeletedValue):
(WebCore::RenderFlexibleBox::OrderHashTraits::isDeletedValue):
(WebCore::RenderFlexibleBox::OrderIterator::setOrderValues):
(WebCore::RenderFlexibleBox::layoutBlock):
(WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes):
* rendering/RenderFlexibleBox.h:
2013-10-24 Zan Dobersek <zdobersek@igalia.com>
Comment in ScopedEventQueue::dispatchEvent is unnecessarily verbose
......
......@@ -39,6 +39,16 @@
namespace WebCore {
// Normally, -1 and 0 are not valid in a HashSet, but these are relatively likely order: values. Instead,
// we make the two smallest int values invalid order: values (in the css parser code we clamp them to
// int min + 2).
struct RenderFlexibleBox::OrderHashTraits : WTF::GenericHashTraits<int> {
static const bool emptyValueIsZero = false;
static int emptyValue() { return std::numeric_limits<int>::min(); }
static void constructDeletedValue(int& slot) { slot = std::numeric_limits<int>::min() + 1; }
static bool isDeletedValue(int value) { return value == std::numeric_limits<int>::min() + 1; }
};
RenderFlexibleBox::OrderIterator::OrderIterator(const RenderFlexibleBox* flexibleBox)
: m_flexibleBox(flexibleBox)
, m_currentChild(0)
......@@ -46,16 +56,11 @@ RenderFlexibleBox::OrderIterator::OrderIterator(const RenderFlexibleBox* flexibl
{
}
void RenderFlexibleBox::OrderIterator::setOrderValues(const OrderValues& orderValues)
void RenderFlexibleBox::OrderIterator::setOrderValues(const OrderHashSet& orderValues)
{
reset();
m_orderValues = orderValues;
if (m_orderValues.size() < 2)
return;
copyToVector(orderValues, m_orderValues);
std::sort(m_orderValues.begin(), m_orderValues.end());
auto nextElement = std::unique(m_orderValues.begin(), m_orderValues.end());
m_orderValues.shrinkCapacity(nextElement - m_orderValues.begin());
}
RenderBox* RenderFlexibleBox::OrderIterator::first()
......@@ -343,7 +348,7 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren, LayoutUnit)
dirtyForLayoutFromPercentageHeightDescendants();
Vector<LineContext> lineContexts;
OrderIterator::OrderValues orderValues;
OrderHashSet orderValues;
computeMainAxisPreferredSizes(orderValues);
m_orderIterator.setOrderValues(orderValues);
......@@ -903,16 +908,10 @@ LayoutUnit RenderFlexibleBox::computeChildMarginValue(const Length& margin)
return minimumValueForLength(margin, availableSize);
}
void RenderFlexibleBox::computeMainAxisPreferredSizes(OrderIterator::OrderValues& orderValues)
void RenderFlexibleBox::computeMainAxisPreferredSizes(OrderHashSet& orderValues)
{
ASSERT(orderValues.isEmpty());
for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
// Avoid growing the vector for the common-case default value of 0. This optimizes the most common case which is
// one or a few values with the default order 0
int order = child->style()->order();
if (orderValues.isEmpty() || orderValues.last() != order)
orderValues.append(order);
orderValues.add(child->style()->order());
if (child->isOutOfFlowPositioned())
continue;
......
......@@ -73,13 +73,14 @@ private:
NoFlipForRowReverse,
};
struct OrderHashTraits;
typedef HashSet<int, DefaultHash<int>::Hash, OrderHashTraits> OrderHashSet;
class OrderIterator {
WTF_MAKE_NONCOPYABLE(OrderIterator);
public:
typedef Vector<int, 1> OrderValues;
OrderIterator(const RenderFlexibleBox*);
void setOrderValues(const OrderValues&);
void setOrderValues(const OrderHashSet&);
RenderBox* currentChild() const { return m_currentChild; }
RenderBox* first();
RenderBox* next();
......@@ -88,7 +89,7 @@ private:
private:
const RenderFlexibleBox* m_flexibleBox;
RenderBox* m_currentChild;
OrderValues m_orderValues;
Vector<int> m_orderValues;
Vector<int>::const_iterator m_orderValuesIterator;
};
......@@ -152,7 +153,7 @@ private:
LayoutUnit marginBoxAscentForChild(RenderBox&);
LayoutUnit computeChildMarginValue(const Length& margin);
void computeMainAxisPreferredSizes(OrderIterator::OrderValues&);
void computeMainAxisPreferredSizes(OrderHashSet&);
LayoutUnit adjustChildSizeForMinAndMax(RenderBox&, LayoutUnit childSize);
bool computeNextFlexLine(OrderedFlexItemList& orderedChildren, LayoutUnit& preferredMainAxisExtent, double& totalFlexGrow, double& totalWeightedFlexShrink, LayoutUnit& minMaxAppliedMainAxisExtent, bool& hasInfiniteLineLength);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment