Revert of https://codereview.chromium.org/82583005/
Reason for revert: This broke PrintWebViewHelperTest.PrintLayoutTest on Mac

TBR=ksakamoto@chromium.org,esprehn@chromium.org,ojan@chromium.org,dglazkov@chromium.org,tasak@google.com
NOTREECHECKS=true
NOTRY=true
BUG=305885

Review URL: https://codereview.chromium.org/131403008

git-svn-id: svn://svn.chromium.org/blink/trunk@164783 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Prevent RenderMarquee from causing a relayout.

In some circumstances, RenderMarquee can cause a relayout which ends up
deleting the calling RenderMarquee. The underlying problem is that layout
shouldn't be triggered like this through the Render tree.

This CL solves the problem by changing RenderMarquee's timer callback to
HTMLMarqueeElement::timerFired, where we can trigger layout before calling
into the RenderMarquee so that there is no layout to be done in the Render
tree.

This is a cleaner alternative to the fix in
https://codereview.chromium.org/91743003/.

BUG=322891

Review URL: https://codereview.chromium.org/128503002

git-svn-id: svn://svn.chromium.org/blink/trunk@164784 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Update animation classes to use OVERRIDE / FINAL when needed

Update animation classes to use OVERRIDE / FINAL when needed. Those are useful for
error checking or performance when the compiler supports it.

R=esprehn, abarth
BUG=None

Review URL: https://codereview.chromium.org/129133002

git-svn-id: svn://svn.chromium.org/blink/trunk@164785 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Explicitly set text direction for TextRuns

Currently we do test measurement on TextRuns without directionality
information, by assuming that it is left to right. For some scripts and
character combinations the measurements are different in rtl and ltr.
To handle that we currently have HarfBuzz guess the direction based on
the script and content. This is unreliable and fails in many cases.

With this patch the directionality information from the BidiResolver is
plumbed through and used to correctly set the text direction thereby
eliminating the need to for HarfBuzz to guess. This fixes a whole slew
of subtle repainting and selection bidi bugs on all platforms using
HarfBuzz for text shaping (win, linux, chromeos, android).

* Source/core/rendering/InlineTextBox.cpp:
    Pass direction to RenderText::width method based on element
    directionality.
* Source/core/rendering/RenderBR.h:
    Add TextDirection argument to overriden width method.
* Source/core/rendering/RenderBlockFlow.cpp,
  Source/core/rendering/RenderBlockFlow.h:
    Add direction argument to constructTextRun method.
* Source/core/rendering/RenderBlockLineLayout.cpp:
    Pass directionality to RenderText::width method based on bidi run
    direction.
* Source/core/rendering/RenderCombineText.cpp,
  Source/core/rendering/RenderCombineText.h:
    Pass direction through.
* Source/core/rendering/RenderText.cpp,
  Source/core/rendering/RenderText.h:
  (RenderText::widthFromCache):
    Add textDirection argument and pass it through to constructTextRun.
  (RenderText::trimmedPrefWidths):
    Assume LTR in trimmedPrefWidths for now, this matches the current
    behavior.
  (RenderText::computePreferredLogicalWidths):
    As preferred widths are computed before layout we do not yet have
    the bidi runs for the text (nor the line boxes). Use the
    BidiResolver to construct bidi runs for the entire text content and
    use the direction information for those runs when computing the
    width by passing it to widthFromCache.
  (RenderText::width):
    Change width methods to take a text direction argument.
* Source/core/rendering/line/BreakingContextInlineHeaders.h:
    Add text direction argument to textWidth method and change the
    handleText method to pass the direction based on the BidiResolver.
* Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp,
  Source/platform/fonts/harfbuzz/HarfBuzzShaper.h:
  (HarfBuzzShaper::shape):
    Remove tge shouldSetDirection logic as it is no longer needed (see
    shapeHarfBuzzRuns).
  (HarfBuzzShaper::shapeHarfBuzzRuns):
    Remove shouldSetDirection argument and always set the direction
    as the direction information is now avalible when calculating
    widths.
* Source/platform/text/BidiResolver.h:
  (BidiResolver::createBidiRunsForLine):
    Add reorderRuns argument (defaults to true) to allow the reorder
    in visual order to be bypassed as the width calculation logic
    RenderText::computePreferredLogicalWidths requires the runs to be in
    logical order.

R=eseidel@chromium.org, behdad@chromium.org, leviw@chromium.org
BUG=327465
TEST=fast/text/international/mixed-directionality-selection.html

Review URL: https://codereview.chromium.org/104813005

git-svn-id: svn://svn.chromium.org/blink/trunk@164788 bbb929c8-8fbe-4397-9dbb-9b2b20218538