From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/rendering/line/LineInlineHeaders.h | 25 ++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'Source/WebCore/rendering/line/LineInlineHeaders.h') diff --git a/Source/WebCore/rendering/line/LineInlineHeaders.h b/Source/WebCore/rendering/line/LineInlineHeaders.h index 0b0c44e6e..db7ad2e83 100644 --- a/Source/WebCore/rendering/line/LineInlineHeaders.h +++ b/Source/WebCore/rendering/line/LineInlineHeaders.h @@ -22,8 +22,7 @@ * */ -#ifndef LineInlineHeaders_h -#define LineInlineHeaders_h +#pragma once #include "RenderLayer.h" @@ -43,7 +42,7 @@ inline bool hasInlineDirectionBordersPaddingOrMargin(const RenderInline& flow) return shouldApplyEndBorderPaddingOrMargin && (flow.borderEnd() || flow.marginEnd() || flow.paddingEnd()); } -inline const RenderStyle& lineStyle(const RenderElement& renderer, const LineInfo& lineInfo) +inline const RenderStyle& lineStyle(const RenderObject& renderer, const LineInfo& lineInfo) { return lineInfo.isFirstLine() ? renderer.firstLineStyle() : renderer.style(); } @@ -56,7 +55,7 @@ inline bool requiresLineBoxForContent(const RenderInline& flow, const LineInfo& const RenderStyle& parentStyle = lineStyle(*parent, lineInfo); if (flowStyle.lineHeight() != parentStyle.lineHeight() || flowStyle.verticalAlign() != parentStyle.verticalAlign() - || !parentStyle.font().fontMetrics().hasIdenticalAscentDescentAndLineGap(flowStyle.font().fontMetrics())) + || !parentStyle.fontCascade().fontMetrics().hasIdenticalAscentDescentAndLineGap(flowStyle.fontCascade().fontMetrics())) return true; } return false; @@ -105,8 +104,8 @@ inline bool requiresLineBox(const InlineIterator& it, const LineInfo& lineInfo = return true; bool rendererIsEmptyInline = false; - if (it.renderer()->isRenderInline()) { - const RenderInline& inlineRenderer = toRenderInline(*it.renderer()); + if (is(*it.renderer())) { + const auto& inlineRenderer = downcast(*it.renderer()); if (!alwaysRequiresLineBox(inlineRenderer) && !requiresLineBoxForContent(inlineRenderer, lineInfo)) return false; rendererIsEmptyInline = isEmptyInline(inlineRenderer); @@ -120,23 +119,21 @@ inline bool requiresLineBox(const InlineIterator& it, const LineInfo& lineInfo = return notJustWhitespace || rendererIsEmptyInline; } -inline void setStaticPositions(RenderBlockFlow& block, RenderBox& child) +inline void setStaticPositions(RenderBlockFlow& block, RenderBox& child, IndentTextOrNot shouldIndentText) { // FIXME: The math here is actually not really right. It's a best-guess approximation that // will work for the common cases RenderElement* containerBlock = child.container(); LayoutUnit blockHeight = block.logicalHeight(); - if (containerBlock->isRenderInline()) { + if (is(*containerBlock)) { // A relative positioned inline encloses us. In this case, we also have to determine our // position as though we were an inline. Set |staticInlinePosition| and |staticBlockPosition| on the relative positioned // inline so that we can obtain the value later. - toRenderInline(containerBlock)->layer()->setStaticInlinePosition(block.startAlignedOffsetForLine(blockHeight, false)); - toRenderInline(containerBlock)->layer()->setStaticBlockPosition(blockHeight); + downcast(*containerBlock).layer()->setStaticInlinePosition(block.startAlignedOffsetForLine(blockHeight, DoNotIndentText)); + downcast(*containerBlock).layer()->setStaticBlockPosition(blockHeight); } - block.updateStaticInlinePositionForChild(child, blockHeight); + block.updateStaticInlinePositionForChild(child, blockHeight, shouldIndentText); child.layer()->setStaticBlockPosition(blockHeight); } -} - -#endif +} // namespace WebCore -- cgit v1.2.1