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

Side by Side Diff: Source/core/page/EventHandler.cpp

Issue 181693003: Have Document::markers() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/core/page/Page.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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 void EventHandler::selectClosestMisspellingFromHitTestResult(const HitTestResult & result, AppendTrailingWhitespace appendTrailingWhitespace) 444 void EventHandler::selectClosestMisspellingFromHitTestResult(const HitTestResult & result, AppendTrailingWhitespace appendTrailingWhitespace)
445 { 445 {
446 Node* innerNode = result.targetNode(); 446 Node* innerNode = result.targetNode();
447 VisibleSelection newSelection; 447 VisibleSelection newSelection;
448 448
449 if (innerNode && innerNode->renderer()) { 449 if (innerNode && innerNode->renderer()) {
450 VisiblePosition pos(innerNode->renderer()->positionForPoint(result.local Point())); 450 VisiblePosition pos(innerNode->renderer()->positionForPoint(result.local Point()));
451 Position start = pos.deepEquivalent(); 451 Position start = pos.deepEquivalent();
452 Position end = pos.deepEquivalent(); 452 Position end = pos.deepEquivalent();
453 if (pos.isNotNull()) { 453 if (pos.isNotNull()) {
454 Vector<DocumentMarker*> markers = innerNode->document().markers()->m arkersInRange(makeRange(pos, pos).get(), DocumentMarker::MisspellingMarkers()); 454 Vector<DocumentMarker*> markers = innerNode->document().markers().ma rkersInRange(makeRange(pos, pos).get(), DocumentMarker::MisspellingMarkers());
455 if (markers.size() == 1) { 455 if (markers.size() == 1) {
456 start.moveToOffset(markers[0]->startOffset()); 456 start.moveToOffset(markers[0]->startOffset());
457 end.moveToOffset(markers[0]->endOffset()); 457 end.moveToOffset(markers[0]->endOffset());
458 newSelection = VisibleSelection(start, end); 458 newSelection = VisibleSelection(start, end);
459 } 459 }
460 } 460 }
461 461
462 if (appendTrailingWhitespace == ShouldAppendTrailingWhitespace && newSel ection.isRange()) 462 if (appendTrailingWhitespace == ShouldAppendTrailingWhitespace && newSel ection.isRange())
463 newSelection.appendTrailingWhitespace(); 463 newSelection.appendTrailingWhitespace();
464 464
(...skipping 3550 matching lines...) Expand 10 before | Expand all | Expand 10 after
4015 unsigned EventHandler::accessKeyModifiers() 4015 unsigned EventHandler::accessKeyModifiers()
4016 { 4016 {
4017 #if OS(MACOSX) 4017 #if OS(MACOSX)
4018 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 4018 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
4019 #else 4019 #else
4020 return PlatformEvent::AltKey; 4020 return PlatformEvent::AltKey;
4021 #endif 4021 #endif
4022 } 4022 }
4023 4023
4024 } // namespace WebCore 4024 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/core/page/Page.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698