Skip to content

Commit

Permalink
First step to fix hacked isReplaced: Rename isReplaced functions to i…
Browse files Browse the repository at this point in the history
…sReplacedOrInlineBlock

https://bugs.webkit.org/show_bug.cgi?id=235258

Reviewed by Alan Bujtas.

The isReplaced function returns true for things that are not CSS replaced
elements. That's confusing and not good. We want to straighten this out.
In this first step, we rename the isReplaced and setReplaced functions
to isReplacedOrInlineBlock and setReplacedOrInlineBlock. There are still
functions with out arguments named "isReplaced", which we can deal with
later. Other later clean-up and clarification could one day change what
bits we store in RenderStyle and possibly even remove this function entirely.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::nextContinuation):
* accessibility/atk/WebKitAccessible.cpp:
(interfaceMaskFromObject):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::isNonReplacedInline):
* dom/Node.cpp:
(WebCore::Node::renderRect):
* dom/Position.cpp:
(WebCore::endsOfNodeAreVisuallyDistinctPositions):
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::leftVisuallyDistinctCandidate const):
(WebCore::VisiblePosition::rightVisuallyDistinctCandidate const):
* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForChild):
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::paint):
* page/TextIndicator.cpp:
(WebCore::hasNonInlineOrReplacedElements):
* page/ios/FrameIOS.mm:
(WebCore::Frame::renderRectForPoint const):
* rendering/CaretRectComputation.cpp:
(WebCore::computeCaretRectForBox):
* rendering/LegacyInlineBox.cpp:
(WebCore::LegacyInlineBox::adjustPosition):
(WebCore::LegacyInlineBox::canAccommodateEllipsis const):
* rendering/LegacyInlineFlowBox.cpp:
(WebCore::LegacyInlineFlowBox::addToLine):
(WebCore::LegacyInlineFlowBox::computeOverAnnotationAdjustment const):
(WebCore::LegacyInlineFlowBox::computeUnderAnnotationAdjustment const):
* rendering/LegacyInlineIterator.h:
(WebCore::isIteratorTarget):
* rendering/LegacyLineLayout.cpp:
(WebCore::LegacyLineLayout::computeInlineDirectionPositionsForLine):
(WebCore::LegacyLineLayout::layoutLineBoxes):
* rendering/LegacyRootInlineBox.cpp:
(WebCore::LegacyRootInlineBox::ascentAndDescentForBox const):
(WebCore::LegacyRootInlineBox::verticalPositionForBox):
(WebCore::LegacyRootInlineBox::includeLeadingForBox const):
(WebCore::LegacyRootInlineBox::includeFontForBox const):
(WebCore::LegacyRootInlineBox::includeGlyphsForBox const):
(WebCore::LegacyRootInlineBox::includeInitialLetterForBox const):
(WebCore::LegacyRootInlineBox::includeMarginForBox const):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::removePositionedObjectsIfNeeded):
(WebCore::RenderBlock::styleWillChange):
(WebCore::RenderBlock::simplifiedNormalFlowLayout):
(WebCore::RenderBlock::paintChild):
(WebCore::RenderBlock::positionForPoint):
(WebCore::RenderBlock::lineHeight const):
(WebCore::RenderBlock::baselinePosition const):
(WebCore::RenderBlock::firstLineBlock const):
(WebCore::findFirstLetterBlock):
(WebCore::RenderBlock::getFirstLetter):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
(WebCore::InlineMinMaxIterator::next):
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::offsetFromContainer const):
(WebCore::RenderBox::positionLineBox):
(WebCore::RenderBox::computeLogicalHeight const):
(WebCore::RenderBox::shouldTreatChildAsReplacedInTableCells const):
(WebCore::RenderBox::computePositionedLogicalWidth const):
(WebCore::RenderBox::computePositionedLogicalHeight const):
(WebCore::RenderBox::avoidsFloats const):
(WebCore::RenderBox::isUnsplittableForPagination const):
(WebCore::RenderBox::lineHeight const):
(WebCore::RenderBox::baselinePosition const):
* rendering/RenderBox.h:
(WebCore::RenderBox::shouldComputeSizeAsReplaced const):
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::canHaveBoxInfoInFragment const):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
(WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::getLeadingCorner const):
(WebCore::RenderElement::getTrailingCorner const):
(WebCore::RenderElement::absoluteAnchorRect const):
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::RenderFullScreen):
* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::RenderListMarker):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::containingBlockForPositionType):
(WebCore::RenderObject::caretMaxOffset const):
* rendering/RenderObject.h:
(WebCore::RenderObject::hasIntrinsicAspectRatio const):
(WebCore::RenderObject::isReplacedOrInlineBlock const):
(WebCore::RenderObject::setReplacedOrInlineBlock):
(WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
(WebCore::RenderObject::isAtomicInlineLevelBox const):
(WebCore::RenderObject::isReplaced const): Deleted.
(WebCore::RenderObject::setReplaced): Deleted.
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::RenderReplaced):
* rendering/RenderReplica.cpp:
(WebCore::RenderReplica::RenderReplica):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::RenderRubyRun):
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::initializeForCurrentObject):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
* rendering/line/LineBreaker.cpp:
(WebCore::LineBreaker::nextLineBreak):
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::nextContinuation):
Renamed in all these places. Also added one FIXME for something
Alan pointed out we'd like to do in the future.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::removeOnlyThisLayer): Removed unhelpful use
of RenderLayer::reflection function just to find out whether the
RenderLayer::reflectionLayer function will return null or not.
* rendering/RenderLayer.h: Removed unneeded RenderLayer::reflection.
* rendering/RenderLayerCompositor.cpp: Removed an unneeded include
of RenderReplica.h.


Canonical link: https://commits.webkit.org/246087@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
darinadler committed Jan 15, 2022
1 parent 93c5106 commit cb9ab6a
Show file tree
Hide file tree
Showing 39 changed files with 234 additions and 95 deletions.
139 changes: 139 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,142 @@
2022-01-15 Darin Adler <darin@apple.com>

First step to fix hacked isReplaced: Rename isReplaced functions to isReplacedOrInlineBlock
https://bugs.webkit.org/show_bug.cgi?id=235258

Reviewed by Alan Bujtas.

The isReplaced function returns true for things that are not CSS replaced
elements. That's confusing and not good. We want to straighten this out.
In this first step, we rename the isReplaced and setReplaced functions
to isReplacedOrInlineBlock and setReplacedOrInlineBlock. There are still
functions with out arguments named "isReplaced", which we can deal with
later. Other later clean-up and clarification could one day change what
bits we store in RenderStyle and possibly even remove this function entirely.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::nextContinuation):
* accessibility/atk/WebKitAccessible.cpp:
(interfaceMaskFromObject):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::isNonReplacedInline):
* dom/Node.cpp:
(WebCore::Node::renderRect):
* dom/Position.cpp:
(WebCore::endsOfNodeAreVisuallyDistinctPositions):
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::leftVisuallyDistinctCandidate const):
(WebCore::VisiblePosition::rightVisuallyDistinctCandidate const):
* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForChild):
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::paint):
* page/TextIndicator.cpp:
(WebCore::hasNonInlineOrReplacedElements):
* page/ios/FrameIOS.mm:
(WebCore::Frame::renderRectForPoint const):
* rendering/CaretRectComputation.cpp:
(WebCore::computeCaretRectForBox):
* rendering/LegacyInlineBox.cpp:
(WebCore::LegacyInlineBox::adjustPosition):
(WebCore::LegacyInlineBox::canAccommodateEllipsis const):
* rendering/LegacyInlineFlowBox.cpp:
(WebCore::LegacyInlineFlowBox::addToLine):
(WebCore::LegacyInlineFlowBox::computeOverAnnotationAdjustment const):
(WebCore::LegacyInlineFlowBox::computeUnderAnnotationAdjustment const):
* rendering/LegacyInlineIterator.h:
(WebCore::isIteratorTarget):
* rendering/LegacyLineLayout.cpp:
(WebCore::LegacyLineLayout::computeInlineDirectionPositionsForLine):
(WebCore::LegacyLineLayout::layoutLineBoxes):
* rendering/LegacyRootInlineBox.cpp:
(WebCore::LegacyRootInlineBox::ascentAndDescentForBox const):
(WebCore::LegacyRootInlineBox::verticalPositionForBox):
(WebCore::LegacyRootInlineBox::includeLeadingForBox const):
(WebCore::LegacyRootInlineBox::includeFontForBox const):
(WebCore::LegacyRootInlineBox::includeGlyphsForBox const):
(WebCore::LegacyRootInlineBox::includeInitialLetterForBox const):
(WebCore::LegacyRootInlineBox::includeMarginForBox const):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::removePositionedObjectsIfNeeded):
(WebCore::RenderBlock::styleWillChange):
(WebCore::RenderBlock::simplifiedNormalFlowLayout):
(WebCore::RenderBlock::paintChild):
(WebCore::RenderBlock::positionForPoint):
(WebCore::RenderBlock::lineHeight const):
(WebCore::RenderBlock::baselinePosition const):
(WebCore::RenderBlock::firstLineBlock const):
(WebCore::findFirstLetterBlock):
(WebCore::RenderBlock::getFirstLetter):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
(WebCore::InlineMinMaxIterator::next):
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::offsetFromContainer const):
(WebCore::RenderBox::positionLineBox):
(WebCore::RenderBox::computeLogicalHeight const):
(WebCore::RenderBox::shouldTreatChildAsReplacedInTableCells const):
(WebCore::RenderBox::computePositionedLogicalWidth const):
(WebCore::RenderBox::computePositionedLogicalHeight const):
(WebCore::RenderBox::avoidsFloats const):
(WebCore::RenderBox::isUnsplittableForPagination const):
(WebCore::RenderBox::lineHeight const):
(WebCore::RenderBox::baselinePosition const):
* rendering/RenderBox.h:
(WebCore::RenderBox::shouldComputeSizeAsReplaced const):
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::canHaveBoxInfoInFragment const):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
(WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::getLeadingCorner const):
(WebCore::RenderElement::getTrailingCorner const):
(WebCore::RenderElement::absoluteAnchorRect const):
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::RenderFullScreen):
* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::RenderListMarker):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::containingBlockForPositionType):
(WebCore::RenderObject::caretMaxOffset const):
* rendering/RenderObject.h:
(WebCore::RenderObject::hasIntrinsicAspectRatio const):
(WebCore::RenderObject::isReplacedOrInlineBlock const):
(WebCore::RenderObject::setReplacedOrInlineBlock):
(WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
(WebCore::RenderObject::isAtomicInlineLevelBox const):
(WebCore::RenderObject::isReplaced const): Deleted.
(WebCore::RenderObject::setReplaced): Deleted.
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::RenderReplaced):
* rendering/RenderReplica.cpp:
(WebCore::RenderReplica::RenderReplica):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::RenderRubyRun):
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::initializeForCurrentObject):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
* rendering/line/LineBreaker.cpp:
(WebCore::LineBreaker::nextLineBreak):
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::nextContinuation):
Renamed in all these places. Also added one FIXME for something
Alan pointed out we'd like to do in the future.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::removeOnlyThisLayer): Removed unhelpful use
of RenderLayer::reflection function just to find out whether the
RenderLayer::reflectionLayer function will return null or not.
* rendering/RenderLayer.h: Removed unneeded RenderLayer::reflection.
* rendering/RenderLayerCompositor.cpp: Removed an unneeded include
of RenderReplica.h.

2022-01-15 Alan Bujtas <zalan@apple.com>

web-platform-tests/html/rendering/dimension-attributes.html is failing when table width is set to 0px
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Expand Up @@ -436,7 +436,7 @@ AccessibilityObject* AccessibilityRenderObject::nextSibling() const

static RenderBoxModelObject* nextContinuation(RenderObject& renderer)
{
if (is<RenderInline>(renderer) && !renderer.isReplaced())
if (is<RenderInline>(renderer) && !renderer.isReplacedOrInlineBlock())
return downcast<RenderInline>(renderer).continuation();
if (is<RenderBlock>(renderer))
return downcast<RenderBlock>(renderer).inlineContinuation();
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/accessibility/atk/WebKitAccessible.cpp
Expand Up @@ -1209,7 +1209,7 @@ static guint16 interfaceMaskFromObject(AXCoreObject* coreObject)
renderer = coreObject->renderer();

// Hyperlink (links and embedded objects).
if (coreObject->isLink() || (renderer && renderer->isReplaced()))
if (coreObject->isLink() || (renderer && renderer->isReplacedOrInlineBlock()))
interfaceMask |= 1 << WAIHyperlink;

// Text, Editable Text & Hypertext
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Expand Up @@ -2307,7 +2307,7 @@ static CSSValueID convertToColumnBreak(BreakInside value)

static inline bool isNonReplacedInline(RenderObject& renderer)
{
return renderer.isInline() && !renderer.isReplaced();
return renderer.isInline() && !renderer.isReplacedOrInlineBlock();
}

static bool isLayoutDependent(CSSPropertyID propertyID, const RenderStyle* style, RenderObject* renderer)
Expand Down
5 changes: 3 additions & 2 deletions Source/WebCore/dom/Node.cpp
Expand Up @@ -821,8 +821,9 @@ LayoutRect Node::renderRect(bool* isReplaced)
}
RenderObject* renderer = hitRenderer;
while (renderer && !renderer->isBody() && !renderer->isDocumentElementRenderer()) {
if (renderer->isRenderBlock() || renderer->isInlineBlockOrInlineTable() || renderer->isReplaced()) {
*isReplaced = renderer->isReplaced();
if (renderer->isRenderBlock() || renderer->isInlineBlockOrInlineTable() || renderer->isReplacedOrInlineBlock()) {
// FIXME: Is this really what callers want for the "isReplaced" flag?
*isReplaced = renderer->isReplacedOrInlineBlock();
return renderer->absoluteBoundingBoxRect();
}
renderer = renderer->parent();
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/dom/Position.cpp
Expand Up @@ -639,7 +639,7 @@ static bool endsOfNodeAreVisuallyDistinctPositions(Node* node)
if (is<HTMLTableElement>(*node))
return false;

if (!node->renderer()->isReplaced() || !canHaveChildrenForEditing(*node) || !downcast<RenderBox>(*node->renderer()).height())
if (!node->renderer()->isReplacedOrInlineBlock() || !canHaveChildrenForEditing(*node) || !downcast<RenderBox>(*node->renderer()).height())
return false;

// There is a VisiblePosition inside an empty inline-block container.
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/editing/VisiblePosition.cpp
Expand Up @@ -132,7 +132,7 @@ Position VisiblePosition::leftVisuallyDistinctCandidate() const
auto* renderer = &run->renderer();

while (true) {
if ((renderer->isReplaced() || renderer->isBR()) && offset == run->rightmostCaretOffset())
if ((renderer->isReplacedOrInlineBlock() || renderer->isBR()) && offset == run->rightmostCaretOffset())
return run->isLeftToRightDirection() ? previousVisuallyDistinctCandidate(m_deepPosition) : nextVisuallyDistinctCandidate(m_deepPosition);

if (!renderer->node()) {
Expand Down Expand Up @@ -298,7 +298,7 @@ Position VisiblePosition::rightVisuallyDistinctCandidate() const
auto* renderer = &run->renderer();

while (true) {
if ((renderer->isReplaced() || renderer->isBR()) && offset == run->leftmostCaretOffset())
if ((renderer->isReplacedOrInlineBlock() || renderer->isBR()) && offset == run->leftmostCaretOffset())
return run->isLeftToRightDirection() ? nextVisuallyDistinctCandidate(m_deepPosition) : previousVisuallyDistinctCandidate(m_deepPosition);

if (!renderer->node()) {
Expand Down
Expand Up @@ -533,7 +533,7 @@ static OptionSet<AvoidanceReason> canUseForChild(const RenderBlockFlow& flow, co

if (is<RenderBlockFlow>(child)) {
auto& block = downcast<RenderBlockFlow>(child);
if (!block.isReplaced() || !block.isInline())
if (!block.isReplacedOrInlineBlock() || !block.isInline())
SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonSupportedChild, reasons, includeReasons)
if (block.isFloating() || block.isPositioned())
SET_REASON_AND_RETURN_IF_NEEDED(ChildBoxIsFloatingOrPositioned, reasons, includeReasons)
Expand Down
Expand Up @@ -634,7 +634,7 @@ void LineLayout::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
continue;
}

if (auto& renderer = m_boxTree.rendererForLayoutBox(box.layoutBox()); is<RenderBox>(renderer) && renderer.isReplaced()) {
if (auto& renderer = m_boxTree.rendererForLayoutBox(box.layoutBox()); is<RenderBox>(renderer) && renderer.isReplacedOrInlineBlock()) {
auto& renderBox = downcast<RenderBox>(renderer);
if (!renderBox.hasSelfPaintingLayer() && paintInfo.shouldPaintWithinRoot(renderBox))
renderBox.paintAsInlineBlock(paintInfo, paintOffset);
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/page/TextIndicator.cpp
Expand Up @@ -119,7 +119,7 @@ static bool hasNonInlineOrReplacedElements(const SimpleRange& range)
{
for (auto& node : intersectingNodes(range)) {
auto renderer = node.renderer();
if (renderer && (!renderer->isInline() || renderer->isReplaced()))
if (renderer && (!renderer->isInline() || renderer->isReplacedOrInlineBlock()))
return true;
}
return false;
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/page/ios/FrameIOS.mm
Expand Up @@ -204,8 +204,8 @@
printf("%s %f %f %f %f\n", nodeName, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
}
#endif
if (renderer->isRenderBlock() || renderer->isInlineBlockOrInlineTable() || renderer->isReplaced()) {
*isReplaced = renderer->isReplaced();
if (renderer->isRenderBlock() || renderer->isInlineBlockOrInlineTable() || renderer->isReplacedOrInlineBlock()) {
*isReplaced = renderer->isReplacedOrInlineBlock();
#if CHECK_FONT_SIZE
for (RenderObject* textRenderer = hitRenderer; textRenderer; textRenderer = textRenderer->traverseNext(hitRenderer)) {
if (textRenderer->isText()) {
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/CaretRectComputation.cpp
Expand Up @@ -242,7 +242,7 @@ static LayoutRect computeCaretRectForBox(const RenderBox& renderer, const Inline
//
// FIXME: ignoring :first-line, missing good reason to take care of
LayoutUnit fontHeight = renderer.style().fontMetrics().height();
if (fontHeight > rect.height() || (!renderer.isReplaced() && !renderer.isTable()))
if (fontHeight > rect.height() || (!renderer.isReplacedOrInlineBlock() && !renderer.isTable()))
rect.setHeight(fontHeight);

// Move to local coords
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/rendering/LegacyInlineBox.cpp
Expand Up @@ -183,7 +183,7 @@ void LegacyInlineBox::adjustPosition(float dx, float dy)
if (renderer().isOutOfFlowPositioned())
return;

if (renderer().isReplaced())
if (renderer().isReplacedOrInlineBlock())
downcast<RenderBox>(renderer()).move(LayoutUnit(dx), LayoutUnit(dy));
}

Expand Down Expand Up @@ -253,7 +253,7 @@ RenderObject::HighlightState LegacyInlineBox::selectionState() const
bool LegacyInlineBox::canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWidth) const
{
// Non-replaced elements can always accommodate an ellipsis.
if (!renderer().isReplaced())
if (!renderer().isReplacedOrInlineBlock())
return true;

IntRect boxRect(left(), 0, m_logicalWidth, 10);
Expand Down
8 changes: 4 additions & 4 deletions Source/WebCore/rendering/LegacyInlineFlowBox.cpp
Expand Up @@ -124,7 +124,7 @@ void LegacyInlineFlowBox::addToLine(LegacyInlineBox* child)
const RenderStyle& parentStyle = lineStyle();
const RenderStyle& childStyle = child->lineStyle();
bool shouldClearDescendantsHaveSameLineHeightAndBaseline = false;
if (child->renderer().isReplaced())
if (child->renderer().isReplacedOrInlineBlock())
shouldClearDescendantsHaveSameLineHeightAndBaseline = true;
else if (child->behavesLikeText()) {
if (child->renderer().isLineBreak() || child->renderer().parent() != &renderer()) {
Expand Down Expand Up @@ -169,7 +169,7 @@ void LegacyInlineFlowBox::addToLine(LegacyInlineBox* child)
}
if (childStyle->letterSpacing() < 0 || childStyle->textShadow() || childStyle->textEmphasisMark() != TextEmphasisMark::None || childStyle->hasPositiveStrokeWidth() || hasMarkers || !childStyle->textUnderlineOffset().isAuto() || !childStyle->textDecorationThickness().isAuto() || childStyle->textUnderlinePosition() != TextUnderlinePosition::Auto)
child->clearKnownToHaveNoOverflow();
} else if (child->renderer().isReplaced()) {
} else if (child->renderer().isReplacedOrInlineBlock()) {
const RenderBox& box = downcast<RenderBox>(child->renderer());
if (box.hasRenderOverflow() || box.hasSelfPaintingLayer())
child->clearKnownToHaveNoOverflow();
Expand Down Expand Up @@ -1209,7 +1209,7 @@ LayoutUnit LegacyInlineFlowBox::computeOverAnnotationAdjustment(LayoutUnit allow
if (is<LegacyInlineFlowBox>(*child))
result = std::max(result, downcast<LegacyInlineFlowBox>(*child).computeOverAnnotationAdjustment(allowedPosition));

if (child->renderer().isReplaced() && is<RenderRubyRun>(child->renderer()) && child->renderer().style().rubyPosition() == RubyPosition::Before) {
if (child->renderer().isReplacedOrInlineBlock() && is<RenderRubyRun>(child->renderer()) && child->renderer().style().rubyPosition() == RubyPosition::Before) {
auto& rubyRun = downcast<RenderRubyRun>(child->renderer());
RenderRubyText* rubyText = rubyRun.rubyText();
if (!rubyText)
Expand Down Expand Up @@ -1257,7 +1257,7 @@ LayoutUnit LegacyInlineFlowBox::computeUnderAnnotationAdjustment(LayoutUnit allo
if (is<LegacyInlineFlowBox>(*child))
result = std::max(result, downcast<LegacyInlineFlowBox>(*child).computeUnderAnnotationAdjustment(allowedPosition));

if (child->renderer().isReplaced() && is<RenderRubyRun>(child->renderer()) && child->renderer().style().rubyPosition() == RubyPosition::After) {
if (child->renderer().isReplacedOrInlineBlock() && is<RenderRubyRun>(child->renderer()) && child->renderer().style().rubyPosition() == RubyPosition::After) {
auto& rubyRun = downcast<RenderRubyRun>(child->renderer());
RenderRubyText* rubyText = rubyRun.rubyText();
if (!rubyText)
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/LegacyInlineIterator.h
Expand Up @@ -196,7 +196,7 @@ static inline void notifyObserverWillExitObject(Observer* observer, RenderObject
static inline bool isIteratorTarget(RenderObject* object)
{
ASSERT(object); // The iterator will of course return 0, but its not an expected argument to this function.
return object->isTextOrLineBreak() || object->isFloating() || object->isOutOfFlowPositioned() || object->isReplaced();
return object->isTextOrLineBreak() || object->isFloating() || object->isOutOfFlowPositioned() || object->isReplacedOrInlineBlock();
}

template <class Observer>
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/rendering/LegacyLineLayout.cpp
Expand Up @@ -707,7 +707,7 @@ void LegacyLineLayout::computeInlineDirectionPositionsForLine(LegacyRootInlineBo
updateLogicalInlinePositions(m_flow, lineLogicalLeft, lineLogicalRight, availableLogicalWidth, isFirstLine, shouldIndentText, 0);
bool needsWordSpacing;

if (firstRun && firstRun->renderer().isReplaced()) {
if (firstRun && firstRun->renderer().isReplacedOrInlineBlock()) {
RenderBox& renderBox = downcast<RenderBox>(firstRun->renderer());
updateLogicalInlinePositions(m_flow, lineLogicalLeft, lineLogicalRight, availableLogicalWidth, isFirstLine, shouldIndentText, renderBox.logicalHeight());
}
Expand Down Expand Up @@ -1741,7 +1741,7 @@ void LegacyLineLayout::layoutLineBoxes(bool relayoutChildren, LayoutUnit& repain
if (!hasInlineChild && o.isInline())
hasInlineChild = true;

if (o.isReplaced() || o.isFloating() || o.isOutOfFlowPositioned()) {
if (o.isReplacedOrInlineBlock() || o.isFloating() || o.isOutOfFlowPositioned()) {
RenderBox& box = downcast<RenderBox>(o);

if (relayoutChildren || box.hasRelativeDimensions())
Expand Down

0 comments on commit cb9ab6a

Please sign in to comment.