Skip to content

Commit

Permalink
Unreviewed, reverting r270544 and r270569.
Browse files Browse the repository at this point in the history
Caused two editing tests to consistently crash on iOS

Reverted changesets:

"[LFC][Integration] Invalidate line layout path for children
of inlines"
https://bugs.webkit.org/show_bug.cgi?id=219639
https://trac.webkit.org/changeset/270544

"Unreviewed. Add missing LFC guards around LineLayout usage
from r270544"
https://trac.webkit.org/changeset/270569

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@270594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
[email protected] committed Dec 9, 2020
1 parent b38833a commit caf78fd
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 31 deletions.
17 changes: 17 additions & 0 deletions Source/WebCore/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
2020-12-09 Ryan Haddad <[email protected]>

Unreviewed, reverting r270544 and r270569.

Caused two editing tests to consistently crash on iOS

Reverted changesets:

"[LFC][Integration] Invalidate line layout path for children
of inlines"
https://bugs.webkit.org/show_bug.cgi?id=219639
https://trac.webkit.org/changeset/270544

"Unreviewed. Add missing LFC guards around LineLayout usage
from r270544"
https://trac.webkit.org/changeset/270569

2020-12-09 Antti Koivisto <[email protected]>

Font loads are triggered too late
Expand Down
22 changes: 7 additions & 15 deletions Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,33 +68,25 @@ LineLayout::LineLayout(RenderBlockFlow& flow)

LineLayout::~LineLayout() = default;

RenderBlockFlow* LineLayout::blockContainer(RenderObject& renderer)
LineLayout* LineLayout::containing(RenderObject& renderer)
{
if (!renderer.isInline())
return nullptr;

// FIXME: These fake renderers have their parent set but are not actually in the tree.
if (renderer.isReplica() || renderer.isRenderScrollbarPart())
return nullptr;

for (auto* parent = renderer.parent(); parent; parent = parent->parent()) {
if (!parent->childrenInline())
return nullptr;
if (is<RenderBlockFlow>(*parent))
return downcast<RenderBlockFlow>(parent);
return downcast<RenderBlockFlow>(*parent).modernLineLayout();
if (!is<RenderInline>(*parent))
return nullptr;
}

return nullptr;
}

LineLayout* LineLayout::containing(RenderObject& renderer)
{
if (!renderer.isInline())
return nullptr;

if (auto* container = blockContainer(renderer))
return container->modernLineLayout();

return nullptr;
}

const LineLayout* LineLayout::containing(const RenderObject& renderer)
{
return containing(const_cast<RenderObject&>(renderer));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class LineLayout : public CanMakeWeakPtr<LineLayout> {
LineLayout(RenderBlockFlow&);
~LineLayout();

static RenderBlockFlow* blockContainer(RenderObject&);
static LineLayout* containing(RenderObject&);
static const LineLayout* containing(const RenderObject&);

Expand Down
10 changes: 0 additions & 10 deletions Source/WebCore/rendering/RenderObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1466,23 +1466,13 @@ void RenderObject::willBeDestroyed()

void RenderObject::insertedIntoTree()
{
#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
if (auto* container = LayoutIntegration::LineLayout::blockContainer(*this))
container->invalidateLineLayoutPath();
#endif

// FIXME: We should ASSERT(isRooted()) here but generated content makes some out-of-order insertion.
if (!isFloating() && parent()->childrenInline())
parent()->dirtyLinesFromChangedChild(*this);
}

void RenderObject::willBeRemovedFromTree()
{
#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
if (auto* container = LayoutIntegration::LineLayout::blockContainer(*this))
container->invalidateLineLayoutPath();
#endif

// FIXME: We should ASSERT(isRooted()) but we have some out-of-order removals which would need to be fixed first.
// Update cached boundaries in SVG renderers, if a child is removed.
parent()->setNeedsBoundariesUpdate();
Expand Down
6 changes: 2 additions & 4 deletions Source/WebCore/rendering/RenderText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1461,10 +1461,8 @@ void RenderText::setText(const String& text, bool force)
setNeedsLayoutAndPrefWidthsRecalc();
m_knownToHaveNoOverflowAndNoFallbackFonts = false;

#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
if (auto* container = LayoutIntegration::LineLayout::blockContainer(*this))
container->invalidateLineLayoutPath();
#endif
if (is<RenderBlockFlow>(*parent()))
downcast<RenderBlockFlow>(*parent()).invalidateLineLayoutPath();

if (AXObjectCache* cache = document().existingAXObjectCache())
cache->deferTextChangedIfNeeded(textNode());
Expand Down
3 changes: 2 additions & 1 deletion Source/WebCore/rendering/updating/RenderTreeBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ void RenderTreeBuilder::attachToRenderElementInternal(RenderElement& parent, Ren

if (AXObjectCache* cache = parent.document().axObjectCache())
cache->childrenChanged(&parent, newChild);

if (is<RenderBlockFlow>(parent))
downcast<RenderBlockFlow>(parent).invalidateLineLayoutPath();
if (parent.hasOutlineAutoAncestor() || parent.outlineStyleForRepaint().outlineStyleIsAuto() == OutlineIsAuto::On)
newChild->setHasOutlineAutoAncestor();
}
Expand Down
4 changes: 4 additions & 0 deletions Source/WebCore/rendering/updating/RenderTreeBuilderBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ void RenderTreeBuilder::Block::attachIgnoringContinuation(RenderBlock& parent, R
}
}

parent.invalidateLineLayoutPath();

m_builder.attachToRenderElement(parent, WTFMove(child), beforeChild);

if (madeBoxesNonInline && is<RenderBlock>(parent.parent()) && parent.isAnonymousBlock())
Expand Down Expand Up @@ -290,6 +292,8 @@ RenderPtr<RenderObject> RenderTreeBuilder::Block::detach(RenderBlock& parent, Re
auto next = makeWeakPtr(oldChild.nextSibling());
bool canMergeAnonymousBlocks = canMergeContiguousAnonymousBlocks(oldChild, prev.get(), next.get());

parent.invalidateLineLayoutPath();

auto takenChild = m_builder.detachFromRenderElement(parent, oldChild);

if (canMergeAnonymousBlocks && prev && next) {
Expand Down

0 comments on commit caf78fd

Please sign in to comment.