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

Side by Side Diff: Source/core/editing/FrameSelection.cpp

Issue 234463003: Avoid using cross RenderView selection rendering (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2014-04-14T01:01:05 Created 6 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 | « LayoutTests/editing/undo/crash-redo-with-iframes-expected.txt ('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) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 Position endPos = selection.end(); 1579 Position endPos = selection.end();
1580 candidate = endPos.upstream(); 1580 candidate = endPos.upstream();
1581 if (candidate.isCandidate()) 1581 if (candidate.isCandidate())
1582 endPos = candidate; 1582 endPos = candidate;
1583 1583
1584 // We can get into a state where the selection endpoints map to the same Vis iblePosition when a selection is deleted 1584 // We can get into a state where the selection endpoints map to the same Vis iblePosition when a selection is deleted
1585 // because we don't yet notify the FrameSelection of text removal. 1585 // because we don't yet notify the FrameSelection of text removal.
1586 if (startPos.isNotNull() && endPos.isNotNull() && selection.visibleStart() ! = selection.visibleEnd()) { 1586 if (startPos.isNotNull() && endPos.isNotNull() && selection.visibleStart() ! = selection.visibleEnd()) {
1587 RenderObject* startRenderer = startPos.deprecatedNode()->renderer(); 1587 RenderObject* startRenderer = startPos.deprecatedNode()->renderer();
1588 RenderObject* endRenderer = endPos.deprecatedNode()->renderer(); 1588 RenderObject* endRenderer = endPos.deprecatedNode()->renderer();
1589 view->setSelection(startRenderer, startPos.deprecatedEditingOffset(), en dRenderer, endPos.deprecatedEditingOffset()); 1589 if (startRenderer->view() == view && endRenderer->view() == view)
Yuta Kitamura 2014/04/14 06:23:40 This line would probably deserve some comments bec
yosin_UTC9 2014/04/14 08:03:56 Done.
1590 view->setSelection(startRenderer, startPos.deprecatedEditingOffset() , endRenderer, endPos.deprecatedEditingOffset());
1590 } 1591 }
1591 } 1592 }
1592 1593
1593 void FrameSelection::setCaretVisibility(CaretVisibility visibility) 1594 void FrameSelection::setCaretVisibility(CaretVisibility visibility)
1594 { 1595 {
1595 if (caretVisibility() == visibility) 1596 if (caretVisibility() == visibility)
1596 return; 1597 return;
1597 1598
1598 m_frame->document()->updateLayoutIgnorePendingStylesheets(); 1599 m_frame->document()->updateLayoutIgnorePendingStylesheets();
1599 if (m_caretPaint) { 1600 if (m_caretPaint) {
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
1876 sel.showTreeForThis(); 1877 sel.showTreeForThis();
1877 } 1878 }
1878 1879
1879 void showTree(const WebCore::FrameSelection* sel) 1880 void showTree(const WebCore::FrameSelection* sel)
1880 { 1881 {
1881 if (sel) 1882 if (sel)
1882 sel->showTreeForThis(); 1883 sel->showTreeForThis();
1883 } 1884 }
1884 1885
1885 #endif 1886 #endif
OLDNEW
« no previous file with comments | « LayoutTests/editing/undo/crash-redo-with-iframes-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698