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

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

Issue 2272793002: Make WebViewImpl::textInputInfo update layout before working on ranges. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed. Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebViewTest.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) 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 2420 matching lines...) Expand 10 before | Expand all | Expand 10 after
2431 info.inputMode = inputModeOfFocusedElement(); 2431 info.inputMode = inputModeOfFocusedElement();
2432 2432
2433 info.type = textInputType(); 2433 info.type = textInputType();
2434 info.flags = textInputFlags(); 2434 info.flags = textInputFlags();
2435 if (info.type == WebTextInputTypeNone) 2435 if (info.type == WebTextInputTypeNone)
2436 return info; 2436 return info;
2437 2437
2438 if (!focused->editor().canEdit()) 2438 if (!focused->editor().canEdit())
2439 return info; 2439 return info;
2440 2440
2441 // TODO(dglazkov): The use of updateStyleAndLayoutIgnorePendingStylesheets n eeds to be audited.
2442 // see http://crbug.com/590369 for more details.
2443 focused->document()->updateStyleAndLayoutIgnorePendingStylesheets();
2444
2445 DocumentLifecycle::DisallowTransitionScope(focused->document()->lifecycle()) ;
Xiaocheng 2016/08/30 15:18:24 Pass-by: I think we need to have a named scope her
2446
2441 // Emits an object replacement character for each replaced element so that 2447 // Emits an object replacement character for each replaced element so that
2442 // it is exposed to IME and thus could be deleted by IME on android. 2448 // it is exposed to IME and thus could be deleted by IME on android.
2443 info.value = plainText(EphemeralRange::rangeOfContents(*element), TextIterat orEmitsObjectReplacementCharacter); 2449 info.value = plainText(EphemeralRange::rangeOfContents(*element), TextIterat orEmitsObjectReplacementCharacter);
2444 2450
2445 if (info.value.isEmpty()) 2451 if (info.value.isEmpty())
2446 return info; 2452 return info;
2447 2453
2448 EphemeralRange firstRange = firstEphemeralRangeOf(selection.selection()); 2454 EphemeralRange firstRange = firstEphemeralRangeOf(selection.selection());
2449 if (firstRange.isNotNull()) { 2455 if (firstRange.isNotNull()) {
2450 PlainTextRange plainTextRange(PlainTextRange::create(*element, firstRang e)); 2456 PlainTextRange plainTextRange(PlainTextRange::create(*element, firstRang e));
(...skipping 2149 matching lines...) Expand 10 before | Expand all | Expand 10 after
4600 return nullptr; 4606 return nullptr;
4601 return focusedFrame; 4607 return focusedFrame;
4602 } 4608 }
4603 4609
4604 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const 4610 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const
4605 { 4611 {
4606 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4612 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4607 } 4613 }
4608 4614
4609 } // namespace blink 4615 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698