[Text Autosizing] Split isAutosizingCluster into three independent checks
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Feb 2013 16:40:52 +0000 (16:40 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Feb 2013 16:40:52 +0000 (16:40 +0000)
commit77535dcf9488333b34849ac9ef37f0b268190cfd
treeb4f7d34dc64f438c3f8a2d23cf84bab3a1debe99
parentb913139d277598e105a4754eff12d457eefe524e
[Text Autosizing] Split isAutosizingCluster into three independent checks
https://bugs.webkit.org/show_bug.cgi?id=109093

Refactoring to create more flexible version of isAutosizingCluster since there're more types
of autosizing cluster now: narrower than the parent cluster, wider than the parent cluster
and the one that doesn't depend on the parent cluster.

Patch by Anton Vayvod <avayvod@chromium.org> on 2013-02-08
Reviewed by Kenneth Rohde Christiansen.

Refactoring, no test changes.

* rendering/TextAutosizer.cpp:

(WebCore::TextAutosizer::isNarrowDescendant):

    Separate check for the container to be of the narrow-descendant type. Was a part of
    isAutosizingCluster().

(WebCore::TextAutosizer::isWiderDescendant):

    Separate check for the container to be of the wider-descendant type. Was a part of
    isAutosizingCluster().

(WebCore::TextAutosizer::isIndependentDescendant):

    Separate check for the container to be autosized separately from the ancestor cluster.
    Checks for conditions independent of the aforementioned cluster.

(WebCore::TextAutosizer::isAutosizingCluster):

    Handy method to check all separate conditions together.

(WebCore::TextAutosizer::processSubtree):
(WebCore::TextAutosizer::processCluster):
(WebCore::TextAutosizer::processContainer):
(WebCore::TextAutosizer::clusterShouldBeAutosized):
(WebCore::TextAutosizer::measureDescendantTextWidth):
(WebCore::TextAutosizer::findFirstTextLeafNotInCluster):

    The methods above were updated to use new functions/arguments.

* rendering/TextAutosizer.h:

    Updated/added method definitions.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142287 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/TextAutosizer.cpp
Source/WebCore/rendering/TextAutosizer.h