Web Animations: Remove dependency on legacy comparison functions

As this has a potential to impact performance when evaluating transition
conditions, this patch is being landed in advance of the full removal so that
we can evaluate results on the perf bots.

BUG=334225

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165716 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[FastTextAutosizer] Add clusterHasEnoughTextToAutosize

This patch adds FastTextAutosizer::clusterHasEnoughTextToAutosize which
prevents blocks with small amounts of text from autosizing
(e.g., copyrights, footers).

The way this is implemented is similar to TA::clusterShouldBeAutosized
where each character is assumed to be 1em wide, and clusters with width
less than 4 lines of text are not autosized.

This patch uses toRenderText(descendant)->text().length() instead of
TextAutosizer's toRenderText(descendant)->renderedTextLength() because
the linebox tree has not yet been built for descendants of the block
we are inflating. Because this code is intended to prevent autosizing
for single-line copyright lines / headers, I think the text().length()
approximation will not cause issues.

This patch lazily computes the text width using FTA::textLength(Cluster*)
and caches the result on Clusters as an optimization.

With this patch we pass 1 additional test.

BUG=302005

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165717 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert of DevTools: fix importScript function to set correct sourceURL (https://chromiumcodereview.appspot.com/134223004/)

Reason for revert:
New sourceURL does not respect path.

Original issue's description:
> DevTools: fix importScript function to set correct sourceURL
> 
> This patch uses window.location fields to generate correct sourceURL
> instead of parsing window.location.href manually.
> 
> BUG=337151
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=165636

TBR=lushnikov@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=337151

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165718 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Make associated IMG element list lazily.

HTMLFormElement::associate(HTMLImageElement&) and
disassociate(HTMLImageElement&) just set a dirty flag, and
HTMLFormElement::imageElements() builds the list of associated IMG elements
lazily.

imageElements() needs to traverse a DOM tree. We want to minimize
the scope of the traversal. So,
 - If the FORM elment has an element which was associated by HTML parser and is
   not a descendant of the FORM, we traverse over the document.
 - Otherwise (the FORM has only elements which are descendants of the FORM), we
   traverse over the FORM element.

We introduce m_hasElementsAssociatedByParser, m_didFinishParsingChildren, and
didAssociateByParser() to check if a FORM element has non-descendant associated
elmenets.

HTMLFormElement::removedFrom needs a special handling for imageElements()
because this function is called after the FORM was removed from a tree and we
might not have up-to-date m_imageElements.
 - If the FORM has no non-descendant associated elements, we have to do nothing.
   We don't need to call formRemovedFromTree for descendant associated elements.
 - If the FORM has up-to-date m_imageElements, we just iterate it.
 - Otherwise, we need to collect associated elements in a tree for the
   insertionPoint and a tree for the FORM element.

BUG=334556
TEST=none; no user-visible behavior changes.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165719 bbb929c8-8fbe-4397-9dbb-9b2b20218538
text-overflow on button should have effect

RenderButton is derived from RenderFlexibleBox.
In https://codereview.chromium.org/23449034 its mentioned that
text-overflow on flexbox should have no effect. But in Firefox
button text-overflow:ellipsis have a effect.
I have added a exception for Renderbutton by returning true
for canCollapseAnonymousBlockChild().

BUG=107014, 319894

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165720 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Mark use-while-animating-crash.html flaky.

BUG=337774
TBR=hclam@chromium.org

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

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