OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_block_node.h" | 5 #include "core/layout/ng/ng_block_node.h" |
6 | 6 |
7 #include "core/layout/LayoutBlockFlow.h" | 7 #include "core/layout/LayoutBlockFlow.h" |
8 #include "core/layout/api/LineLayoutAPIShim.h" | 8 #include "core/layout/api/LineLayoutAPIShim.h" |
9 #include "core/layout/line/InlineIterator.h" | 9 #include "core/layout/line/InlineIterator.h" |
10 #include "core/layout/ng/layout_ng_block_flow.h" | 10 #include "core/layout/ng/layout_ng_block_flow.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 if (!layout_box_->isLayoutBlockFlow()) | 230 if (!layout_box_->isLayoutBlockFlow()) |
231 return false; | 231 return false; |
232 if (RuntimeEnabledFeatures::layoutNGInlineEnabled()) | 232 if (RuntimeEnabledFeatures::layoutNGInlineEnabled()) |
233 return true; | 233 return true; |
234 if (HasInlineChildren()) | 234 if (HasInlineChildren()) |
235 return false; | 235 return false; |
236 return true; | 236 return true; |
237 } | 237 } |
238 | 238 |
239 bool NGBlockNode::HasInlineChildren() { | 239 bool NGBlockNode::HasInlineChildren() { |
240 if (!layout_box_) | 240 if (!layout_box_ || !layout_box_->isLayoutBlockFlow()) |
241 return false; | 241 return false; |
242 | 242 |
243 const LayoutBlockFlow* block_flow = toLayoutBlockFlow(layout_box_); | 243 const LayoutBlockFlow* block_flow = toLayoutBlockFlow(layout_box_); |
| 244 if (!block_flow->childrenInline()) |
| 245 return false; |
244 LayoutObject* child = block_flow->firstChild(); | 246 LayoutObject* child = block_flow->firstChild(); |
245 while (child) { | 247 while (child) { |
246 if (child->isInline()) | 248 if (child->isInline()) |
247 return true; | 249 return true; |
248 child = child->nextSibling(); | 250 child = child->nextSibling(); |
249 } | 251 } |
250 | 252 |
251 return false; | 253 return false; |
252 } | 254 } |
253 | 255 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 .SetBlockSize(layout_box_->logicalHeight()) | 317 .SetBlockSize(layout_box_->logicalHeight()) |
316 .SetDirection(layout_box_->styleRef().direction()) | 318 .SetDirection(layout_box_->styleRef().direction()) |
317 .SetWritingMode( | 319 .SetWritingMode( |
318 FromPlatformWritingMode(layout_box_->styleRef().getWritingMode())) | 320 FromPlatformWritingMode(layout_box_->styleRef().getWritingMode())) |
319 .SetInlineOverflow(overflow.width()) | 321 .SetInlineOverflow(overflow.width()) |
320 .SetBlockOverflow(overflow.height()); | 322 .SetBlockOverflow(overflow.height()); |
321 return builder.ToFragment(); | 323 return builder.ToFragment(); |
322 } | 324 } |
323 | 325 |
324 } // namespace blink | 326 } // namespace blink |
OLD | NEW |