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

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

Issue 2206793004: Revert of Add grid/flex layout support for <fieldset> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/LayoutBlockFlow.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
index 91086f2643cf0d1d1f12a1ec13fe4ede9a028760..7148dcf83b9c7158784d0508ce8366d8c2697208 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -1143,6 +1143,9 @@
BlockChildrenLayoutInfo layoutInfo(this, beforeEdge, afterEdge);
MarginInfo& marginInfo = layoutInfo.marginInfo();
+ // Fieldsets need to find their legend and position it inside the border of the object.
+ // The legend then gets skipped during normal layout. The same is true for ruby text.
+ // It doesn't get included in the normal layout process but is instead skipped.
LayoutObject* childToExclude = layoutSpecialExcludedChild(relayoutChildren, layoutScope);
LayoutBox* next = firstChildBox();
@@ -1155,7 +1158,7 @@
child->setMayNeedPaintInvalidation();
if (childToExclude == child)
- continue; // Skip this child, since it will be positioned by the specialized subclass (ruby runs).
+ continue; // Skip this child, since it will be positioned by the specialized subclass (fieldsets and ruby runs).
updateBlockChildDirtyBitsBeforeLayout(relayoutChildren, *child);
@@ -2394,7 +2397,7 @@
// that isn't sufficient for us, and can only cause trouble at this point.
LayoutBox::addChild(newChild, beforeChild);
- if (madeBoxesNonInline && parent() && isAnonymousBlock() && parent()->isLayoutBlock() && !parent()->createsAnonymousWrapper()) {
+ if (madeBoxesNonInline && parent() && isAnonymousBlock() && parent()->isLayoutBlock()) {
toLayoutBlock(parent())->removeLeftoverAnonymousBlock(this);
// |this| may be dead now.
}
@@ -3520,6 +3523,11 @@
if (isRuby())
return;
+ // Fieldsets look for a legend special child (layoutSpecialExcludedChild()). We currently only
+ // support one special child per layout object, and the flow thread would make for a second one.
+ if (isFieldset())
+ return;
+
// Form controls are replaced content, and are therefore not supposed to support multicol.
if (isFileUploadControl() || isTextControl() || isListBox())
return;
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutFieldset.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698