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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutInline.cpp

Issue 2806123002: Restore behaviour of middle anonymous blocks inheriting style from inline parents (Closed)
Patch Set: bug 706324 Created 3 years, 8 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/LayoutInline.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutInline.cpp b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
index 466e6b5bbd3e52f5a22e787fadb6575b4718c77a..13d0fceaf90a4ff2b580c5ab307ef775510de536 100644
--- a/third_party/WebKit/Source/core/layout/LayoutInline.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
@@ -346,8 +346,16 @@ void LayoutInline::addChildIgnoringContinuation(LayoutObject* newChild,
// of this inline. We take all of the children after |beforeChild| and put
// them in a clone of this object.
RefPtr<ComputedStyle> newStyle =
- ComputedStyle::createAnonymousStyleWithDisplay(
- containingBlock()->styleRef(), EDisplay::kBlock);
+ ComputedStyle::createAnonymousStyleWithDisplay(styleRef(),
+ EDisplay::kBlock);
+ // Block elements in the anon block must use the direction set by the
+ // anon block's containing block, so we need to prevent the anon block
+ // from inheriting direction from the inline. If there are any other
+ // inheritable properties that apply to block and inline elements
+ // but only affect the layout of children we will want to special-case
+ // them here too. Writing-mode would be one if it didn't create a
+ // formatting context of its own, removing the need for continuations.
mstensho (USE GERRIT) 2017/04/19 09:32:48 Great comment. Could you also add that this anonym
+ newStyle->setDirection(containingBlock()->styleRef().direction());
// If inside an inline affected by in-flow positioning the block needs to be
// affected by it too. Giving the block a layer like this allows it to

Powered by Google App Engine
This is Rietveld 408576698