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

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

Issue 23467007: Have Range constructor take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 if (pos.isNotNull()) { 525 if (pos.isNotNull()) {
526 newSelection = VisibleSelection(pos); 526 newSelection = VisibleSelection(pos);
527 newSelection.expandUsingGranularity(ParagraphGranularity); 527 newSelection.expandUsingGranularity(ParagraphGranularity);
528 } 528 }
529 529
530 return updateSelectionForMouseDownDispatchingSelectStart(innerNode, expandSe lectionToRespectUserSelectAll(innerNode, newSelection), ParagraphGranularity); 530 return updateSelectionForMouseDownDispatchingSelectStart(innerNode, expandSe lectionToRespectUserSelectAll(innerNode, newSelection), ParagraphGranularity);
531 } 531 }
532 532
533 static int textDistance(const Position& start, const Position& end) 533 static int textDistance(const Position& start, const Position& end)
534 { 534 {
535 RefPtr<Range> range = Range::create(&start.anchorNode()->document(), start, end); 535 RefPtr<Range> range = Range::create(start.anchorNode()->document(), start, e nd);
536 return TextIterator::rangeLength(range.get(), true); 536 return TextIterator::rangeLength(range.get(), true);
537 } 537 }
538 538
539 bool EventHandler::handleMousePressEventSingleClick(const MouseEventWithHitTestR esults& event) 539 bool EventHandler::handleMousePressEventSingleClick(const MouseEventWithHitTestR esults& event)
540 { 540 {
541 m_frame->document()->updateLayoutIgnorePendingStylesheets(); 541 m_frame->document()->updateLayoutIgnorePendingStylesheets();
542 Node* innerNode = event.targetNode(); 542 Node* innerNode = event.targetNode();
543 if (!(innerNode && innerNode->renderer() && m_mouseDownMayStartSelect)) 543 if (!(innerNode && innerNode->renderer() && m_mouseDownMayStartSelect))
544 return false; 544 return false;
545 545
(...skipping 3301 matching lines...) Expand 10 before | Expand all | Expand 10 after
3847 unsigned EventHandler::accessKeyModifiers() 3847 unsigned EventHandler::accessKeyModifiers()
3848 { 3848 {
3849 #if OS(DARWIN) 3849 #if OS(DARWIN)
3850 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3850 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3851 #else 3851 #else
3852 return PlatformEvent::AltKey; 3852 return PlatformEvent::AltKey;
3853 #endif 3853 #endif
3854 } 3854 }
3855 3855
3856 } // namespace WebCore 3856 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698