Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (226830 => 226831)
--- branches/safari-605-branch/Source/WebCore/ChangeLog 2018-01-12 01:50:38 UTC (rev 226830)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog 2018-01-12 01:50:41 UTC (rev 226831)
@@ -1,5 +1,9 @@
2018-01-11 Jason Marcell <[email protected]>
+ Revert r226237. rdar://problem/36183940
+
+2018-01-11 Jason Marcell <[email protected]>
+
Revert r226240. rdar://problem/36180916
2018-01-11 Jason Marcell <[email protected]>
Modified: branches/safari-605-branch/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp (226830 => 226831)
--- branches/safari-605-branch/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp 2018-01-12 01:50:38 UTC (rev 226830)
+++ branches/safari-605-branch/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp 2018-01-12 01:50:41 UTC (rev 226831)
@@ -62,14 +62,6 @@
void RenderTreeBuilder::insertChild(RenderElement& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
{
- auto insertRecursiveIfNeeded = [&](RenderElement& parentCandidate) {
- if (&parent == &parentCandidate) {
- parent.addChild(*this, WTFMove(child), beforeChild);
- return;
- }
- insertChild(parentCandidate, WTFMove(child), beforeChild);
- };
-
ASSERT(&parent.view() == &m_view);
if (is<RenderText>(beforeChild)) {
@@ -78,17 +70,32 @@
}
if (is<RenderTableRow>(parent)) {
- insertRecursiveIfNeeded(tableBuilder().findOrCreateParentForChild(downcast<RenderTableRow>(parent), *child, beforeChild));
+ auto& parentCandidate = tableBuilder().findOrCreateParentForChild(downcast<RenderTableRow>(parent), *child, beforeChild);
+ if (&parent != &parentCandidate) {
+ insertChild(parentCandidate, WTFMove(child), beforeChild);
+ return;
+ }
+ parent.addChild(*this, WTFMove(child), beforeChild);
return;
}
if (is<RenderTableSection>(parent)) {
- insertRecursiveIfNeeded(tableBuilder().findOrCreateParentForChild(downcast<RenderTableSection>(parent), *child, beforeChild));
+ auto& parentCandidate = tableBuilder().findOrCreateParentForChild(downcast<RenderTableSection>(parent), *child, beforeChild);
+ if (&parent != &parentCandidate) {
+ insertChild(parentCandidate, WTFMove(child), beforeChild);
+ return;
+ }
+ parent.addChild(*this, WTFMove(child), beforeChild);
return;
}
if (is<RenderTable>(parent)) {
- insertRecursiveIfNeeded(tableBuilder().findOrCreateParentForChild(downcast<RenderTable>(parent), *child, beforeChild));
+ auto& parentCandidate = tableBuilder().findOrCreateParentForChild(downcast<RenderTable>(parent), *child, beforeChild);
+ if (&parent != &parentCandidate) {
+ insertChild(parentCandidate, WTFMove(child), beforeChild);
+ return;
+ }
+ parent.addChild(*this, WTFMove(child), beforeChild);
return;
}