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

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

Issue 610323003: Editing: Null-check in FrameSelection::updteAppearancea (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add a layout test Created 6 years, 2 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/selection/deleteFromDocument-crash-expected.html ('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 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 Position endPos = selection.end(); 1595 Position endPos = selection.end();
1596 candidate = endPos.upstream(); 1596 candidate = endPos.upstream();
1597 if (candidate.isCandidate()) 1597 if (candidate.isCandidate())
1598 endPos = candidate; 1598 endPos = candidate;
1599 1599
1600 // We can get into a state where the selection endpoints map to the same Vis iblePosition when a selection is deleted 1600 // We can get into a state where the selection endpoints map to the same Vis iblePosition when a selection is deleted
1601 // because we don't yet notify the FrameSelection of text removal. 1601 // because we don't yet notify the FrameSelection of text removal.
1602 if (startPos.isNotNull() && endPos.isNotNull() && selection.visibleStart() ! = selection.visibleEnd()) { 1602 if (startPos.isNotNull() && endPos.isNotNull() && selection.visibleStart() ! = selection.visibleEnd()) {
1603 RenderObject* startRenderer = startPos.deprecatedNode()->renderer(); 1603 RenderObject* startRenderer = startPos.deprecatedNode()->renderer();
1604 RenderObject* endRenderer = endPos.deprecatedNode()->renderer(); 1604 RenderObject* endRenderer = endPos.deprecatedNode()->renderer();
1605 if (startRenderer->view() == view && endRenderer->view() == view) 1605 if (startRenderer && endRenderer && startRenderer->view() == view && end Renderer->view() == view)
1606 view->setSelection(startRenderer, startPos.deprecatedEditingOffset() , endRenderer, endPos.deprecatedEditingOffset()); 1606 view->setSelection(startRenderer, startPos.deprecatedEditingOffset() , endRenderer, endPos.deprecatedEditingOffset());
1607 } 1607 }
1608 } 1608 }
1609 1609
1610 void FrameSelection::setCaretVisibility(CaretVisibility visibility) 1610 void FrameSelection::setCaretVisibility(CaretVisibility visibility)
1611 { 1611 {
1612 if (caretVisibility() == visibility) 1612 if (caretVisibility() == visibility)
1613 return; 1613 return;
1614 1614
1615 CaretBase::setCaretVisibility(visibility); 1615 CaretBase::setCaretVisibility(visibility);
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1940 sel.showTreeForThis(); 1940 sel.showTreeForThis();
1941 } 1941 }
1942 1942
1943 void showTree(const blink::FrameSelection* sel) 1943 void showTree(const blink::FrameSelection* sel)
1944 { 1944 {
1945 if (sel) 1945 if (sel)
1946 sel->showTreeForThis(); 1946 sel->showTreeForThis();
1947 } 1947 }
1948 1948
1949 #endif 1949 #endif
OLDNEW
« no previous file with comments | « LayoutTests/editing/selection/deleteFromDocument-crash-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698