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 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1437 } | 1437 } |
1438 return num; | 1438 return num; |
1439 } | 1439 } |
1440 | 1440 |
1441 void updatePositionForNodeRemoval(Position& position, Node& node) | 1441 void updatePositionForNodeRemoval(Position& position, Node& node) |
1442 { | 1442 { |
1443 if (position.isNull()) | 1443 if (position.isNull()) |
1444 return; | 1444 return; |
1445 switch (position.anchorType()) { | 1445 switch (position.anchorType()) { |
1446 case PositionAnchorType::BeforeChildren: | 1446 case PositionAnchorType::BeforeChildren: |
1447 if (node.containsIncludingShadowDOM(position.computeContainerNode())) | 1447 if (node.isShadowIncludingInclusiveAncestorOf(position.computeContainerN
ode())) |
1448 position = positionInParentBeforeNode(node); | 1448 position = positionInParentBeforeNode(node); |
1449 break; | 1449 break; |
1450 case PositionAnchorType::AfterChildren: | 1450 case PositionAnchorType::AfterChildren: |
1451 if (node.containsIncludingShadowDOM(position.computeContainerNode())) | 1451 if (node.isShadowIncludingInclusiveAncestorOf(position.computeContainerN
ode())) |
1452 position = positionInParentAfterNode(node); | 1452 position = positionInParentAfterNode(node); |
1453 break; | 1453 break; |
1454 case PositionAnchorType::OffsetInAnchor: | 1454 case PositionAnchorType::OffsetInAnchor: |
1455 if (position.computeContainerNode() == node.parentNode() && static_cast<
unsigned>(position.offsetInContainerNode()) > node.nodeIndex()) | 1455 if (position.computeContainerNode() == node.parentNode() && static_cast<
unsigned>(position.offsetInContainerNode()) > node.nodeIndex()) |
1456 position = Position(position.computeContainerNode(), position.offset
InContainerNode() - 1); | 1456 position = Position(position.computeContainerNode(), position.offset
InContainerNode() - 1); |
1457 else if (node.containsIncludingShadowDOM(position.computeContainerNode()
)) | 1457 else if (node.isShadowIncludingInclusiveAncestorOf(position.computeConta
inerNode())) |
1458 position = positionInParentBeforeNode(node); | 1458 position = positionInParentBeforeNode(node); |
1459 break; | 1459 break; |
1460 case PositionAnchorType::AfterAnchor: | 1460 case PositionAnchorType::AfterAnchor: |
1461 if (node.containsIncludingShadowDOM(position.anchorNode())) | 1461 if (node.isShadowIncludingInclusiveAncestorOf(position.anchorNode())) |
1462 position = positionInParentAfterNode(node); | 1462 position = positionInParentAfterNode(node); |
1463 break; | 1463 break; |
1464 case PositionAnchorType::BeforeAnchor: | 1464 case PositionAnchorType::BeforeAnchor: |
1465 if (node.containsIncludingShadowDOM(position.anchorNode())) | 1465 if (node.isShadowIncludingInclusiveAncestorOf(position.anchorNode())) |
1466 position = positionInParentBeforeNode(node); | 1466 position = positionInParentBeforeNode(node); |
1467 break; | 1467 break; |
1468 } | 1468 } |
1469 } | 1469 } |
1470 | 1470 |
1471 bool isMailHTMLBlockquoteElement(const Node* node) | 1471 bool isMailHTMLBlockquoteElement(const Node* node) |
1472 { | 1472 { |
1473 if (!node || !node->isHTMLElement()) | 1473 if (!node || !node->isHTMLElement()) |
1474 return false; | 1474 return false; |
1475 | 1475 |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1700 // instead of possibly at the end of the last node before the selection | 1700 // instead of possibly at the end of the last node before the selection |
1701 return mostForwardCaretPosition(visiblePosition.deepEquivalent()); | 1701 return mostForwardCaretPosition(visiblePosition.deepEquivalent()); |
1702 } | 1702 } |
1703 | 1703 |
1704 bool isTextSecurityNode(const Node* node) | 1704 bool isTextSecurityNode(const Node* node) |
1705 { | 1705 { |
1706 return node && node->layoutObject() && node->layoutObject()->style()->textSe
curity() != TSNONE; | 1706 return node && node->layoutObject() && node->layoutObject()->style()->textSe
curity() != TSNONE; |
1707 } | 1707 } |
1708 | 1708 |
1709 } // namespace blink | 1709 } // namespace blink |
OLD | NEW |