| 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/serializers/StyledMarkupSerializer.h" | 5 #include "core/editing/serializers/StyledMarkupSerializer.h" |
| 6 | 6 |
| 7 #include "core/dom/Text.h" | 7 #include "core/dom/Text.h" |
| 8 #include "core/editing/EditingTestBase.h" | 8 #include "core/editing/EditingTestBase.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 } | 277 } |
| 278 | 278 |
| 279 TEST_F(StyledMarkupSerializerTest, AcrossInvisibleElements) { | 279 TEST_F(StyledMarkupSerializerTest, AcrossInvisibleElements) { |
| 280 const char* body_content = | 280 const char* body_content = |
| 281 "<span id='span1' style='display: none'>11</span><span id='span2' " | 281 "<span id='span1' style='display: none'>11</span><span id='span2' " |
| 282 "style='display: none'>22</span>"; | 282 "style='display: none'>22</span>"; |
| 283 SetBodyContent(body_content); | 283 SetBodyContent(body_content); |
| 284 Element* span1 = GetDocument().getElementById("span1"); | 284 Element* span1 = GetDocument().getElementById("span1"); |
| 285 Element* span2 = GetDocument().getElementById("span2"); | 285 Element* span2 = GetDocument().getElementById("span2"); |
| 286 Position start_dom = Position::FirstPositionInNode(*span1); | 286 Position start_dom = Position::FirstPositionInNode(*span1); |
| 287 Position end_dom = Position::LastPositionInNode(span2); | 287 Position end_dom = Position::LastPositionInNode(*span2); |
| 288 EXPECT_EQ("", SerializePart<EditingStrategy>(start_dom, end_dom)); | 288 EXPECT_EQ("", SerializePart<EditingStrategy>(start_dom, end_dom)); |
| 289 PositionInFlatTree start_ict = | 289 PositionInFlatTree start_ict = |
| 290 PositionInFlatTree::FirstPositionInNode(*span1); | 290 PositionInFlatTree::FirstPositionInNode(*span1); |
| 291 PositionInFlatTree end_ict = PositionInFlatTree::LastPositionInNode(span2); | 291 PositionInFlatTree end_ict = PositionInFlatTree::LastPositionInNode(*span2); |
| 292 EXPECT_EQ("", SerializePart<EditingInFlatTreeStrategy>(start_ict, end_ict)); | 292 EXPECT_EQ("", SerializePart<EditingInFlatTreeStrategy>(start_ict, end_ict)); |
| 293 } | 293 } |
| 294 | 294 |
| 295 } // namespace blink | 295 } // namespace blink |
| OLD | NEW |