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

Unified Diff: third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp

Issue 2125693003: Fix RenderedDocumentMarker::nullifyRenderedRect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | third_party/WebKit/Source/core/editing/markers/RenderedDocumentMarker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
index 8c0b53c74d61288a504ff0d41a1e9a4d281098eb..b0b6a02e09065eb88bf4affea036a7bb57d396be 100644
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
@@ -188,7 +188,7 @@ static bool doesNotInclude(const Member<RenderedDocumentMarker>& marker, size_t
return marker->endOffset() < startOffset;
}
-static bool updateMarkerRenderedRect(const Node& node, RenderedDocumentMarker& marker)
+static void updateMarkerRenderedRect(const Node& node, RenderedDocumentMarker& marker)
{
Range* range = Range::create(node.document());
// The offsets of the marker may be out-dated, so check for exceptions.
@@ -196,15 +196,14 @@ static bool updateMarkerRenderedRect(const Node& node, RenderedDocumentMarker& m
range->setStart(&const_cast<Node&>(node), marker.startOffset(), exceptionState);
if (!exceptionState.hadException())
range->setEnd(&const_cast<Node&>(node), marker.endOffset(), IGNORE_EXCEPTION);
- if (exceptionState.hadException()) {
- range->dispose();
- return marker.nullifyRenderedRect();
+ if (!exceptionState.hadException()) {
+ // TODO(yosin): Once we have a |EphemeralRange| version of |boundingBox()|,
+ // we should use it instead of |Range| version.
+ marker.setRenderedRect(LayoutRect(range->boundingBox()));
+ } else {
+ marker.nullifyRenderedRect();
}
- // TODO(yosin): Once we have a |EphemeralRange| version of |boundingBox()|,
- // we should use it instead of |Range| version.
- const bool isUpdated = marker.setRenderedRect(LayoutRect(range->boundingBox()));
range->dispose();
- return isUpdated;
}
// Markers are stored in order sorted by their start offset.
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/markers/RenderedDocumentMarker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698