forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LayoutNG] Check first-line anonymous more correctly
When |LayoutBlockFlow| adds a child, it assumed all anonymous |LayoutInline|s are anoymous wrappers for ::first-line, but there are two other usage of anonymous |LayoutInline|. This patch checks if it is really an anonymous |LayoutInline| for ::first-line. Bug: 962275 Change-Id: Ibbde37297e4636e4f0c51f0ed8249e3166639d76 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1610657 Reviewed-by: Aleks Totic <atotic@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#659369}
- Loading branch information
Showing
9 changed files
with
79 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
third_party/blink/renderer/core/layout/ng/list/layout_ng_list_item_test.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2019 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "third_party/blink/renderer/core/layout/ng/ng_base_layout_algorithm_test.h" | ||
|
||
#include "third_party/blink/renderer/core/dom/dom_token_list.h" | ||
#include "third_party/blink/renderer/core/layout/ng/list/layout_ng_list_item.h" | ||
|
||
namespace blink { | ||
|
||
class LayoutNGListItemTest : public NGLayoutTest {}; | ||
|
||
namespace { | ||
|
||
TEST_F(LayoutNGListItemTest, InsideWithFirstLine) { | ||
SetBodyInnerHTML(R"HTML( | ||
<!DOCTYPE html> | ||
<style> | ||
li { | ||
list-style-position: inside; | ||
} | ||
.after::first-line { | ||
background: yellow; | ||
} | ||
</style> | ||
<div id=container> | ||
<ul> | ||
<li id=item>test</li> | ||
</ul> | ||
</div> | ||
)HTML"); | ||
|
||
Element* container = GetElementById("container"); | ||
container->classList().Add("after"); | ||
GetDocument().UpdateStyleAndLayoutTree(); | ||
|
||
// The list-item should have a marker. | ||
LayoutNGListItem* list_item = | ||
ToLayoutNGListItem(GetLayoutObjectByElementId("item")); | ||
LayoutObject* marker = list_item->Marker(); | ||
EXPECT_TRUE(marker); | ||
// The marker should have only 1 child. | ||
LayoutObject* marker_child = marker->SlowFirstChild(); | ||
EXPECT_TRUE(marker_child); | ||
EXPECT_FALSE(marker_child->NextSibling()); | ||
} | ||
|
||
} // namespace | ||
} // namespace blink |