Range API is throwing wrong exception type
https://bugs.webkit.org/show_bug.cgi?id=148648

Reviewed by Ryosuke Niwa.

Source/WebCore:

The RangeException type does not exist in the latest DOM specification.
Instead, the Range API is throwing regular DOMExceptions [1]:
https://dom.spec.whatwg.org/#range

The error codes also differ. RangeException.INVALID_NODE_TYPE_ERR (2)
is replaced with DOMException.INVALID_NODE_TYPE_ERR (24).
RangeException.BAD_BOUNDARYPOINTS_ERR (1) is replaced by
DOMException.INVALID_STATE_ERR (11), as per:
https://dom.spec.whatwg.org/#dom-range-surroundcontents (step 1).

This patch aligns WebKit's behavior with the specification and with
other browsers (tested Firefox and Chrome).

[1] https://heycam.github.io/webidl/#dfn-DOMException

No new tests, covered by existing tests (rebaselined):
http/tests/w3c/dom/ranges/Range-comparePoint.html
http/tests/w3c/dom/ranges/Range-isPointInRange.html
http/tests/w3c/dom/ranges/Range-selectNode.html
http/tests/w3c/dom/ranges/Range-set.html
http/tests/w3c/dom/ranges/Range-surroundContents.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSExceptionBase.cpp:
(WebCore::toExceptionBase): Deleted.
* dom/DOMAllInOne.cpp:
* dom/DOMExceptions.in:
* dom/Range.cpp:
(WebCore::Range::insertNode):
(WebCore::Range::checkNodeWOffset):
(WebCore::Range::checkNodeBA):
(WebCore::Range::selectNode):
(WebCore::Range::selectNodeContents):
(WebCore::Range::surroundContents):
* dom/RangeException.cpp: Removed.
* dom/RangeException.h: Removed.
* dom/RangeException.idl: Removed.

Source/WebKit/win:

* Interfaces/DOMWindow.idl:
Drop outdated comment.

LayoutTests:

Update / rebaseline tests. A lot of w3c tests progressed after this
change. However, some of our pre-existing layout tests were relying
on RangeException.

* fast/dom/DOMException/RangeException-expected.txt: Removed.
* fast/dom/DOMException/RangeException.html: Removed.
* fast/dom/DOMException/resources/RangeException.js: Removed.
* fast/dom/Range/range-compareNode.html:
* fast/dom/Range/range-exceptions-expected.txt:
* fast/dom/Range/range-intersectsNode-expected.txt:
* fast/dom/Range/script-tests/range-exceptions.js:
* fast/dom/Window/get-set-properties-expected.txt:
* fast/dom/Window/get-set-properties.html:
* fast/dom/Window/resources/window-properties.js:
* http/tests/w3c/dom/ranges/Range-comparePoint-expected.txt:
* http/tests/w3c/dom/ranges/Range-isPointInRange-expected.txt:
* http/tests/w3c/dom/ranges/Range-selectNode-expected.txt:
* http/tests/w3c/dom/ranges/Range-set-expected.txt:
* http/tests/w3c/dom/ranges/Range-surroundContents-expected.txt:
* platform/mac/fast/dom/Window/window-lookup-precedence-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@189202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
44 files changed