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

Side by Side Diff: Source/core/editing/markers/DocumentMarkerController.cpp

Issue 1347313002: Don't merge adjacent composition markers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove unnecessary toElement() call in the unit test Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/editing/markers/DocumentMarkerControllerTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 if (!markers->at(markerListIndex)) { 207 if (!markers->at(markerListIndex)) {
208 markers->insert(markerListIndex, adoptPtrWillBeNoop(new MarkerList)); 208 markers->insert(markerListIndex, adoptPtrWillBeNoop(new MarkerList));
209 } 209 }
210 210
211 OwnPtrWillBeMember<MarkerList>& list = markers->at(markerListIndex); 211 OwnPtrWillBeMember<MarkerList>& list = markers->at(markerListIndex);
212 OwnPtrWillBeRawPtr<RenderedDocumentMarker> newRenderedMarker = RenderedDocum entMarker::create(newMarker); 212 OwnPtrWillBeRawPtr<RenderedDocumentMarker> newRenderedMarker = RenderedDocum entMarker::create(newMarker);
213 updateMarkerRenderedRect(node, *newRenderedMarker); 213 updateMarkerRenderedRect(node, *newRenderedMarker);
214 if (list->isEmpty() || list->last()->endOffset() < newMarker.startOffset()) { 214 if (list->isEmpty() || list->last()->endOffset() < newMarker.startOffset()) {
215 list->append(newRenderedMarker.release()); 215 list->append(newRenderedMarker.release());
216 } else { 216 } else {
217 if (newMarker.type() != DocumentMarker::TextMatch) { 217 if (newMarker.type() != DocumentMarker::TextMatch && newMarker.type() != DocumentMarker::Composition) {
218 mergeOverlapping(list.get(), newRenderedMarker.release()); 218 mergeOverlapping(list.get(), newRenderedMarker.release());
219 } else { 219 } else {
220 MarkerList::iterator pos = std::lower_bound(list->begin(), list->end (), &newMarker, startsFurther); 220 MarkerList::iterator pos = std::lower_bound(list->begin(), list->end (), &newMarker, startsFurther);
221 list->insert(pos - list->begin(), newRenderedMarker.release()); 221 list->insert(pos - list->begin(), newRenderedMarker.release());
222 } 222 }
223 } 223 }
224 224
225 // repaint the affected node 225 // repaint the affected node
226 if (node->layoutObject()) 226 if (node->layoutObject())
227 node->layoutObject()->setShouldDoFullPaintInvalidation(); 227 node->layoutObject()->setShouldDoFullPaintInvalidation();
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 742
743 } // namespace blink 743 } // namespace blink
744 744
745 #ifndef NDEBUG 745 #ifndef NDEBUG
746 void showDocumentMarkers(const blink::DocumentMarkerController* controller) 746 void showDocumentMarkers(const blink::DocumentMarkerController* controller)
747 { 747 {
748 if (controller) 748 if (controller)
749 controller->showMarkers(); 749 controller->showMarkers();
750 } 750 }
751 #endif 751 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/editing/markers/DocumentMarkerControllerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698