Title: [224641] trunk/Source/WebCore
- Revision
- 224641
- Author
- za...@apple.com
- Date
- 2017-11-09 12:22:10 -0800 (Thu, 09 Nov 2017)
Log Message
[LayoutState cleanup] Remove conditional push from RenderTableSection::calcRowLogicalHeight
https://bugs.webkit.org/show_bug.cgi?id=179493
<rdar://problem/35446631>
Reviewed by Antti Koivisto.
Pushing layout states is cheap and we do it for every container anyway.
Covered by existing tests.
* rendering/LayoutState.cpp:
(WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
(WebCore::LayoutStateMaintainer::~LayoutStateMaintainer):
(WebCore::LayoutStateMaintainer::pop):
(WebCore::LayoutStateMaintainer::push): Deleted.
* rendering/LayoutState.h:
(WebCore::LayoutStateMaintainer::didPush const): Deleted.
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (224640 => 224641)
--- trunk/Source/WebCore/ChangeLog 2017-11-09 19:30:16 UTC (rev 224640)
+++ trunk/Source/WebCore/ChangeLog 2017-11-09 20:22:10 UTC (rev 224641)
@@ -1,3 +1,25 @@
+2017-11-09 Zalan Bujtas <za...@apple.com>
+
+ [LayoutState cleanup] Remove conditional push from RenderTableSection::calcRowLogicalHeight
+ https://bugs.webkit.org/show_bug.cgi?id=179493
+ <rdar://problem/35446631>
+
+ Reviewed by Antti Koivisto.
+
+ Pushing layout states is cheap and we do it for every container anyway.
+
+ Covered by existing tests.
+
+ * rendering/LayoutState.cpp:
+ (WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
+ (WebCore::LayoutStateMaintainer::~LayoutStateMaintainer):
+ (WebCore::LayoutStateMaintainer::pop):
+ (WebCore::LayoutStateMaintainer::push): Deleted.
+ * rendering/LayoutState.h:
+ (WebCore::LayoutStateMaintainer::didPush const): Deleted.
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::calcRowLogicalHeight):
+
2017-11-09 Youenn Fablet <you...@apple.com>
CachedResourceLoader::requestRawResource should not assert when destination is set in the context of a service worker
Modified: trunk/Source/WebCore/rendering/LayoutState.cpp (224640 => 224641)
--- trunk/Source/WebCore/rendering/LayoutState.cpp 2017-11-09 19:30:16 UTC (rev 224640)
+++ trunk/Source/WebCore/rendering/LayoutState.cpp 2017-11-09 20:22:10 UTC (rev 224641)
@@ -276,7 +276,9 @@
: m_context(root.view().frameView().layoutContext())
, m_paintOffsetCacheIsDisabled(disablePaintOffsetCache)
{
- push(root, offset, pageHeight, pageHeightChanged);
+ m_didPushLayoutState = m_context.pushLayoutState(root, offset, pageHeight, pageHeightChanged);
+ if (m_didPushLayoutState && m_paintOffsetCacheIsDisabled)
+ m_context.disablePaintOffsetCache();
}
LayoutStateMaintainer::LayoutStateMaintainer(LayoutContext& context)
@@ -286,30 +288,15 @@
LayoutStateMaintainer::~LayoutStateMaintainer()
{
- // FIXME: Remove conditional push/pop.
- if (m_didCallPush && !m_didCallPop)
+ // FIXME: Remove conditional pop.
+ if (!m_didCallPop)
pop();
- ASSERT(!m_didCallPush || m_didCallPush == m_didCallPop);
}
-void LayoutStateMaintainer::push(RenderBox& root, LayoutSize offset, LayoutUnit pageHeight, bool pageHeightChanged)
-{
- ASSERT(!m_didCallPush);
- m_didCallPush = true;
- // We push state even if disabled, because we still need to store layoutDelta
- m_didPushLayoutState = m_context.pushLayoutState(root, offset, pageHeight, pageHeightChanged);
- if (!m_didPushLayoutState)
- return;
- if (m_paintOffsetCacheIsDisabled)
- m_context.disablePaintOffsetCache();
-}
-
void LayoutStateMaintainer::pop()
{
ASSERT(!m_didCallPop);
m_didCallPop = true;
- if (!m_didCallPush)
- return;
if (!m_didPushLayoutState)
return;
m_context.popLayoutState();
Modified: trunk/Source/WebCore/rendering/LayoutState.h (224640 => 224641)
--- trunk/Source/WebCore/rendering/LayoutState.h 2017-11-09 19:30:16 UTC (rev 224640)
+++ trunk/Source/WebCore/rendering/LayoutState.h 2017-11-09 20:22:10 UTC (rev 224641)
@@ -144,14 +144,11 @@
explicit LayoutStateMaintainer(LayoutContext&);
~LayoutStateMaintainer();
- void push(RenderBox& root, LayoutSize offset, LayoutUnit pageHeight = 0, bool pageHeightChanged = false);
void pop();
- bool didPush() const { return m_didCallPush; }
private:
LayoutContext& m_context;
bool m_paintOffsetCacheIsDisabled { false };
- bool m_didCallPush { false };
bool m_didCallPop { false };
bool m_didPushLayoutState { false };
};
Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (224640 => 224641)
--- trunk/Source/WebCore/rendering/RenderTableSection.cpp 2017-11-09 19:30:16 UTC (rev 224640)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp 2017-11-09 20:22:10 UTC (rev 224641)
@@ -278,7 +278,7 @@
if (this == table()->topSection())
spacing = table()->vBorderSpacing();
- LayoutStateMaintainer statePusher(view().frameView().layoutContext());
+ LayoutStateMaintainer statePusher(*this, locationOffset(), hasTransform() || hasReflection() || style().isFlippedBlocksWritingMode());
m_rowPos.resize(m_grid.size() + 1);
m_rowPos[0] = spacing;
@@ -329,11 +329,6 @@
unsigned cellStartRow = cell->rowIndex();
if (cell->hasOverrideLogicalContentHeight()) {
- if (!statePusher.didPush()) {
- // Technically, we should also push state for the row, but since
- // rows don't push a coordinate transform, that's not necessary.
- statePusher.push(*this, locationOffset());
- }
cell->clearIntrinsicPadding();
cell->clearOverrideSize();
cell->setChildNeedsLayout(MarkOnlyThis);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes