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

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

Issue 1307523002: Move nodeIsUserSelectAll() out from PositionAlgorithm template class (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-20T14:22:40 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/VisibleUnits.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 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 if ((o->isText() && boundingBoxLogicalHeight(o, toLayoutText(o)->lin esBoundingBox())) 827 if ((o->isText() && boundingBoxLogicalHeight(o, toLayoutText(o)->lin esBoundingBox()))
828 || (o->isBox() && toLayoutBox(o)->pixelSnappedLogicalHeight()) 828 || (o->isBox() && toLayoutBox(o)->pixelSnappedLogicalHeight())
829 || (o->isLayoutInline() && isEmptyInline(LineLayoutItem(o)) && b oundingBoxLogicalHeight(o, toLayoutInline(o)->linesBoundingBox()))) 829 || (o->isLayoutInline() && isEmptyInline(LineLayoutItem(o)) && b oundingBoxLogicalHeight(o, toLayoutInline(o)->linesBoundingBox())))
830 return true; 830 return true;
831 } 831 }
832 } 832 }
833 return false; 833 return false;
834 } 834 }
835 835
836 template <typename Strategy> 836 template <typename Strategy>
837 bool PositionAlgorithm<Strategy>::nodeIsUserSelectAll(const Node* node)
838 {
839 return RuntimeEnabledFeatures::userSelectAllEnabled() && node && node->layou tObject() && node->layoutObject()->style()->userSelect() == SELECT_ALL;
840 }
841
842 template <typename Strategy>
843 Node* PositionAlgorithm<Strategy>::rootUserSelectAllForNode(Node* node) 837 Node* PositionAlgorithm<Strategy>::rootUserSelectAllForNode(Node* node)
844 { 838 {
845 if (!node || !nodeIsUserSelectAll(node)) 839 if (!node || !nodeIsUserSelectAll(node))
846 return 0; 840 return 0;
847 Node* parent = Strategy::parent(*node); 841 Node* parent = Strategy::parent(*node);
848 if (!parent) 842 if (!parent)
849 return node; 843 return node;
850 844
851 Node* candidateRoot = node; 845 Node* candidateRoot = node;
852 while (parent) { 846 while (parent) {
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 1354
1361 void showTree(const blink::Position* pos) 1355 void showTree(const blink::Position* pos)
1362 { 1356 {
1363 if (pos) 1357 if (pos)
1364 pos->showTreeForThis(); 1358 pos->showTreeForThis();
1365 else 1359 else
1366 fprintf(stderr, "Cannot showTree for (nil)\n"); 1360 fprintf(stderr, "Cannot showTree for (nil)\n");
1367 } 1361 }
1368 1362
1369 #endif 1363 #endif
OLDNEW
« no previous file with comments | « Source/core/editing/Position.h ('k') | Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698