summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/layout/ng/flex/layout_ng_flexible_box.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-29 10:46:47 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-11-02 12:02:10 +0000
commit99677208ff3b216fdfec551fbe548da5520cd6fb (patch)
tree476a4865c10320249360e859d8fdd3e01833b03a /chromium/third_party/blink/renderer/core/layout/ng/flex/layout_ng_flexible_box.cc
parentc30a6232df03e1efbd9f3b226777b07e087a1122 (diff)
downloadqtwebengine-chromium-99677208ff3b216fdfec551fbe548da5520cd6fb.tar.gz
BASELINE: Update Chromium to 86.0.4240.124
Change-Id: Ide0ff151e94cd665ae6521a446995d34a9d1d644 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/layout/ng/flex/layout_ng_flexible_box.cc')
-rw-r--r--chromium/third_party/blink/renderer/core/layout/ng/flex/layout_ng_flexible_box.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/chromium/third_party/blink/renderer/core/layout/ng/flex/layout_ng_flexible_box.cc b/chromium/third_party/blink/renderer/core/layout/ng/flex/layout_ng_flexible_box.cc
index 7ecffbcf6c1..8a185309025 100644
--- a/chromium/third_party/blink/renderer/core/layout/ng/flex/layout_ng_flexible_box.cc
+++ b/chromium/third_party/blink/renderer/core/layout/ng/flex/layout_ng_flexible_box.cc
@@ -4,6 +4,7 @@
#include "third_party/blink/renderer/core/layout/ng/flex/layout_ng_flexible_box.h"
+#include "third_party/blink/renderer/core/html/forms/html_select_element.h"
#include "third_party/blink/renderer/core/layout/layout_analyzer.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h"
@@ -62,6 +63,19 @@ void MergeAnonymousFlexItems(LayoutObject* remove_child) {
} // namespace
+// See LayoutFlexibleBox::IsChildAllowed().
+bool LayoutNGFlexibleBox::IsChildAllowed(LayoutObject* object,
+ const ComputedStyle& style) const {
+ const auto* select = DynamicTo<HTMLSelectElement>(GetNode());
+ if (UNLIKELY(select && select->UsesMenuList())) {
+ // For a size=1 <select>, we only render the active option label through the
+ // InnerElement. We do not allow adding layout objects for options and
+ // optgroups.
+ return object->GetNode() == &select->InnerElement();
+ }
+ return LayoutNGMixin<LayoutBlock>::IsChildAllowed(object, style);
+}
+
void LayoutNGFlexibleBox::RemoveChild(LayoutObject* child) {
if (!DocumentBeingDestroyed() &&
!StyleRef().IsDeprecatedFlexboxUsingFlexLayout())