Remove complexity related to m_cachedElementsArrayOffset from LiveNodeListBase

Remove complexity related to m_cachedElementsArrayOffset from LiveNodeListBase
and HTMLCollection. The complexity is moved to HTMLFormControlsCollection
which is the only type that actually needs to cache this offset.

The code in LiveNodeListBase / HTMLCollection is overly complex and this is one
step towards improving the situation.

This change is a partial merge of WebKit r158758 by <antti@apple.com>.

R=abarth, esprehn, eseidel

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

git-svn-id: svn://svn.chromium.org/blink/trunk@164452 bbb929c8-8fbe-4397-9dbb-9b2b20218538
MIME type predicates and case-insensitive matching.

The registered type portion of a MIME type must be compared
case-insensitively for equality. Make all Blink-side predicates (e.g.,
is*MIMEType()) do such equality testing.

If the equality testing delegates to external platform predicates,
then ensure that the MIME type is first translated to lower case.
(This is due to the net/base/ MIME type predicates assuming
lower-cased input.)

The downstream benefit of this is that we can let go of various
explicit lower case conversions before invoking these predicates.

R=jochen
BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@164453 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Change link drag bubble to take directionality into account

Change DragImage to use drawBidiText instead of drawText for the link
text thereby respecting the directionality. Also check the paragraph
directionality explicitly to allow proper alignment.

Also, move the determineDirectionality functionality out of HTMLElement
and into a new BidiTextRun file allowing the functionality to be shared.

BUG=287263
R=leviw@chromium.org

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

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