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

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 unit 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
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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1932 sel.showTreeForThis(); 1932 sel.showTreeForThis();
1933 } 1933 }
1934 1934
1935 void showTree(const blink::FrameSelection* sel) 1935 void showTree(const blink::FrameSelection* sel)
1936 { 1936 {
1937 if (sel) 1937 if (sel)
1938 sel->showTreeForThis(); 1938 sel->showTreeForThis();
1939 } 1939 }
1940 1940
1941 #endif 1941 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/editing/FrameSelectionTest.cpp » ('j') | Source/core/editing/FrameSelectionTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698