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

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

Issue 2891173002: [DMC #9] Rename DocumentMarkerController::InvalidateRects*() methods (Closed)
Patch Set: Created 3 years, 7 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 | « third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h ('k') | no next file » | 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 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
7 * reserved. 7 * reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 433
434 void DocumentMarkerController::UpdateMarkerRenderedRectIfNeeded( 434 void DocumentMarkerController::UpdateMarkerRenderedRectIfNeeded(
435 const Node& node, 435 const Node& node,
436 RenderedDocumentMarker& marker) { 436 RenderedDocumentMarker& marker) {
437 DCHECK(!document_->View() || !document_->View()->NeedsLayout()); 437 DCHECK(!document_->View() || !document_->View()->NeedsLayout());
438 DCHECK(!document_->NeedsLayoutTreeUpdate()); 438 DCHECK(!document_->NeedsLayoutTreeUpdate());
439 if (!marker.IsValid()) 439 if (!marker.IsValid())
440 UpdateMarkerRenderedRect(node, marker); 440 UpdateMarkerRenderedRect(node, marker);
441 } 441 }
442 442
443 void DocumentMarkerController::InvalidateRectsForMarkersInNode( 443 void DocumentMarkerController::InvalidateRectsForTextMatchMarkersInNode(
444 const Node& node) { 444 const Node& node) {
445 MarkerLists* markers = markers_.at(&node); 445 MarkerLists* markers = markers_.at(&node);
446 446
447 const DocumentMarkerList* const marker_list = 447 const DocumentMarkerList* const marker_list =
448 ListForType(markers, DocumentMarker::kTextMatch); 448 ListForType(markers, DocumentMarker::kTextMatch);
449 if (!marker_list || marker_list->IsEmpty()) 449 if (!marker_list || marker_list->IsEmpty())
450 return; 450 return;
451 451
452 const HeapVector<Member<DocumentMarker>>& markers_in_list = 452 const HeapVector<Member<DocumentMarker>>& markers_in_list =
453 marker_list->GetMarkers(); 453 marker_list->GetMarkers();
454 for (auto& marker : markers_in_list) 454 for (auto& marker : markers_in_list)
455 ToRenderedDocumentMarker(marker)->Invalidate(); 455 ToRenderedDocumentMarker(marker)->Invalidate();
456 456
457 InvalidatePaintForTickmarks(node); 457 InvalidatePaintForTickmarks(node);
458 } 458 }
459 459
460 void DocumentMarkerController::InvalidateRectsForAllMarkers() { 460 void DocumentMarkerController::InvalidateRectsForAllTextMatchMarkers() {
461 for (auto& node_markers : markers_) { 461 for (auto& node_markers : markers_) {
462 const Node& node = *node_markers.key; 462 const Node& node = *node_markers.key;
463 InvalidateRectsForMarkersInNode(node); 463 InvalidateRectsForTextMatchMarkersInNode(node);
464 } 464 }
465 } 465 }
466 466
467 DEFINE_TRACE(DocumentMarkerController) { 467 DEFINE_TRACE(DocumentMarkerController) {
468 visitor->Trace(markers_); 468 visitor->Trace(markers_);
469 visitor->Trace(document_); 469 visitor->Trace(document_);
470 SynchronousMutationObserver::Trace(visitor); 470 SynchronousMutationObserver::Trace(visitor);
471 } 471 }
472 472
473 void DocumentMarkerController::RemoveMarkersForNode( 473 void DocumentMarkerController::RemoveMarkersForNode(
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 continue; 715 continue;
716 716
717 if (list->ShiftMarkers(offset, old_length, new_length)) 717 if (list->ShiftMarkers(offset, old_length, new_length))
718 did_shift_marker = true; 718 did_shift_marker = true;
719 } 719 }
720 720
721 if (!did_shift_marker) 721 if (!did_shift_marker)
722 return; 722 return;
723 if (!node->GetLayoutObject()) 723 if (!node->GetLayoutObject())
724 return; 724 return;
725 InvalidateRectsForMarkersInNode(*node); 725 InvalidateRectsForTextMatchMarkersInNode(*node);
726 // repaint the affected node 726 // repaint the affected node
727 node->GetLayoutObject()->SetShouldDoFullPaintInvalidation(); 727 node->GetLayoutObject()->SetShouldDoFullPaintInvalidation();
728 } 728 }
729 729
730 } // namespace blink 730 } // namespace blink
731 731
732 #ifndef NDEBUG 732 #ifndef NDEBUG
733 void showDocumentMarkers(const blink::DocumentMarkerController* controller) { 733 void showDocumentMarkers(const blink::DocumentMarkerController* controller) {
734 if (controller) 734 if (controller)
735 controller->ShowMarkers(); 735 controller->ShowMarkers();
736 } 736 }
737 #endif 737 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698