| OLD | NEW |
| 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 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 Element* enclosingBlock(const Position& position, EditingBoundaryCrossingRule ru
le) | 711 Element* enclosingBlock(const Position& position, EditingBoundaryCrossingRule ru
le) |
| 712 { | 712 { |
| 713 return enclosingBlockAlgorithm<EditingStrategy>(position, rule); | 713 return enclosingBlockAlgorithm<EditingStrategy>(position, rule); |
| 714 } | 714 } |
| 715 | 715 |
| 716 Element* enclosingBlock(const PositionInFlatTree& position, EditingBoundaryCross
ingRule rule) | 716 Element* enclosingBlock(const PositionInFlatTree& position, EditingBoundaryCross
ingRule rule) |
| 717 { | 717 { |
| 718 return enclosingBlockAlgorithm<EditingInFlatTreeStrategy>(position, rule); | 718 return enclosingBlockAlgorithm<EditingInFlatTreeStrategy>(position, rule); |
| 719 } | 719 } |
| 720 | 720 |
| 721 Element* enclosingBlockFlowElement(Node& node) | 721 Element* enclosingBlockFlowElement(const Node& node) |
| 722 { | 722 { |
| 723 if (isBlockFlowElement(node)) | 723 if (isBlockFlowElement(node)) |
| 724 return &toElement(node); | 724 return const_cast<Element*>(&toElement(node)); |
| 725 | 725 |
| 726 for (Node* n = node.parentNode(); n; n = n->parentNode()) { | 726 for (Node* n = node.parentNode(); n; n = n->parentNode()) { |
| 727 if (isBlockFlowElement(*n) || isHTMLBodyElement(*n)) | 727 if (isBlockFlowElement(*n) || isHTMLBodyElement(*n)) |
| 728 return toElement(n); | 728 return toElement(n); |
| 729 } | 729 } |
| 730 return 0; | 730 return nullptr; |
| 731 } | 731 } |
| 732 | 732 |
| 733 bool inSameContainingBlockFlowElement(Node* a, Node* b) | 733 bool inSameContainingBlockFlowElement(Node* a, Node* b) |
| 734 { | 734 { |
| 735 return a && b && enclosingBlockFlowElement(*a) == enclosingBlockFlowElement(
*b); | 735 return a && b && enclosingBlockFlowElement(*a) == enclosingBlockFlowElement(
*b); |
| 736 } | 736 } |
| 737 | 737 |
| 738 bool nodeIsUserSelectAll(const Node* node) | 738 bool nodeIsUserSelectAll(const Node* node) |
| 739 { | 739 { |
| 740 return RuntimeEnabledFeatures::userSelectAllEnabled() && node && node->layou
tObject() && node->layoutObject()->style()->userSelect() == SELECT_ALL; | 740 return RuntimeEnabledFeatures::userSelectAllEnabled() && node && node->layou
tObject() && node->layoutObject()->style()->userSelect() == SELECT_ALL; |
| (...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1677 // instead of possibly at the end of the last node before the selection | 1677 // instead of possibly at the end of the last node before the selection |
| 1678 return mostForwardCaretPosition(visiblePosition.deepEquivalent()); | 1678 return mostForwardCaretPosition(visiblePosition.deepEquivalent()); |
| 1679 } | 1679 } |
| 1680 | 1680 |
| 1681 bool isTextSecurityNode(const Node* node) | 1681 bool isTextSecurityNode(const Node* node) |
| 1682 { | 1682 { |
| 1683 return node && node->layoutObject() && node->layoutObject()->style()->textSe
curity() != TSNONE; | 1683 return node && node->layoutObject() && node->layoutObject()->style()->textSe
curity() != TSNONE; |
| 1684 } | 1684 } |
| 1685 | 1685 |
| 1686 } // namespace blink | 1686 } // namespace blink |
| OLD | NEW |