OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, 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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 // |m_affinity| is |TextAffinity::Upstream|. | 528 // |m_affinity| is |TextAffinity::Upstream|. |
529 m_affinity = TextAffinity::Downstream; | 529 m_affinity = TextAffinity::Downstream; |
530 } | 530 } |
531 } | 531 } |
532 | 532 |
533 template <typename Strategy> | 533 template <typename Strategy> |
534 void VisibleSelectionTemplate< | 534 void VisibleSelectionTemplate< |
535 Strategy>::adjustSelectionToAvoidCrossingShadowBoundaries() { | 535 Strategy>::adjustSelectionToAvoidCrossingShadowBoundaries() { |
536 if (m_base.isNull() || m_start.isNull() || m_base.isNull()) | 536 if (m_base.isNull() || m_start.isNull() || m_base.isNull()) |
537 return; | 537 return; |
538 SelectionAdjuster::adjustSelectionToAvoidCrossingShadowBoundaries(this); | 538 std::pair<AdjustDirection, PositionTemplate<Strategy>> adjustment = |
| 539 adjustmentToAvoidCrossingShadowBoundaries(*this); |
| 540 if (adjustment.first == AdjustDirection::kAdjustNone) |
| 541 return; |
| 542 if (adjustment.first == AdjustDirection::kAdjustStart) |
| 543 m_start = adjustment.second; |
| 544 else |
| 545 m_end = adjustment.second; |
| 546 m_extent = adjustment.second; |
539 } | 547 } |
540 | 548 |
541 static Element* lowestEditableAncestor(Node* node) { | 549 static Element* lowestEditableAncestor(Node* node) { |
542 while (node) { | 550 while (node) { |
543 if (hasEditableStyle(*node)) | 551 if (hasEditableStyle(*node)) |
544 return rootEditableElement(*node); | 552 return rootEditableElement(*node); |
545 if (isHTMLBodyElement(*node)) | 553 if (isHTMLBodyElement(*node)) |
546 break; | 554 break; |
547 node = node->parentNode(); | 555 node = node->parentNode(); |
548 } | 556 } |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 | 808 |
801 void showTree(const blink::VisibleSelectionInFlatTree& sel) { | 809 void showTree(const blink::VisibleSelectionInFlatTree& sel) { |
802 sel.showTreeForThis(); | 810 sel.showTreeForThis(); |
803 } | 811 } |
804 | 812 |
805 void showTree(const blink::VisibleSelectionInFlatTree* sel) { | 813 void showTree(const blink::VisibleSelectionInFlatTree* sel) { |
806 if (sel) | 814 if (sel) |
807 sel->showTreeForThis(); | 815 sel->showTreeForThis(); |
808 } | 816 } |
809 #endif | 817 #endif |
OLD | NEW |