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

Unified Diff: third_party/WebKit/Source/core/dom/Range.h

Issue 2701413003: Range: node offsets should be unsigned. (Closed)
Patch Set: Resolve std::numeric_limits<int>::max() leftover Created 3 years, 10 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
Index: third_party/WebKit/Source/core/dom/Range.h
diff --git a/third_party/WebKit/Source/core/dom/Range.h b/third_party/WebKit/Source/core/dom/Range.h
index 18bc278cd43c69ba6a620c5c81d999227144720d..f76b3f020887ebc9b9de54bd94f8576d8aa48fb3 100644
--- a/third_party/WebKit/Source/core/dom/Range.h
+++ b/third_party/WebKit/Source/core/dom/Range.h
@@ -56,9 +56,9 @@ class CORE_EXPORT Range final : public GarbageCollected<Range>,
static Range* create(Document&);
static Range* create(Document&,
Node* startContainer,
- int startOffset,
+ unsigned startOffset,
Node* endContainer,
- int endOffset);
+ unsigned endOffset);
static Range* create(Document&, const Position&, const Position&);
static Range* createAdjustedToTreeScope(const TreeScope&, const Position&);
@@ -69,9 +69,9 @@ class CORE_EXPORT Range final : public GarbageCollected<Range>,
return *m_ownerDocument.get();
}
Node* startContainer() const { return m_start.container(); }
- int startOffset() const { return m_start.offset(); }
+ unsigned startOffset() const { return m_start.offset(); }
Node* endContainer() const { return m_end.container(); }
- int endOffset() const { return m_end.offset(); }
+ unsigned endOffset() const { return m_end.offset(); }
bool collapsed() const { return m_start == m_end; }
bool isConnected() const;
@@ -80,15 +80,15 @@ class CORE_EXPORT Range final : public GarbageCollected<Range>,
static Node* commonAncestorContainer(const Node* containerA,
const Node* containerB);
void setStart(Node* container,
- int offset,
+ unsigned offset,
ExceptionState& = ASSERT_NO_EXCEPTION);
void setEnd(Node* container,
- int offset,
+ unsigned offset,
ExceptionState& = ASSERT_NO_EXCEPTION);
void collapse(bool toStart);
bool isNodeFullyContained(Node&) const;
- bool isPointInRange(Node* refNode, int offset, ExceptionState&) const;
- short comparePoint(Node* refNode, int offset, ExceptionState&) const;
+ bool isPointInRange(Node* refNode, unsigned offset, ExceptionState&) const;
+ short comparePoint(Node* refNode, unsigned offset, ExceptionState&) const;
enum CompareResults {
NODE_BEFORE,
NODE_AFTER,
@@ -100,9 +100,9 @@ class CORE_EXPORT Range final : public GarbageCollected<Range>,
const Range* sourceRange,
ExceptionState&) const;
static short compareBoundaryPoints(Node* containerA,
- int offsetA,
+ unsigned offsetA,
Node* containerB,
- int offsetB,
+ unsigned offsetB,
ExceptionState&);
static short compareBoundaryPoints(const RangeBoundaryPoint& boundaryA,
const RangeBoundaryPoint& boundaryB,
@@ -166,7 +166,7 @@ class CORE_EXPORT Range final : public GarbageCollected<Range>,
ClientRectList* getClientRects() const;
ClientRect* getBoundingClientRect() const;
- static Node* checkNodeWOffset(Node*, int offset, ExceptionState&);
+ static Node* checkNodeWOffset(Node*, unsigned offset, ExceptionState&);
DECLARE_TRACE();
@@ -174,9 +174,9 @@ class CORE_EXPORT Range final : public GarbageCollected<Range>,
explicit Range(Document&);
Range(Document&,
Node* startContainer,
- int startOffset,
+ unsigned startOffset,
Node* endContainer,
- int endOffset);
+ unsigned endOffset);
void setDocument(Document&);

Powered by Google App Engine
This is Rietveld 408576698