InvalidStateError should be thrown firstly in Range.surroundContents

SPEC: http://dom.spec.whatwg.org/#dom-range-surroundcontents

According to spec, 'If a non-Text node is partially contained in the context object, throw an "InvalidStateError" exception.' is first step.
So this CL moved existed implementation to the first code block in function.

72 test cases will be passed with this CL in
http://w3c-test.org/dom/ranges/Range-surroundContents.html

Behavior in other browsers.
*)FF: PASS
*)IE: FAIL

TEST=LayoutTests/fast/dom/Range/surroundContents-for-invalid-state-error.html

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

git-svn-id: svn://svn.chromium.org/blink/trunk@179795 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Auto-rebaseline for r179782

http://src.chromium.org/viewvc/blink?view=revision&revision=179782

BUG=398417
TBR=keishi@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@179796 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Rename InternalsPrototype to PrivateScriptTestPrototype

I forgot to rename this when I factored PrivateScriptTest's code out of Internals.

BUG=341031

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

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