Modified: trunk/Source/WebCore/ChangeLog (224562 => 224563)
--- trunk/Source/WebCore/ChangeLog 2017-11-08 01:30:14 UTC (rev 224562)
+++ trunk/Source/WebCore/ChangeLog 2017-11-08 05:41:30 UTC (rev 224563)
@@ -1,5 +1,32 @@
2017-11-07 Antti Koivisto <[email protected]>
+ Remove RenderBlock::isAnonymousBlockContinuation()
+ https://bugs.webkit.org/show_bug.cgi?id=179403
+
+ Non-anonymous blocks don't have continuations so this is the same as simply calling continuation().
+
+ Some of these are also really isContinuation() tests. This ends up being the same as calling
+ continuation() as block continuations always have next continuation too. This patch uses
+ isContinuation() where appropriate.
+
+ Reviewed by Zalan Bujtas.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::nodeForHitTest const):
+ (WebCore::RenderBlock::absoluteRects const):
+ (WebCore::RenderBlock::absoluteQuads const):
+ (WebCore::RenderBlock::rectWithOutlineForRepaint const):
+ (WebCore::RenderBlock::hoverAncestor const):
+ (WebCore::RenderBlock::outlineStyleForRepaint const):
+ * rendering/RenderBlock.h:
+ (WebCore::RenderBlock::isAnonymousBlockContinuation const): Deleted.
+ * rendering/RenderElement.cpp:
+ (WebCore::RenderElement::propagateStyleToAnonymousChildren):
+ * rendering/RenderInline.cpp:
+ (WebCore::updateStyleOfAnonymousBlockContinuations):
+
+2017-11-07 Antti Koivisto <[email protected]>
+
There is no such thing as block element continuation
https://bugs.webkit.org/show_bug.cgi?id=179400
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (224562 => 224563)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2017-11-08 01:30:14 UTC (rev 224562)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2017-11-08 05:41:30 UTC (rev 224563)
@@ -2381,7 +2381,7 @@
// that was split. Use the appropriate inner node.
if (isRenderView())
return &document();
- return isAnonymousBlockContinuation() ? continuation()->element() : element();
+ return continuation() ? continuation()->element() : element();
}
bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction)
@@ -3160,12 +3160,12 @@
{
// For blocks inside inlines, we include margins so that we run right up to the inline boxes
// above and below us (thus getting merged with them to form a single irregular shape).
- if (isAnonymousBlockContinuation()) {
+ if (auto* continuation = this->continuation()) {
// FIXME: This is wrong for block-flows that are horizontal.
// https://bugs.webkit.org/show_bug.cgi?id=46781
rects.append(snappedIntRect(accumulatedOffset.x(), accumulatedOffset.y() - collapsedMarginBefore(),
width(), height() + collapsedMarginBefore() + collapsedMarginAfter()));
- continuation()->absoluteRects(rects, accumulatedOffset - toLayoutSize(location() +
+ continuation->absoluteRects(rects, accumulatedOffset - toLayoutSize(location() +
inlineElementContinuation()->containingBlock()->location()));
} else
rects.append(snappedIntRect(accumulatedOffset, size()));
@@ -3175,7 +3175,8 @@
{
// For blocks inside inlines, we include margins so that we run right up to the inline boxes
// above and below us (thus getting merged with them to form a single irregular shape).
- FloatRect localRect = isAnonymousBlockContinuation()
+ auto* continuation = this->continuation();
+ FloatRect localRect = continuation
? FloatRect(0, -collapsedMarginBefore(), width(), height() + collapsedMarginBefore() + collapsedMarginAfter())
: FloatRect(0, 0, width(), height());
@@ -3185,14 +3186,14 @@
if (!fragmentedFlow || !fragmentedFlow->absoluteQuadsForBox(quads, wasFixed, this, localRect.y(), localRect.maxY()))
quads.append(localToAbsoluteQuad(localRect, UseTransforms, wasFixed));
- if (isAnonymousBlockContinuation())
- continuation()->absoluteQuads(quads, wasFixed);
+ if (continuation)
+ continuation->absoluteQuads(quads, wasFixed);
}
LayoutRect RenderBlock::rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const
{
LayoutRect r(RenderBox::rectWithOutlineForRepaint(repaintContainer, outlineWidth));
- if (isAnonymousBlockContinuation())
+ if (isContinuation())
r.inflateY(collapsedMarginBefore()); // FIXME: This is wrong for block-flows that are horizontal.
return r;
}
@@ -3199,7 +3200,9 @@
RenderElement* RenderBlock::hoverAncestor() const
{
- return isAnonymousBlockContinuation() ? continuation() : RenderBox::hoverAncestor();
+ if (auto* continuation = this->continuation())
+ return continuation;
+ return RenderBox::hoverAncestor();
}
void RenderBlock::updateDragState(bool dragOn)
@@ -3211,7 +3214,9 @@
const RenderStyle& RenderBlock::outlineStyleForRepaint() const
{
- return isAnonymousBlockContinuation() ? continuation()->style() : RenderElement::outlineStyleForRepaint();
+ if (auto* continuation = this->continuation())
+ return continuation->style();
+ return RenderElement::outlineStyleForRepaint();
}
void RenderBlock::childBecameNonInline(RenderElement&)
Modified: trunk/Source/WebCore/rendering/RenderBlock.h (224562 => 224563)
--- trunk/Source/WebCore/rendering/RenderBlock.h 2017-11-08 01:30:14 UTC (rev 224562)
+++ trunk/Source/WebCore/rendering/RenderBlock.h 2017-11-08 05:41:30 UTC (rev 224563)
@@ -189,7 +189,6 @@
void addContinuationWithOutline(RenderInline*);
bool paintsContinuationOutline(RenderInline*);
- bool isAnonymousBlockContinuation() const { return isAnonymousBlock() && continuation(); }
WEBCORE_EXPORT RenderInline* inlineElementContinuation() const;
static RenderPtr<RenderBlock> createAnonymousWithParentRendererAndDisplay(const RenderBox& parent, EDisplay = BLOCK);
Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (224562 => 224563)
--- trunk/Source/WebCore/rendering/RenderElement.cpp 2017-11-08 01:30:14 UTC (rev 224562)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp 2017-11-08 05:41:30 UTC (rev 224563)
@@ -818,7 +818,7 @@
// Preserve the position style of anonymous block continuations as they can have relative or sticky position when
// they contain block descendants of relative or sticky positioned inlines.
- if (elementChild.isInFlowPositioned() && downcast<RenderBlock>(elementChild).isAnonymousBlockContinuation())
+ if (elementChild.isInFlowPositioned() && elementChild.isContinuation())
newStyle.setPosition(elementChild.style().position());
updateAnonymousChildStyle(elementChild, newStyle);
Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (224562 => 224563)
--- trunk/Source/WebCore/rendering/RenderInline.cpp 2017-11-08 01:30:14 UTC (rev 224562)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp 2017-11-08 05:41:30 UTC (rev 224563)
@@ -155,7 +155,7 @@
continue;
RenderBlock& block = downcast<RenderBlock>(*box);
- if (!block.isAnonymousBlockContinuation())
+ if (!block.isContinuation())
continue;
// If we are no longer in-flow positioned but our descendant block(s) still have an in-flow positioned ancestor then