| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/editing/VisibleUnits.h" | 5 #include "core/editing/VisibleUnits.h" |
| 6 | 6 |
| 7 #include <ostream> // NOLINT |
| 7 #include "core/dom/Text.h" | 8 #include "core/dom/Text.h" |
| 8 #include "core/editing/EditingTestBase.h" | 9 #include "core/editing/EditingTestBase.h" |
| 9 #include "core/editing/VisiblePosition.h" | 10 #include "core/editing/VisiblePosition.h" |
| 10 #include "core/html/TextControlElement.h" | 11 #include "core/html/TextControlElement.h" |
| 11 #include "core/layout/LayoutTextFragment.h" | 12 #include "core/layout/LayoutTextFragment.h" |
| 12 #include "core/layout/line/InlineTextBox.h" | 13 #include "core/layout/line/InlineTextBox.h" |
| 13 #include <ostream> // NOLINT | |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 PositionWithAffinity positionWithAffinityInDOMTree( | 19 PositionWithAffinity positionWithAffinityInDOMTree( |
| 20 Node& anchor, | 20 Node& anchor, |
| 21 int offset, | 21 int offset, |
| 22 TextAffinity affinity = TextAffinity::Downstream) { | 22 TextAffinity affinity = TextAffinity::Downstream) { |
| 23 return PositionWithAffinity(canonicalPositionOf(Position(&anchor, offset)), | 23 return PositionWithAffinity(canonicalPositionOf(Position(&anchor, offset)), |
| (...skipping 1977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2001 TEST_F(VisibleUnitsTest, localSelectionRectOfPositionTemplateNotCrash) { | 2001 TEST_F(VisibleUnitsTest, localSelectionRectOfPositionTemplateNotCrash) { |
| 2002 setBodyContent("<div>foo<img></div>"); | 2002 setBodyContent("<div>foo<img></div>"); |
| 2003 | 2003 |
| 2004 Node* node = document().querySelector("img"); | 2004 Node* node = document().querySelector("img"); |
| 2005 IntRect rect = absoluteSelectionBoundsOf(VisiblePosition::create( | 2005 IntRect rect = absoluteSelectionBoundsOf(VisiblePosition::create( |
| 2006 PositionWithAffinity(Position(node, PositionAnchorType::AfterChildren)))); | 2006 PositionWithAffinity(Position(node, PositionAnchorType::AfterChildren)))); |
| 2007 EXPECT_FALSE(rect.isEmpty()); | 2007 EXPECT_FALSE(rect.isEmpty()); |
| 2008 } | 2008 } |
| 2009 | 2009 |
| 2010 } // namespace blink | 2010 } // namespace blink |
| OLD | NEW |