| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2009 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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 // children of shadow host. | 534 // children of shadow host. |
| 535 // e.g. "foo",0 in <progress>foo</progress> | 535 // e.g. "foo",0 in <progress>foo</progress> |
| 536 if (anchor->isShadowRoot()) | 536 if (anchor->isShadowRoot()) |
| 537 return PositionInFlatTree(anchor->ownerShadowHost(), | 537 return PositionInFlatTree(anchor->ownerShadowHost(), |
| 538 PositionAnchorType::AfterChildren); | 538 PositionAnchorType::AfterChildren); |
| 539 return PositionInFlatTree(anchor, PositionAnchorType::AfterChildren); | 539 return PositionInFlatTree(anchor, PositionAnchorType::AfterChildren); |
| 540 } | 540 } |
| 541 | 541 |
| 542 if (anchor->isShadowRoot()) | 542 if (anchor->isShadowRoot()) |
| 543 return PositionInFlatTree(anchor->ownerShadowHost(), pos.anchorType()); | 543 return PositionInFlatTree(anchor->ownerShadowHost(), pos.anchorType()); |
| 544 if (anchor->canParticipateInFlatTree() && |
| 545 !FlatTreeTraversal::parent(*anchor)) { |
| 546 // Since this function is a primitive function, we do not adjust |pos| |
| 547 // to somewhere in flat tree. |
| 548 return PositionInFlatTree(); |
| 549 } |
| 544 // TODO(yosin): Once we have a test case for SLOT or active insertion point, | 550 // TODO(yosin): Once we have a test case for SLOT or active insertion point, |
| 545 // this function should handle it. | 551 // this function should handle it. |
| 546 return PositionInFlatTree(anchor, pos.anchorType()); | 552 return PositionInFlatTree(anchor, pos.anchorType()); |
| 547 } | 553 } |
| 548 | 554 |
| 549 Position toPositionInDOMTree(const Position& position) { | 555 Position toPositionInDOMTree(const Position& position) { |
| 550 return position; | 556 return position; |
| 551 } | 557 } |
| 552 | 558 |
| 553 Position toPositionInDOMTree(const PositionInFlatTree& position) { | 559 Position toPositionInDOMTree(const PositionInFlatTree& position) { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 } | 684 } |
| 679 | 685 |
| 680 void showTree(const blink::Position* pos) { | 686 void showTree(const blink::Position* pos) { |
| 681 if (pos) | 687 if (pos) |
| 682 pos->showTreeForThis(); | 688 pos->showTreeForThis(); |
| 683 else | 689 else |
| 684 LOG(INFO) << "Cannot showTree for <null>"; | 690 LOG(INFO) << "Cannot showTree for <null>"; |
| 685 } | 691 } |
| 686 | 692 |
| 687 #endif | 693 #endif |
| OLD | NEW |