GraphicsContext::drawBidiText()'s BidiResolver should not have isolated runs
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Sep 2015 00:05:58 +0000 (00:05 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Sep 2015 00:05:58 +0000 (00:05 +0000)
commit43bff4aacff31912b99cbcb0585b7888679187d1
treeb8ad7ca1494a7bd79568c54cb55b02976c216db9
parent5ad0035b7f5e181d7ee9ed35e290d17d12cd47c1
GraphicsContext::drawBidiText()'s BidiResolver should not have isolated runs
https://bugs.webkit.org/show_bug.cgi?id=149193

Reviewed by Anders Carlsson.

There are two users of BidiResolver, one which needs isolated runs (in RenderBlockLineLayout) and
one which doesn't (in GraphicsContext::drawBidiText()). Because of [1], the isolated runs vector
is migrating to a new type outside of platform/. Therefore, only the first user of BidiResolver
should have this member variable.

This is achieved by creating two subclasses of BidiResolver, and using the Curiously Repeating
Template pattern to downcast into specializations.

[1] https://bugs.webkit.org/show_bug.cgi?id=149153

No new tests because there is no behavior change.

* platform/text/BidiResolver.h:
(WebCore::BidiResolverBase::BidiResolverBase):
(WebCore::BidiResolverBase::increment):
(WebCore::BidiResolverBase::appendRun):
(WebCore::BidiResolverBase::incrementInternal):
(WebCore::IsolateRun>::~BidiResolverWithIsolate):
(WebCore::Subclass>::appendRunInternal):
(WebCore::Subclass>::embed):
(WebCore::Subclass>::checkDirectionInLowerRaiseEmbeddingLevel):
(WebCore::Subclass>::lowerExplicitEmbeddingLevel):
(WebCore::Subclass>::raiseExplicitEmbeddingLevel):
(WebCore::Subclass>::commitExplicitEmbedding):
(WebCore::Subclass>::updateStatusLastFromCurrentDirection):
(WebCore::Subclass>::reorderRunsFromLevels):
(WebCore::Subclass>::createBidiRunsForLine):
(WebCore::Subclass>::setMidpointForIsolatedRun):
(WebCore::Subclass>::midpointForIsolatedRun):
(WebCore::BidiResolver::BidiResolver): Deleted.
(WebCore::BidiResolver::increment): Deleted.
(WebCore::BidiResolver::isolatedRuns): Deleted.
(WebCore::Run>::~BidiResolver): Deleted.
(WebCore::Run>::appendRun): Deleted.
(WebCore::Run>::embed): Deleted.
(WebCore::Run>::checkDirectionInLowerRaiseEmbeddingLevel): Deleted.
(WebCore::Run>::lowerExplicitEmbeddingLevel): Deleted.
(WebCore::Run>::raiseExplicitEmbeddingLevel): Deleted.
(WebCore::Run>::commitExplicitEmbedding): Deleted.
(WebCore::Run>::updateStatusLastFromCurrentDirection): Deleted.
(WebCore::Run>::reorderRunsFromLevels): Deleted.
(WebCore::Run>::createBidiRunsForLine): Deleted.
(WebCore::Run>::setMidpointForIsolatedRun): Deleted.
(WebCore::Run>::midpointForIsolatedRun): Deleted.
* rendering/InlineIterator.h:
(WebCore::InlineBidiResolver::incrementInternal):
(WebCore::InlineBidiResolver::appendRunInternal):
(WebCore::InlineBidiResolver::increment): Deleted.
(WebCore::InlineBidiResolver::appendRun): Deleted.
* rendering/line/TrailingObjects.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189829 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/text/BidiResolver.h
Source/WebCore/rendering/InlineIterator.h
Source/WebCore/rendering/line/TrailingObjects.h