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

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

Issue 1301933002: Move a static member function nodeIsUserSelectNone() out from PositionAlgorithm template class (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-19T18:58:27 Move to EditingUtilities.{cpp,h} Created 5 years, 4 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 | « Source/core/editing/Position.h ('k') | Source/core/editing/SelectionController.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, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2009 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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 if ((o->isText() && boundingBoxLogicalHeight(o, toLayoutText(o)->lin esBoundingBox())) 813 if ((o->isText() && boundingBoxLogicalHeight(o, toLayoutText(o)->lin esBoundingBox()))
814 || (o->isBox() && toLayoutBox(o)->pixelSnappedLogicalHeight()) 814 || (o->isBox() && toLayoutBox(o)->pixelSnappedLogicalHeight())
815 || (o->isLayoutInline() && isEmptyInline(LineLayoutItem(o)) && b oundingBoxLogicalHeight(o, toLayoutInline(o)->linesBoundingBox()))) 815 || (o->isLayoutInline() && isEmptyInline(LineLayoutItem(o)) && b oundingBoxLogicalHeight(o, toLayoutInline(o)->linesBoundingBox())))
816 return true; 816 return true;
817 } 817 }
818 } 818 }
819 return false; 819 return false;
820 } 820 }
821 821
822 template <typename Strategy> 822 template <typename Strategy>
823 bool PositionAlgorithm<Strategy>::nodeIsUserSelectNone(Node* node)
824 {
825 return node && node->layoutObject() && !node->layoutObject()->isSelectable() ;
826 }
827
828 template <typename Strategy>
829 bool PositionAlgorithm<Strategy>::nodeIsUserSelectAll(const Node* node) 823 bool PositionAlgorithm<Strategy>::nodeIsUserSelectAll(const Node* node)
830 { 824 {
831 return RuntimeEnabledFeatures::userSelectAllEnabled() && node && node->layou tObject() && node->layoutObject()->style()->userSelect() == SELECT_ALL; 825 return RuntimeEnabledFeatures::userSelectAllEnabled() && node && node->layou tObject() && node->layoutObject()->style()->userSelect() == SELECT_ALL;
832 } 826 }
833 827
834 template <typename Strategy> 828 template <typename Strategy>
835 Node* PositionAlgorithm<Strategy>::rootUserSelectAllForNode(Node* node) 829 Node* PositionAlgorithm<Strategy>::rootUserSelectAllForNode(Node* node)
836 { 830 {
837 if (!node || !nodeIsUserSelectAll(node)) 831 if (!node || !nodeIsUserSelectAll(node))
838 return 0; 832 return 0;
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
1352 1346
1353 void showTree(const blink::Position* pos) 1347 void showTree(const blink::Position* pos)
1354 { 1348 {
1355 if (pos) 1349 if (pos)
1356 pos->showTreeForThis(); 1350 pos->showTreeForThis();
1357 else 1351 else
1358 fprintf(stderr, "Cannot showTree for (nil)\n"); 1352 fprintf(stderr, "Cannot showTree for (nil)\n");
1359 } 1353 }
1360 1354
1361 #endif 1355 #endif
OLDNEW
« no previous file with comments | « Source/core/editing/Position.h ('k') | Source/core/editing/SelectionController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698