diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
commit | 32761a6cee1d0dee366b885b7b9c777e67885688 (patch) | |
tree | d6bec92bebfb216f4126356e55518842c2f476a1 /Source/WebCore/rendering/RenderRubyBase.cpp | |
parent | a4e969f4965059196ca948db781e52f7cfebf19e (diff) | |
download | WebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz |
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/WebCore/rendering/RenderRubyBase.cpp')
-rw-r--r-- | Source/WebCore/rendering/RenderRubyBase.cpp | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/Source/WebCore/rendering/RenderRubyBase.cpp b/Source/WebCore/rendering/RenderRubyBase.cpp index 45b9b15d1..67be72b56 100644 --- a/Source/WebCore/rendering/RenderRubyBase.cpp +++ b/Source/WebCore/rendering/RenderRubyBase.cpp @@ -36,10 +36,8 @@ namespace WebCore { -RenderRubyBase::RenderRubyBase(Document& document, Ref<RenderStyle>&& style) - : RenderBlockFlow(document, WTFMove(style)) - , m_initialOffset(0) - , m_isAfterExpansion(true) +RenderRubyBase::RenderRubyBase(Document& document, PassRef<RenderStyle> style) + : RenderBlockFlow(document, std::move(style)) { setInline(false); } @@ -71,12 +69,6 @@ void RenderRubyBase::moveChildren(RenderRubyBase* toBase, RenderObject* beforeCh toBase->setNeedsLayoutAndPrefWidthsRecalc(); } -void RenderRubyBase::mergeChildrenWithBase(RenderRubyBase* toBlock) -{ - moveChildren(toBlock); - moveFloatsTo(toBlock); -} - void RenderRubyBase::moveInlineChildren(RenderRubyBase* toBase, RenderObject* beforeChild) { ASSERT(childrenInline()); @@ -94,7 +86,7 @@ void RenderRubyBase::moveInlineChildren(RenderRubyBase* toBase, RenderObject* be // If toBase has a suitable block, we re-use it, otherwise create a new one. RenderObject* lastChild = toBase->lastChild(); if (lastChild && lastChild->isAnonymousBlock() && lastChild->childrenInline()) - toBlock = downcast<RenderBlock>(lastChild); + toBlock = toRenderBlock(lastChild); else { toBlock = toBase->createAnonymousBlock(); toBase->insertChildInternal(toBlock, nullptr, NotifyChildren); @@ -120,8 +112,8 @@ void RenderRubyBase::moveBlockChildren(RenderRubyBase* toBase, RenderObject* bef RenderObject* lastChildThere = toBase->lastChild(); if (firstChildHere->isAnonymousBlock() && firstChildHere->childrenInline() && lastChildThere && lastChildThere->isAnonymousBlock() && lastChildThere->childrenInline()) { - RenderBlock* anonBlockHere = downcast<RenderBlock>(firstChildHere); - RenderBlock* anonBlockThere = downcast<RenderBlock>(lastChildThere); + RenderBlock* anonBlockHere = toRenderBlock(firstChildHere); + RenderBlock* anonBlockThere = toRenderBlock(lastChildThere); anonBlockHere->moveAllChildrenTo(anonBlockThere, true); anonBlockHere->deleteLines(); anonBlockHere->destroy(); @@ -133,7 +125,9 @@ void RenderRubyBase::moveBlockChildren(RenderRubyBase* toBase, RenderObject* bef RenderRubyRun* RenderRubyBase::rubyRun() const { ASSERT(parent()); - return downcast<RenderRubyRun>(parent()); + ASSERT(parent()->isRubyRun()); + + return &toRenderRubyRun(*parent()); } ETextAlign RenderRubyBase::textAlignmentForLine(bool /* endsWithSoftBreak */) const @@ -143,13 +137,7 @@ ETextAlign RenderRubyBase::textAlignmentForLine(bool /* endsWithSoftBreak */) co void RenderRubyBase::adjustInlineDirectionLineBounds(int expansionOpportunityCount, float& logicalLeft, float& logicalWidth) const { - if (rubyRun()->hasOverrideLogicalContentWidth() && firstRootBox() && !firstRootBox()->nextRootBox()) { - logicalLeft += m_initialOffset; - logicalWidth -= 2 * m_initialOffset; - return; - } - - LayoutUnit maxPreferredLogicalWidth = rubyRun() && rubyRun()->hasOverrideLogicalContentWidth() ? rubyRun()->overrideLogicalContentWidth() : this->maxPreferredLogicalWidth(); + int maxPreferredLogicalWidth = this->maxPreferredLogicalWidth(); if (maxPreferredLogicalWidth >= logicalWidth) return; @@ -160,11 +148,4 @@ void RenderRubyBase::adjustInlineDirectionLineBounds(int expansionOpportunityCou logicalWidth -= inset; } -void RenderRubyBase::cachePriorCharactersIfNeeded(const LazyLineBreakIterator& lineBreakIterator) -{ - auto* run = rubyRun(); - if (run) - run->setCachedPriorCharacters(lineBreakIterator.lastCharacter(), lineBreakIterator.secondToLastCharacter()); -} - } // namespace WebCore |