Diff
Modified: trunk/Source/WebCore/ChangeLog (288066 => 288067)
--- trunk/Source/WebCore/ChangeLog 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/ChangeLog 2022-01-15 22:29:21 UTC (rev 288067)
@@ -1,3 +1,142 @@
+2022-01-15 Darin Adler <[email protected]>
+
+ 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 <[email protected]>
web-platform-tests/html/rendering/dimension-attributes.html is failing when table width is set to 0px
Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (288066 => 288067)
--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -436,7 +436,7 @@
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();
Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessible.cpp (288066 => 288067)
--- trunk/Source/WebCore/accessibility/atk/WebKitAccessible.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessible.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -1209,7 +1209,7 @@
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
Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (288066 => 288067)
--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -2307,7 +2307,7 @@
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)
Modified: trunk/Source/WebCore/dom/Node.cpp (288066 => 288067)
--- trunk/Source/WebCore/dom/Node.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/dom/Node.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -821,8 +821,9 @@
}
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();
Modified: trunk/Source/WebCore/dom/Position.cpp (288066 => 288067)
--- trunk/Source/WebCore/dom/Position.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/dom/Position.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -639,7 +639,7 @@
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.
Modified: trunk/Source/WebCore/editing/VisiblePosition.cpp (288066 => 288067)
--- trunk/Source/WebCore/editing/VisiblePosition.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/editing/VisiblePosition.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -132,7 +132,7 @@
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()) {
@@ -298,7 +298,7 @@
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()) {
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp (288066 => 288067)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -533,7 +533,7 @@
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)
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (288066 => 288067)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -634,7 +634,7 @@
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);
Modified: trunk/Source/WebCore/page/TextIndicator.cpp (288066 => 288067)
--- trunk/Source/WebCore/page/TextIndicator.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/page/TextIndicator.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -119,7 +119,7 @@
{
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;
Modified: trunk/Source/WebCore/page/ios/FrameIOS.mm (288066 => 288067)
--- trunk/Source/WebCore/page/ios/FrameIOS.mm 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/page/ios/FrameIOS.mm 2022-01-15 22:29:21 UTC (rev 288067)
@@ -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()) {
Modified: trunk/Source/WebCore/rendering/CaretRectComputation.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/CaretRectComputation.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/CaretRectComputation.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -242,7 +242,7 @@
//
// 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
Modified: trunk/Source/WebCore/rendering/LegacyInlineBox.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/LegacyInlineBox.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/LegacyInlineBox.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -183,7 +183,7 @@
if (renderer().isOutOfFlowPositioned())
return;
- if (renderer().isReplaced())
+ if (renderer().isReplacedOrInlineBlock())
downcast<RenderBox>(renderer()).move(LayoutUnit(dx), LayoutUnit(dy));
}
@@ -253,7 +253,7 @@
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);
Modified: trunk/Source/WebCore/rendering/LegacyInlineFlowBox.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/LegacyInlineFlowBox.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/LegacyInlineFlowBox.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -124,7 +124,7 @@
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()) {
@@ -169,7 +169,7 @@
}
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();
@@ -1209,7 +1209,7 @@
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)
@@ -1257,7 +1257,7 @@
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)
Modified: trunk/Source/WebCore/rendering/LegacyInlineIterator.h (288066 => 288067)
--- trunk/Source/WebCore/rendering/LegacyInlineIterator.h 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/LegacyInlineIterator.h 2022-01-15 22:29:21 UTC (rev 288067)
@@ -196,7 +196,7 @@
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>
Modified: trunk/Source/WebCore/rendering/LegacyLineLayout.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/LegacyLineLayout.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/LegacyLineLayout.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -707,7 +707,7 @@
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());
}
@@ -1741,7 +1741,7 @@
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())
Modified: trunk/Source/WebCore/rendering/LegacyRootInlineBox.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/LegacyRootInlineBox.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/LegacyRootInlineBox.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -677,7 +677,7 @@
// Replaced boxes will return 0 for the line-height if line-box-contain says they are
// not to be included.
- if (box.renderer().isReplaced()) {
+ if (box.renderer().isReplacedOrInlineBlock()) {
if (lineStyle().lineBoxContain().contains(LineBoxContain::Replaced)) {
ascent = box.baselinePosition(baselineType());
descent = roundToInt(box.lineHeight()) - ascent;
@@ -837,7 +837,7 @@
else if (verticalAlign == VerticalAlign::TextBottom) {
verticalPosition += fontMetrics.descent(baselineType());
// lineHeight - baselinePosition is always 0 for replaced elements (except inline blocks), so don't bother wasting time in that case.
- if (!renderer->isReplaced() || renderer->isInlineBlockOrInlineTable())
+ if (!renderer->isReplacedOrInlineBlock() || renderer->isInlineBlockOrInlineTable())
verticalPosition -= (renderer->lineHeight(firstLine, lineDirection) - renderer->baselinePosition(baselineType(), firstLine, lineDirection));
} else if (verticalAlign == VerticalAlign::BaselineMiddle)
verticalPosition += -renderer->lineHeight(firstLine, lineDirection) / 2 + renderer->baselinePosition(baselineType(), firstLine, lineDirection);
@@ -861,7 +861,7 @@
bool LegacyRootInlineBox::includeLeadingForBox(LegacyInlineBox& box) const
{
- if (box.renderer().isReplaced() || (box.renderer().isTextOrLineBreak() && !box.behavesLikeText()))
+ if (box.renderer().isReplacedOrInlineBlock() || (box.renderer().isTextOrLineBreak() && !box.behavesLikeText()))
return false;
auto lineBoxContain = renderer().style().lineBoxContain();
@@ -870,7 +870,7 @@
bool LegacyRootInlineBox::includeFontForBox(LegacyInlineBox& box) const
{
- if (box.renderer().isReplaced() || (box.renderer().isTextOrLineBreak() && !box.behavesLikeText()))
+ if (box.renderer().isReplacedOrInlineBlock() || (box.renderer().isTextOrLineBreak() && !box.behavesLikeText()))
return false;
if (!box.behavesLikeText() && is<LegacyInlineFlowBox>(box) && !downcast<LegacyInlineFlowBox>(box).hasTextChildren())
@@ -881,7 +881,7 @@
bool LegacyRootInlineBox::includeGlyphsForBox(LegacyInlineBox& box) const
{
- if (box.renderer().isReplaced() || (box.renderer().isTextOrLineBreak() && !box.behavesLikeText()))
+ if (box.renderer().isReplacedOrInlineBlock() || (box.renderer().isTextOrLineBreak() && !box.behavesLikeText()))
return false;
if (!box.behavesLikeText() && is<LegacyInlineFlowBox>(box) && !downcast<LegacyInlineFlowBox>(box).hasTextChildren())
@@ -892,7 +892,7 @@
bool LegacyRootInlineBox::includeInitialLetterForBox(LegacyInlineBox& box) const
{
- if (box.renderer().isReplaced() || (box.renderer().isTextOrLineBreak() && !box.behavesLikeText()))
+ if (box.renderer().isReplacedOrInlineBlock() || (box.renderer().isTextOrLineBreak() && !box.behavesLikeText()))
return false;
if (!box.behavesLikeText() && is<LegacyInlineFlowBox>(box) && !downcast<LegacyInlineFlowBox>(box).hasTextChildren())
@@ -903,7 +903,7 @@
bool LegacyRootInlineBox::includeMarginForBox(LegacyInlineBox& box) const
{
- if (box.renderer().isReplaced() || (box.renderer().isTextOrLineBreak() && !box.behavesLikeText()))
+ if (box.renderer().isReplacedOrInlineBlock() || (box.renderer().isTextOrLineBreak() && !box.behavesLikeText()))
return false;
return renderer().style().lineBoxContain().contains(LineBoxContain::InlineBox);
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -393,8 +393,8 @@
// They will be inserted into our positioned objects list during layout.
auto* containingBlock = parent();
while (containingBlock && !is<RenderView>(*containingBlock)
- && (containingBlock->style().position() == PositionType::Static || (containingBlock->isInline() && !containingBlock->isReplaced()))) {
- if (containingBlock->style().position() == PositionType::Relative && containingBlock->isInline() && !containingBlock->isReplaced()) {
+ && (containingBlock->style().position() == PositionType::Static || (containingBlock->isInline() && !containingBlock->isReplacedOrInlineBlock()))) {
+ if (containingBlock->style().position() == PositionType::Relative && containingBlock->isInline() && !containingBlock->isReplacedOrInlineBlock()) {
containingBlock = containingBlock->containingBlock();
break;
}
@@ -408,7 +408,8 @@
void RenderBlock::styleWillChange(StyleDifference diff, const RenderStyle& newStyle)
{
const RenderStyle* oldStyle = hasInitializedStyle() ? &style() : nullptr;
- setReplaced(newStyle.isDisplayInlineType());
+ // FIXME: Should change the _expression_ below to newStyle.display() == DisplayType::InlineBlock.
+ setReplacedOrInlineBlock(newStyle.isDisplayInlineType());
if (oldStyle)
removePositionedObjectsIfNeeded(*oldStyle, newStyle);
RenderBox::styleWillChange(diff, newStyle);
@@ -876,7 +877,7 @@
ListHashSet<LegacyRootInlineBox*> lineBoxes;
for (InlineWalker walker(downcast<RenderBlockFlow>(*this)); !walker.atEnd(); walker.advance()) {
RenderObject& renderer = *walker.current();
- if (!renderer.isOutOfFlowPositioned() && (renderer.isReplaced() || renderer.isFloating())) {
+ if (!renderer.isOutOfFlowPositioned() && (renderer.isReplacedOrInlineBlock() || renderer.isFloating())) {
RenderBox& box = downcast<RenderBox>(renderer);
box.layoutIfNeeded();
if (box.inlineBoxWrapper())
@@ -1180,7 +1181,7 @@
return false;
}
- if (!child.isFloating() && child.isReplaced() && usePrintRect && child.height() <= view().printRect().height()) {
+ if (!child.isFloating() && child.isReplacedOrInlineBlock() && usePrintRect && child.height() <= view().printRect().height()) {
// Paginate block-level replaced elements.
if (absoluteChildY + child.height() > view().printRect().maxY()) {
if (absoluteChildY < view().truncatedAt())
@@ -2176,7 +2177,7 @@
if (isTable())
return RenderBox::positionForPoint(point, fragment);
- if (isReplaced()) {
+ if (isReplacedOrInlineBlock()) {
// FIXME: This seems wrong when the object's writing-mode doesn't match the line's writing-mode.
LayoutUnit pointLogicalLeft = isHorizontalWritingMode() ? point.x() : point.y();
LayoutUnit pointLogicalTop = isHorizontalWritingMode() ? point.y() : point.x();
@@ -2429,7 +2430,7 @@
// the base class. If we're being queried as though we're the root line
// box, then the fact that we're an inline-block is irrelevant, and we behave
// just like a block.
- if (isReplaced() && linePositionMode == PositionOnContainingLine)
+ if (isReplacedOrInlineBlock() && linePositionMode == PositionOnContainingLine)
return RenderBox::lineHeight(firstLine, direction, linePositionMode);
if (firstLine && view().usesFirstLineRules()) {
@@ -2447,7 +2448,7 @@
// the base class. If we're being queried as though we're the root line
// box, then the fact that we're an inline-block is irrelevant, and we behave
// just like a block.
- if (isReplaced() && linePositionMode == PositionOnContainingLine) {
+ if (isReplacedOrInlineBlock() && linePositionMode == PositionOnContainingLine) {
// For "leaf" theme objects, let the theme decide what the baseline position is.
// FIXME: Might be better to have a custom CSS property instead, so that if the theme
// is turned off, checkboxes/radios will still have decent baselines.
@@ -2576,7 +2577,7 @@
if (hasPseudo)
break;
RenderElement* parentBlock = firstLineBlock->parent();
- if (firstLineBlock->isReplaced() || firstLineBlock->isFloating()
+ if (firstLineBlock->isReplacedOrInlineBlock() || firstLineBlock->isFloating()
|| !parentBlock || parentBlock->firstChild() != firstLineBlock || !isRenderBlockFlowOrRenderButton(*parentBlock))
break;
firstLineBlock = downcast<RenderBlock>(parentBlock);
@@ -2599,7 +2600,7 @@
return firstLetterBlock;
RenderElement* parentBlock = firstLetterBlock->parent();
- if (firstLetterBlock->isReplaced() || !parentBlock || parentBlock->firstChild() != firstLetterBlock
+ if (firstLetterBlock->isReplacedOrInlineBlock() || !parentBlock || parentBlock->firstChild() != firstLetterBlock
|| !isRenderBlockFlowOrRenderButton(*parentBlock))
return nullptr;
firstLetterBlock = downcast<RenderBlock>(parentBlock);
@@ -2647,7 +2648,7 @@
break;
}
firstLetter = current.nextSibling();
- } else if (current.isReplaced() || is<RenderButton>(current) || is<RenderMenuList>(current))
+ } else if (current.isReplacedOrInlineBlock() || is<RenderButton>(current) || is<RenderMenuList>(current))
break;
else if (current.isFlexibleBoxIncludingDeprecated() || current.isRenderGrid())
firstLetter = current.nextSibling();
Modified: trunk/Source/WebCore/rendering/RenderBlock.h (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderBlock.h 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderBlock.h 2022-01-15 22:29:21 UTC (rev 288067)
@@ -394,7 +394,7 @@
void adjustBorderBoxRectForPainting(LayoutRect&) override;
LayoutRect paintRectToClipOutFromBorder(const LayoutRect&) override;
- bool isInlineBlockOrInlineTable() const final { return isInline() && isReplaced(); }
+ bool isInlineBlockOrInlineTable() const final { return isInline() && isReplacedOrInlineBlock(); }
void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const override;
void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override;
Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -206,7 +206,7 @@
}
}
- // Inline blocks are covered by the isReplaced() check in the avoidFloats method.
+ // Inline blocks are covered by the isReplacedOrInlineBlock() check in the avoidFloats method.
if (avoidsFloats() || isDocumentElementRenderer() || isRenderView() || isFloatingOrOutOfFlowPositioned() || isTableCell()) {
if (m_floatingObjects)
m_floatingObjects->clear();
@@ -3425,7 +3425,7 @@
LayoutPoint point(pointInLogicalContents.x(), closestRun->line()->blockDirectionPointInLine());
if (!isHorizontalWritingMode())
point = point.transposedPoint();
- if (closestRun->renderer().isReplaced())
+ if (closestRun->renderer().isReplacedOrInlineBlock())
return positionForPointRespectingEditingBoundaries(*this, const_cast<RenderBox&>(downcast<RenderBox>(closestRun->renderer())), point);
return const_cast<RenderObject&>(closestRun->renderer()).positionForPoint(point, nullptr);
}
@@ -3997,7 +3997,7 @@
bool oldEndOfInline = endOfInline;
endOfInline = false;
do {
- if (!oldEndOfInline && (current && !current->isFloating() && !current->isReplaced() && !current->isOutOfFlowPositioned()))
+ if (!oldEndOfInline && (current && !current->isFloating() && !current->isReplacedOrInlineBlock() && !current->isOutOfFlowPositioned()))
result = current->firstChildSlow();
else if (initial) {
result = parent.firstChild();
@@ -4028,7 +4028,7 @@
if (!result)
break;
- if (!result->isOutOfFlowPositioned() && (result->isTextOrLineBreak() || result->isFloating() || result->isReplaced() || result->isRenderInline()))
+ if (!result->isOutOfFlowPositioned() && (result->isTextOrLineBreak() || result->isFloating() || result->isReplacedOrInlineBlock() || result->isRenderInline()))
break;
current = result;
@@ -4126,7 +4126,7 @@
bool addedStartPunctuationHang = false;
while (RenderObject* child = childIterator.next()) {
- bool autoWrap = child->isReplaced() ? child->parent()->style().autoWrap() :
+ bool autoWrap = child->isReplacedOrInlineBlock() ? child->parent()->style().autoWrap() :
child->style().autoWrap();
if (!child->isBR()) {
// Step One: determine whether or not we need to terminate our current line.
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -2400,7 +2400,7 @@
if (isInFlowPositioned())
offset += offsetForInFlowPosition();
- if (!isInline() || isReplaced())
+ if (!isInline() || isReplacedOrInlineBlock())
offset += topLeftLocationOffset();
if (is<RenderBox>(container))
@@ -2457,7 +2457,7 @@
return;
}
- if (isReplaced()) {
+ if (isReplacedOrInlineBlock()) {
setLocation(LayoutPoint(box.topLeft()));
setInlineBoxWrapper(&box);
}
@@ -3085,7 +3085,7 @@
computedValues.m_position = logicalTop;
// Cell height is managed by the table and inline non-replaced elements do not support a height property.
- if (isTableCell() || (isInline() && !isReplaced()))
+ if (isTableCell() || (isInline() && !isReplacedOrInlineBlock()))
return computedValues;
Length h;
@@ -3284,7 +3284,7 @@
bool RenderBox::shouldTreatChildAsReplacedInTableCells() const
{
- if (isReplaced())
+ if (isReplacedOrInlineBlock())
return true;
return element() && (element()->isFormControlElement() || is<HTMLImageElement>(element()));
}
@@ -3849,7 +3849,7 @@
void RenderBox::computePositionedLogicalWidth(LogicalExtentComputedValues& computedValues, RenderFragmentContainer* fragment) const
{
- if (isReplaced()) {
+ if (isReplacedOrInlineBlock()) {
// FIXME: Positioned replaced elements inside a flow thread are not working properly
// with variable width fragments (see https://bugs.webkit.org/show_bug.cgi?id=69896 ).
computePositionedLogicalWidthReplaced(computedValues);
@@ -4239,7 +4239,7 @@
void RenderBox::computePositionedLogicalHeight(LogicalExtentComputedValues& computedValues) const
{
- if (isReplaced()) {
+ if (isReplacedOrInlineBlock()) {
computePositionedLogicalHeightReplaced(computedValues);
return;
}
@@ -4923,7 +4923,7 @@
bool RenderBox::avoidsFloats() const
{
- return isReplaced() || isHR() || isLegend() || isFieldset() || createsNewFormattingContext();
+ return isReplacedOrInlineBlock() || isHR() || isLegend() || isFieldset() || createsNewFormattingContext();
}
void RenderBox::addVisualEffectOverflow()
@@ -5096,7 +5096,7 @@
bool RenderBox::isUnsplittableForPagination() const
{
- return isReplaced()
+ return isReplacedOrInlineBlock()
|| hasUnsplittableScrollingOverflow()
|| (parent() && isWritingModeRoot())
|| (isFloating() && style().styleType() == PseudoId::FirstLetter && style().initialLetterDrop() > 0)
@@ -5105,7 +5105,7 @@
LayoutUnit RenderBox::lineHeight(bool /*firstLine*/, LineDirectionMode direction, LinePositionMode /*linePositionMode*/) const
{
- if (isReplaced())
+ if (isReplacedOrInlineBlock())
return direction == HorizontalLine ? m_marginBox.top() + height() + m_marginBox.bottom() : m_marginBox.right() + width() + m_marginBox.left();
return 0;
}
@@ -5112,7 +5112,7 @@
LayoutUnit RenderBox::baselinePosition(FontBaseline baselineType, bool /*firstLine*/, LineDirectionMode direction, LinePositionMode /*linePositionMode*/) const
{
- if (isReplaced()) {
+ if (isReplacedOrInlineBlock()) {
auto result = roundToInt(direction == HorizontalLine ? m_marginBox.top() + height() + m_marginBox.bottom() : m_marginBox.right() + width() + m_marginBox.left());
if (baselineType == AlphabeticBaseline)
return result;
Modified: trunk/Source/WebCore/rendering/RenderBox.h (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderBox.h 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderBox.h 2022-01-15 22:29:21 UTC (rev 288067)
@@ -710,7 +710,7 @@
LayoutUnit computeIntrinsicLogicalWidthUsing(Length logicalWidthLength, LayoutUnit availableLogicalWidth, LayoutUnit borderAndPadding) const;
virtual std::optional<LayoutUnit> computeIntrinsicLogicalContentHeightUsing(Length logicalHeightLength, std::optional<LayoutUnit> intrinsicContentHeight, LayoutUnit borderAndPadding) const;
- virtual bool shouldComputeSizeAsReplaced() const { return isReplaced() && !isInlineBlockOrInlineTable(); }
+ virtual bool shouldComputeSizeAsReplaced() const { return isReplacedOrInlineBlock() && !isInlineBlockOrInlineTable(); }
void mapLocalToContainer(const RenderLayerModelObject* ancestorContainer, TransformState&, OptionSet<MapCoordinatesMode>, bool* wasFixed) const override;
const RenderObject* pushMappingToContainer(const RenderLayerModelObject*, RenderGeometryMap&) const override;
Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.h (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderBoxModelObject.h 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.h 2022-01-15 22:29:21 UTC (rev 288067)
@@ -225,7 +225,7 @@
void setSelectionState(HighlightState) override;
- bool canHaveBoxInfoInFragment() const { return !isFloating() && !isReplaced() && !isInline() && !isTableCell() && isRenderBlock() && !isRenderSVGBlock(); }
+ bool canHaveBoxInfoInFragment() const { return !isFloating() && !isReplacedOrInlineBlock() && !isInline() && !isTableCell() && isRenderBlock() && !isRenderSVGBlock(); }
void getGeometryForBackgroundImage(const RenderLayerModelObject* paintContainer, const LayoutPoint& paintOffset, FloatRect& destRect, FloatSize& phase, FloatSize& tileSize) const;
void contentChanged(ContentChangeType);
Modified: trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -1003,7 +1003,7 @@
continue;
child->clearOverridingContentSize();
- if (relayoutChildren || (child->isReplaced() && (child->style().width().isPercentOrCalculated() || child->style().height().isPercentOrCalculated()))
+ if (relayoutChildren || (child->isReplacedOrInlineBlock() && (child->style().width().isPercentOrCalculated() || child->style().height().isPercentOrCalculated()))
|| (child->style().height().isAuto() && is<RenderBlockFlow>(*child))) {
child->setChildNeedsLayout(MarkOnlyThis);
@@ -1104,7 +1104,7 @@
continue;
child->clearOverridingContentSize();
- if ((child->isReplaced() && (child->style().width().isPercentOrCalculated() || child->style().height().isPercentOrCalculated()))
+ if ((child->isReplacedOrInlineBlock() && (child->style().width().isPercentOrCalculated() || child->style().height().isPercentOrCalculated()))
|| (child->style().height().isAuto() && is<RenderBlockFlow>(*child))) {
child->setChildNeedsLayout();
Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderElement.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -1588,7 +1588,7 @@
bool RenderElement::getLeadingCorner(FloatPoint& point, bool& insideFixed) const
{
- if (!isInline() || isReplaced()) {
+ if (!isInline() || isReplacedOrInlineBlock()) {
point = localToAbsolute(FloatPoint(), UseTransforms, &insideFixed);
return true;
}
@@ -1614,7 +1614,7 @@
}
ASSERT(o);
- if (!o->isInline() || o->isReplaced()) {
+ if (!o->isInline() || o->isReplacedOrInlineBlock()) {
point = o->localToAbsolute(FloatPoint(), UseTransforms, &insideFixed);
return true;
}
@@ -1621,7 +1621,7 @@
if (p->node() && p->node() == element() && is<RenderText>(*o) && !InlineIterator::firstTextBoxFor(downcast<RenderText>(*o))) {
// do nothing - skip unrendered whitespace that is a child or next sibling of the anchor
- } else if (is<RenderText>(*o) || o->isReplaced()) {
+ } else if (is<RenderText>(*o) || o->isReplacedOrInlineBlock()) {
point = FloatPoint();
if (is<RenderText>(*o)) {
auto& textRenderer = downcast<RenderText>(*o);
@@ -1645,7 +1645,7 @@
bool RenderElement::getTrailingCorner(FloatPoint& point, bool& insideFixed) const
{
- if (!isInline() || isReplaced()) {
+ if (!isInline() || isReplacedOrInlineBlock()) {
point = localToAbsolute(LayoutPoint(downcast<RenderBox>(*this).size()), UseTransforms, &insideFixed);
return true;
}
@@ -1668,7 +1668,7 @@
o = prev;
}
ASSERT(o);
- if (is<RenderText>(*o) || o->isReplaced()) {
+ if (is<RenderText>(*o) || o->isReplacedOrInlineBlock()) {
point = FloatPoint();
if (is<RenderText>(*o)) {
LayoutRect linesBox = downcast<RenderText>(*o).linesBoundingBox();
@@ -1696,7 +1696,7 @@
FloatPoint lowerRight = trailing;
// Vertical writing modes might mean the leading point is not in the top left
- if (!isInline() || isReplaced()) {
+ if (!isInline() || isReplacedOrInlineBlock()) {
upperLeft = FloatPoint(std::min(leading.x(), trailing.x()), std::min(leading.y(), trailing.y()));
lowerRight = FloatPoint(std::max(leading.x(), trailing.x()), std::max(leading.y(), trailing.y()));
} // Otherwise, it's not obvious what to do.
Modified: trunk/Source/WebCore/rendering/RenderFullScreen.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderFullScreen.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderFullScreen.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -54,7 +54,7 @@
RenderFullScreen::RenderFullScreen(Document& document, RenderStyle&& style)
: RenderFlexibleBox(document, WTFMove(style))
{
- setReplaced(false);
+ setReplacedOrInlineBlock(false);
}
RenderFullScreen::~RenderFullScreen()
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -523,8 +523,8 @@
// Remove the child reflection layer before moving other child layers.
// The reflection layer should not be moved to the parent.
- if (reflection())
- removeChild(*reflectionLayer());
+ if (auto* reflectionLayer = this->reflectionLayer())
+ removeChild(*reflectionLayer);
// Now walk our kids and reattach them to our parent.
RenderLayer* current = m_first;
Modified: trunk/Source/WebCore/rendering/RenderLayer.h (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderLayer.h 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderLayer.h 2022-01-15 22:29:21 UTC (rev 288067)
@@ -439,7 +439,6 @@
bool hasReflection() const { return renderer().hasReflection(); }
bool isReflection() const { return renderer().isReplica(); }
- RenderReplica* reflection() const { return m_reflection.get(); }
RenderLayer* reflectionLayer() const;
bool isReflectionLayer(const RenderLayer&) const;
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -56,7 +56,6 @@
#include "RenderImage.h"
#include "RenderLayerBacking.h"
#include "RenderLayerScrollableArea.h"
-#include "RenderReplica.h"
#include "RenderVideo.h"
#include "RenderView.h"
#include "RuntimeEnabledFeatures.h"
Modified: trunk/Source/WebCore/rendering/RenderLineBoxList.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderLineBoxList.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderLineBoxList.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -332,7 +332,7 @@
if (current->isFloatingOrOutOfFlowPositioned())
continue;
- if (current->isReplaced()) {
+ if (current->isReplacedOrInlineBlock()) {
if (auto wrapper = downcast<RenderBox>(*current).inlineBoxWrapper())
box = &wrapper->root();
} if (is<RenderLineBreak>(*current)) {
Modified: trunk/Source/WebCore/rendering/RenderListMarker.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderListMarker.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderListMarker.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -1467,9 +1467,8 @@
: RenderBox(listItem.document(), WTFMove(style), 0)
, m_listItem(listItem)
{
- // init RenderObject attributes
- setInline(true); // our object is Inline
- setReplaced(true); // pretend to be replaced
+ setInline(true);
+ setReplacedOrInlineBlock(true); // pretend to be replaced
}
RenderListMarker::~RenderListMarker()
Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderObject.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -668,7 +668,7 @@
if (positionType == PositionType::Static || positionType == PositionType::Relative || positionType == PositionType::Sticky) {
auto containingBlockForObjectInFlow = [&] {
auto* ancestor = renderer.parent();
- while (ancestor && ((ancestor->isInline() && !ancestor->isReplaced()) || !ancestor->isRenderBlock()))
+ while (ancestor && ((ancestor->isInline() && !ancestor->isReplacedOrInlineBlock()) || !ancestor->isRenderBlock()))
ancestor = ancestor->parent();
return downcast<RenderBlock>(ancestor);
};
@@ -1707,7 +1707,7 @@
int RenderObject::caretMaxOffset() const
{
- if (isReplaced())
+ if (isReplacedOrInlineBlock())
return node() ? std::max(1U, node()->countChildNodes()) : 1;
if (isHR())
return 1;
Modified: trunk/Source/WebCore/rendering/RenderObject.h (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderObject.h 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderObject.h 2022-01-15 22:29:21 UTC (rev 288067)
@@ -387,7 +387,7 @@
// rest of the rendering tree will move to a similar model.
virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
- bool hasIntrinsicAspectRatio() const { return isReplaced() && (isImage() || isVideo() || isCanvas()); }
+ bool hasIntrinsicAspectRatio() const { return isReplacedOrInlineBlock() && (isImage() || isVideo() || isCanvas()); }
bool isAnonymous() const { return m_bitfields.isAnonymous(); }
bool isAnonymousBlock() const;
@@ -410,7 +410,7 @@
bool isTableRow() const { return m_bitfields.isTableRow(); }
bool isRenderView() const { return m_bitfields.isBox() && m_bitfields.isTextOrRenderView(); }
bool isInline() const { return m_bitfields.isInline(); } // inline object
- bool isReplaced() const { return m_bitfields.isReplaced(); } // a "replaced" element (see CSS)
+ bool isReplacedOrInlineBlock() const { return m_bitfields.isReplacedOrInlineBlock(); }
bool isHorizontalWritingMode() const { return m_bitfields.horizontalWritingMode(); }
bool hasReflection() const { return m_bitfields.hasRareData() && rareData().hasReflection(); }
@@ -506,7 +506,7 @@
void setIsBox() { m_bitfields.setIsBox(true); }
void setIsTableRow() { m_bitfields.setIsTableRow(true); }
void setIsRenderView() { ASSERT(isBox()); m_bitfields.setIsTextOrRenderView(true); }
- void setReplaced(bool b = true) { m_bitfields.setIsReplaced(b); }
+ void setReplacedOrInlineBlock(bool b = true) { m_bitfields.setIsReplacedOrInlineBlock(b); }
void setHorizontalWritingMode(bool b = true) { m_bitfields.setHorizontalWritingMode(b); }
void setHasNonVisibleOverflow(bool b = true) { m_bitfields.setHasNonVisibleOverflow(b); }
void setHasLayer(bool b = true) { m_bitfields.setHasLayer(b); }
@@ -858,7 +858,7 @@
, m_isBox(false)
, m_isTableRow(false)
, m_isInline(true)
- , m_isReplaced(false)
+ , m_isReplacedOrInlineBlock(false)
, m_isLineBreak(false)
, m_horizontalWritingMode(true)
, m_hasLayer(false)
@@ -890,7 +890,7 @@
ADD_BOOLEAN_BITFIELD(isBox, IsBox);
ADD_BOOLEAN_BITFIELD(isTableRow, IsTableRow);
ADD_BOOLEAN_BITFIELD(isInline, IsInline);
- ADD_BOOLEAN_BITFIELD(isReplaced, IsReplaced);
+ ADD_BOOLEAN_BITFIELD(isReplacedOrInlineBlock, IsReplacedOrInlineBlock);
ADD_BOOLEAN_BITFIELD(isLineBreak, IsLineBreak);
ADD_BOOLEAN_BITFIELD(horizontalWritingMode, HorizontalWritingMode);
@@ -1200,7 +1200,7 @@
inline bool RenderObject::isAtomicInlineLevelBox() const
{
- return style().isDisplayInlineType() && !(style().display() == DisplayType::Inline && !isReplaced());
+ return style().isDisplayInlineType() && !(style().display() == DisplayType::Inline && !isReplacedOrInlineBlock());
}
inline bool RenderObject::hasPotentiallyScrollableOverflow() const
Modified: trunk/Source/WebCore/rendering/RenderReplaced.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderReplaced.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderReplaced.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -61,7 +61,7 @@
: RenderBox(element, WTFMove(style), RenderReplacedFlag)
, m_intrinsicSize(cDefaultWidth, cDefaultHeight)
{
- setReplaced(true);
+ setReplacedOrInlineBlock(true);
}
RenderReplaced::RenderReplaced(Element& element, RenderStyle&& style, const LayoutSize& intrinsicSize)
@@ -68,7 +68,7 @@
: RenderBox(element, WTFMove(style), RenderReplacedFlag)
, m_intrinsicSize(intrinsicSize)
{
- setReplaced(true);
+ setReplacedOrInlineBlock(true);
}
RenderReplaced::RenderReplaced(Document& document, RenderStyle&& style, const LayoutSize& intrinsicSize)
@@ -75,7 +75,7 @@
: RenderBox(document, WTFMove(style), RenderReplacedFlag)
, m_intrinsicSize(intrinsicSize)
{
- setReplaced(true);
+ setReplacedOrInlineBlock(true);
}
RenderReplaced::~RenderReplaced() = default;
Modified: trunk/Source/WebCore/rendering/RenderReplica.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderReplica.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderReplica.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -44,7 +44,8 @@
// renderers being replicated, so they always report that they are inline, non-replaced.
// However, we need transforms to be applied to replicas for reflections, so have to pass
// the if (!isInline() || isReplaced()) check before setHasTransform().
- setReplaced(true);
+ // FIXME: Is the comment above obsolete? Can't find a check of isReplacedOrInlineBlock guarding setHasTransform any more.
+ setReplacedOrInlineBlock(true);
}
RenderReplica::~RenderReplica() = default;
Modified: trunk/Source/WebCore/rendering/RenderRubyRun.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/RenderRubyRun.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/RenderRubyRun.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -50,7 +50,7 @@
, m_lastCharacter(0)
, m_secondToLastCharacter(0)
{
- setReplaced(true);
+ setReplacedOrInlineBlock(true);
setInline(true);
}
Modified: trunk/Source/WebCore/rendering/line/BreakingContext.h (288066 => 288067)
--- trunk/Source/WebCore/rendering/line/BreakingContext.h 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/line/BreakingContext.h 2022-01-15 22:29:21 UTC (rev 288067)
@@ -218,8 +218,8 @@
if (m_nextObject && m_nextObject->parent() && !m_nextObject->parent()->isDescendantOf(renderer.parent()))
m_includeEndWidth = true;
- m_currWS = renderer.isReplaced() ? renderer.parent()->style().whiteSpace() : renderer.style().whiteSpace();
- m_lastWS = m_lastObject->isReplaced() ? m_lastObject->parent()->style().whiteSpace() : m_lastObject->style().whiteSpace();
+ m_currWS = renderer.isReplacedOrInlineBlock() ? renderer.parent()->style().whiteSpace() : renderer.style().whiteSpace();
+ m_lastWS = m_lastObject->isReplacedOrInlineBlock() ? m_lastObject->parent()->style().whiteSpace() : m_lastObject->style().whiteSpace();
m_autoWrap = RenderStyle::autoWrap(m_currWS);
m_autoWrapWasEverTrueOnLine = m_autoWrapWasEverTrueOnLine || m_autoWrap;
@@ -1086,7 +1086,7 @@
return false;
// Avoid breaking before empty inlines (as long as the current object isn't replaced).
- if (!m_current.renderer()->isReplaced() && is<RenderInline>(m_nextObject) && isEmptyInline(downcast<RenderInline>(*m_nextObject)))
+ if (!m_current.renderer()->isReplacedOrInlineBlock() && is<RenderInline>(m_nextObject) && isEmptyInline(downcast<RenderInline>(*m_nextObject)))
return false;
// Return early if we autowrap and the current character is a space as we will always want to break at such a position.
@@ -1150,7 +1150,7 @@
if (!m_current.renderer()->isFloatingOrOutOfFlowPositioned()) {
m_lastObject = m_current.renderer();
- if (m_lastObject->isReplaced() && m_autoWrap && !m_lastObject->isRubyRun() && (!m_lastObject->isImage() || m_allowImagesToBreak) && (!is<RenderListMarker>(*m_lastObject) || downcast<RenderListMarker>(*m_lastObject).isInside())) {
+ if (m_lastObject->isReplacedOrInlineBlock() && m_autoWrap && !m_lastObject->isRubyRun() && (!m_lastObject->isImage() || m_allowImagesToBreak) && (!is<RenderListMarker>(*m_lastObject) || downcast<RenderListMarker>(*m_lastObject).isInside())) {
if (m_nextObject)
commitLineBreakAtCurrentWidth(*m_nextObject);
else
Modified: trunk/Source/WebCore/rendering/line/LineBreaker.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/line/LineBreaker.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/line/LineBreaker.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -104,7 +104,7 @@
context.handleFloat();
} else if (context.currentObject()->isRenderInline()) {
context.handleEmptyInline();
- } else if (context.currentObject()->isReplaced()) {
+ } else if (context.currentObject()->isReplacedOrInlineBlock()) {
context.handleReplaced();
} else if (context.currentObject()->isText()) {
if (context.handleText(wordMeasurements, m_hyphenated, consecutiveHyphenatedLines)) {
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilderInline.cpp (288066 => 288067)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilderInline.cpp 2022-01-15 21:35:01 UTC (rev 288066)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilderInline.cpp 2022-01-15 22:29:21 UTC (rev 288067)
@@ -50,7 +50,7 @@
static RenderBoxModelObject* nextContinuation(RenderObject* renderer)
{
- if (is<RenderInline>(*renderer) && !renderer->isReplaced())
+ if (is<RenderInline>(*renderer) && !renderer->isReplacedOrInlineBlock())
return downcast<RenderInline>(*renderer).continuation();
return downcast<RenderBlock>(*renderer).inlineContinuation();
}