Commit 05c0c8a8 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Make LayoutSelectionTest.FirstLetterClearSeletion simpler

This patch makes |LayoutSelectionTest.FirstLetterClearSeletion| simpler for
improving code health.

Change-Id: I316057bc63acb597cc2a2575a9416ae8b0eaf927
Reviewed-on: https://chromium-review.googlesource.com/702195
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarYoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506978}
parent aabe1570
...@@ -305,15 +305,8 @@ TEST_F(LayoutSelectionTest, FirstLetter) { ...@@ -305,15 +305,8 @@ TEST_F(LayoutSelectionTest, FirstLetter) {
} }
TEST_F(LayoutSelectionTest, FirstLetterClearSeletion) { TEST_F(LayoutSelectionTest, FirstLetterClearSeletion) {
SetBodyContent( InsertStyleElement("div::first-letter { color: red; }");
"<style>div::first-letter { color: red; }</style>" Selection().SetSelection(SetSelectionTextToBody("fo^o<div>bar</div>b|az"));
"foo<div>bar</div>baz");
Node* foo = GetDocument().body()->firstChild()->nextSibling();
// <div>fo^o</div><div>bar</div>b|az
Selection().SetSelection(
SelectionInDOMTree::Builder()
.SetBaseAndExtent({foo, 2}, {foo->nextSibling()->nextSibling(), 1})
.Build());
Selection().CommitAppearanceIfNeeded(); Selection().CommitAppearanceIfNeeded();
TEST_NEXT(IsLayoutBlock, kStartAndEnd, ShouldInvalidate); TEST_NEXT(IsLayoutBlock, kStartAndEnd, ShouldInvalidate);
TEST_NEXT(IsLayoutBlock, kStart, ShouldInvalidate); TEST_NEXT(IsLayoutBlock, kStart, ShouldInvalidate);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment