Simplify & optimize StringImpl::replace(UChar, UChar)

StringImpl::replace(UChar, UChar) is mentioned as one of the
hot spots by the Intel VTune Amplifier profile when running
the 'textarea-dom.html' performance test.

StringImpl::replace(UChar, UChar) is optimized (and simplified)
by using 'StringImpl::find' method instead of manual traversing
the internal buffer and checking 'is8Bit' property value on
each iteration.

This changes gives approx 2.25% improvement of the average
'textarea-dom.html' performance test results (linux desktop x64,
GCC 4.6.3, release content_shell build with enabled
'linux_dump_symbols' flag).

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175198 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Reset RestyleFlags when Element is removed.

The RestyleFlags are set based on selectors and DOM structure. Wether the
elements are attached or detached is irrelevant. Furthermore, when these
flags are reset, we must be sure all elements which may contribute to these
flags will have their style recalculated in order to set the flags properly.
That is not necessarily the case for attach/detach since siblings, or
descendants of siblings of the detached element will not have their style
recalculated in general.

Instead, reset RestyleFlags when an element is removed from its parent. If
the element is re-inserted into the DOM, siblings and sibling subtrees will
have the style recalculated to update the flags properly.

R=esprehn@chromium.org
BUG=376139

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

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