Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1131)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.h

Issue 2650583003: Fix ::first-letter not to apply non-block containers (Closed)
Patch Set: Fix ListItem, add test Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutObject.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.h b/third_party/WebKit/Source/core/layout/LayoutObject.h
index ae8d7805bd1f4b4606a4cebc8aae601315f7f79e..cef8ef1a279f3757243cf20cc8e294f15cd80a5c 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -889,10 +889,13 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
// first-line, first-letter and text-overflow.
// The flex box and grid specs require that flex box and grid do not
// support first-line|first-letter, though.
+ // When LayoutObject and display do not agree, allow first-line|first-letter
+ // only when both indicate it's a block container.
// TODO(cbiesinger): Remove when buttons are implemented with align-items
// instead of flex box. crbug.com/226252.
bool behavesLikeBlockContainer() const {
- return isLayoutBlockFlow() || isLayoutButton();
+ return (isLayoutBlockFlow() && style()->isDisplayBlockContainer()) ||
+ isLayoutButton();
}
// May be optionally passed to container() and various other similar methods

Powered by Google App Engine
This is Rietveld 408576698