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

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

Issue 2776103002: Make RenderedRectsForMarkers() to ignore disconnected nodes. (Closed)
Patch Set: move to VisibleUnits Created 3 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 | « third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp ('k') | no next file » | 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 f76a22b37cb8f1d9ffce213a976438a412427ee2..dd38e71754a4795618a2827c87fc129a0188a246 100644
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
@@ -32,6 +32,7 @@
#include "core/dom/NodeTraversal.h"
#include "core/dom/Range.h"
#include "core/dom/Text.h"
+#include "core/editing/VisibleUnits.h"
#include "core/editing/iterators/TextIterator.h"
#include "core/editing/markers/RenderedDocumentMarker.h"
#include "core/frame/FrameView.h"
@@ -213,10 +214,8 @@ static void updateMarkerRenderedRect(const Node& node,
range->setEnd(&const_cast<Node&>(node), marker.endOffset(),
IGNORE_EXCEPTION_FOR_TESTING);
}
- 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()));
+ if (!exceptionState.hadException() && range->isConnected()) {
+ marker.setRenderedRect(LayoutRect(boundingBox(EphemeralRange(range))));
yosin_UTC9 2017/03/30 01:23:17 Note: Intention of this TODO is using |EphemeralRa
} else {
marker.nullifyRenderedRect();
}
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698