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

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 2841093002: Algorithm for deciding if a frame's selection should be hidden (Closed)
Patch Set: More robust logic (no need to modify LayoutTests?) and new C++ unit tests 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 1800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1811 #endif 1811 #endif
1812 IntPoint location_in_root_frame; 1812 IntPoint location_in_root_frame;
1813 1813
1814 Element* focused_element = 1814 Element* focused_element =
1815 override_target_element ? override_target_element : doc->FocusedElement(); 1815 override_target_element ? override_target_element : doc->FocusedElement();
1816 FrameSelection& selection = frame_->Selection(); 1816 FrameSelection& selection = frame_->Selection();
1817 Position start = 1817 Position start =
1818 selection.ComputeVisibleSelectionInDOMTreeDeprecated().Start(); 1818 selection.ComputeVisibleSelectionInDOMTreeDeprecated().Start();
1819 VisualViewport& visual_viewport = frame_->GetPage()->GetVisualViewport(); 1819 VisualViewport& visual_viewport = frame_->GetPage()->GetVisualViewport();
1820 1820
1821 if (!override_target_element && start.AnchorNode() && 1821 if (!override_target_element && start.AnchorNode() && !selection.IsHidden() &&
1822 (selection.ComputeVisibleSelectionInDOMTreeDeprecated() 1822 (selection.ComputeVisibleSelectionInDOMTreeDeprecated()
1823 .RootEditableElement() || 1823 .RootEditableElement() ||
1824 selection.ComputeVisibleSelectionInDOMTreeDeprecated().IsRange())) { 1824 selection.ComputeVisibleSelectionInDOMTreeDeprecated().IsRange())) {
1825 // TODO(editing-dev): Use of updateStyleAndLayoutIgnorePendingStylesheets 1825 // TODO(editing-dev): Use of updateStyleAndLayoutIgnorePendingStylesheets
1826 // needs to be audited. See http://crbug.com/590369 for more details. 1826 // needs to be audited. See http://crbug.com/590369 for more details.
1827 doc->UpdateStyleAndLayoutIgnorePendingStylesheets(); 1827 doc->UpdateStyleAndLayoutIgnorePendingStylesheets();
1828 1828
1829 IntRect first_rect = frame_->GetEditor().FirstRectForRange( 1829 IntRect first_rect = frame_->GetEditor().FirstRectForRange(
1830 selection.ComputeVisibleSelectionInDOMTree() 1830 selection.ComputeVisibleSelectionInDOMTree()
1831 .ToNormalizedEphemeralRange()); 1831 .ToNormalizedEphemeralRange());
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
2109 MouseEventWithHitTestResults& mev, 2109 MouseEventWithHitTestResults& mev,
2110 LocalFrame* subframe) { 2110 LocalFrame* subframe) {
2111 WebInputEventResult result = 2111 WebInputEventResult result =
2112 subframe->GetEventHandler().HandleMouseReleaseEvent(mev.Event()); 2112 subframe->GetEventHandler().HandleMouseReleaseEvent(mev.Event());
2113 if (result != WebInputEventResult::kNotHandled) 2113 if (result != WebInputEventResult::kNotHandled)
2114 return result; 2114 return result;
2115 return WebInputEventResult::kHandledSystem; 2115 return WebInputEventResult::kHandledSystem;
2116 } 2116 }
2117 2117
2118 } // namespace blink 2118 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698