Skip to content
Permalink
Browse files
Remove some obsolete layout assertions
https://bugs.webkit.org/show_bug.cgi?id=178170

Reviewed by Zalan Bujtas.

We have strong assertions against render tree mutation functions being called in layout. These are unnecessary.

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::moveChildTo):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::takeChildInternal):
* rendering/RenderElement.h:
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::layout):
* rendering/RenderListItem.h:


Canonical link: https://commits.webkit.org/194426@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223194 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
anttijk committed Oct 11, 2017
1 parent ebb25b8 commit 7729f19ad245694f42e7166032b7a7ba0350edab
Showing 6 changed files with 18 additions and 26 deletions.
@@ -1,3 +1,21 @@
2017-10-11 Antti Koivisto <antti@apple.com>

Remove some obsolete layout assertions
https://bugs.webkit.org/show_bug.cgi?id=178170

Reviewed by Zalan Bujtas.

We have strong assertions against render tree mutation functions being called in layout. These are unnecessary.

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::moveChildTo):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::takeChildInternal):
* rendering/RenderElement.h:
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::layout):
* rendering/RenderListItem.h:

2017-10-11 Andy Estes <aestes@apple.com>

[Payment Request] Implement Apple Pay merchant validation
@@ -2585,9 +2585,6 @@ void RenderBoxModelObject::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, Tra

void RenderBoxModelObject::moveChildTo(RenderBoxModelObject* toBoxModelObject, RenderObject* child, RenderObject* beforeChild, bool fullRemoveInsert)
{
#if !ASSERT_DISABLED
SetForScope<bool> reparentingChild(m_reparentingChild, true);
#endif
// We assume that callers have cleared their positioned objects list for child moves (!fullRemoveInsert) so the
// positioned renderer maps don't become stale. It would be too slow to do the map lookup on each call.
ASSERT(!fullRemoveInsert || !is<RenderBlock>(*this) || !downcast<RenderBlock>(*this).hasPositionedObjects());
@@ -85,9 +85,6 @@ struct SameSizeAsRenderElement : public RenderObject {
void* firstChild;
void* lastChild;
RenderStyle style;
#if !ASSERT_DISABLED
bool reparentingChild;
#endif
};

static_assert(sizeof(RenderElement) == sizeof(SameSizeAsRenderElement), "RenderElement should stay small");
@@ -634,11 +631,6 @@ RenderPtr<RenderObject> RenderElement::takeChildInternal(RenderObject& oldChild,

if (AXObjectCache* cache = document().existingAXObjectCache())
cache->childrenChanged(this);
#if !ASSERT_DISABLED
// Check if the marker gets detached while laying out the list item.
if (is<RenderListMarker>(oldChild))
ASSERT(m_reparentingChild || !downcast<RenderListMarker>(oldChild).listItem().inLayout());
#endif

return RenderPtr<RenderObject>(&oldChild);
}
@@ -358,11 +358,6 @@ class RenderElement : public RenderObject {
// Store state between styleWillChange and styleDidChange
static bool s_affectsParentBlock;
static bool s_noLongerAffectsParentBlock;

protected:
#if !ASSERT_DISABLED
bool m_reparentingChild { false };
#endif
};

inline void RenderElement::setAncestorLineBoxDirty(bool f)
@@ -234,9 +234,6 @@ void RenderListItem::layout()
StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());

#if !ASSERT_DISABLED
SetForScope<bool> inListItemLayout(m_inLayout, true);
#endif
RenderBlockFlow::layout();
}

@@ -59,10 +59,6 @@ class RenderListItem final : public RenderBlockFlow {
RenderListMarker* markerRenderer() const { return m_marker.get(); }
void setMarkerRenderer(RenderListMarker& marker) { m_marker = makeWeakPtr(marker); }

#if !ASSERT_DISABLED
bool inLayout() const { return m_inLayout; }
#endif

private:
void willBeDestroyed() override;

@@ -90,9 +86,6 @@ class RenderListItem final : public RenderBlockFlow {
int m_explicitValue;
WeakPtr<RenderListMarker> m_marker;
mutable int m_value;
#if !ASSERT_DISABLED
bool m_inLayout { false };
#endif
bool m_hasExplicitValue : 1;
mutable bool m_isValueUpToDate : 1;
bool m_notInList : 1;

0 comments on commit 7729f19

Please sign in to comment.