Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(736)

Unified Diff: Source/core/dom/Range.cpp

Issue 974823002: Add [TypeChecking=Interface] to Range interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add FIXME comments Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/text/first-letter-bad-line-boxes-crash-expected.txt ('k') | Source/core/dom/Range.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Range.cpp
diff --git a/Source/core/dom/Range.cpp b/Source/core/dom/Range.cpp
index 667caf6034b6ee254d7c57530f09995b3af638fa..389e65fe038dece09c4b53ac597acf1d78a52b7d 100644
--- a/Source/core/dom/Range.cpp
+++ b/Source/core/dom/Range.cpp
@@ -157,7 +157,8 @@ static inline bool checkForDifferentRootContainer(const RangeBoundaryPoint& star
void Range::setStart(PassRefPtrWillBeRawPtr<Node> refNode, int offset, ExceptionState& exceptionState)
{
if (!refNode) {
- exceptionState.throwDOMException(NotFoundError, "The node provided was null.");
+ // FIXME: Generated bindings code never calls with null, and neither should other callers!
+ exceptionState.throwTypeError("The node provided is null.");
return;
}
@@ -180,7 +181,8 @@ void Range::setStart(PassRefPtrWillBeRawPtr<Node> refNode, int offset, Exception
void Range::setEnd(PassRefPtrWillBeRawPtr<Node> refNode, int offset, ExceptionState& exceptionState)
{
if (!refNode) {
- exceptionState.throwDOMException(NotFoundError, "The node provided was null.");
+ // FIXME: Generated bindings code never calls with null, and neither should other callers!
+ exceptionState.throwTypeError("The node provided is null.");
return;
}
@@ -223,7 +225,8 @@ void Range::collapse(bool toStart)
bool Range::isPointInRange(Node* refNode, int offset, ExceptionState& exceptionState)
{
if (!refNode) {
- exceptionState.throwDOMException(HierarchyRequestError, "The node provided was null.");
+ // FIXME: Generated bindings code never calls with null, and neither should other callers!
+ exceptionState.throwTypeError("The node provided is null.");
return false;
}
@@ -281,7 +284,8 @@ Range::CompareResults Range::compareNode(Node* refNode, ExceptionState& exceptio
// before and after(surrounds), or inside the range, respectively
if (!refNode) {
- exceptionState.throwDOMException(NotFoundError, "The node provided was null.");
+ // FIXME: Generated bindings code never calls with null, and neither should other callers!
+ exceptionState.throwTypeError("The node provided is null.");
return NODE_BEFORE;
}
@@ -473,7 +477,8 @@ void Range::deleteContents(ExceptionState& exceptionState)
static bool nodeValidForIntersects(Node* refNode, Document* expectedDocument, ExceptionState& exceptionState)
{
if (!refNode) {
- exceptionState.throwDOMException(NotFoundError, "The node provided is null.");
+ // FIXME: Generated bindings code never calls with null, and neither should other callers!
+ exceptionState.throwTypeError("The node provided is null.");
return false;
}
@@ -860,7 +865,8 @@ void Range::insertNode(PassRefPtrWillBeRawPtr<Node> prpNewNode, ExceptionState&
RefPtrWillBeRawPtr<Node> newNode = prpNewNode;
if (!newNode) {
- exceptionState.throwDOMException(NotFoundError, "The node provided is null.");
+ // FIXME: Generated bindings code never calls with null, and neither should other callers!
+ exceptionState.throwTypeError("The node provided is null.");
return;
}
@@ -1079,7 +1085,8 @@ Node* Range::checkNodeWOffset(Node* n, int offset, ExceptionState& exceptionStat
void Range::checkNodeBA(Node* n, ExceptionState& exceptionState) const
{
if (!n) {
- exceptionState.throwDOMException(NotFoundError, "The node provided is null.");
+ // FIXME: Generated bindings code never calls with null, and neither should other callers!
+ exceptionState.throwTypeError("The node provided is null.");
return;
}
@@ -1162,7 +1169,8 @@ void Range::setEndAfter(Node* refNode, ExceptionState& exceptionState)
void Range::selectNode(Node* refNode, ExceptionState& exceptionState)
{
if (!refNode) {
- exceptionState.throwDOMException(NotFoundError, "The node provided is null.");
+ // FIXME: Generated bindings code never calls with null, and neither should other callers!
+ exceptionState.throwTypeError("The node provided is null.");
return;
}
@@ -1216,7 +1224,8 @@ void Range::selectNode(Node* refNode, ExceptionState& exceptionState)
void Range::selectNodeContents(Node* refNode, ExceptionState& exceptionState)
{
if (!refNode) {
- exceptionState.throwDOMException(NotFoundError, "The node provided is null.");
+ // FIXME: Generated bindings code never calls with null, and neither should other callers!
+ exceptionState.throwTypeError("The node provided is null.");
return;
}
@@ -1281,7 +1290,8 @@ void Range::surroundContents(PassRefPtrWillBeRawPtr<Node> passNewParent, Excepti
{
RefPtrWillBeRawPtr<Node> newParent = passNewParent;
if (!newParent) {
- exceptionState.throwDOMException(NotFoundError, "The node provided is null.");
+ // FIXME: Generated bindings code never calls with null, and neither should other callers!
+ exceptionState.throwTypeError("The node provided is null.");
return;
}
« no previous file with comments | « LayoutTests/fast/text/first-letter-bad-line-boxes-crash-expected.txt ('k') | Source/core/dom/Range.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698