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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2784243002: Get rid of computeVisibleSelectionInDOMTreeDeprecated() from WebViewImpl::selectionBounds() (Closed)
Patch Set: 2017-03-30T16:04:49 Created 3 years, 8 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 | 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2326 matching lines...) Expand 10 before | Expand all | Expand 10 after
2337 // well. This code needs to be refactored (http://crbug.com/629721). 2337 // well. This code needs to be refactored (http://crbug.com/629721).
2338 bool WebViewImpl::selectionBounds(WebRect& anchor, WebRect& focus) const { 2338 bool WebViewImpl::selectionBounds(WebRect& anchor, WebRect& focus) const {
2339 const Frame* frame = focusedCoreFrame(); 2339 const Frame* frame = focusedCoreFrame();
2340 if (!frame || !frame->isLocalFrame()) 2340 if (!frame || !frame->isLocalFrame())
2341 return false; 2341 return false;
2342 2342
2343 const LocalFrame* localFrame = toLocalFrame(frame); 2343 const LocalFrame* localFrame = toLocalFrame(frame);
2344 if (!localFrame) 2344 if (!localFrame)
2345 return false; 2345 return false;
2346 FrameSelection& selection = localFrame->selection(); 2346 FrameSelection& selection = localFrame->selection();
2347 if (!selection.isAvailable() || 2347 if (!selection.isAvailable() || selection.selectionInDOMTree().isNone())
2348 selection.computeVisibleSelectionInDOMTreeDeprecated().isNone()) { 2348 return false;
2349
2350 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
2351 // needs to be audited. See http://crbug.com/590369 for more details.
2352 localFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
2353 if (selection.computeVisibleSelectionInDOMTree().isNone()) {
2349 // plugins/mouse-capture-inside-shadow.html reaches here. 2354 // plugins/mouse-capture-inside-shadow.html reaches here.
2350 return false; 2355 return false;
2351 } 2356 }
2352 2357
2353 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
2354 // needs to be audited. See http://crbug.com/590369 for more details.
2355 localFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
2356
2357 DocumentLifecycle::DisallowTransitionScope disallowTransition( 2358 DocumentLifecycle::DisallowTransitionScope disallowTransition(
2358 localFrame->document()->lifecycle()); 2359 localFrame->document()->lifecycle());
2359 2360
2360 if (selection.computeVisibleSelectionInDOMTreeDeprecated().isCaret()) { 2361 if (selection.computeVisibleSelectionInDOMTreeDeprecated().isCaret()) {
2361 anchor = focus = selection.absoluteCaretBounds(); 2362 anchor = focus = selection.absoluteCaretBounds();
2362 } else { 2363 } else {
2363 const EphemeralRange selectedRange = 2364 const EphemeralRange selectedRange =
2364 selection.computeVisibleSelectionInDOMTreeDeprecated() 2365 selection.computeVisibleSelectionInDOMTreeDeprecated()
2365 .toNormalizedEphemeralRange(); 2366 .toNormalizedEphemeralRange();
2366 if (selectedRange.isNull()) 2367 if (selectedRange.isNull())
(...skipping 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after
4177 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4178 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4178 return nullptr; 4179 return nullptr;
4179 return focusedFrame; 4180 return focusedFrame;
4180 } 4181 }
4181 4182
4182 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4183 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4183 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4184 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4184 } 4185 }
4185 4186
4186 } // namespace blink 4187 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698