Remove broken sibling selector optimization

Blink r154053 landed with a broken optimization for nth-child that
this patch removes.

Background: nth-child was formerly O(1) and nth-last-child was O(N^2),
but r154053 reversed these making the more common nth-child slower.
It included an optimization to make both O(1), but the optimization
was broken in one of the merges.

I will re-land the working optimization in another patch, and with
a magnitude perf test Ojan, eseidel, and myself wrote to ensure it
works.

R=ojan@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154072 bbb929c8-8fbe-4397-9dbb-9b2b20218538
StringTruncator shouldn't use bloatedCharacters

Moving StringTruncator off bloatedCharacters required teaching
NonSharedCharacterBreakIterator how to find character breaks in Latin-1 without
calling into ICU.

R=eseidel@chromium.org
BUG=254708

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154073 bbb929c8-8fbe-4397-9dbb-9b2b20218538
SearchBuffer shouldn't use bloatedCharacters

This code was already doing a bunch of memcpies to normalize quote marks of
various kinds. After this CL, we do one memcpy into a Vector<UChar> and skip
the String::replace-induced memcpies.

R=ojan@chromium.org
BUG=254708

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154074 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add ElementResolveContext and use it in the style-sharing code as proof of concept

Most code for style resolution does not need the whole StyleResolverState
object, which has both mutable and immutable properties with both
element-resolve and document-resolve lifetimes.

This factors out just the immutable element-context properties which is
enough for things like style-sharing to understand what element we're
talking about, and does not contain any mutable out-parameters
like the resulting style.

This change was inspired by trying to pull out the style sharing code from
StyleResolver and feeling sad that it needed to use a StyleResolverState
pointer even though it didn't want most of those members.

I discovered through this process that m_elementAffectedByClassRules
was actually just and out-parameter of some one of the style-sharing
methods which was stored on StyleResolverState (probably by accident).

When I move the style sharing code into its own object I'll move
m_elementAffectedByClassRules there as well, and later we can clean it
up to be a parameter passed between methods instead of being a side-effect.

BUG=259202
R=esprehn@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154076 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fix document leak when selection is created inside the document.

The FrameSelection instance may have a RefPtr to Node inside the document with the selection. This persist after the document is navigated away, leading to a leak.

TEST=LayoutTests/editing/selection/leak-document-with-selection-inside.html
BUG=None

Review URL: https://chromiumcodereview.appspot.com/18682006

git-svn-id: svn://svn.chromium.org/blink/trunk@154077 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Introduce isHTMLVideoElement and toHTMLVideoElement

To avoid direct use of static_cast, this patch introduces isHTMLVideoElement and toHTMLVideoElement for code cleanup.

Review URL: https://chromiumcodereview.appspot.com/18205009

git-svn-id: svn://svn.chromium.org/blink/trunk@154078 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Mark the ResourceRequest if there was a preconnect prior to the request.

The corresponding chrome patch is http://crrev.com/18601004

This will be used to measure PLT for (possibly) preconnected navigations.

BUG=235361

Review URL: https://chromiumcodereview.appspot.com/18598003

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