Introduce ToV8Value.

ToV8Value is a utility class for converting an object to a V8 value.
This is a refactoring CL.

BUG=NONE
R=haraken

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172118 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Oilpan: Enable Oilpan in modules/crypto

This is a straightforward replacement from transition types to real types.

BUG=340522

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172119 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove dead canDetermineWidthWithoutLayout optimization

This optimization didn't work, and we ended up disabling it shortly after
it was enabled. I don't think we ever want to turn it back on, instead
lets just delete it.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172120 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Unfocused TEXTAREA element should not accept editing.

The normal unfocusing step clears selection. But unfocusing caused by
display:none style didn't clear selection because:
 - It used Document::setFocusedElement. It bypassed FocusController.
 - Even if it used it, clearSelectionIfNeeded() in FocusController didn't
    clear selection because selection.rootEditableElement() was null in
    this case.

This CL changes the code so that:
 - We use Element::blur(), which uses FocusController::setFocusedElement.
 - clearSelectionIfNeeded() uses enclosingTextFormControl() to check
    if the selection is in INPUT/TEXTAREA instead of
    rootEditableElement(), which depends on renderers.

BUG=364309
TEST=automated

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172121 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert "Remove v8::TryCatch from V8StringResource<T>::prepare so that a caller can"

This reverts r172013, it bloated Chrome Linux release ~150K, and others.

TBR=yhirano@chromium.org,haraken@chromium.org
BUG=365265

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172122 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Plumbing ServiceWorkerGlobalScopeProxy::reportConsoleMessage to WebServiceWorkerContextClient.

BUG=365235

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172123 bbb929c8-8fbe-4397-9dbb-9b2b20218538
When passing out the user gesture token, also pass the ref count

This is a follow to to r171900 - the token is now used in a different
event handler and should not longer be held by the page's event handler

BUG=364405

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172124 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Oilpan's heap should be shut down after all threads are detached and Heap::shutdown is called

This CL is a fix for bug 365197. The crash happens if things happen in the following order:

(1) The main thread posts a setupHTMLParserThread task to a parser thread.
(2) The main thread calls detachMainThread(). Because the main thread is the last thread detached, it calls Heap::lastThreadDetached(). It calls ThreadState::shutdown(). It deletes ThreadState::SafePointBarrier.
(3) The parser thread starts processing the setupHTMLParserThread task. It calls ThreadState::attach() and tries to enter an safe point scope. It crashes because ThreadState::SafePointBarrier is already deleted.

The issue here is that we're shutting down the heap before the main thread calls Heap::shutdown(). (The main thread joins with the parser thread before calling Heap::shutdown().) Thus this CL fixes the crash by making Oilpan's heap start the shutdown sequence after all threads are detached *and* Heap::shutdown() is called.

BUG=365197
TEST=None. Cannot reproducible.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172125 bbb929c8-8fbe-4397-9dbb-9b2b20218538
SVG does not respect overflow:visible.

For standalone svg documents, always clip to the viewport ('auto' acts as 'hidden').

For 'overflow: hidden | scroll' on any svg element: clip.
For 'overflow: auto | visible' on any svg element: don't clip.

New behaviours for stand-alone svg documents:
* overflow-x and overflow-y for controlling each scrollbar independently is now supported.
* overflow:scroll will display scrollbars regardless of the svg overflowing or not (as required by CSS).
* overflow:hidden will cause overflow to be clipped away and scrollbars to be hidden.

BUG=231577

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

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