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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 nodeIsUserSelectNone(Node* node) |
| 549 { |
| 550 return node && node->layoutObject() && !node->layoutObject()->isSelectable()
; |
| 551 } |
| 552 |
548 TextDirection directionOfEnclosingBlock(const Position& position) | 553 TextDirection directionOfEnclosingBlock(const Position& position) |
549 { | 554 { |
550 Element* enclosingBlockElement = enclosingBlock(position.computeContainerNod
e()); | 555 Element* enclosingBlockElement = enclosingBlock(position.computeContainerNod
e()); |
551 if (!enclosingBlockElement) | 556 if (!enclosingBlockElement) |
552 return LTR; | 557 return LTR; |
553 LayoutObject* layoutObject = enclosingBlockElement->layoutObject(); | 558 LayoutObject* layoutObject = enclosingBlockElement->layoutObject(); |
554 return layoutObject ? layoutObject->style()->direction() : LTR; | 559 return layoutObject ? layoutObject->style()->direction() : LTR; |
555 } | 560 } |
556 | 561 |
557 TextDirection primaryDirectionOf(const Node& node) | 562 TextDirection primaryDirectionOf(const Node& node) |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1434 // if the selection starts just before a paragraph break, skip over it | 1439 // if the selection starts just before a paragraph break, skip over it |
1435 if (isEndOfParagraph(visiblePosition)) | 1440 if (isEndOfParagraph(visiblePosition)) |
1436 return visiblePosition.next().deepEquivalent().downstream(); | 1441 return visiblePosition.next().deepEquivalent().downstream(); |
1437 | 1442 |
1438 // otherwise, make sure to be at the start of the first selected node, | 1443 // otherwise, make sure to be at the start of the first selected node, |
1439 // instead of possibly at the end of the last node before the selection | 1444 // instead of possibly at the end of the last node before the selection |
1440 return visiblePosition.deepEquivalent().downstream(); | 1445 return visiblePosition.deepEquivalent().downstream(); |
1441 } | 1446 } |
1442 | 1447 |
1443 } // namespace blink | 1448 } // namespace blink |
OLD | NEW |