| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/layout/ng/ng_out_of_flow_layout_part.h" | 5 #include "core/layout/ng/ng_out_of_flow_layout_part.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutTestHelper.h" | 7 #include "core/layout/LayoutTestHelper.h" |
| 8 #include "core/layout/ng/layout_ng_block_flow.h" | 8 #include "core/layout/ng/layout_ng_block_flow.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 // Test the final result. | 73 // Test the final result. |
| 74 Element* fixed_1 = GetDocument().GetElementById("fixed1"); | 74 Element* fixed_1 = GetDocument().GetElementById("fixed1"); |
| 75 Element* fixed_2 = GetDocument().GetElementById("fixed2"); | 75 Element* fixed_2 = GetDocument().GetElementById("fixed2"); |
| 76 // fixed1 top is static: #abs.top + #pad.height | 76 // fixed1 top is static: #abs.top + #pad.height |
| 77 EXPECT_EQ(fixed_1->OffsetTop(), LayoutUnit(99)); | 77 EXPECT_EQ(fixed_1->OffsetTop(), LayoutUnit(99)); |
| 78 // fixed2 top is positioned: #fixed2.top | 78 // fixed2 top is positioned: #fixed2.top |
| 79 EXPECT_EQ(fixed_2->OffsetTop(), LayoutUnit(9)); | 79 EXPECT_EQ(fixed_2->OffsetTop(), LayoutUnit(9)); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 TEST_F(NGOutOfFlowLayoutPartTest, OrthogonalWritingMode1) { | 82 TEST_F(NGOutOfFlowLayoutPartTest, DISABLED_OrthogonalWritingMode1) { |
| 83 SetBodyInnerHTML( | 83 SetBodyInnerHTML( |
| 84 R"HTML( | 84 R"HTML( |
| 85 <style> | 85 <style> |
| 86 #container { | 86 #container { |
| 87 position: relative; | 87 position: relative; |
| 88 writing-mode: horizontal-tb; | 88 writing-mode: horizontal-tb; |
| 89 width: 200px; | 89 width: 200px; |
| 90 height: 400px; | 90 height: 400px; |
| 91 } | 91 } |
| 92 #abs-child { | 92 #abs-child { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 111 RefPtr<const NGPhysicalFragment> fragment = | 111 RefPtr<const NGPhysicalFragment> fragment = |
| 112 node->Layout(space.Get())->PhysicalFragment(); | 112 node->Layout(space.Get())->PhysicalFragment(); |
| 113 EXPECT_EQ(NGPhysicalSize(LayoutUnit(200), LayoutUnit(400)), fragment->Size()); | 113 EXPECT_EQ(NGPhysicalSize(LayoutUnit(200), LayoutUnit(400)), fragment->Size()); |
| 114 | 114 |
| 115 fragment = ToNGPhysicalBoxFragment(fragment.Get())->Children()[0]; | 115 fragment = ToNGPhysicalBoxFragment(fragment.Get())->Children()[0]; |
| 116 EXPECT_EQ(NGPhysicalSize(LayoutUnit(0), LayoutUnit(30)), fragment->Size()); | 116 EXPECT_EQ(NGPhysicalSize(LayoutUnit(0), LayoutUnit(30)), fragment->Size()); |
| 117 EXPECT_EQ(NGPhysicalOffset(LayoutUnit(0), LayoutUnit(10)), | 117 EXPECT_EQ(NGPhysicalOffset(LayoutUnit(0), LayoutUnit(10)), |
| 118 fragment->Offset()); | 118 fragment->Offset()); |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 TEST_F(NGOutOfFlowLayoutPartTest, OrthogonalWritingMode2) { | 121 TEST_F(NGOutOfFlowLayoutPartTest, DISABLED_OrthogonalWritingMode2) { |
| 122 SetBodyInnerHTML( | 122 SetBodyInnerHTML( |
| 123 R"HTML( | 123 R"HTML( |
| 124 <style> | 124 <style> |
| 125 #container { | 125 #container { |
| 126 position: relative; | 126 position: relative; |
| 127 writing-mode: horizontal-tb; | 127 writing-mode: horizontal-tb; |
| 128 width: 200px; | 128 width: 200px; |
| 129 height: 400px; | 129 height: 400px; |
| 130 } | 130 } |
| 131 #abs-child { | 131 #abs-child { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 152 EXPECT_EQ(NGPhysicalSize(LayoutUnit(200), LayoutUnit(400)), fragment->Size()); | 152 EXPECT_EQ(NGPhysicalSize(LayoutUnit(200), LayoutUnit(400)), fragment->Size()); |
| 153 | 153 |
| 154 fragment = ToNGPhysicalBoxFragment(fragment.Get())->Children()[0]; | 154 fragment = ToNGPhysicalBoxFragment(fragment.Get())->Children()[0]; |
| 155 EXPECT_EQ(NGPhysicalSize(LayoutUnit(40), LayoutUnit(30)), fragment->Size()); | 155 EXPECT_EQ(NGPhysicalSize(LayoutUnit(40), LayoutUnit(30)), fragment->Size()); |
| 156 EXPECT_EQ(NGPhysicalOffset(LayoutUnit(0), LayoutUnit(10)), | 156 EXPECT_EQ(NGPhysicalOffset(LayoutUnit(0), LayoutUnit(10)), |
| 157 fragment->Offset()); | 157 fragment->Offset()); |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 } // namespace | 160 } // namespace |
| 161 } // namespace blink | 161 } // namespace blink |
| OLD | NEW |