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

Side by Side Diff: Source/core/editing/EditingUtilities.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/EditingUtilities.h ('k') | Source/core/editing/Position.h » ('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 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007 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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 return toElement(n); 538 return toElement(n);
539 } 539 }
540 return 0; 540 return 0;
541 } 541 }
542 542
543 bool inSameContainingBlockFlowElement(Node* a, Node* b) 543 bool inSameContainingBlockFlowElement(Node* a, Node* b)
544 { 544 {
545 return a && b && enclosingBlockFlowElement(*a) == enclosingBlockFlowElement( *b); 545 return a && b && enclosingBlockFlowElement(*a) == enclosingBlockFlowElement( *b);
546 } 546 }
547 547
548 bool nodeIsUserSelectAll(const Node* node)
549 {
550 return RuntimeEnabledFeatures::userSelectAllEnabled() && node && node->layou tObject() && node->layoutObject()->style()->userSelect() == SELECT_ALL;
551
552 }
553
548 bool nodeIsUserSelectNone(Node* node) 554 bool nodeIsUserSelectNone(Node* node)
549 { 555 {
550 return node && node->layoutObject() && !node->layoutObject()->isSelectable() ; 556 return node && node->layoutObject() && !node->layoutObject()->isSelectable() ;
551 } 557 }
552 558
553 TextDirection directionOfEnclosingBlock(const Position& position) 559 TextDirection directionOfEnclosingBlock(const Position& position)
554 { 560 {
555 Element* enclosingBlockElement = enclosingBlock(position.computeContainerNod e()); 561 Element* enclosingBlockElement = enclosingBlock(position.computeContainerNod e());
556 if (!enclosingBlockElement) 562 if (!enclosingBlockElement)
557 return LTR; 563 return LTR;
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 // if the selection starts just before a paragraph break, skip over it 1445 // if the selection starts just before a paragraph break, skip over it
1440 if (isEndOfParagraph(visiblePosition)) 1446 if (isEndOfParagraph(visiblePosition))
1441 return visiblePosition.next().deepEquivalent().downstream(); 1447 return visiblePosition.next().deepEquivalent().downstream();
1442 1448
1443 // otherwise, make sure to be at the start of the first selected node, 1449 // otherwise, make sure to be at the start of the first selected node,
1444 // instead of possibly at the end of the last node before the selection 1450 // instead of possibly at the end of the last node before the selection
1445 return visiblePosition.deepEquivalent().downstream(); 1451 return visiblePosition.deepEquivalent().downstream();
1446 } 1452 }
1447 1453
1448 } // namespace blink 1454 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/EditingUtilities.h ('k') | Source/core/editing/Position.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698