Index: third_party/WebKit/Source/core/layout/LayoutFieldset.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutFieldset.cpp b/third_party/WebKit/Source/core/layout/LayoutFieldset.cpp |
index 37750db20c649197de1de4147ee4cba6b0f52656..dd4b46f1b56a985c7a8e63a7da4b7495902cde77 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutFieldset.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutFieldset.cpp |
@@ -135,8 +135,10 @@ LayoutBox* LayoutFieldset::findInFlowLegend() const |
if (legend->isFloatingOrOutOfFlowPositioned()) |
continue; |
- if (isHTMLLegendElement(legend->node())) |
- return toLayoutBox(legend); |
+ if (isHTMLLegendElement(legend->node())) { |
+ if (legend->isBox()) |
+ return toLayoutBox(legend); |
+ } |
} |
return nullptr; |
} |