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

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: Restore behaviour of middle anonymous blocks inheriting style from inline parents 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 0a4eda2dd57eb310ed1135c0862e548400dc8632..f33c3e2ec468f3682adb8ec08d0678d708cc1408 100644
--- a/third_party/WebKit/Source/core/layout/LayoutInline.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
@@ -343,8 +343,18 @@ void LayoutInline::AddChildIgnoringContinuation(LayoutObject* new_child,
// of this inline. We take all of the children after |beforeChild| and put
// them in a clone of this object.
RefPtr<ComputedStyle> new_style =
- ComputedStyle::CreateAnonymousStyleWithDisplay(
- ContainingBlock()->StyleRef(), EDisplay::kBlock);
+ ComputedStyle::CreateAnonymousStyleWithDisplay(StyleRef(),
+ EDisplay::kBlock);
+ // The anon block we create here doesn't exist in the CSS spec, so
+ // we need to ensure that any blocks it contains inherit properly
+ // from its true parent. This means they 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.
+ new_style->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
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win/virtual/sharedarraybuffer/fast/css/child-style-can-override-visited-style-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698