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

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

Issue 2312663002: Audit the use of updateStyleAndLayoutIgnorePendingStylesheets in PlainTextRange::create (Closed)
Patch Set: 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 | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | 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 2389 matching lines...) Expand 10 before | Expand all | Expand 10 after
2400 LocalFrame* focused = focusedLocalFrameAvailableForIme(); 2400 LocalFrame* focused = focusedLocalFrameAvailableForIme();
2401 if (!focused) 2401 if (!focused)
2402 return WebRange(); 2402 return WebRange();
2403 2403
2404 const EphemeralRange range = focused->inputMethodController().compositionEph emeralRange(); 2404 const EphemeralRange range = focused->inputMethodController().compositionEph emeralRange();
2405 if (range.isNull()) 2405 if (range.isNull())
2406 return WebRange(); 2406 return WebRange();
2407 2407
2408 Element* editable = focused->selection().rootEditableElementOrDocumentElemen t(); 2408 Element* editable = focused->selection().rootEditableElementOrDocumentElemen t();
2409 DCHECK(editable); 2409 DCHECK(editable);
2410
2411 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
2412 // needs to be audited. See http://crbug.com/590369 for more details.
2413 editable->document().updateStyleAndLayoutIgnorePendingStylesheets();
2414
2410 return PlainTextRange::create(*editable, range); 2415 return PlainTextRange::create(*editable, range);
2411 } 2416 }
2412 2417
2413 WebTextInputInfo WebViewImpl::textInputInfo() 2418 WebTextInputInfo WebViewImpl::textInputInfo()
2414 { 2419 {
2415 WebTextInputInfo info; 2420 WebTextInputInfo info;
2416 2421
2417 LocalFrame* focused = focusedLocalFrameInWidget(); 2422 LocalFrame* focused = focusedLocalFrameInWidget();
2418 if (!focused) 2423 if (!focused)
2419 return info; 2424 return info;
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
2715 { 2720 {
2716 return m_pagePopup.get(); 2721 return m_pagePopup.get();
2717 } 2722 }
2718 2723
2719 WebRange WebViewImpl::caretOrSelectionRange() 2724 WebRange WebViewImpl::caretOrSelectionRange()
2720 { 2725 {
2721 const LocalFrame* focused = focusedLocalFrameInWidget(); 2726 const LocalFrame* focused = focusedLocalFrameInWidget();
2722 if (!focused) 2727 if (!focused)
2723 return WebRange(); 2728 return WebRange();
2724 2729
2730 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
2731 // needs to be audited. See http://crbug.com/590369 for more details.
2732 focused->document()->updateStyleAndLayoutIgnorePendingStylesheets();
2733
2725 return focused->inputMethodController().getSelectionOffsets(); 2734 return focused->inputMethodController().getSelectionOffsets();
2726 } 2735 }
2727 2736
2728 void WebViewImpl::setTextDirection(WebTextDirection direction) 2737 void WebViewImpl::setTextDirection(WebTextDirection direction)
2729 { 2738 {
2730 // The Editor::setBaseWritingDirection() function checks if we can change 2739 // The Editor::setBaseWritingDirection() function checks if we can change
2731 // the text direction of the selected node and updates its DOM "dir" 2740 // the text direction of the selected node and updates its DOM "dir"
2732 // attribute and its CSS "direction" property. 2741 // attribute and its CSS "direction" property.
2733 // So, we just call the function as Safari does. 2742 // So, we just call the function as Safari does.
2734 const LocalFrame* focused = focusedLocalFrameInWidget(); 2743 const LocalFrame* focused = focusedLocalFrameInWidget();
(...skipping 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after
4602 return nullptr; 4611 return nullptr;
4603 return focusedFrame; 4612 return focusedFrame;
4604 } 4613 }
4605 4614
4606 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const 4615 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const
4607 { 4616 {
4608 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4617 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4609 } 4618 }
4610 4619
4611 } // namespace blink 4620 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698