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

Side by Side Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 LocalFrame* focused = focusedLocalFrameAvailableForIme(); 582 LocalFrame* focused = focusedLocalFrameAvailableForIme();
583 if (!focused) 583 if (!focused)
584 return WebRange(); 584 return WebRange();
585 585
586 const EphemeralRange range = focused->inputMethodController().compositionEph emeralRange(); 586 const EphemeralRange range = focused->inputMethodController().compositionEph emeralRange();
587 if (range.isNull()) 587 if (range.isNull())
588 return WebRange(); 588 return WebRange();
589 589
590 Element* editable = focused->selection().rootEditableElementOrDocumentElemen t(); 590 Element* editable = focused->selection().rootEditableElementOrDocumentElemen t();
591 DCHECK(editable); 591 DCHECK(editable);
592
593 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
594 // needs to be audited. See http://crbug.com/590369 for more details.
595 editable->document().updateStyleAndLayoutIgnorePendingStylesheets();
596
592 return PlainTextRange::create(*editable, range); 597 return PlainTextRange::create(*editable, range);
593 } 598 }
594 599
595 WebTextInputInfo WebFrameWidgetImpl::textInputInfo() 600 WebTextInputInfo WebFrameWidgetImpl::textInputInfo()
596 { 601 {
597 WebTextInputInfo info; 602 WebTextInputInfo info;
598 603
599 LocalFrame* focused = focusedLocalFrameInWidget(); 604 LocalFrame* focused = focusedLocalFrameInWidget();
600 if (!focused) 605 if (!focused)
601 return info; 606 return info;
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 return frame->selection().selection().isBaseFirst(); 785 return frame->selection().selection().isBaseFirst();
781 return false; 786 return false;
782 } 787 }
783 788
784 WebRange WebFrameWidgetImpl::caretOrSelectionRange() 789 WebRange WebFrameWidgetImpl::caretOrSelectionRange()
785 { 790 {
786 LocalFrame* focused = focusedLocalFrameInWidget(); 791 LocalFrame* focused = focusedLocalFrameInWidget();
787 if (!focused) 792 if (!focused)
788 return WebRange(); 793 return WebRange();
789 794
795 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
796 // needs to be audited. See http://crbug.com/590369 for more details.
797 focused->document()->updateStyleAndLayoutIgnorePendingStylesheets();
798
790 return focused->inputMethodController().getSelectionOffsets(); 799 return focused->inputMethodController().getSelectionOffsets();
791 } 800 }
792 801
793 void WebFrameWidgetImpl::setTextDirection(WebTextDirection direction) 802 void WebFrameWidgetImpl::setTextDirection(WebTextDirection direction)
794 { 803 {
795 // The Editor::setBaseWritingDirection() function checks if we can change 804 // The Editor::setBaseWritingDirection() function checks if we can change
796 // the text direction of the selected node and updates its DOM "dir" 805 // the text direction of the selected node and updates its DOM "dir"
797 // attribute and its CSS "direction" property. 806 // attribute and its CSS "direction" property.
798 // So, we just call the function as Safari does. 807 // So, we just call the function as Safari does.
799 const LocalFrame* focused = focusedLocalFrameInWidget(); 808 const LocalFrame* focused = focusedLocalFrameInWidget();
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 } 1458 }
1450 1459
1451 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const 1460 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const
1452 { 1461 {
1453 if (!m_imeAcceptEvents) 1462 if (!m_imeAcceptEvents)
1454 return nullptr; 1463 return nullptr;
1455 return focusedLocalFrameInWidget(); 1464 return focusedLocalFrameInWidget();
1456 } 1465 }
1457 1466
1458 } // namespace blink 1467 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/PlainTextRange.cpp ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698