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

Side by Side Diff: third_party/WebKit/Source/core/editing/VisibleUnits.cpp

Issue 1652853002: Editing: isVisuallyEquivalentCandidate() should return false for Position with Document. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp » ('j') | 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, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
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 2771 matching lines...) Expand 10 before | Expand all | Expand 10 after
2782 return false; 2782 return false;
2783 } 2783 }
2784 2784
2785 if (isDisplayInsideTable(anchorNode) || Strategy::editingIgnoresContent(anch orNode)) { 2785 if (isDisplayInsideTable(anchorNode) || Strategy::editingIgnoresContent(anch orNode)) {
2786 if (!position.atFirstEditingPositionForNode() && !position.atLastEditing PositionForNode()) 2786 if (!position.atFirstEditingPositionForNode() && !position.atLastEditing PositionForNode())
2787 return false; 2787 return false;
2788 const Node* parent = Strategy::parent(*anchorNode); 2788 const Node* parent = Strategy::parent(*anchorNode);
2789 return parent->layoutObject() && parent->layoutObject()->isSelectable(); 2789 return parent->layoutObject() && parent->layoutObject()->isSelectable();
2790 } 2790 }
2791 2791
2792 if (anchorNode->document().documentElement() == anchorNode) 2792 if (anchorNode->document().documentElement() == anchorNode || anchorNode->is DocumentNode())
2793 return false; 2793 return false;
2794 2794
2795 if (!layoutObject->isSelectable()) 2795 if (!layoutObject->isSelectable())
2796 return false; 2796 return false;
2797 2797
2798 if (layoutObject->isLayoutBlockFlow() || layoutObject->isFlexibleBox() || la youtObject->isLayoutGrid()) { 2798 if (layoutObject->isLayoutBlockFlow() || layoutObject->isFlexibleBox() || la youtObject->isLayoutGrid()) {
2799 if (toLayoutBlock(layoutObject)->logicalHeight() || isHTMLBodyElement(*a nchorNode)) { 2799 if (toLayoutBlock(layoutObject)->logicalHeight() || isHTMLBodyElement(*a nchorNode)) {
2800 if (!hasRenderedNonAnonymousDescendantsWithHeight(layoutObject)) 2800 if (!hasRenderedNonAnonymousDescendantsWithHeight(layoutObject))
2801 return position.atFirstEditingPositionForNode(); 2801 return position.atFirstEditingPositionForNode();
2802 return anchorNode->hasEditableStyle() && atEditingBoundary(position) ; 2802 return anchorNode->hasEditableStyle() && atEditingBoundary(position) ;
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
3350 { 3350 {
3351 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); 3351 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule);
3352 } 3352 }
3353 3353
3354 VisiblePositionInComposedTree previousPositionOf(const VisiblePositionInComposed Tree& visiblePosition, EditingBoundaryCrossingRule rule) 3354 VisiblePositionInComposedTree previousPositionOf(const VisiblePositionInComposed Tree& visiblePosition, EditingBoundaryCrossingRule rule)
3355 { 3355 {
3356 return previousPositionOfAlgorithm<EditingInComposedTreeStrategy>(visiblePos ition, rule); 3356 return previousPositionOfAlgorithm<EditingInComposedTreeStrategy>(visiblePos ition, rule);
3357 } 3357 }
3358 3358
3359 } // namespace blink 3359 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698