summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/layout/layout_block_test.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-05-16 09:59:13 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-05-20 10:28:53 +0000
commit6c11fb357ec39bf087b8b632e2b1e375aef1b38b (patch)
treec8315530db18a8ee566521c39ab8a6af4f72bc03 /chromium/third_party/blink/renderer/core/layout/layout_block_test.cc
parent3ffaed019d0772e59d6cdb2d0d32fe4834c31f72 (diff)
downloadqtwebengine-chromium-6c11fb357ec39bf087b8b632e2b1e375aef1b38b.tar.gz
BASELINE: Update Chromium to 74.0.3729.159
Change-Id: I8d2497da544c275415aedd94dd25328d555de811 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/layout/layout_block_test.cc')
-rw-r--r--chromium/third_party/blink/renderer/core/layout/layout_block_test.cc30
1 files changed, 28 insertions, 2 deletions
diff --git a/chromium/third_party/blink/renderer/core/layout/layout_block_test.cc b/chromium/third_party/blink/renderer/core/layout/layout_block_test.cc
index d4e73a8d192..093e8a67b93 100644
--- a/chromium/third_party/blink/renderer/core/layout/layout_block_test.cc
+++ b/chromium/third_party/blink/renderer/core/layout/layout_block_test.cc
@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "build/build_config.h"
+
#include "third_party/blink/renderer/core/dom/element_traversal.h"
#include "third_party/blink/renderer/core/layout/layout_block.h"
-
#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/layout/layout_block_flow.h"
@@ -20,7 +21,8 @@ class LayoutBlockTest : public RenderingTest {};
TEST_F(LayoutBlockTest, LayoutNameCalledWithNullStyle) {
scoped_refptr<ComputedStyle> style = ComputedStyle::Create();
LayoutObject* obj = LayoutBlockFlow::CreateAnonymous(&GetDocument(), style);
- obj->SetStyleInternal(nullptr);
+ obj->SetModifiedStyleOutsideStyleRecalc(nullptr,
+ LayoutObject::ApplyStyleChanges::kNo);
EXPECT_FALSE(obj->Style());
EXPECT_THAT(obj->DecoratedName().Ascii().data(),
MatchesRegex("LayoutN?G?BlockFlow \\(anonymous\\)"));
@@ -71,4 +73,28 @@ TEST_F(LayoutBlockTest, OverflowWithTransformAndPerspective) {
EXPECT_EQ(119.5, scroller->LayoutOverflowRect().Width().ToFloat());
}
+TEST_F(LayoutBlockTest, NestedInlineVisualOverflow) {
+ // Only exercises legacy code.
+ if (RuntimeEnabledFeatures::LayoutNGEnabled())
+ return;
+ SetBodyInnerHTML(R"HTML(
+ <label style="font-size: 0px">
+ <input type="radio" style="margin-left: -15px">
+ </label>
+ )HTML");
+ LayoutBlockFlow* body =
+ ToLayoutBlockFlow(GetDocument().body()->GetLayoutObject());
+ RootInlineBox* box = body->FirstRootBox();
+#if defined(OS_MACOSX)
+ EXPECT_EQ(LayoutRect(-17, 0, 16, 19),
+ box->VisualOverflowRect(box->LineTop(), box->LineBottom()));
+#elif defined(OS_ANDROID)
+ EXPECT_EQ(LayoutRect(-15, 3, 19, 16),
+ box->VisualOverflowRect(box->LineTop(), box->LineBottom()));
+#else
+ EXPECT_EQ(LayoutRect(-15, 3, 16, 13),
+ box->VisualOverflowRect(box->LineTop(), box->LineBottom()));
+#endif
+}
+
} // namespace blink