haikuwebkit/Source/WebCore/rendering/OrderIterator.h

81 lines
2.5 KiB
C
Raw Permalink Normal View History

[CSS Grid Layout] Add support for order inside grid items https://bugs.webkit.org/show_bug.cgi?id=123208 Reviewed by Antti Koivisto. Source/WebCore: Based on Blink r153457 and r153536 by <jchaffraix@chromium.org> Added support for sorting grid items by using -webkit-order property. Used OrderIterator to implement it so it had to be moved out of RenderFlexibleBox to be shared with RenderGrid. Tests: fast/css-grid-layout/grid-item-order-auto-flow-resolution.html fast/css-grid-layout/grid-item-order-paint-order.html * CMakeLists.txt: Added new file. * GNUmakefile.list.am: Ditto. * WebCore.vcxproj/WebCore.vcxproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * rendering/OrderIterator.cpp: Added. Ripped out of RenderFlexibleBox. (WebCore::OrderIterator::OrderIterator): (WebCore::OrderIterator::setOrderValues): Use std::move semantics. (WebCore::OrderIterator::first): Use an integer as iterator. (WebCore::OrderIterator::next): Ditto. (WebCore::OrderIterator::reset): Ditto. * rendering/OrderIterator.h: Added. (WebCore::OrderIterator::currentChild): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::RenderFlexibleBox): (WebCore::RenderFlexibleBox::layoutBlock): * rendering/RenderFlexibleBox.h: * rendering/RenderGrid.cpp: (WebCore::RenderGrid::RenderGrid): (WebCore::RenderGrid::placeItemsOnGrid): (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): (WebCore::RenderGrid::paintChildren): * rendering/RenderGrid.h: LayoutTests: From Blink r153536 by <jchaffraix@chromium.org> Added a couple of tests to verify that we respect the specified order of grid items both in the auto-placement algorithm and in the final painting. * fast/css-grid-layout/grid-item-order-auto-flow-resolution-expected.txt: Added. * fast/css-grid-layout/grid-item-order-auto-flow-resolution.html: Added. * fast/css-grid-layout/grid-item-order-paint-order-expected.html: Added. * fast/css-grid-layout/grid-item-order-paint-order.html: Added. Canonical link: https://commits.webkit.org/141517@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-28 17:35:52 +00:00
/*
* Copyright (C) 2011 Google Inc. All rights reserved.
* Copyright (C) 2013 Igalia S.L. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
[CSS Grid Layout] Add support for order inside grid items https://bugs.webkit.org/show_bug.cgi?id=123208 Reviewed by Antti Koivisto. Source/WebCore: Based on Blink r153457 and r153536 by <jchaffraix@chromium.org> Added support for sorting grid items by using -webkit-order property. Used OrderIterator to implement it so it had to be moved out of RenderFlexibleBox to be shared with RenderGrid. Tests: fast/css-grid-layout/grid-item-order-auto-flow-resolution.html fast/css-grid-layout/grid-item-order-paint-order.html * CMakeLists.txt: Added new file. * GNUmakefile.list.am: Ditto. * WebCore.vcxproj/WebCore.vcxproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * rendering/OrderIterator.cpp: Added. Ripped out of RenderFlexibleBox. (WebCore::OrderIterator::OrderIterator): (WebCore::OrderIterator::setOrderValues): Use std::move semantics. (WebCore::OrderIterator::first): Use an integer as iterator. (WebCore::OrderIterator::next): Ditto. (WebCore::OrderIterator::reset): Ditto. * rendering/OrderIterator.h: Added. (WebCore::OrderIterator::currentChild): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::RenderFlexibleBox): (WebCore::RenderFlexibleBox::layoutBlock): * rendering/RenderFlexibleBox.h: * rendering/RenderGrid.cpp: (WebCore::RenderGrid::RenderGrid): (WebCore::RenderGrid::placeItemsOnGrid): (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): (WebCore::RenderGrid::paintChildren): * rendering/RenderGrid.h: LayoutTests: From Blink r153536 by <jchaffraix@chromium.org> Added a couple of tests to verify that we respect the specified order of grid items both in the auto-placement algorithm and in the final painting. * fast/css-grid-layout/grid-item-order-auto-flow-resolution-expected.txt: Added. * fast/css-grid-layout/grid-item-order-auto-flow-resolution.html: Added. * fast/css-grid-layout/grid-item-order-paint-order-expected.html: Added. * fast/css-grid-layout/grid-item-order-paint-order.html: Added. Canonical link: https://commits.webkit.org/141517@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-28 17:35:52 +00:00
[WTF] Add standard containers with FastAllocator specialization https://bugs.webkit.org/show_bug.cgi?id=183789 Reviewed by Darin Adler. Source/JavaScriptCore: * b3/air/testair.cpp: * b3/testb3.cpp: (JSC::B3::testDoubleLiteralComparison): (JSC::B3::testFloatEqualOrUnorderedFoldingNaN): * dfg/DFGGraph.h: * dfg/DFGIntegerCheckCombiningPhase.cpp: * dfg/DFGObjectAllocationSinkingPhase.cpp: * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::switchStringSlow): * runtime/FunctionHasExecutedCache.h: * runtime/TypeLocationCache.h: Source/WebCore: * Modules/indexeddb/IDBKeyData.h: * Modules/mediasource/SampleMap.h: * Modules/mediasource/SourceBuffer.cpp: * Modules/webauthn/cbor/CBORValue.h: It did not use FastAllocator for its container. * page/WheelEventTestTrigger.h: * platform/audio/PlatformMediaSessionManager.h: * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h: * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: * platform/graphics/cv/VideoTextureCopierCV.cpp: (WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction): * platform/mock/mediasource/MockSourceBufferPrivate.cpp: * platform/wpe/PlatformPasteboardWPE.cpp: * rendering/OrderIterator.h: Source/WTF: Sometimes we want standard containers due to various reasons. For example, WTF::HashMap lacks the ability to hold all the integer keys since it uses 0 for empty value and -1 for deleted value. However, using std::containers use std::allocator without specialization. This patch introduces WTF::{StdMap, StdSet, StdList, StdUnorderedMap, StdUnorderedSet}. They are standard containers with FastAllocator specialization. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/StdList.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h. * wtf/StdMap.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h. * wtf/StdSet.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h. * wtf/StdUnorderedMap.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h. * wtf/StdUnorderedSet.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h. Canonical link: https://commits.webkit.org/199528@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-23 12:34:08 +00:00
#include <wtf/StdSet.h>
[CSS Grid Layout] Add support for order inside grid items https://bugs.webkit.org/show_bug.cgi?id=123208 Reviewed by Antti Koivisto. Source/WebCore: Based on Blink r153457 and r153536 by <jchaffraix@chromium.org> Added support for sorting grid items by using -webkit-order property. Used OrderIterator to implement it so it had to be moved out of RenderFlexibleBox to be shared with RenderGrid. Tests: fast/css-grid-layout/grid-item-order-auto-flow-resolution.html fast/css-grid-layout/grid-item-order-paint-order.html * CMakeLists.txt: Added new file. * GNUmakefile.list.am: Ditto. * WebCore.vcxproj/WebCore.vcxproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * rendering/OrderIterator.cpp: Added. Ripped out of RenderFlexibleBox. (WebCore::OrderIterator::OrderIterator): (WebCore::OrderIterator::setOrderValues): Use std::move semantics. (WebCore::OrderIterator::first): Use an integer as iterator. (WebCore::OrderIterator::next): Ditto. (WebCore::OrderIterator::reset): Ditto. * rendering/OrderIterator.h: Added. (WebCore::OrderIterator::currentChild): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::RenderFlexibleBox): (WebCore::RenderFlexibleBox::layoutBlock): * rendering/RenderFlexibleBox.h: * rendering/RenderGrid.cpp: (WebCore::RenderGrid::RenderGrid): (WebCore::RenderGrid::placeItemsOnGrid): (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): (WebCore::RenderGrid::paintChildren): * rendering/RenderGrid.h: LayoutTests: From Blink r153536 by <jchaffraix@chromium.org> Added a couple of tests to verify that we respect the specified order of grid items both in the auto-placement algorithm and in the final painting. * fast/css-grid-layout/grid-item-order-auto-flow-resolution-expected.txt: Added. * fast/css-grid-layout/grid-item-order-auto-flow-resolution.html: Added. * fast/css-grid-layout/grid-item-order-paint-order-expected.html: Added. * fast/css-grid-layout/grid-item-order-paint-order.html: Added. Canonical link: https://commits.webkit.org/141517@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-28 17:35:52 +00:00
namespace WebCore {
class RenderBox;
Enable fieldsets to be flexboxes, grids and multicolumn. https://bugs.webkit.org/show_bug.cgi?id=169082 Source/WebCore: Reviewed by Simon Fraser . Added new tests in fast/forms/fieldset. This patch eliminates RenderFieldset and moves the functionality into RenderBlock so that derived classes can also be fieldsets. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: Remove RenderFieldset from the project. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::titleUIElement): Call in to RenderBlock now instead of RenderFieldset. * html/HTMLFieldSetElement.cpp: (WebCore::HTMLFieldSetElement::createElementRenderer): * html/HTMLFieldSetElement.h: The fieldset DOM element now uses RenderElement::createFor to make renderers so that multiple display types can be supported. A special flag has been added that indicates only to make flexbox and block-related renderers (not table display types). * rendering/OrderIterator.cpp: (WebCore::OrderIterator::shouldSkipChild): (WebCore::OrderIteratorPopulator::collectChild): * rendering/OrderIterator.h: Streamline child collection for flexboxes and grids to indicate whether the child should be skipped as a return value from collectChild. Add a shouldSkipChild method that skips both out of flow positioned objects and excluded children like the legends of fieldsets. * rendering/RenderBlock.cpp: (WebCore::RenderBlockRareData::RenderBlockRareData): When the legend is taller than the fieldset's borderBefore(), intrinsic border is added to the CSS border width. This intrinsic border being factored in ensures that the padding and content boxes of fieldsets are correct across any layout system, since the legend is now just treated as part of the border. (WebCore::RenderBlock::computePreferredLogicalWidths): (WebCore::RenderBlock::computeBlockPreferredLogicalWidths): Call the new computePreferredWidthsForExcludedChildren to ensure that excluded children contribute to preferred width in their own way and not as part of a specific layout system. (WebCore::RenderBlock::renderName): Hacked to still return RenderFieldSet for RenderBlockFlow-backed fieldsets for layout test compatibility. (WebCore::RenderBlock::layoutExcludedChildren): Renamed from layoutSpecialExcludedChild to more accurately reflect the fact that multiple excluded children can be included here (e.g., both a multicolumn flow thread and a legend). The RenderBlock base class handles the layout of legends by both placing them and setting the correct intrinsic border before amount on the block. (WebCore::RenderBlock::findFieldsetLegend): Moved from RenderFieldset. (WebCore::RenderBlock::adjustBorderBoxRectForPainting): (WebCore::RenderBlock::paintRectToClipOutFromBorder): These methods are used when painting to shrink the border box as needed to account for the legend and to provide the portion of the border that needs to be clipped out. These methods have been enhanced to properly support all writing modes. (WebCore::RenderBlock::intrinsicBorderForFieldset): (WebCore::RenderBlock::setIntrinsicBorderForFieldset): (WebCore::RenderBlock::borderTop): (WebCore::RenderBlock::borderLeft): (WebCore::RenderBlock::borderBottom): (WebCore::RenderBlock::borderRight): (WebCore::RenderBlock::borderBefore): These methods are overridden for border to ensure that the intrinsic border added by a tall legend is properly factored in. (WebCore::RenderBlock::computePreferredWidthsForExcludedChildren): * rendering/RenderBlock.h: This method computes the preferred widths for legend children in order to ensure that the legend properly grows the width of the fieldset when it is the widest item. (WebCore::RenderBlock::adjustBorderBoxLogicalHeightForBoxSizing): (WebCore::RenderBlock::adjustContentBoxLogicalHeightForBoxSizing): Preserve the behavior of fieldsets in that the available content size includes the space lost accounting for the legend. I don't think this makes much sense, but it matches the behavior of other browsers (and our old behavior). (WebCore::RenderBlock::paintExcludedChildrenInBorder): Method for painting the excluded children that might be present in our border. We only do this if the paint phase is a box decoration painting phase and if the legend isn't self-painting. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::willCreateColumns): Allow fieldsets to create columns now. (WebCore::RenderBlockFlow::layoutBlockChildren): (WebCore::RenderBlockFlow::layoutExcludedChildren): Renamed this method and change it to call the base class to ensure that legends in multicolumn fieldsets get handled properly. (WebCore::RenderBlockFlow::addChild): Patched to make sure legends don't get put into the multicolumn flow thread, as they need to remain outside of it. (WebCore::RenderBlockFlow::layoutSpecialExcludedChild): Deleted. Renamed to layoutExcludedChildren. * rendering/RenderBlockFlow.h: * rendering/RenderBox.cpp: (WebCore::RenderBox::paintBoxDecorations): (WebCore::RenderBox::paintMask): Patched to call the new adjustBorderBoxRectForPainting and paintRectToClipOutFromBorder methods in order to properly shrink the border box rect for painting and to clip out the portion of the border covered by the legend. (WebCore::RenderBox::avoidsFloats): Add fieldsets as avoiding floats. RenderFieldset used to subclass this method to return true, but with its removal, we need to put this in the base class along with legends. * rendering/RenderBox.h: (WebCore::RenderBox::isGridItem): (WebCore::RenderBox::isFlexItem): Patched to exclude legends so that they don't try to size like they are really in the grid or flexbox. (WebCore::RenderBox::adjustBorderBoxRectForPainting): This method is overridden by RenderBLock to handle adjusting fieldset border rects for painting. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintBorder): * rendering/RenderBoxModelObject.h: (WebCore::RenderBoxModelObject::paintRectToClipOutFromBorder): Patched to properly paint fieldsets using the new helpers. * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::FlexBoxIterator::next): (WebCore::RenderDeprecatedFlexibleBox::layoutBlock): (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox): Make sure deprecated flexible boxes lay out their legends properly by calling layoutExcludedChildren. * rendering/RenderElement.cpp: (WebCore::RenderElement::createFor): * rendering/RenderElement.h: Patched to take a flag that limits what renderers can be created so that fieldsets don't make table display types. * rendering/RenderFieldset.cpp: Removed. * rendering/RenderFieldset.h: Removed. Remove RenderFieldset files from the tree. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths): (WebCore::RenderFlexibleBox::firstLineBaseline): (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::layoutFlexItems): (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins): Make sure flexible boxes lay out their legends properly by calling layoutExcludedChildren. Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't part of the flexible box layout. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutBlock): (WebCore::RenderGrid::computeIntrinsicLogicalWidths): (WebCore::RenderGrid::placeItemsOnGrid): (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): (WebCore::RenderGrid::layoutGridItems): Make sure grids lay out their legends properly by calling layoutExcludedChildren. Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't part of the grid's layout. * rendering/RenderMultiColumnFlowThread.cpp: (WebCore::RenderMultiColumnFlowThread::populate): Pull legends back up into the block and don't let them be part of the flow thread. * rendering/RenderMultiColumnSet.cpp: (WebCore::RenderMultiColumnSet::requiresBalancing): Fix an assert to allow legends to exist as siblings of multicolumn sets. * rendering/RenderObject.cpp: (WebCore::RenderObject::isFieldset): Changed to examine the HTML element rather than RenderFieldset. * rendering/RenderObject.h: (WebCore::RenderObject::isExcludedFromNormalLayout): (WebCore::RenderObject::setIsExcludedFromNormalLayout): (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields): RenderObjects now have a new bit that is set for excluded objects like legends, flow threads, placeholders, and ruby text. This bit lets code easily detect that an object is excluded from the layout system and can be skipped. (WebCore::RenderObject::isExcludedAndPlacedInBorder): Helper method for asking if an object is painting inside the border. Used to know we need to factor it into preferred width calculations outside of any one layout system and also to know that we need to paint it when we paint the fieldset's border instead of later (after we might have scrolled or clipped the child painting area). * rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::layoutExcludedChildren): (WebCore::RenderRubyRun::layoutSpecialExcludedChild): Deleted. * rendering/RenderRubyRun.h: Rename layoutSpecialExcludedChild to layoutExcludedChildren. * rendering/RenderTable.cpp: (WebCore::RenderTable::adjustBorderBoxRectForPainting): (WebCore::RenderTable::paintBoxDecorations): (WebCore::RenderTable::paintMask): (WebCore::RenderTable::subtractCaptionRect): Deleted. * rendering/RenderTable.h: Patched tables to share the same border box rect adjustment used by fieldsets when subtracting out captions. This is prep work to allow tables to be fieldsets, but for now I didn't go all the way. * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::paintBoxDecorations): (WebCore::RenderTableCell::paintMask): Make sure table cells adjust their border box rects for painting. Again this is prep work for cells potentially being fieldsets, but not supported yet. * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::layoutExcludedChildren): (WebCore::RenderTextControl::layoutSpecialExcludedChild): Deleted. * rendering/RenderTextControl.h: * rendering/RenderTextControlMultiLine.cpp: (WebCore::RenderTextControlMultiLine::layoutExcludedChildren): (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild): Deleted. * rendering/RenderTextControlMultiLine.h: Renamed the methods for doing the excluded child layout. * rendering/RenderTreeAsText.cpp: (WebCore::RenderTreeAsText::writeRenderObject): Make sure to dump the original fieldset border and not the border with the extra legend stuff in it. LayoutTests: Reviewed by Simon Fraser. * fast/forms/fieldset/abs-pos-child-sizing-expected.html: Added. * fast/forms/fieldset/abs-pos-child-sizing.html: Added. * fast/forms/fieldset/fieldset-deprecated-flexbox-expected.html: Added. * fast/forms/fieldset/fieldset-deprecated-flexbox.html: Added. * fast/forms/fieldset/fieldset-flexbox-expected.html: Added. * fast/forms/fieldset/fieldset-flexbox.html: Added. * fast/forms/fieldset/fieldset-grid-expected.html: Added. * fast/forms/fieldset/fieldset-grid.html: Added. * fast/forms/fieldset/fieldset-multicolumn-expected.html: Added. * fast/forms/fieldset/fieldset-multicolumn.html: Added. * fast/forms/fieldset/fieldset-overflow-auto-expected.html: Added. * fast/forms/fieldset/fieldset-overflow-auto.html: Added. * fast/forms/fieldset/fieldset-overflow-hidden-expected.html: Added. * fast/forms/fieldset/fieldset-overflow-hidden.html: Added. * fast/forms/fieldset/fieldset-positioned-children-expected.html: Added. * fast/forms/fieldset/fieldset-positioned-children.html: Added. * fast/forms/fieldset/fieldset-positioned-legend-expected.html: Added. * fast/forms/fieldset/fieldset-positioned-legend.html: Added. * fast/forms/fieldset/fieldset-self-painting-legend-expected.html: Added. * fast/forms/fieldset/fieldset-self-painting-legend.html: Added. * fast/forms/fieldset/fieldset-writing-modes-expected.html: Added. * fast/forms/fieldset/fieldset-writing-modes.html: Added. Canonical link: https://commits.webkit.org/186219@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-06 18:00:35 +00:00
class RenderObject;
Update flexbox to Blink's tip of tree https://bugs.webkit.org/show_bug.cgi?id=168657 Reviewed by Zalan Bujtas. Source/WebCore: Added new tests in css3/flexbox. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * rendering/FlexibleBoxAlgorithm.cpp: Added. (WebCore::FlexItem::FlexItem): (WebCore::FlexLayoutAlgorithm::FlexLayoutAlgorithm): (WebCore::FlexLayoutAlgorithm::computeNextFlexLine): * rendering/FlexibleBoxAlgorithm.h: Added. (WebCore::FlexItem::hypotheticalMainAxisMarginBoxSize): (WebCore::FlexItem::flexBaseMarginBoxSize): (WebCore::FlexItem::flexedMarginBoxSize): (WebCore::FlexLayoutAlgorithm::isMultiline): * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize): (WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems): (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild): (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild): (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded): * rendering/GridTrackSizingAlgorithm.h: * rendering/OrderIterator.cpp: (WebCore::OrderIterator::next): (WebCore::OrderIterator::reset): (WebCore::OrderIteratorPopulator::~OrderIteratorPopulator): (WebCore::OrderIteratorPopulator::collectChild): (WebCore::OrderIteratorPopulator::OrderIteratorPopulator): Deleted. (WebCore::OrderIteratorPopulator::removeDuplicatedOrderValues): Deleted. * rendering/OrderIterator.h: (WebCore::OrderIteratorPopulator::OrderIteratorPopulator): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::updateBlockChildDirtyBitsBeforeLayout): (WebCore::RenderBlock::layoutPositionedObject): (WebCore::RenderBlock::computeBlockPreferredLogicalWidths): (WebCore::RenderBlock::computeChildPreferredLogicalWidths): (WebCore::RenderBlock::hasDefiniteLogicalHeight): (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation): * rendering/RenderBlock.h: (WebCore::RenderBlock::hasPercentHeightDescendants): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::isStretchingColumnFlexItem): (WebCore::RenderBox::hasStretchedLogicalWidth): (WebCore::RenderBox::sizesLogicalWidthToFitContent): (WebCore::RenderBox::computeInlineDirectionMargins): (WebCore::RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem): (WebCore::RenderBox::updateLogicalHeight): (WebCore::RenderBox::computeLogicalHeightWithoutLayout): (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation): (WebCore::RenderBox::shouldTreatChildAsReplacedInTableCells): (WebCore::tableCellShouldHaveZeroInitialSize): (WebCore::RenderBox::computePercentageLogicalHeight): (WebCore::RenderBox::computeReplacedLogicalHeightUsing): (WebCore::RenderBox::availableLogicalHeightUsing): (WebCore::RenderBox::percentageLogicalHeightIsResolvable): (WebCore::RenderBox::hasUnsplittableScrollingOverflow): (WebCore::flexItemHasStretchAlignment): Deleted. (WebCore::isStretchingColumnFlexItem): Deleted. (WebCore::logicalWidthIsResolvable): Deleted. (WebCore::RenderBox::hasDefiniteLogicalWidth): Deleted. (WebCore::percentageLogicalHeightIsResolvable): Deleted. (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock): Deleted. (WebCore::RenderBox::hasDefiniteLogicalHeight): Deleted. * rendering/RenderBox.h: (WebCore::RenderBox::isGridItem): (WebCore::RenderBox::isFlexItem): (WebCore::RenderBox::selfAlignmentNormalBehavior): * rendering/RenderBoxModelObject.cpp: (WebCore::isOutOfFlowPositionedWithImplicitHeight): (WebCore::RenderBoxModelObject::containingBlockForAutoHeightDetection): (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight): * rendering/RenderBoxModelObject.h: * rendering/RenderElement.cpp: (WebCore::RenderElement::removeChildInternal): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::LineContext::LineContext): (WebCore::RenderFlexibleBox::RenderFlexibleBox): (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths): (WebCore::contentAlignmentNormalBehavior): (WebCore::RenderFlexibleBox::styleDidChange): (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems): (WebCore::RenderFlexibleBox::clientLogicalBottomAfterRepositioning): (WebCore::RenderFlexibleBox::hasOrthogonalFlow): (WebCore::RenderFlexibleBox::flexBasisForChild): (WebCore::RenderFlexibleBox::crossAxisExtentForChild): (WebCore::RenderFlexibleBox::cachedChildIntrinsicContentLogicalHeight): (WebCore::RenderFlexibleBox::setCachedChildIntrinsicContentLogicalHeight): (WebCore::RenderFlexibleBox::clearCachedChildIntrinsicContentLogicalHeight): (WebCore::RenderFlexibleBox::childIntrinsicLogicalHeight): (WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth): (WebCore::RenderFlexibleBox::crossAxisIntrinsicExtentForChild): (WebCore::RenderFlexibleBox::mainAxisExtentForChild): (WebCore::RenderFlexibleBox::mainAxisContentExtentForChildIncludingScrollbar): (WebCore::RenderFlexibleBox::crossAxisExtent): (WebCore::RenderFlexibleBox::mainAxisExtent): (WebCore::RenderFlexibleBox::mainAxisContentExtent): (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild): (WebCore::RenderFlexibleBox::transformedWritingMode): (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild): (WebCore::RenderFlexibleBox::crossAxisMarginExtentForChild): (WebCore::RenderFlexibleBox::flowAwareLocationForChild): (WebCore::RenderFlexibleBox::useChildAspectRatio): (WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing): (WebCore::RenderFlexibleBox::setFlowAwareLocationForChild): (WebCore::RenderFlexibleBox::mainAxisLengthIsDefinite): (WebCore::RenderFlexibleBox::crossAxisLengthIsDefinite): (WebCore::RenderFlexibleBox::cacheChildMainSize): (WebCore::RenderFlexibleBox::clearCachedMainSizeForChild): (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild): (WebCore::RenderFlexibleBox::layoutFlexItems): (WebCore::RenderFlexibleBox::autoMarginOffsetInMainAxis): (WebCore::RenderFlexibleBox::updateAutoMarginsInMainAxis): (WebCore::RenderFlexibleBox::hasAutoMarginsInCrossAxis): (WebCore::RenderFlexibleBox::availableAlignmentSpaceForChild): (WebCore::RenderFlexibleBox::updateAutoMarginsInCrossAxis): (WebCore::RenderFlexibleBox::marginBoxAscentForChild): (WebCore::RenderFlexibleBox::computeChildMarginValue): (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax): (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution): (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): (WebCore::RenderFlexibleBox::childLogicalHeightForPercentageResolution): (WebCore::RenderFlexibleBox::adjustChildSizeForAspectRatioCrossAxisMinAndMax): (WebCore::RenderFlexibleBox::constructFlexItem): (WebCore::RenderFlexibleBox::freezeViolations): (WebCore::RenderFlexibleBox::freezeInflexibleItems): (WebCore::RenderFlexibleBox::resolveFlexibleLengths): (WebCore::alignmentOffset): (WebCore::RenderFlexibleBox::setOverrideMainAxisContentSizeForChild): (WebCore::RenderFlexibleBox::staticMainAxisPositionForPositionedChild): (WebCore::RenderFlexibleBox::staticCrossAxisPositionForPositionedChild): (WebCore::RenderFlexibleBox::staticInlinePositionForPositionedChild): (WebCore::RenderFlexibleBox::staticBlockPositionForPositionedChild): (WebCore::RenderFlexibleBox::setStaticPositionForPositionedLayout): (WebCore::RenderFlexibleBox::prepareChildForPositionedLayout): (WebCore::RenderFlexibleBox::alignmentForChild): (WebCore::RenderFlexibleBox::resetAutoMarginsAndLogicalTopInCrossAxis): (WebCore::RenderFlexibleBox::needToStretchChildLogicalHeight): (WebCore::RenderFlexibleBox::childHasIntrinsicMainAxisSize): (WebCore::RenderFlexibleBox::crossAxisOverflowForChild): (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): (WebCore::RenderFlexibleBox::layoutColumnReverse): (WebCore::initialAlignContentOffset): (WebCore::alignContentSpaceBetweenChildren): (WebCore::RenderFlexibleBox::alignFlexLines): (WebCore::RenderFlexibleBox::adjustAlignmentForChild): (WebCore::RenderFlexibleBox::alignChildren): (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): (WebCore::RenderFlexibleBox::flipForRightToLeftColumn): (WebCore::RenderFlexibleBox::flipForWrapReverse): (WebCore::RenderFlexibleBox::Violation::Violation): Deleted. (WebCore::RenderFlexibleBox::setCrossAxisExtent): Deleted. (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): Deleted. (WebCore::RenderFlexibleBox::mainAxisBorderAndPaddingExtentForChild): Deleted. (WebCore::RenderFlexibleBox::mainAxisScrollbarExtentForChild): Deleted. (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild): Deleted. (WebCore::RenderFlexibleBox::computeNextFlexLine): Deleted. (WebCore::RenderFlexibleBox::setLogicalOverrideSize): Deleted. (WebCore::RenderFlexibleBox::numberOfInFlowPositionedChildren): Deleted. (WebCore::RenderFlexibleBox::needToStretchChild): Deleted. (WebCore::contentAlignmentNormalBehaviorFlexibleBox): Deleted. * rendering/RenderFlexibleBox.h: (WebCore::RenderFlexibleBox::orderIterator): (WebCore::RenderFlexibleBox::isFlexibleBoxImpl): * rendering/RenderFullScreen.h: * rendering/RenderGrid.cpp: (WebCore::selfAlignmentChangedToStretchInRowAxis): (WebCore::selfAlignmentChangedFromStretchInRowAxis): (WebCore::selfAlignmentChangedFromStretchInColumnAxis): (WebCore::RenderGrid::styleDidChange): (WebCore::RenderGrid::computeTrackBasedLogicalHeight): (WebCore::RenderGrid::computeTrackSizesForDefiniteSize): (WebCore::RenderGrid::gridGapForDirection): (WebCore::RenderGrid::guttersSize): (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize): (WebCore::RenderGrid::computeAutoRepeatTracksCount): (WebCore::RenderGrid::trackSizesForComputedStyle): (WebCore::RenderGrid::offsetAndBreadthForPositionedChild): (WebCore::RenderGrid::populateGridPositionsForDirection): (WebCore::RenderGrid::alignSelfForChild): (WebCore::RenderGrid::justifySelfForChild): (WebCore::RenderGrid::columnAxisPositionForChild): (WebCore::RenderGrid::rowAxisPositionForChild): (WebCore::RenderGrid::columnAxisOffsetForChild): (WebCore::RenderGrid::rowAxisOffsetForChild): (WebCore::RenderGrid::needToStretchChildLogicalHeight): Deleted. * rendering/RenderGrid.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateScrollbarsAfterLayout): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::computeLogicalHeight): * rendering/RenderTable.cpp: (WebCore::RenderTable::layout): * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::layout): * rendering/RenderTableSection.cpp: (WebCore::shouldFlexCellChild): (WebCore::RenderTableSection::relayoutCellIfFlexed): (WebCore::RenderTableSection::layoutRows): * rendering/RenderTableSection.h: * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::computeLogicalHeight): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedAlignSelf): (WebCore::RenderStyle::resolvedJustifySelf): * rendering/style/RenderStyle.h: * style/RenderTreeUpdater.cpp: (WebCore::textRendererIsNeeded): LayoutTests: * css3/flexbox/align-absolute-child-expected.txt: * css3/flexbox/align-absolute-child.html: * css3/flexbox/alignContent-applies-with-flexWrap-wrap-with-single-line-expected.txt: Added. * css3/flexbox/alignContent-applies-with-flexWrap-wrap-with-single-line.html: Added. * css3/flexbox/anonymous-block-merge-crash.html: * css3/flexbox/assert-generated-new-flexbox-expected.txt: Added. * css3/flexbox/assert-generated-new-flexbox.html: Added. * css3/flexbox/auto-height-dynamic-expected.txt: * css3/flexbox/auto-height-dynamic.html: * css3/flexbox/auto-height-with-flex-expected.html: Added. * css3/flexbox/auto-height-with-flex.html: Added. * css3/flexbox/auto-margins-expected.html: Removed. * css3/flexbox/auto-margins.html: Removed. * css3/flexbox/border-and-padding-abspos-expected.txt: Added. * css3/flexbox/border-and-padding-abspos.html: Added. * css3/flexbox/box-orient-button-expected.txt: Added. * css3/flexbox/box-orient-button.html: Added. * css3/flexbox/box-sizing-expected.txt: * css3/flexbox/box-sizing-min-max-sizes-expected.txt: * css3/flexbox/box-sizing-min-max-sizes.html: * css3/flexbox/box-sizing.html: * css3/flexbox/bug527039-expected.txt: Added. * css3/flexbox/bug527039.html: Added. * css3/flexbox/bug580586-expected.txt: Added. * css3/flexbox/bug580586.html: Added. * css3/flexbox/bug604346-expected.html: Added. * css3/flexbox/bug604346.html: Added. * css3/flexbox/bug605682-expected.txt: Added. * css3/flexbox/bug605682.html: Added. * css3/flexbox/bug633212-expected.txt: Added. * css3/flexbox/bug633212.html: Added. * css3/flexbox/bug646288-expected.txt: Added. * css3/flexbox/bug646288.html: Added. * css3/flexbox/bug669714-expected.txt: Added. * css3/flexbox/bug669714.html: Added. * css3/flexbox/canvas-dynamic-change-expected.txt: Added. * css3/flexbox/canvas-dynamic-change.html: Added. * css3/flexbox/change-flexitem-into-abspos-expected.txt: Added. * css3/flexbox/change-flexitem-into-abspos.html: Added. * css3/flexbox/child-overflow-expected.html: * css3/flexbox/child-overflow.html: * css3/flexbox/column-flex-child-with-overflow-scroll-expected.txt: Added. * css3/flexbox/column-flex-child-with-overflow-scroll.html: Added. * css3/flexbox/columns-auto-size.html: * css3/flexbox/columns-center-with-margins-and-wrap-expected.html: Added. * css3/flexbox/columns-center-with-margins-and-wrap.html: Added. * css3/flexbox/columns-center-with-margins-expected.html: Added. * css3/flexbox/columns-center-with-margins.html: Added. * css3/flexbox/columns-height-set-via-top-bottom-expected.txt: * css3/flexbox/columns-height-set-via-top-bottom.html: * css3/flexbox/content-height-with-scrollbars.html: * css3/flexbox/cross-axis-scrollbar-expected.html: * css3/flexbox/cross-axis-scrollbar.html: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/csswg/flex-margin-no-collapse.html: * css3/flexbox/definite-cross-sizes-expected.txt: Added. * css3/flexbox/definite-cross-sizes.html: Added. * css3/flexbox/definite-main-size-expected.txt: Added. * css3/flexbox/definite-main-size.html: Added. * css3/flexbox/display-flexbox-set-get-expected.txt: * css3/flexbox/display-flexbox-set-get.html: * css3/flexbox/flex-algorithm-expected.txt: * css3/flexbox/flex-algorithm-min-max-expected.txt: * css3/flexbox/flex-algorithm-min-max.html: * css3/flexbox/flex-algorithm-with-margins-expected.txt: * css3/flexbox/flex-algorithm-with-margins.html: * css3/flexbox/flex-algorithm.html: * css3/flexbox/flex-align-baseline-expected.txt: * css3/flexbox/flex-align-baseline.html: * css3/flexbox/flex-align-column-expected.txt: * css3/flexbox/flex-align-column.html: * css3/flexbox/flex-align-end-expected.txt: * css3/flexbox/flex-align-end.html: * css3/flexbox/flex-align-max-expected.txt: * css3/flexbox/flex-align-max.html: * css3/flexbox/flex-align-percent-height-expected.txt: * css3/flexbox/flex-align-percent-height.html: * css3/flexbox/flex-align-stretch-expected.txt: * css3/flexbox/flex-align-stretch.html: * css3/flexbox/flex-align-vertical-writing-mode.html: * css3/flexbox/flex-align.html: * css3/flexbox/flex-column-relayout-assert-expected.txt: Added. * css3/flexbox/flex-column-relayout-assert.html: Added. * css3/flexbox/flex-factor-less-than-one-expected.txt: Added. * css3/flexbox/flex-factor-less-than-one.html: Added. * css3/flexbox/flex-flow-2-expected.txt: * css3/flexbox/flex-flow-2.html: * css3/flexbox/flex-flow-auto-margins-expected.txt: * css3/flexbox/flex-flow-auto-margins-no-available-space-assert-expected.txt: Added. * css3/flexbox/flex-flow-auto-margins-no-available-space-assert.html: Added. * css3/flexbox/flex-flow-auto-margins-no-available-space-expected.txt: * css3/flexbox/flex-flow-auto-margins-no-available-space.html: * css3/flexbox/flex-flow-auto-margins.html: * css3/flexbox/flex-flow-border-expected.txt: * css3/flexbox/flex-flow-border.html: * css3/flexbox/flex-flow-expected.txt: * css3/flexbox/flex-flow-initial-expected.txt: * css3/flexbox/flex-flow-initial.html: * css3/flexbox/flex-flow-margins-auto-size-expected.txt: * css3/flexbox/flex-flow-margins-auto-size.html: * css3/flexbox/flex-flow-margins-expected.txt: * css3/flexbox/flex-flow-margins.html: * css3/flexbox/flex-flow-orientations-expected.txt: * css3/flexbox/flex-flow-orientations.html: * css3/flexbox/flex-flow-overflow-expected.txt: * css3/flexbox/flex-flow-overflow.html: * css3/flexbox/flex-flow-padding-expected.txt: * css3/flexbox/flex-flow-padding.html: * css3/flexbox/flex-flow.html: * css3/flexbox/flex-item-child-overflow-expected.txt: * css3/flexbox/flex-item-child-overflow.html: * css3/flexbox/flex-item-contains-strict-expected.txt: Added. * css3/flexbox/flex-item-contains-strict.html: Added. * css3/flexbox/flex-item-firstLine-valid-expected.txt: * css3/flexbox/flex-item-firstLine-valid.html: * css3/flexbox/flex-justify-content-expected.txt: * css3/flexbox/flex-justify-content.html: * css3/flexbox/flex-longhand-parsing-expected.txt: * css3/flexbox/flex-longhand-parsing.html: * css3/flexbox/flex-no-flex-expected.txt: * css3/flexbox/flex-no-flex.html: * css3/flexbox/flex-one-sets-flex-basis-to-zero-px-expected.txt: Added. * css3/flexbox/flex-one-sets-flex-basis-to-zero-px.html: Added. * css3/flexbox/flex-order-expected.html: Added. * css3/flexbox/flex-order-expected.png: Removed. * css3/flexbox/flex-order-expected.txt: Removed. * css3/flexbox/flex-order.html: * css3/flexbox/flex-property-parsing-expected.txt: * css3/flexbox/flex-property-parsing.html: * css3/flexbox/flex-shorthand-flex-basis-middle-expected.txt: Added. * css3/flexbox/flex-shorthand-flex-basis-middle.html: Added. * css3/flexbox/flexbox-baseline.html: * css3/flexbox/flexbox-height-with-overflow-auto-expected.txt: Added. * css3/flexbox/flexbox-height-with-overflow-auto.html: Added. * css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt: * css3/flexbox/flexbox-ignore-container-firstLetter.html: * css3/flexbox/flexbox-ignore-firstLetter-expected.txt: * css3/flexbox/flexbox-ignore-firstLetter.html: * css3/flexbox/flexbox-ignore-firstLine-expected.txt: * css3/flexbox/flexbox-ignore-firstLine.html: * css3/flexbox/flexbox-lines-must-be-stretched-by-default-expected.txt: * css3/flexbox/flexbox-lines-must-be-stretched-by-default.html: * css3/flexbox/flexbox-overflow-auto-expected.html: * css3/flexbox/flexbox-overflow-auto.html: * css3/flexbox/flexbox-with-multi-column-property-expected.html: Added. * css3/flexbox/flexbox-with-multi-column-property.html: Added. * css3/flexbox/flexbox-wordwrap-expected.txt: Added. * css3/flexbox/flexbox-wordwrap.html: Added. * css3/flexbox/flexitem-expected.txt: * css3/flexbox/flexitem-no-margin-collapsing-expected.txt: * css3/flexbox/flexitem-no-margin-collapsing.html: * css3/flexbox/flexitem-percent-height-change-expected.txt: * css3/flexbox/flexitem-percent-height-change.html: * css3/flexbox/flexitem-stretch-image-expected.txt: * css3/flexbox/flexitem-stretch-image.html: * css3/flexbox/flexitem-stretch-range.html: * css3/flexbox/flexitem.html: * css3/flexbox/floated-flexbox-expected.txt: * css3/flexbox/floated-flexbox.html: * css3/flexbox/floated-flexitem.html: * css3/flexbox/inline-flex-crash.html: * css3/flexbox/inline-flex-crash2.html: * css3/flexbox/inline-flex-expected.txt: * css3/flexbox/inline-flex.html: * css3/flexbox/inline-flexbox-ignore-firstLine-expected.txt: * css3/flexbox/inline-flexbox-ignore-firstLine.html: * css3/flexbox/inline-flexbox-wrap-vertically-width-calculation-expected.txt: Added. * css3/flexbox/inline-flexbox-wrap-vertically-width-calculation.html: Added. * css3/flexbox/insert-text-crash.html: * css3/flexbox/intrinsic-min-width-applies-with-fixed-width-expected.txt: * css3/flexbox/intrinsic-min-width-applies-with-fixed-width.html: * css3/flexbox/intrinsic-width-orthogonal-writing-mode-expected.txt: Added. * css3/flexbox/intrinsic-width-orthogonal-writing-mode.html: Added. * css3/flexbox/large-flex-shrink-assert-expected.txt: Added. * css3/flexbox/large-flex-shrink-assert.html: Added. * css3/flexbox/line-wrapping.html: * css3/flexbox/mainAxisExtent-crash-expected.txt: Added. * css3/flexbox/mainAxisExtent-crash.html: Added. * css3/flexbox/max-width-violation-expected.txt: Added. * css3/flexbox/max-width-violation.html: Added. * css3/flexbox/min-size-auto-expected.txt: * css3/flexbox/min-size-auto.html: * css3/flexbox/minimum-size-image-expected.txt: Added. * css3/flexbox/minimum-size-image.html: Added. * css3/flexbox/multiline-align-content-expected.txt: * css3/flexbox/multiline-align-content-horizontal-column-expected.txt: * css3/flexbox/multiline-align-content-horizontal-column.html: * css3/flexbox/multiline-align-content.html: * css3/flexbox/multiline-align-self-expected.txt: * css3/flexbox/multiline-align-self.html: * css3/flexbox/multiline-column-auto-expected.txt: * css3/flexbox/multiline-column-auto.html: * css3/flexbox/multiline-column-overflow-expected.html: Added. * css3/flexbox/multiline-column-overflow.html: Added. * css3/flexbox/multiline-expected.txt: * css3/flexbox/multiline-justify-content-expected.txt: * css3/flexbox/multiline-justify-content.html: * css3/flexbox/multiline-min-max-expected.txt: Added. * css3/flexbox/multiline-min-max.html: Added. * css3/flexbox/multiline-min-preferred-width-expected.txt: * css3/flexbox/multiline-min-preferred-width.html: * css3/flexbox/multiline-reverse-wrap-baseline.html: * css3/flexbox/multiline-reverse-wrap-overflow-expected.txt: * css3/flexbox/multiline-reverse-wrap-overflow.html: * css3/flexbox/multiline-shrink-to-fit-expected.html: * css3/flexbox/multiline-shrink-to-fit.html: * css3/flexbox/multiline.html: * css3/flexbox/negative-flex-rounding-assert.html: * css3/flexbox/negative-margins-assert.html: * css3/flexbox/negative-overflow-expected.txt: * css3/flexbox/negative-overflow.html: * css3/flexbox/nested-flexbox-min-size-auto-expected.txt: Added. * css3/flexbox/nested-flexbox-min-size-auto.html: Added. * css3/flexbox/nested-orthogonal-flexbox-relayout-expected.html: Added. * css3/flexbox/nested-orthogonal-flexbox-relayout.html: Added. * css3/flexbox/nested-stretch-expected.txt: * css3/flexbox/nested-stretch.html: * css3/flexbox/order-painting.html: * css3/flexbox/orthogonal-flex-directions-expected.txt: * css3/flexbox/orthogonal-flex-directions.html: * css3/flexbox/orthogonal-writing-modes-and-intrinsic-sizing-expected.txt: Added. * css3/flexbox/orthogonal-writing-modes-and-intrinsic-sizing.html: Added. * css3/flexbox/overflow-and-padding-expected.txt: Added. * css3/flexbox/overflow-and-padding.html: Added. * css3/flexbox/overflow-auto-dynamic-changes-abspos-expected.html: Added. * css3/flexbox/overflow-auto-dynamic-changes-abspos.html: Added. * css3/flexbox/overflow-auto-dynamic-changes-expected.html: Added. * css3/flexbox/overflow-auto-dynamic-changes.html: Added. * css3/flexbox/overflow-auto-resizes-correctly-expected.txt: Added. * css3/flexbox/overflow-auto-resizes-correctly.html: Added. * css3/flexbox/overflow-keep-scrollpos-expected.txt: * css3/flexbox/overflow-keep-scrollpos.html: * css3/flexbox/percent-height-children-of-alignSelf-stretch-flex-item-expected.txt: Added. * css3/flexbox/percent-height-children-of-alignSelf-stretch-flex-item.html: Added. * css3/flexbox/percent-margins-expected.txt: * css3/flexbox/percent-margins.html: * css3/flexbox/percentage-height-in-abspos-expected.html: Added. * css3/flexbox/percentage-height-in-abspos.html: Added. * css3/flexbox/percentage-height-replaced-element-expected.txt: Added. * css3/flexbox/percentage-height-replaced-element.html: Added. * css3/flexbox/percentage-heights-expected.txt: * css3/flexbox/percentage-heights.html: * css3/flexbox/percentage-max-width-cross-axis-expected.txt: Added. * css3/flexbox/percentage-max-width-cross-axis.html: Added. * css3/flexbox/percentage-sizes-expected.txt: * css3/flexbox/percentage-sizes-quirks-expected.txt: * css3/flexbox/percentage-sizes-quirks.html: * css3/flexbox/percentage-sizes.html: * css3/flexbox/percentage-width-in-abspos-expected.html: Added. * css3/flexbox/percentage-width-in-abspos.html: Added. * css3/flexbox/perpendicular-writing-modes-inside-flex-item-expected.txt: * css3/flexbox/perpendicular-writing-modes-inside-flex-item.html: * css3/flexbox/position-absolute-child-expected.txt: * css3/flexbox/position-absolute-child.html: * css3/flexbox/position-absolute-children-expected.txt: * css3/flexbox/position-absolute-children.html: * css3/flexbox/preferred-widths-expected.txt: * css3/flexbox/preferred-widths-orthogonal.html: * css3/flexbox/preferred-widths.html: * css3/flexbox/relayout-align-items-expected.txt: * css3/flexbox/relayout-align-items.html: * css3/flexbox/relayout-image-load-expected.txt: * css3/flexbox/relayout-image-load.html: * css3/flexbox/relpos-with-percentage-top-expected.txt: Added. * css3/flexbox/relpos-with-percentage-top.html: Added. * css3/flexbox/relpos-with-scrollable-with-abspos-crash-expected.txt: Added. * css3/flexbox/relpos-with-scrollable-with-abspos-crash.html: Added. * css3/flexbox/resize-min-content-flexbox-expected.txt: Added. * css3/flexbox/resize-min-content-flexbox.html: Added. * css3/flexbox/resources/box-orient-button.js: Added. (setFlexDirection): (gebi): (test): * css3/flexbox/scrollbars-auto-expected.html: Added. * css3/flexbox/scrollbars-auto.html: Added. * css3/flexbox/scrollbars-expected.html: Added. * css3/flexbox/scrollbars.html: Added. * css3/flexbox/shrinking-column-flexbox-expected.txt: Added. * css3/flexbox/shrinking-column-flexbox.html: Added. * css3/flexbox/stretch-after-sibling-size-change-expected.txt: * css3/flexbox/stretch-after-sibling-size-change.html: * css3/flexbox/stretch-input-in-column-expected.html: * css3/flexbox/stretch-simplified-layout-expected.txt: * css3/flexbox/stretch-simplified-layout.html: * css3/flexbox/stretch-table-child-expected.txt: Added. * css3/flexbox/stretch-table-child.html: Added. * css3/flexbox/stretched-child-shrink-on-relayout-expected.txt: Added. * css3/flexbox/stretched-child-shrink-on-relayout.html: Added. * css3/flexbox/stretching-orthogonal-flows-expected.html: Added. * css3/flexbox/stretching-orthogonal-flows.html: Added. * css3/flexbox/style-change-expected.txt: * css3/flexbox/style-change.html: * css3/flexbox/text-overflow-on-flexbox-expected.html: Added. * css3/flexbox/text-overflow-on-flexbox.html: Added. * css3/flexbox/true-centering-expected.txt: * css3/flexbox/true-centering.html: * css3/flexbox/undefined-min-width-expected.txt: Added. * css3/flexbox/undefined-min-width.html: Added. * css3/flexbox/vertical-align-do-not-effect-flex-items-expected.html: Added. * css3/flexbox/vertical-align-do-not-effect-flex-items.html: Added. * css3/flexbox/vertical-flexbox-percentage-ignored-expected.html: Added. * css3/flexbox/vertical-flexbox-percentage-ignored.html: Added. * css3/flexbox/whitespace-in-flexitem-expected.html: Added. * css3/flexbox/whitespace-in-flexitem.html: Added. * css3/flexbox/width-change-and-relayout-children-expected.txt: * css3/flexbox/width-change-and-relayout-children.html: * css3/flexbox/wrapping-column-dynamic-changes-expected.txt: Added. * css3/flexbox/wrapping-column-dynamic-changes.html: Added. * css3/flexbox/writing-modes-expected.txt: * css3/flexbox/writing-modes.html: * css3/flexbox/z-index.html: * resources/check-layout-th.js: Added. (checkSubtreeExpectedValues): (checkAttribute): (assert_tolerance): (checkExpectedValues): (window.checkLayout): Canonical link: https://commits.webkit.org/185959@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-28 16:23:15 +00:00
[CSS Grid Layout] Add support for order inside grid items https://bugs.webkit.org/show_bug.cgi?id=123208 Reviewed by Antti Koivisto. Source/WebCore: Based on Blink r153457 and r153536 by <jchaffraix@chromium.org> Added support for sorting grid items by using -webkit-order property. Used OrderIterator to implement it so it had to be moved out of RenderFlexibleBox to be shared with RenderGrid. Tests: fast/css-grid-layout/grid-item-order-auto-flow-resolution.html fast/css-grid-layout/grid-item-order-paint-order.html * CMakeLists.txt: Added new file. * GNUmakefile.list.am: Ditto. * WebCore.vcxproj/WebCore.vcxproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * rendering/OrderIterator.cpp: Added. Ripped out of RenderFlexibleBox. (WebCore::OrderIterator::OrderIterator): (WebCore::OrderIterator::setOrderValues): Use std::move semantics. (WebCore::OrderIterator::first): Use an integer as iterator. (WebCore::OrderIterator::next): Ditto. (WebCore::OrderIterator::reset): Ditto. * rendering/OrderIterator.h: Added. (WebCore::OrderIterator::currentChild): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::RenderFlexibleBox): (WebCore::RenderFlexibleBox::layoutBlock): * rendering/RenderFlexibleBox.h: * rendering/RenderGrid.cpp: (WebCore::RenderGrid::RenderGrid): (WebCore::RenderGrid::placeItemsOnGrid): (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): (WebCore::RenderGrid::paintChildren): * rendering/RenderGrid.h: LayoutTests: From Blink r153536 by <jchaffraix@chromium.org> Added a couple of tests to verify that we respect the specified order of grid items both in the auto-placement algorithm and in the final painting. * fast/css-grid-layout/grid-item-order-auto-flow-resolution-expected.txt: Added. * fast/css-grid-layout/grid-item-order-auto-flow-resolution.html: Added. * fast/css-grid-layout/grid-item-order-paint-order-expected.html: Added. * fast/css-grid-layout/grid-item-order-paint-order.html: Added. Canonical link: https://commits.webkit.org/141517@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-28 17:35:52 +00:00
class OrderIterator {
public:
Setting up OrderIterator shouldn't require an extra Vector https://bugs.webkit.org/show_bug.cgi?id=119061 Reviewed by Darin Adler. From Blink r153971 by <jchaffraix@chromium.org> This patches reuse the OrderIterator's Vector. It provides a helper class OrderIteratorPopulator, used for manipulating the Vector directly. Which allows to consolidate the code into a single implementation across flexbox and grid. No new tests, already covered by current tests. * rendering/OrderIterator.cpp: (WebCore::OrderIteratorPopulator::~OrderIteratorPopulator): Reset OrderIterator and call removeDuplicatedOrderValues(). (WebCore::OrderIteratorPopulator::removeDuplicatedOrderValues): Sorts the Vector and removes the duplicated order values. (WebCore::OrderIteratorPopulator::collectChild): Collect order value information from child. (WebCore::OrderIterator::setOrderValues): Deleted. * rendering/OrderIterator.h: (WebCore::OrderIteratorPopulator::OrderIteratorPopulator): Add helper class to manipulate OrderValues Vector. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): Remove unneeded code related to old OrderValues vector. (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins): Populate OrderIterator using collectChild(). (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): Deleted. * rendering/RenderFlexibleBox.h: Rename computeMainAxisPreferredSizes() to prepareOrderIteratorAndMargins(). * rendering/RenderGrid.cpp: (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Populate OrderIterator using collectChild(). Canonical link: https://commits.webkit.org/151329@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-27 07:17:52 +00:00
friend class OrderIteratorPopulator;
[CSS Grid Layout] Add support for order inside grid items https://bugs.webkit.org/show_bug.cgi?id=123208 Reviewed by Antti Koivisto. Source/WebCore: Based on Blink r153457 and r153536 by <jchaffraix@chromium.org> Added support for sorting grid items by using -webkit-order property. Used OrderIterator to implement it so it had to be moved out of RenderFlexibleBox to be shared with RenderGrid. Tests: fast/css-grid-layout/grid-item-order-auto-flow-resolution.html fast/css-grid-layout/grid-item-order-paint-order.html * CMakeLists.txt: Added new file. * GNUmakefile.list.am: Ditto. * WebCore.vcxproj/WebCore.vcxproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * rendering/OrderIterator.cpp: Added. Ripped out of RenderFlexibleBox. (WebCore::OrderIterator::OrderIterator): (WebCore::OrderIterator::setOrderValues): Use std::move semantics. (WebCore::OrderIterator::first): Use an integer as iterator. (WebCore::OrderIterator::next): Ditto. (WebCore::OrderIterator::reset): Ditto. * rendering/OrderIterator.h: Added. (WebCore::OrderIterator::currentChild): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::RenderFlexibleBox): (WebCore::RenderFlexibleBox::layoutBlock): * rendering/RenderFlexibleBox.h: * rendering/RenderGrid.cpp: (WebCore::RenderGrid::RenderGrid): (WebCore::RenderGrid::placeItemsOnGrid): (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): (WebCore::RenderGrid::paintChildren): * rendering/RenderGrid.h: LayoutTests: From Blink r153536 by <jchaffraix@chromium.org> Added a couple of tests to verify that we respect the specified order of grid items both in the auto-placement algorithm and in the final painting. * fast/css-grid-layout/grid-item-order-auto-flow-resolution-expected.txt: Added. * fast/css-grid-layout/grid-item-order-auto-flow-resolution.html: Added. * fast/css-grid-layout/grid-item-order-paint-order-expected.html: Added. * fast/css-grid-layout/grid-item-order-paint-order.html: Added. Canonical link: https://commits.webkit.org/141517@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-28 17:35:52 +00:00
Setting up OrderIterator shouldn't require an extra Vector https://bugs.webkit.org/show_bug.cgi?id=119061 Reviewed by Darin Adler. From Blink r153971 by <jchaffraix@chromium.org> This patches reuse the OrderIterator's Vector. It provides a helper class OrderIteratorPopulator, used for manipulating the Vector directly. Which allows to consolidate the code into a single implementation across flexbox and grid. No new tests, already covered by current tests. * rendering/OrderIterator.cpp: (WebCore::OrderIteratorPopulator::~OrderIteratorPopulator): Reset OrderIterator and call removeDuplicatedOrderValues(). (WebCore::OrderIteratorPopulator::removeDuplicatedOrderValues): Sorts the Vector and removes the duplicated order values. (WebCore::OrderIteratorPopulator::collectChild): Collect order value information from child. (WebCore::OrderIterator::setOrderValues): Deleted. * rendering/OrderIterator.h: (WebCore::OrderIteratorPopulator::OrderIteratorPopulator): Add helper class to manipulate OrderValues Vector. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): Remove unneeded code related to old OrderValues vector. (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins): Populate OrderIterator using collectChild(). (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): Deleted. * rendering/RenderFlexibleBox.h: Rename computeMainAxisPreferredSizes() to prepareOrderIteratorAndMargins(). * rendering/RenderGrid.cpp: (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Populate OrderIterator using collectChild(). Canonical link: https://commits.webkit.org/151329@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-27 07:17:52 +00:00
explicit OrderIterator(RenderBox&);
RenderBox* currentChild() const { return m_currentChild; }
[CSS Grid Layout] Add support for order inside grid items https://bugs.webkit.org/show_bug.cgi?id=123208 Reviewed by Antti Koivisto. Source/WebCore: Based on Blink r153457 and r153536 by <jchaffraix@chromium.org> Added support for sorting grid items by using -webkit-order property. Used OrderIterator to implement it so it had to be moved out of RenderFlexibleBox to be shared with RenderGrid. Tests: fast/css-grid-layout/grid-item-order-auto-flow-resolution.html fast/css-grid-layout/grid-item-order-paint-order.html * CMakeLists.txt: Added new file. * GNUmakefile.list.am: Ditto. * WebCore.vcxproj/WebCore.vcxproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * rendering/OrderIterator.cpp: Added. Ripped out of RenderFlexibleBox. (WebCore::OrderIterator::OrderIterator): (WebCore::OrderIterator::setOrderValues): Use std::move semantics. (WebCore::OrderIterator::first): Use an integer as iterator. (WebCore::OrderIterator::next): Ditto. (WebCore::OrderIterator::reset): Ditto. * rendering/OrderIterator.h: Added. (WebCore::OrderIterator::currentChild): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::RenderFlexibleBox): (WebCore::RenderFlexibleBox::layoutBlock): * rendering/RenderFlexibleBox.h: * rendering/RenderGrid.cpp: (WebCore::RenderGrid::RenderGrid): (WebCore::RenderGrid::placeItemsOnGrid): (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): (WebCore::RenderGrid::paintChildren): * rendering/RenderGrid.h: LayoutTests: From Blink r153536 by <jchaffraix@chromium.org> Added a couple of tests to verify that we respect the specified order of grid items both in the auto-placement algorithm and in the final painting. * fast/css-grid-layout/grid-item-order-auto-flow-resolution-expected.txt: Added. * fast/css-grid-layout/grid-item-order-auto-flow-resolution.html: Added. * fast/css-grid-layout/grid-item-order-paint-order-expected.html: Added. * fast/css-grid-layout/grid-item-order-paint-order.html: Added. Canonical link: https://commits.webkit.org/141517@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-28 17:35:52 +00:00
RenderBox* first();
RenderBox* next();
Enable fieldsets to be flexboxes, grids and multicolumn. https://bugs.webkit.org/show_bug.cgi?id=169082 Source/WebCore: Reviewed by Simon Fraser . Added new tests in fast/forms/fieldset. This patch eliminates RenderFieldset and moves the functionality into RenderBlock so that derived classes can also be fieldsets. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: Remove RenderFieldset from the project. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::titleUIElement): Call in to RenderBlock now instead of RenderFieldset. * html/HTMLFieldSetElement.cpp: (WebCore::HTMLFieldSetElement::createElementRenderer): * html/HTMLFieldSetElement.h: The fieldset DOM element now uses RenderElement::createFor to make renderers so that multiple display types can be supported. A special flag has been added that indicates only to make flexbox and block-related renderers (not table display types). * rendering/OrderIterator.cpp: (WebCore::OrderIterator::shouldSkipChild): (WebCore::OrderIteratorPopulator::collectChild): * rendering/OrderIterator.h: Streamline child collection for flexboxes and grids to indicate whether the child should be skipped as a return value from collectChild. Add a shouldSkipChild method that skips both out of flow positioned objects and excluded children like the legends of fieldsets. * rendering/RenderBlock.cpp: (WebCore::RenderBlockRareData::RenderBlockRareData): When the legend is taller than the fieldset's borderBefore(), intrinsic border is added to the CSS border width. This intrinsic border being factored in ensures that the padding and content boxes of fieldsets are correct across any layout system, since the legend is now just treated as part of the border. (WebCore::RenderBlock::computePreferredLogicalWidths): (WebCore::RenderBlock::computeBlockPreferredLogicalWidths): Call the new computePreferredWidthsForExcludedChildren to ensure that excluded children contribute to preferred width in their own way and not as part of a specific layout system. (WebCore::RenderBlock::renderName): Hacked to still return RenderFieldSet for RenderBlockFlow-backed fieldsets for layout test compatibility. (WebCore::RenderBlock::layoutExcludedChildren): Renamed from layoutSpecialExcludedChild to more accurately reflect the fact that multiple excluded children can be included here (e.g., both a multicolumn flow thread and a legend). The RenderBlock base class handles the layout of legends by both placing them and setting the correct intrinsic border before amount on the block. (WebCore::RenderBlock::findFieldsetLegend): Moved from RenderFieldset. (WebCore::RenderBlock::adjustBorderBoxRectForPainting): (WebCore::RenderBlock::paintRectToClipOutFromBorder): These methods are used when painting to shrink the border box as needed to account for the legend and to provide the portion of the border that needs to be clipped out. These methods have been enhanced to properly support all writing modes. (WebCore::RenderBlock::intrinsicBorderForFieldset): (WebCore::RenderBlock::setIntrinsicBorderForFieldset): (WebCore::RenderBlock::borderTop): (WebCore::RenderBlock::borderLeft): (WebCore::RenderBlock::borderBottom): (WebCore::RenderBlock::borderRight): (WebCore::RenderBlock::borderBefore): These methods are overridden for border to ensure that the intrinsic border added by a tall legend is properly factored in. (WebCore::RenderBlock::computePreferredWidthsForExcludedChildren): * rendering/RenderBlock.h: This method computes the preferred widths for legend children in order to ensure that the legend properly grows the width of the fieldset when it is the widest item. (WebCore::RenderBlock::adjustBorderBoxLogicalHeightForBoxSizing): (WebCore::RenderBlock::adjustContentBoxLogicalHeightForBoxSizing): Preserve the behavior of fieldsets in that the available content size includes the space lost accounting for the legend. I don't think this makes much sense, but it matches the behavior of other browsers (and our old behavior). (WebCore::RenderBlock::paintExcludedChildrenInBorder): Method for painting the excluded children that might be present in our border. We only do this if the paint phase is a box decoration painting phase and if the legend isn't self-painting. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::willCreateColumns): Allow fieldsets to create columns now. (WebCore::RenderBlockFlow::layoutBlockChildren): (WebCore::RenderBlockFlow::layoutExcludedChildren): Renamed this method and change it to call the base class to ensure that legends in multicolumn fieldsets get handled properly. (WebCore::RenderBlockFlow::addChild): Patched to make sure legends don't get put into the multicolumn flow thread, as they need to remain outside of it. (WebCore::RenderBlockFlow::layoutSpecialExcludedChild): Deleted. Renamed to layoutExcludedChildren. * rendering/RenderBlockFlow.h: * rendering/RenderBox.cpp: (WebCore::RenderBox::paintBoxDecorations): (WebCore::RenderBox::paintMask): Patched to call the new adjustBorderBoxRectForPainting and paintRectToClipOutFromBorder methods in order to properly shrink the border box rect for painting and to clip out the portion of the border covered by the legend. (WebCore::RenderBox::avoidsFloats): Add fieldsets as avoiding floats. RenderFieldset used to subclass this method to return true, but with its removal, we need to put this in the base class along with legends. * rendering/RenderBox.h: (WebCore::RenderBox::isGridItem): (WebCore::RenderBox::isFlexItem): Patched to exclude legends so that they don't try to size like they are really in the grid or flexbox. (WebCore::RenderBox::adjustBorderBoxRectForPainting): This method is overridden by RenderBLock to handle adjusting fieldset border rects for painting. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintBorder): * rendering/RenderBoxModelObject.h: (WebCore::RenderBoxModelObject::paintRectToClipOutFromBorder): Patched to properly paint fieldsets using the new helpers. * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::FlexBoxIterator::next): (WebCore::RenderDeprecatedFlexibleBox::layoutBlock): (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox): Make sure deprecated flexible boxes lay out their legends properly by calling layoutExcludedChildren. * rendering/RenderElement.cpp: (WebCore::RenderElement::createFor): * rendering/RenderElement.h: Patched to take a flag that limits what renderers can be created so that fieldsets don't make table display types. * rendering/RenderFieldset.cpp: Removed. * rendering/RenderFieldset.h: Removed. Remove RenderFieldset files from the tree. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths): (WebCore::RenderFlexibleBox::firstLineBaseline): (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::layoutFlexItems): (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins): Make sure flexible boxes lay out their legends properly by calling layoutExcludedChildren. Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't part of the flexible box layout. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutBlock): (WebCore::RenderGrid::computeIntrinsicLogicalWidths): (WebCore::RenderGrid::placeItemsOnGrid): (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): (WebCore::RenderGrid::layoutGridItems): Make sure grids lay out their legends properly by calling layoutExcludedChildren. Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't part of the grid's layout. * rendering/RenderMultiColumnFlowThread.cpp: (WebCore::RenderMultiColumnFlowThread::populate): Pull legends back up into the block and don't let them be part of the flow thread. * rendering/RenderMultiColumnSet.cpp: (WebCore::RenderMultiColumnSet::requiresBalancing): Fix an assert to allow legends to exist as siblings of multicolumn sets. * rendering/RenderObject.cpp: (WebCore::RenderObject::isFieldset): Changed to examine the HTML element rather than RenderFieldset. * rendering/RenderObject.h: (WebCore::RenderObject::isExcludedFromNormalLayout): (WebCore::RenderObject::setIsExcludedFromNormalLayout): (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields): RenderObjects now have a new bit that is set for excluded objects like legends, flow threads, placeholders, and ruby text. This bit lets code easily detect that an object is excluded from the layout system and can be skipped. (WebCore::RenderObject::isExcludedAndPlacedInBorder): Helper method for asking if an object is painting inside the border. Used to know we need to factor it into preferred width calculations outside of any one layout system and also to know that we need to paint it when we paint the fieldset's border instead of later (after we might have scrolled or clipped the child painting area). * rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::layoutExcludedChildren): (WebCore::RenderRubyRun::layoutSpecialExcludedChild): Deleted. * rendering/RenderRubyRun.h: Rename layoutSpecialExcludedChild to layoutExcludedChildren. * rendering/RenderTable.cpp: (WebCore::RenderTable::adjustBorderBoxRectForPainting): (WebCore::RenderTable::paintBoxDecorations): (WebCore::RenderTable::paintMask): (WebCore::RenderTable::subtractCaptionRect): Deleted. * rendering/RenderTable.h: Patched tables to share the same border box rect adjustment used by fieldsets when subtracting out captions. This is prep work to allow tables to be fieldsets, but for now I didn't go all the way. * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::paintBoxDecorations): (WebCore::RenderTableCell::paintMask): Make sure table cells adjust their border box rects for painting. Again this is prep work for cells potentially being fieldsets, but not supported yet. * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::layoutExcludedChildren): (WebCore::RenderTextControl::layoutSpecialExcludedChild): Deleted. * rendering/RenderTextControl.h: * rendering/RenderTextControlMultiLine.cpp: (WebCore::RenderTextControlMultiLine::layoutExcludedChildren): (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild): Deleted. * rendering/RenderTextControlMultiLine.h: Renamed the methods for doing the excluded child layout. * rendering/RenderTreeAsText.cpp: (WebCore::RenderTreeAsText::writeRenderObject): Make sure to dump the original fieldset border and not the border with the extra legend stuff in it. LayoutTests: Reviewed by Simon Fraser. * fast/forms/fieldset/abs-pos-child-sizing-expected.html: Added. * fast/forms/fieldset/abs-pos-child-sizing.html: Added. * fast/forms/fieldset/fieldset-deprecated-flexbox-expected.html: Added. * fast/forms/fieldset/fieldset-deprecated-flexbox.html: Added. * fast/forms/fieldset/fieldset-flexbox-expected.html: Added. * fast/forms/fieldset/fieldset-flexbox.html: Added. * fast/forms/fieldset/fieldset-grid-expected.html: Added. * fast/forms/fieldset/fieldset-grid.html: Added. * fast/forms/fieldset/fieldset-multicolumn-expected.html: Added. * fast/forms/fieldset/fieldset-multicolumn.html: Added. * fast/forms/fieldset/fieldset-overflow-auto-expected.html: Added. * fast/forms/fieldset/fieldset-overflow-auto.html: Added. * fast/forms/fieldset/fieldset-overflow-hidden-expected.html: Added. * fast/forms/fieldset/fieldset-overflow-hidden.html: Added. * fast/forms/fieldset/fieldset-positioned-children-expected.html: Added. * fast/forms/fieldset/fieldset-positioned-children.html: Added. * fast/forms/fieldset/fieldset-positioned-legend-expected.html: Added. * fast/forms/fieldset/fieldset-positioned-legend.html: Added. * fast/forms/fieldset/fieldset-self-painting-legend-expected.html: Added. * fast/forms/fieldset/fieldset-self-painting-legend.html: Added. * fast/forms/fieldset/fieldset-writing-modes-expected.html: Added. * fast/forms/fieldset/fieldset-writing-modes.html: Added. Canonical link: https://commits.webkit.org/186219@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-06 18:00:35 +00:00
bool shouldSkipChild(const RenderObject&) const;
[CSS Grid Layout] Add support for order inside grid items https://bugs.webkit.org/show_bug.cgi?id=123208 Reviewed by Antti Koivisto. Source/WebCore: Based on Blink r153457 and r153536 by <jchaffraix@chromium.org> Added support for sorting grid items by using -webkit-order property. Used OrderIterator to implement it so it had to be moved out of RenderFlexibleBox to be shared with RenderGrid. Tests: fast/css-grid-layout/grid-item-order-auto-flow-resolution.html fast/css-grid-layout/grid-item-order-paint-order.html * CMakeLists.txt: Added new file. * GNUmakefile.list.am: Ditto. * WebCore.vcxproj/WebCore.vcxproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * rendering/OrderIterator.cpp: Added. Ripped out of RenderFlexibleBox. (WebCore::OrderIterator::OrderIterator): (WebCore::OrderIterator::setOrderValues): Use std::move semantics. (WebCore::OrderIterator::first): Use an integer as iterator. (WebCore::OrderIterator::next): Ditto. (WebCore::OrderIterator::reset): Ditto. * rendering/OrderIterator.h: Added. (WebCore::OrderIterator::currentChild): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::RenderFlexibleBox): (WebCore::RenderFlexibleBox::layoutBlock): * rendering/RenderFlexibleBox.h: * rendering/RenderGrid.cpp: (WebCore::RenderGrid::RenderGrid): (WebCore::RenderGrid::placeItemsOnGrid): (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): (WebCore::RenderGrid::paintChildren): * rendering/RenderGrid.h: LayoutTests: From Blink r153536 by <jchaffraix@chromium.org> Added a couple of tests to verify that we respect the specified order of grid items both in the auto-placement algorithm and in the final painting. * fast/css-grid-layout/grid-item-order-auto-flow-resolution-expected.txt: Added. * fast/css-grid-layout/grid-item-order-auto-flow-resolution.html: Added. * fast/css-grid-layout/grid-item-order-paint-order-expected.html: Added. * fast/css-grid-layout/grid-item-order-paint-order.html: Added. Canonical link: https://commits.webkit.org/141517@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-28 17:35:52 +00:00
private:
void reset();
RenderBox& m_containerBox;
RenderBox* m_currentChild;
Setting up OrderIterator shouldn't require an extra Vector https://bugs.webkit.org/show_bug.cgi?id=119061 Reviewed by Darin Adler. From Blink r153971 by <jchaffraix@chromium.org> This patches reuse the OrderIterator's Vector. It provides a helper class OrderIteratorPopulator, used for manipulating the Vector directly. Which allows to consolidate the code into a single implementation across flexbox and grid. No new tests, already covered by current tests. * rendering/OrderIterator.cpp: (WebCore::OrderIteratorPopulator::~OrderIteratorPopulator): Reset OrderIterator and call removeDuplicatedOrderValues(). (WebCore::OrderIteratorPopulator::removeDuplicatedOrderValues): Sorts the Vector and removes the duplicated order values. (WebCore::OrderIteratorPopulator::collectChild): Collect order value information from child. (WebCore::OrderIterator::setOrderValues): Deleted. * rendering/OrderIterator.h: (WebCore::OrderIteratorPopulator::OrderIteratorPopulator): Add helper class to manipulate OrderValues Vector. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): Remove unneeded code related to old OrderValues vector. (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins): Populate OrderIterator using collectChild(). (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): Deleted. * rendering/RenderFlexibleBox.h: Rename computeMainAxisPreferredSizes() to prepareOrderIteratorAndMargins(). * rendering/RenderGrid.cpp: (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Populate OrderIterator using collectChild(). Canonical link: https://commits.webkit.org/151329@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-27 07:17:52 +00:00
[WTF] Add standard containers with FastAllocator specialization https://bugs.webkit.org/show_bug.cgi?id=183789 Reviewed by Darin Adler. Source/JavaScriptCore: * b3/air/testair.cpp: * b3/testb3.cpp: (JSC::B3::testDoubleLiteralComparison): (JSC::B3::testFloatEqualOrUnorderedFoldingNaN): * dfg/DFGGraph.h: * dfg/DFGIntegerCheckCombiningPhase.cpp: * dfg/DFGObjectAllocationSinkingPhase.cpp: * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::switchStringSlow): * runtime/FunctionHasExecutedCache.h: * runtime/TypeLocationCache.h: Source/WebCore: * Modules/indexeddb/IDBKeyData.h: * Modules/mediasource/SampleMap.h: * Modules/mediasource/SourceBuffer.cpp: * Modules/webauthn/cbor/CBORValue.h: It did not use FastAllocator for its container. * page/WheelEventTestTrigger.h: * platform/audio/PlatformMediaSessionManager.h: * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h: * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: * platform/graphics/cv/VideoTextureCopierCV.cpp: (WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction): * platform/mock/mediasource/MockSourceBufferPrivate.cpp: * platform/wpe/PlatformPasteboardWPE.cpp: * rendering/OrderIterator.h: Source/WTF: Sometimes we want standard containers due to various reasons. For example, WTF::HashMap lacks the ability to hold all the integer keys since it uses 0 for empty value and -1 for deleted value. However, using std::containers use std::allocator without specialization. This patch introduces WTF::{StdMap, StdSet, StdList, StdUnorderedMap, StdUnorderedSet}. They are standard containers with FastAllocator specialization. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/StdList.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h. * wtf/StdMap.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h. * wtf/StdSet.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h. * wtf/StdUnorderedMap.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h. * wtf/StdUnorderedSet.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h. Canonical link: https://commits.webkit.org/199528@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-23 12:34:08 +00:00
using OrderValues = StdSet<int>;
Update flexbox to Blink's tip of tree https://bugs.webkit.org/show_bug.cgi?id=168657 Reviewed by Zalan Bujtas. Source/WebCore: Added new tests in css3/flexbox. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * rendering/FlexibleBoxAlgorithm.cpp: Added. (WebCore::FlexItem::FlexItem): (WebCore::FlexLayoutAlgorithm::FlexLayoutAlgorithm): (WebCore::FlexLayoutAlgorithm::computeNextFlexLine): * rendering/FlexibleBoxAlgorithm.h: Added. (WebCore::FlexItem::hypotheticalMainAxisMarginBoxSize): (WebCore::FlexItem::flexBaseMarginBoxSize): (WebCore::FlexItem::flexedMarginBoxSize): (WebCore::FlexLayoutAlgorithm::isMultiline): * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize): (WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems): (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild): (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild): (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded): * rendering/GridTrackSizingAlgorithm.h: * rendering/OrderIterator.cpp: (WebCore::OrderIterator::next): (WebCore::OrderIterator::reset): (WebCore::OrderIteratorPopulator::~OrderIteratorPopulator): (WebCore::OrderIteratorPopulator::collectChild): (WebCore::OrderIteratorPopulator::OrderIteratorPopulator): Deleted. (WebCore::OrderIteratorPopulator::removeDuplicatedOrderValues): Deleted. * rendering/OrderIterator.h: (WebCore::OrderIteratorPopulator::OrderIteratorPopulator): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::updateBlockChildDirtyBitsBeforeLayout): (WebCore::RenderBlock::layoutPositionedObject): (WebCore::RenderBlock::computeBlockPreferredLogicalWidths): (WebCore::RenderBlock::computeChildPreferredLogicalWidths): (WebCore::RenderBlock::hasDefiniteLogicalHeight): (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation): * rendering/RenderBlock.h: (WebCore::RenderBlock::hasPercentHeightDescendants): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::isStretchingColumnFlexItem): (WebCore::RenderBox::hasStretchedLogicalWidth): (WebCore::RenderBox::sizesLogicalWidthToFitContent): (WebCore::RenderBox::computeInlineDirectionMargins): (WebCore::RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem): (WebCore::RenderBox::updateLogicalHeight): (WebCore::RenderBox::computeLogicalHeightWithoutLayout): (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation): (WebCore::RenderBox::shouldTreatChildAsReplacedInTableCells): (WebCore::tableCellShouldHaveZeroInitialSize): (WebCore::RenderBox::computePercentageLogicalHeight): (WebCore::RenderBox::computeReplacedLogicalHeightUsing): (WebCore::RenderBox::availableLogicalHeightUsing): (WebCore::RenderBox::percentageLogicalHeightIsResolvable): (WebCore::RenderBox::hasUnsplittableScrollingOverflow): (WebCore::flexItemHasStretchAlignment): Deleted. (WebCore::isStretchingColumnFlexItem): Deleted. (WebCore::logicalWidthIsResolvable): Deleted. (WebCore::RenderBox::hasDefiniteLogicalWidth): Deleted. (WebCore::percentageLogicalHeightIsResolvable): Deleted. (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock): Deleted. (WebCore::RenderBox::hasDefiniteLogicalHeight): Deleted. * rendering/RenderBox.h: (WebCore::RenderBox::isGridItem): (WebCore::RenderBox::isFlexItem): (WebCore::RenderBox::selfAlignmentNormalBehavior): * rendering/RenderBoxModelObject.cpp: (WebCore::isOutOfFlowPositionedWithImplicitHeight): (WebCore::RenderBoxModelObject::containingBlockForAutoHeightDetection): (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight): * rendering/RenderBoxModelObject.h: * rendering/RenderElement.cpp: (WebCore::RenderElement::removeChildInternal): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::LineContext::LineContext): (WebCore::RenderFlexibleBox::RenderFlexibleBox): (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths): (WebCore::contentAlignmentNormalBehavior): (WebCore::RenderFlexibleBox::styleDidChange): (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems): (WebCore::RenderFlexibleBox::clientLogicalBottomAfterRepositioning): (WebCore::RenderFlexibleBox::hasOrthogonalFlow): (WebCore::RenderFlexibleBox::flexBasisForChild): (WebCore::RenderFlexibleBox::crossAxisExtentForChild): (WebCore::RenderFlexibleBox::cachedChildIntrinsicContentLogicalHeight): (WebCore::RenderFlexibleBox::setCachedChildIntrinsicContentLogicalHeight): (WebCore::RenderFlexibleBox::clearCachedChildIntrinsicContentLogicalHeight): (WebCore::RenderFlexibleBox::childIntrinsicLogicalHeight): (WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth): (WebCore::RenderFlexibleBox::crossAxisIntrinsicExtentForChild): (WebCore::RenderFlexibleBox::mainAxisExtentForChild): (WebCore::RenderFlexibleBox::mainAxisContentExtentForChildIncludingScrollbar): (WebCore::RenderFlexibleBox::crossAxisExtent): (WebCore::RenderFlexibleBox::mainAxisExtent): (WebCore::RenderFlexibleBox::mainAxisContentExtent): (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild): (WebCore::RenderFlexibleBox::transformedWritingMode): (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild): (WebCore::RenderFlexibleBox::crossAxisMarginExtentForChild): (WebCore::RenderFlexibleBox::flowAwareLocationForChild): (WebCore::RenderFlexibleBox::useChildAspectRatio): (WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing): (WebCore::RenderFlexibleBox::setFlowAwareLocationForChild): (WebCore::RenderFlexibleBox::mainAxisLengthIsDefinite): (WebCore::RenderFlexibleBox::crossAxisLengthIsDefinite): (WebCore::RenderFlexibleBox::cacheChildMainSize): (WebCore::RenderFlexibleBox::clearCachedMainSizeForChild): (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild): (WebCore::RenderFlexibleBox::layoutFlexItems): (WebCore::RenderFlexibleBox::autoMarginOffsetInMainAxis): (WebCore::RenderFlexibleBox::updateAutoMarginsInMainAxis): (WebCore::RenderFlexibleBox::hasAutoMarginsInCrossAxis): (WebCore::RenderFlexibleBox::availableAlignmentSpaceForChild): (WebCore::RenderFlexibleBox::updateAutoMarginsInCrossAxis): (WebCore::RenderFlexibleBox::marginBoxAscentForChild): (WebCore::RenderFlexibleBox::computeChildMarginValue): (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax): (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution): (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): (WebCore::RenderFlexibleBox::childLogicalHeightForPercentageResolution): (WebCore::RenderFlexibleBox::adjustChildSizeForAspectRatioCrossAxisMinAndMax): (WebCore::RenderFlexibleBox::constructFlexItem): (WebCore::RenderFlexibleBox::freezeViolations): (WebCore::RenderFlexibleBox::freezeInflexibleItems): (WebCore::RenderFlexibleBox::resolveFlexibleLengths): (WebCore::alignmentOffset): (WebCore::RenderFlexibleBox::setOverrideMainAxisContentSizeForChild): (WebCore::RenderFlexibleBox::staticMainAxisPositionForPositionedChild): (WebCore::RenderFlexibleBox::staticCrossAxisPositionForPositionedChild): (WebCore::RenderFlexibleBox::staticInlinePositionForPositionedChild): (WebCore::RenderFlexibleBox::staticBlockPositionForPositionedChild): (WebCore::RenderFlexibleBox::setStaticPositionForPositionedLayout): (WebCore::RenderFlexibleBox::prepareChildForPositionedLayout): (WebCore::RenderFlexibleBox::alignmentForChild): (WebCore::RenderFlexibleBox::resetAutoMarginsAndLogicalTopInCrossAxis): (WebCore::RenderFlexibleBox::needToStretchChildLogicalHeight): (WebCore::RenderFlexibleBox::childHasIntrinsicMainAxisSize): (WebCore::RenderFlexibleBox::crossAxisOverflowForChild): (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): (WebCore::RenderFlexibleBox::layoutColumnReverse): (WebCore::initialAlignContentOffset): (WebCore::alignContentSpaceBetweenChildren): (WebCore::RenderFlexibleBox::alignFlexLines): (WebCore::RenderFlexibleBox::adjustAlignmentForChild): (WebCore::RenderFlexibleBox::alignChildren): (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): (WebCore::RenderFlexibleBox::flipForRightToLeftColumn): (WebCore::RenderFlexibleBox::flipForWrapReverse): (WebCore::RenderFlexibleBox::Violation::Violation): Deleted. (WebCore::RenderFlexibleBox::setCrossAxisExtent): Deleted. (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): Deleted. (WebCore::RenderFlexibleBox::mainAxisBorderAndPaddingExtentForChild): Deleted. (WebCore::RenderFlexibleBox::mainAxisScrollbarExtentForChild): Deleted. (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild): Deleted. (WebCore::RenderFlexibleBox::computeNextFlexLine): Deleted. (WebCore::RenderFlexibleBox::setLogicalOverrideSize): Deleted. (WebCore::RenderFlexibleBox::numberOfInFlowPositionedChildren): Deleted. (WebCore::RenderFlexibleBox::needToStretchChild): Deleted. (WebCore::contentAlignmentNormalBehaviorFlexibleBox): Deleted. * rendering/RenderFlexibleBox.h: (WebCore::RenderFlexibleBox::orderIterator): (WebCore::RenderFlexibleBox::isFlexibleBoxImpl): * rendering/RenderFullScreen.h: * rendering/RenderGrid.cpp: (WebCore::selfAlignmentChangedToStretchInRowAxis): (WebCore::selfAlignmentChangedFromStretchInRowAxis): (WebCore::selfAlignmentChangedFromStretchInColumnAxis): (WebCore::RenderGrid::styleDidChange): (WebCore::RenderGrid::computeTrackBasedLogicalHeight): (WebCore::RenderGrid::computeTrackSizesForDefiniteSize): (WebCore::RenderGrid::gridGapForDirection): (WebCore::RenderGrid::guttersSize): (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize): (WebCore::RenderGrid::computeAutoRepeatTracksCount): (WebCore::RenderGrid::trackSizesForComputedStyle): (WebCore::RenderGrid::offsetAndBreadthForPositionedChild): (WebCore::RenderGrid::populateGridPositionsForDirection): (WebCore::RenderGrid::alignSelfForChild): (WebCore::RenderGrid::justifySelfForChild): (WebCore::RenderGrid::columnAxisPositionForChild): (WebCore::RenderGrid::rowAxisPositionForChild): (WebCore::RenderGrid::columnAxisOffsetForChild): (WebCore::RenderGrid::rowAxisOffsetForChild): (WebCore::RenderGrid::needToStretchChildLogicalHeight): Deleted. * rendering/RenderGrid.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateScrollbarsAfterLayout): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::computeLogicalHeight): * rendering/RenderTable.cpp: (WebCore::RenderTable::layout): * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::layout): * rendering/RenderTableSection.cpp: (WebCore::shouldFlexCellChild): (WebCore::RenderTableSection::relayoutCellIfFlexed): (WebCore::RenderTableSection::layoutRows): * rendering/RenderTableSection.h: * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::computeLogicalHeight): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedAlignSelf): (WebCore::RenderStyle::resolvedJustifySelf): * rendering/style/RenderStyle.h: * style/RenderTreeUpdater.cpp: (WebCore::textRendererIsNeeded): LayoutTests: * css3/flexbox/align-absolute-child-expected.txt: * css3/flexbox/align-absolute-child.html: * css3/flexbox/alignContent-applies-with-flexWrap-wrap-with-single-line-expected.txt: Added. * css3/flexbox/alignContent-applies-with-flexWrap-wrap-with-single-line.html: Added. * css3/flexbox/anonymous-block-merge-crash.html: * css3/flexbox/assert-generated-new-flexbox-expected.txt: Added. * css3/flexbox/assert-generated-new-flexbox.html: Added. * css3/flexbox/auto-height-dynamic-expected.txt: * css3/flexbox/auto-height-dynamic.html: * css3/flexbox/auto-height-with-flex-expected.html: Added. * css3/flexbox/auto-height-with-flex.html: Added. * css3/flexbox/auto-margins-expected.html: Removed. * css3/flexbox/auto-margins.html: Removed. * css3/flexbox/border-and-padding-abspos-expected.txt: Added. * css3/flexbox/border-and-padding-abspos.html: Added. * css3/flexbox/box-orient-button-expected.txt: Added. * css3/flexbox/box-orient-button.html: Added. * css3/flexbox/box-sizing-expected.txt: * css3/flexbox/box-sizing-min-max-sizes-expected.txt: * css3/flexbox/box-sizing-min-max-sizes.html: * css3/flexbox/box-sizing.html: * css3/flexbox/bug527039-expected.txt: Added. * css3/flexbox/bug527039.html: Added. * css3/flexbox/bug580586-expected.txt: Added. * css3/flexbox/bug580586.html: Added. * css3/flexbox/bug604346-expected.html: Added. * css3/flexbox/bug604346.html: Added. * css3/flexbox/bug605682-expected.txt: Added. * css3/flexbox/bug605682.html: Added. * css3/flexbox/bug633212-expected.txt: Added. * css3/flexbox/bug633212.html: Added. * css3/flexbox/bug646288-expected.txt: Added. * css3/flexbox/bug646288.html: Added. * css3/flexbox/bug669714-expected.txt: Added. * css3/flexbox/bug669714.html: Added. * css3/flexbox/canvas-dynamic-change-expected.txt: Added. * css3/flexbox/canvas-dynamic-change.html: Added. * css3/flexbox/change-flexitem-into-abspos-expected.txt: Added. * css3/flexbox/change-flexitem-into-abspos.html: Added. * css3/flexbox/child-overflow-expected.html: * css3/flexbox/child-overflow.html: * css3/flexbox/column-flex-child-with-overflow-scroll-expected.txt: Added. * css3/flexbox/column-flex-child-with-overflow-scroll.html: Added. * css3/flexbox/columns-auto-size.html: * css3/flexbox/columns-center-with-margins-and-wrap-expected.html: Added. * css3/flexbox/columns-center-with-margins-and-wrap.html: Added. * css3/flexbox/columns-center-with-margins-expected.html: Added. * css3/flexbox/columns-center-with-margins.html: Added. * css3/flexbox/columns-height-set-via-top-bottom-expected.txt: * css3/flexbox/columns-height-set-via-top-bottom.html: * css3/flexbox/content-height-with-scrollbars.html: * css3/flexbox/cross-axis-scrollbar-expected.html: * css3/flexbox/cross-axis-scrollbar.html: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/csswg/flex-margin-no-collapse.html: * css3/flexbox/definite-cross-sizes-expected.txt: Added. * css3/flexbox/definite-cross-sizes.html: Added. * css3/flexbox/definite-main-size-expected.txt: Added. * css3/flexbox/definite-main-size.html: Added. * css3/flexbox/display-flexbox-set-get-expected.txt: * css3/flexbox/display-flexbox-set-get.html: * css3/flexbox/flex-algorithm-expected.txt: * css3/flexbox/flex-algorithm-min-max-expected.txt: * css3/flexbox/flex-algorithm-min-max.html: * css3/flexbox/flex-algorithm-with-margins-expected.txt: * css3/flexbox/flex-algorithm-with-margins.html: * css3/flexbox/flex-algorithm.html: * css3/flexbox/flex-align-baseline-expected.txt: * css3/flexbox/flex-align-baseline.html: * css3/flexbox/flex-align-column-expected.txt: * css3/flexbox/flex-align-column.html: * css3/flexbox/flex-align-end-expected.txt: * css3/flexbox/flex-align-end.html: * css3/flexbox/flex-align-max-expected.txt: * css3/flexbox/flex-align-max.html: * css3/flexbox/flex-align-percent-height-expected.txt: * css3/flexbox/flex-align-percent-height.html: * css3/flexbox/flex-align-stretch-expected.txt: * css3/flexbox/flex-align-stretch.html: * css3/flexbox/flex-align-vertical-writing-mode.html: * css3/flexbox/flex-align.html: * css3/flexbox/flex-column-relayout-assert-expected.txt: Added. * css3/flexbox/flex-column-relayout-assert.html: Added. * css3/flexbox/flex-factor-less-than-one-expected.txt: Added. * css3/flexbox/flex-factor-less-than-one.html: Added. * css3/flexbox/flex-flow-2-expected.txt: * css3/flexbox/flex-flow-2.html: * css3/flexbox/flex-flow-auto-margins-expected.txt: * css3/flexbox/flex-flow-auto-margins-no-available-space-assert-expected.txt: Added. * css3/flexbox/flex-flow-auto-margins-no-available-space-assert.html: Added. * css3/flexbox/flex-flow-auto-margins-no-available-space-expected.txt: * css3/flexbox/flex-flow-auto-margins-no-available-space.html: * css3/flexbox/flex-flow-auto-margins.html: * css3/flexbox/flex-flow-border-expected.txt: * css3/flexbox/flex-flow-border.html: * css3/flexbox/flex-flow-expected.txt: * css3/flexbox/flex-flow-initial-expected.txt: * css3/flexbox/flex-flow-initial.html: * css3/flexbox/flex-flow-margins-auto-size-expected.txt: * css3/flexbox/flex-flow-margins-auto-size.html: * css3/flexbox/flex-flow-margins-expected.txt: * css3/flexbox/flex-flow-margins.html: * css3/flexbox/flex-flow-orientations-expected.txt: * css3/flexbox/flex-flow-orientations.html: * css3/flexbox/flex-flow-overflow-expected.txt: * css3/flexbox/flex-flow-overflow.html: * css3/flexbox/flex-flow-padding-expected.txt: * css3/flexbox/flex-flow-padding.html: * css3/flexbox/flex-flow.html: * css3/flexbox/flex-item-child-overflow-expected.txt: * css3/flexbox/flex-item-child-overflow.html: * css3/flexbox/flex-item-contains-strict-expected.txt: Added. * css3/flexbox/flex-item-contains-strict.html: Added. * css3/flexbox/flex-item-firstLine-valid-expected.txt: * css3/flexbox/flex-item-firstLine-valid.html: * css3/flexbox/flex-justify-content-expected.txt: * css3/flexbox/flex-justify-content.html: * css3/flexbox/flex-longhand-parsing-expected.txt: * css3/flexbox/flex-longhand-parsing.html: * css3/flexbox/flex-no-flex-expected.txt: * css3/flexbox/flex-no-flex.html: * css3/flexbox/flex-one-sets-flex-basis-to-zero-px-expected.txt: Added. * css3/flexbox/flex-one-sets-flex-basis-to-zero-px.html: Added. * css3/flexbox/flex-order-expected.html: Added. * css3/flexbox/flex-order-expected.png: Removed. * css3/flexbox/flex-order-expected.txt: Removed. * css3/flexbox/flex-order.html: * css3/flexbox/flex-property-parsing-expected.txt: * css3/flexbox/flex-property-parsing.html: * css3/flexbox/flex-shorthand-flex-basis-middle-expected.txt: Added. * css3/flexbox/flex-shorthand-flex-basis-middle.html: Added. * css3/flexbox/flexbox-baseline.html: * css3/flexbox/flexbox-height-with-overflow-auto-expected.txt: Added. * css3/flexbox/flexbox-height-with-overflow-auto.html: Added. * css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt: * css3/flexbox/flexbox-ignore-container-firstLetter.html: * css3/flexbox/flexbox-ignore-firstLetter-expected.txt: * css3/flexbox/flexbox-ignore-firstLetter.html: * css3/flexbox/flexbox-ignore-firstLine-expected.txt: * css3/flexbox/flexbox-ignore-firstLine.html: * css3/flexbox/flexbox-lines-must-be-stretched-by-default-expected.txt: * css3/flexbox/flexbox-lines-must-be-stretched-by-default.html: * css3/flexbox/flexbox-overflow-auto-expected.html: * css3/flexbox/flexbox-overflow-auto.html: * css3/flexbox/flexbox-with-multi-column-property-expected.html: Added. * css3/flexbox/flexbox-with-multi-column-property.html: Added. * css3/flexbox/flexbox-wordwrap-expected.txt: Added. * css3/flexbox/flexbox-wordwrap.html: Added. * css3/flexbox/flexitem-expected.txt: * css3/flexbox/flexitem-no-margin-collapsing-expected.txt: * css3/flexbox/flexitem-no-margin-collapsing.html: * css3/flexbox/flexitem-percent-height-change-expected.txt: * css3/flexbox/flexitem-percent-height-change.html: * css3/flexbox/flexitem-stretch-image-expected.txt: * css3/flexbox/flexitem-stretch-image.html: * css3/flexbox/flexitem-stretch-range.html: * css3/flexbox/flexitem.html: * css3/flexbox/floated-flexbox-expected.txt: * css3/flexbox/floated-flexbox.html: * css3/flexbox/floated-flexitem.html: * css3/flexbox/inline-flex-crash.html: * css3/flexbox/inline-flex-crash2.html: * css3/flexbox/inline-flex-expected.txt: * css3/flexbox/inline-flex.html: * css3/flexbox/inline-flexbox-ignore-firstLine-expected.txt: * css3/flexbox/inline-flexbox-ignore-firstLine.html: * css3/flexbox/inline-flexbox-wrap-vertically-width-calculation-expected.txt: Added. * css3/flexbox/inline-flexbox-wrap-vertically-width-calculation.html: Added. * css3/flexbox/insert-text-crash.html: * css3/flexbox/intrinsic-min-width-applies-with-fixed-width-expected.txt: * css3/flexbox/intrinsic-min-width-applies-with-fixed-width.html: * css3/flexbox/intrinsic-width-orthogonal-writing-mode-expected.txt: Added. * css3/flexbox/intrinsic-width-orthogonal-writing-mode.html: Added. * css3/flexbox/large-flex-shrink-assert-expected.txt: Added. * css3/flexbox/large-flex-shrink-assert.html: Added. * css3/flexbox/line-wrapping.html: * css3/flexbox/mainAxisExtent-crash-expected.txt: Added. * css3/flexbox/mainAxisExtent-crash.html: Added. * css3/flexbox/max-width-violation-expected.txt: Added. * css3/flexbox/max-width-violation.html: Added. * css3/flexbox/min-size-auto-expected.txt: * css3/flexbox/min-size-auto.html: * css3/flexbox/minimum-size-image-expected.txt: Added. * css3/flexbox/minimum-size-image.html: Added. * css3/flexbox/multiline-align-content-expected.txt: * css3/flexbox/multiline-align-content-horizontal-column-expected.txt: * css3/flexbox/multiline-align-content-horizontal-column.html: * css3/flexbox/multiline-align-content.html: * css3/flexbox/multiline-align-self-expected.txt: * css3/flexbox/multiline-align-self.html: * css3/flexbox/multiline-column-auto-expected.txt: * css3/flexbox/multiline-column-auto.html: * css3/flexbox/multiline-column-overflow-expected.html: Added. * css3/flexbox/multiline-column-overflow.html: Added. * css3/flexbox/multiline-expected.txt: * css3/flexbox/multiline-justify-content-expected.txt: * css3/flexbox/multiline-justify-content.html: * css3/flexbox/multiline-min-max-expected.txt: Added. * css3/flexbox/multiline-min-max.html: Added. * css3/flexbox/multiline-min-preferred-width-expected.txt: * css3/flexbox/multiline-min-preferred-width.html: * css3/flexbox/multiline-reverse-wrap-baseline.html: * css3/flexbox/multiline-reverse-wrap-overflow-expected.txt: * css3/flexbox/multiline-reverse-wrap-overflow.html: * css3/flexbox/multiline-shrink-to-fit-expected.html: * css3/flexbox/multiline-shrink-to-fit.html: * css3/flexbox/multiline.html: * css3/flexbox/negative-flex-rounding-assert.html: * css3/flexbox/negative-margins-assert.html: * css3/flexbox/negative-overflow-expected.txt: * css3/flexbox/negative-overflow.html: * css3/flexbox/nested-flexbox-min-size-auto-expected.txt: Added. * css3/flexbox/nested-flexbox-min-size-auto.html: Added. * css3/flexbox/nested-orthogonal-flexbox-relayout-expected.html: Added. * css3/flexbox/nested-orthogonal-flexbox-relayout.html: Added. * css3/flexbox/nested-stretch-expected.txt: * css3/flexbox/nested-stretch.html: * css3/flexbox/order-painting.html: * css3/flexbox/orthogonal-flex-directions-expected.txt: * css3/flexbox/orthogonal-flex-directions.html: * css3/flexbox/orthogonal-writing-modes-and-intrinsic-sizing-expected.txt: Added. * css3/flexbox/orthogonal-writing-modes-and-intrinsic-sizing.html: Added. * css3/flexbox/overflow-and-padding-expected.txt: Added. * css3/flexbox/overflow-and-padding.html: Added. * css3/flexbox/overflow-auto-dynamic-changes-abspos-expected.html: Added. * css3/flexbox/overflow-auto-dynamic-changes-abspos.html: Added. * css3/flexbox/overflow-auto-dynamic-changes-expected.html: Added. * css3/flexbox/overflow-auto-dynamic-changes.html: Added. * css3/flexbox/overflow-auto-resizes-correctly-expected.txt: Added. * css3/flexbox/overflow-auto-resizes-correctly.html: Added. * css3/flexbox/overflow-keep-scrollpos-expected.txt: * css3/flexbox/overflow-keep-scrollpos.html: * css3/flexbox/percent-height-children-of-alignSelf-stretch-flex-item-expected.txt: Added. * css3/flexbox/percent-height-children-of-alignSelf-stretch-flex-item.html: Added. * css3/flexbox/percent-margins-expected.txt: * css3/flexbox/percent-margins.html: * css3/flexbox/percentage-height-in-abspos-expected.html: Added. * css3/flexbox/percentage-height-in-abspos.html: Added. * css3/flexbox/percentage-height-replaced-element-expected.txt: Added. * css3/flexbox/percentage-height-replaced-element.html: Added. * css3/flexbox/percentage-heights-expected.txt: * css3/flexbox/percentage-heights.html: * css3/flexbox/percentage-max-width-cross-axis-expected.txt: Added. * css3/flexbox/percentage-max-width-cross-axis.html: Added. * css3/flexbox/percentage-sizes-expected.txt: * css3/flexbox/percentage-sizes-quirks-expected.txt: * css3/flexbox/percentage-sizes-quirks.html: * css3/flexbox/percentage-sizes.html: * css3/flexbox/percentage-width-in-abspos-expected.html: Added. * css3/flexbox/percentage-width-in-abspos.html: Added. * css3/flexbox/perpendicular-writing-modes-inside-flex-item-expected.txt: * css3/flexbox/perpendicular-writing-modes-inside-flex-item.html: * css3/flexbox/position-absolute-child-expected.txt: * css3/flexbox/position-absolute-child.html: * css3/flexbox/position-absolute-children-expected.txt: * css3/flexbox/position-absolute-children.html: * css3/flexbox/preferred-widths-expected.txt: * css3/flexbox/preferred-widths-orthogonal.html: * css3/flexbox/preferred-widths.html: * css3/flexbox/relayout-align-items-expected.txt: * css3/flexbox/relayout-align-items.html: * css3/flexbox/relayout-image-load-expected.txt: * css3/flexbox/relayout-image-load.html: * css3/flexbox/relpos-with-percentage-top-expected.txt: Added. * css3/flexbox/relpos-with-percentage-top.html: Added. * css3/flexbox/relpos-with-scrollable-with-abspos-crash-expected.txt: Added. * css3/flexbox/relpos-with-scrollable-with-abspos-crash.html: Added. * css3/flexbox/resize-min-content-flexbox-expected.txt: Added. * css3/flexbox/resize-min-content-flexbox.html: Added. * css3/flexbox/resources/box-orient-button.js: Added. (setFlexDirection): (gebi): (test): * css3/flexbox/scrollbars-auto-expected.html: Added. * css3/flexbox/scrollbars-auto.html: Added. * css3/flexbox/scrollbars-expected.html: Added. * css3/flexbox/scrollbars.html: Added. * css3/flexbox/shrinking-column-flexbox-expected.txt: Added. * css3/flexbox/shrinking-column-flexbox.html: Added. * css3/flexbox/stretch-after-sibling-size-change-expected.txt: * css3/flexbox/stretch-after-sibling-size-change.html: * css3/flexbox/stretch-input-in-column-expected.html: * css3/flexbox/stretch-simplified-layout-expected.txt: * css3/flexbox/stretch-simplified-layout.html: * css3/flexbox/stretch-table-child-expected.txt: Added. * css3/flexbox/stretch-table-child.html: Added. * css3/flexbox/stretched-child-shrink-on-relayout-expected.txt: Added. * css3/flexbox/stretched-child-shrink-on-relayout.html: Added. * css3/flexbox/stretching-orthogonal-flows-expected.html: Added. * css3/flexbox/stretching-orthogonal-flows.html: Added. * css3/flexbox/style-change-expected.txt: * css3/flexbox/style-change.html: * css3/flexbox/text-overflow-on-flexbox-expected.html: Added. * css3/flexbox/text-overflow-on-flexbox.html: Added. * css3/flexbox/true-centering-expected.txt: * css3/flexbox/true-centering.html: * css3/flexbox/undefined-min-width-expected.txt: Added. * css3/flexbox/undefined-min-width.html: Added. * css3/flexbox/vertical-align-do-not-effect-flex-items-expected.html: Added. * css3/flexbox/vertical-align-do-not-effect-flex-items.html: Added. * css3/flexbox/vertical-flexbox-percentage-ignored-expected.html: Added. * css3/flexbox/vertical-flexbox-percentage-ignored.html: Added. * css3/flexbox/whitespace-in-flexitem-expected.html: Added. * css3/flexbox/whitespace-in-flexitem.html: Added. * css3/flexbox/width-change-and-relayout-children-expected.txt: * css3/flexbox/width-change-and-relayout-children.html: * css3/flexbox/wrapping-column-dynamic-changes-expected.txt: Added. * css3/flexbox/wrapping-column-dynamic-changes.html: Added. * css3/flexbox/writing-modes-expected.txt: * css3/flexbox/writing-modes.html: * css3/flexbox/z-index.html: * resources/check-layout-th.js: Added. (checkSubtreeExpectedValues): (checkAttribute): (assert_tolerance): (checkExpectedValues): (window.checkLayout): Canonical link: https://commits.webkit.org/185959@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-28 16:23:15 +00:00
OrderValues m_orderValues;
OrderValues::const_iterator m_orderValuesIterator;
bool m_isReset { false };
[CSS Grid Layout] Add support for order inside grid items https://bugs.webkit.org/show_bug.cgi?id=123208 Reviewed by Antti Koivisto. Source/WebCore: Based on Blink r153457 and r153536 by <jchaffraix@chromium.org> Added support for sorting grid items by using -webkit-order property. Used OrderIterator to implement it so it had to be moved out of RenderFlexibleBox to be shared with RenderGrid. Tests: fast/css-grid-layout/grid-item-order-auto-flow-resolution.html fast/css-grid-layout/grid-item-order-paint-order.html * CMakeLists.txt: Added new file. * GNUmakefile.list.am: Ditto. * WebCore.vcxproj/WebCore.vcxproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * rendering/OrderIterator.cpp: Added. Ripped out of RenderFlexibleBox. (WebCore::OrderIterator::OrderIterator): (WebCore::OrderIterator::setOrderValues): Use std::move semantics. (WebCore::OrderIterator::first): Use an integer as iterator. (WebCore::OrderIterator::next): Ditto. (WebCore::OrderIterator::reset): Ditto. * rendering/OrderIterator.h: Added. (WebCore::OrderIterator::currentChild): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::RenderFlexibleBox): (WebCore::RenderFlexibleBox::layoutBlock): * rendering/RenderFlexibleBox.h: * rendering/RenderGrid.cpp: (WebCore::RenderGrid::RenderGrid): (WebCore::RenderGrid::placeItemsOnGrid): (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): (WebCore::RenderGrid::paintChildren): * rendering/RenderGrid.h: LayoutTests: From Blink r153536 by <jchaffraix@chromium.org> Added a couple of tests to verify that we respect the specified order of grid items both in the auto-placement algorithm and in the final painting. * fast/css-grid-layout/grid-item-order-auto-flow-resolution-expected.txt: Added. * fast/css-grid-layout/grid-item-order-auto-flow-resolution.html: Added. * fast/css-grid-layout/grid-item-order-paint-order-expected.html: Added. * fast/css-grid-layout/grid-item-order-paint-order.html: Added. Canonical link: https://commits.webkit.org/141517@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-28 17:35:52 +00:00
};
Setting up OrderIterator shouldn't require an extra Vector https://bugs.webkit.org/show_bug.cgi?id=119061 Reviewed by Darin Adler. From Blink r153971 by <jchaffraix@chromium.org> This patches reuse the OrderIterator's Vector. It provides a helper class OrderIteratorPopulator, used for manipulating the Vector directly. Which allows to consolidate the code into a single implementation across flexbox and grid. No new tests, already covered by current tests. * rendering/OrderIterator.cpp: (WebCore::OrderIteratorPopulator::~OrderIteratorPopulator): Reset OrderIterator and call removeDuplicatedOrderValues(). (WebCore::OrderIteratorPopulator::removeDuplicatedOrderValues): Sorts the Vector and removes the duplicated order values. (WebCore::OrderIteratorPopulator::collectChild): Collect order value information from child. (WebCore::OrderIterator::setOrderValues): Deleted. * rendering/OrderIterator.h: (WebCore::OrderIteratorPopulator::OrderIteratorPopulator): Add helper class to manipulate OrderValues Vector. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): Remove unneeded code related to old OrderValues vector. (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins): Populate OrderIterator using collectChild(). (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): Deleted. * rendering/RenderFlexibleBox.h: Rename computeMainAxisPreferredSizes() to prepareOrderIteratorAndMargins(). * rendering/RenderGrid.cpp: (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Populate OrderIterator using collectChild(). Canonical link: https://commits.webkit.org/151329@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-27 07:17:52 +00:00
class OrderIteratorPopulator {
public:
Update flexbox to Blink's tip of tree https://bugs.webkit.org/show_bug.cgi?id=168657 Reviewed by Zalan Bujtas. Source/WebCore: Added new tests in css3/flexbox. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * rendering/FlexibleBoxAlgorithm.cpp: Added. (WebCore::FlexItem::FlexItem): (WebCore::FlexLayoutAlgorithm::FlexLayoutAlgorithm): (WebCore::FlexLayoutAlgorithm::computeNextFlexLine): * rendering/FlexibleBoxAlgorithm.h: Added. (WebCore::FlexItem::hypotheticalMainAxisMarginBoxSize): (WebCore::FlexItem::flexBaseMarginBoxSize): (WebCore::FlexItem::flexedMarginBoxSize): (WebCore::FlexLayoutAlgorithm::isMultiline): * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize): (WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems): (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild): (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild): (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded): * rendering/GridTrackSizingAlgorithm.h: * rendering/OrderIterator.cpp: (WebCore::OrderIterator::next): (WebCore::OrderIterator::reset): (WebCore::OrderIteratorPopulator::~OrderIteratorPopulator): (WebCore::OrderIteratorPopulator::collectChild): (WebCore::OrderIteratorPopulator::OrderIteratorPopulator): Deleted. (WebCore::OrderIteratorPopulator::removeDuplicatedOrderValues): Deleted. * rendering/OrderIterator.h: (WebCore::OrderIteratorPopulator::OrderIteratorPopulator): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::updateBlockChildDirtyBitsBeforeLayout): (WebCore::RenderBlock::layoutPositionedObject): (WebCore::RenderBlock::computeBlockPreferredLogicalWidths): (WebCore::RenderBlock::computeChildPreferredLogicalWidths): (WebCore::RenderBlock::hasDefiniteLogicalHeight): (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation): * rendering/RenderBlock.h: (WebCore::RenderBlock::hasPercentHeightDescendants): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::isStretchingColumnFlexItem): (WebCore::RenderBox::hasStretchedLogicalWidth): (WebCore::RenderBox::sizesLogicalWidthToFitContent): (WebCore::RenderBox::computeInlineDirectionMargins): (WebCore::RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem): (WebCore::RenderBox::updateLogicalHeight): (WebCore::RenderBox::computeLogicalHeightWithoutLayout): (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation): (WebCore::RenderBox::shouldTreatChildAsReplacedInTableCells): (WebCore::tableCellShouldHaveZeroInitialSize): (WebCore::RenderBox::computePercentageLogicalHeight): (WebCore::RenderBox::computeReplacedLogicalHeightUsing): (WebCore::RenderBox::availableLogicalHeightUsing): (WebCore::RenderBox::percentageLogicalHeightIsResolvable): (WebCore::RenderBox::hasUnsplittableScrollingOverflow): (WebCore::flexItemHasStretchAlignment): Deleted. (WebCore::isStretchingColumnFlexItem): Deleted. (WebCore::logicalWidthIsResolvable): Deleted. (WebCore::RenderBox::hasDefiniteLogicalWidth): Deleted. (WebCore::percentageLogicalHeightIsResolvable): Deleted. (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock): Deleted. (WebCore::RenderBox::hasDefiniteLogicalHeight): Deleted. * rendering/RenderBox.h: (WebCore::RenderBox::isGridItem): (WebCore::RenderBox::isFlexItem): (WebCore::RenderBox::selfAlignmentNormalBehavior): * rendering/RenderBoxModelObject.cpp: (WebCore::isOutOfFlowPositionedWithImplicitHeight): (WebCore::RenderBoxModelObject::containingBlockForAutoHeightDetection): (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight): * rendering/RenderBoxModelObject.h: * rendering/RenderElement.cpp: (WebCore::RenderElement::removeChildInternal): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::LineContext::LineContext): (WebCore::RenderFlexibleBox::RenderFlexibleBox): (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths): (WebCore::contentAlignmentNormalBehavior): (WebCore::RenderFlexibleBox::styleDidChange): (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems): (WebCore::RenderFlexibleBox::clientLogicalBottomAfterRepositioning): (WebCore::RenderFlexibleBox::hasOrthogonalFlow): (WebCore::RenderFlexibleBox::flexBasisForChild): (WebCore::RenderFlexibleBox::crossAxisExtentForChild): (WebCore::RenderFlexibleBox::cachedChildIntrinsicContentLogicalHeight): (WebCore::RenderFlexibleBox::setCachedChildIntrinsicContentLogicalHeight): (WebCore::RenderFlexibleBox::clearCachedChildIntrinsicContentLogicalHeight): (WebCore::RenderFlexibleBox::childIntrinsicLogicalHeight): (WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth): (WebCore::RenderFlexibleBox::crossAxisIntrinsicExtentForChild): (WebCore::RenderFlexibleBox::mainAxisExtentForChild): (WebCore::RenderFlexibleBox::mainAxisContentExtentForChildIncludingScrollbar): (WebCore::RenderFlexibleBox::crossAxisExtent): (WebCore::RenderFlexibleBox::mainAxisExtent): (WebCore::RenderFlexibleBox::mainAxisContentExtent): (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild): (WebCore::RenderFlexibleBox::transformedWritingMode): (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild): (WebCore::RenderFlexibleBox::crossAxisMarginExtentForChild): (WebCore::RenderFlexibleBox::flowAwareLocationForChild): (WebCore::RenderFlexibleBox::useChildAspectRatio): (WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing): (WebCore::RenderFlexibleBox::setFlowAwareLocationForChild): (WebCore::RenderFlexibleBox::mainAxisLengthIsDefinite): (WebCore::RenderFlexibleBox::crossAxisLengthIsDefinite): (WebCore::RenderFlexibleBox::cacheChildMainSize): (WebCore::RenderFlexibleBox::clearCachedMainSizeForChild): (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild): (WebCore::RenderFlexibleBox::layoutFlexItems): (WebCore::RenderFlexibleBox::autoMarginOffsetInMainAxis): (WebCore::RenderFlexibleBox::updateAutoMarginsInMainAxis): (WebCore::RenderFlexibleBox::hasAutoMarginsInCrossAxis): (WebCore::RenderFlexibleBox::availableAlignmentSpaceForChild): (WebCore::RenderFlexibleBox::updateAutoMarginsInCrossAxis): (WebCore::RenderFlexibleBox::marginBoxAscentForChild): (WebCore::RenderFlexibleBox::computeChildMarginValue): (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax): (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution): (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): (WebCore::RenderFlexibleBox::childLogicalHeightForPercentageResolution): (WebCore::RenderFlexibleBox::adjustChildSizeForAspectRatioCrossAxisMinAndMax): (WebCore::RenderFlexibleBox::constructFlexItem): (WebCore::RenderFlexibleBox::freezeViolations): (WebCore::RenderFlexibleBox::freezeInflexibleItems): (WebCore::RenderFlexibleBox::resolveFlexibleLengths): (WebCore::alignmentOffset): (WebCore::RenderFlexibleBox::setOverrideMainAxisContentSizeForChild): (WebCore::RenderFlexibleBox::staticMainAxisPositionForPositionedChild): (WebCore::RenderFlexibleBox::staticCrossAxisPositionForPositionedChild): (WebCore::RenderFlexibleBox::staticInlinePositionForPositionedChild): (WebCore::RenderFlexibleBox::staticBlockPositionForPositionedChild): (WebCore::RenderFlexibleBox::setStaticPositionForPositionedLayout): (WebCore::RenderFlexibleBox::prepareChildForPositionedLayout): (WebCore::RenderFlexibleBox::alignmentForChild): (WebCore::RenderFlexibleBox::resetAutoMarginsAndLogicalTopInCrossAxis): (WebCore::RenderFlexibleBox::needToStretchChildLogicalHeight): (WebCore::RenderFlexibleBox::childHasIntrinsicMainAxisSize): (WebCore::RenderFlexibleBox::crossAxisOverflowForChild): (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): (WebCore::RenderFlexibleBox::layoutColumnReverse): (WebCore::initialAlignContentOffset): (WebCore::alignContentSpaceBetweenChildren): (WebCore::RenderFlexibleBox::alignFlexLines): (WebCore::RenderFlexibleBox::adjustAlignmentForChild): (WebCore::RenderFlexibleBox::alignChildren): (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): (WebCore::RenderFlexibleBox::flipForRightToLeftColumn): (WebCore::RenderFlexibleBox::flipForWrapReverse): (WebCore::RenderFlexibleBox::Violation::Violation): Deleted. (WebCore::RenderFlexibleBox::setCrossAxisExtent): Deleted. (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): Deleted. (WebCore::RenderFlexibleBox::mainAxisBorderAndPaddingExtentForChild): Deleted. (WebCore::RenderFlexibleBox::mainAxisScrollbarExtentForChild): Deleted. (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild): Deleted. (WebCore::RenderFlexibleBox::computeNextFlexLine): Deleted. (WebCore::RenderFlexibleBox::setLogicalOverrideSize): Deleted. (WebCore::RenderFlexibleBox::numberOfInFlowPositionedChildren): Deleted. (WebCore::RenderFlexibleBox::needToStretchChild): Deleted. (WebCore::contentAlignmentNormalBehaviorFlexibleBox): Deleted. * rendering/RenderFlexibleBox.h: (WebCore::RenderFlexibleBox::orderIterator): (WebCore::RenderFlexibleBox::isFlexibleBoxImpl): * rendering/RenderFullScreen.h: * rendering/RenderGrid.cpp: (WebCore::selfAlignmentChangedToStretchInRowAxis): (WebCore::selfAlignmentChangedFromStretchInRowAxis): (WebCore::selfAlignmentChangedFromStretchInColumnAxis): (WebCore::RenderGrid::styleDidChange): (WebCore::RenderGrid::computeTrackBasedLogicalHeight): (WebCore::RenderGrid::computeTrackSizesForDefiniteSize): (WebCore::RenderGrid::gridGapForDirection): (WebCore::RenderGrid::guttersSize): (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize): (WebCore::RenderGrid::computeAutoRepeatTracksCount): (WebCore::RenderGrid::trackSizesForComputedStyle): (WebCore::RenderGrid::offsetAndBreadthForPositionedChild): (WebCore::RenderGrid::populateGridPositionsForDirection): (WebCore::RenderGrid::alignSelfForChild): (WebCore::RenderGrid::justifySelfForChild): (WebCore::RenderGrid::columnAxisPositionForChild): (WebCore::RenderGrid::rowAxisPositionForChild): (WebCore::RenderGrid::columnAxisOffsetForChild): (WebCore::RenderGrid::rowAxisOffsetForChild): (WebCore::RenderGrid::needToStretchChildLogicalHeight): Deleted. * rendering/RenderGrid.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateScrollbarsAfterLayout): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::computeLogicalHeight): * rendering/RenderTable.cpp: (WebCore::RenderTable::layout): * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::layout): * rendering/RenderTableSection.cpp: (WebCore::shouldFlexCellChild): (WebCore::RenderTableSection::relayoutCellIfFlexed): (WebCore::RenderTableSection::layoutRows): * rendering/RenderTableSection.h: * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::computeLogicalHeight): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedAlignSelf): (WebCore::RenderStyle::resolvedJustifySelf): * rendering/style/RenderStyle.h: * style/RenderTreeUpdater.cpp: (WebCore::textRendererIsNeeded): LayoutTests: * css3/flexbox/align-absolute-child-expected.txt: * css3/flexbox/align-absolute-child.html: * css3/flexbox/alignContent-applies-with-flexWrap-wrap-with-single-line-expected.txt: Added. * css3/flexbox/alignContent-applies-with-flexWrap-wrap-with-single-line.html: Added. * css3/flexbox/anonymous-block-merge-crash.html: * css3/flexbox/assert-generated-new-flexbox-expected.txt: Added. * css3/flexbox/assert-generated-new-flexbox.html: Added. * css3/flexbox/auto-height-dynamic-expected.txt: * css3/flexbox/auto-height-dynamic.html: * css3/flexbox/auto-height-with-flex-expected.html: Added. * css3/flexbox/auto-height-with-flex.html: Added. * css3/flexbox/auto-margins-expected.html: Removed. * css3/flexbox/auto-margins.html: Removed. * css3/flexbox/border-and-padding-abspos-expected.txt: Added. * css3/flexbox/border-and-padding-abspos.html: Added. * css3/flexbox/box-orient-button-expected.txt: Added. * css3/flexbox/box-orient-button.html: Added. * css3/flexbox/box-sizing-expected.txt: * css3/flexbox/box-sizing-min-max-sizes-expected.txt: * css3/flexbox/box-sizing-min-max-sizes.html: * css3/flexbox/box-sizing.html: * css3/flexbox/bug527039-expected.txt: Added. * css3/flexbox/bug527039.html: Added. * css3/flexbox/bug580586-expected.txt: Added. * css3/flexbox/bug580586.html: Added. * css3/flexbox/bug604346-expected.html: Added. * css3/flexbox/bug604346.html: Added. * css3/flexbox/bug605682-expected.txt: Added. * css3/flexbox/bug605682.html: Added. * css3/flexbox/bug633212-expected.txt: Added. * css3/flexbox/bug633212.html: Added. * css3/flexbox/bug646288-expected.txt: Added. * css3/flexbox/bug646288.html: Added. * css3/flexbox/bug669714-expected.txt: Added. * css3/flexbox/bug669714.html: Added. * css3/flexbox/canvas-dynamic-change-expected.txt: Added. * css3/flexbox/canvas-dynamic-change.html: Added. * css3/flexbox/change-flexitem-into-abspos-expected.txt: Added. * css3/flexbox/change-flexitem-into-abspos.html: Added. * css3/flexbox/child-overflow-expected.html: * css3/flexbox/child-overflow.html: * css3/flexbox/column-flex-child-with-overflow-scroll-expected.txt: Added. * css3/flexbox/column-flex-child-with-overflow-scroll.html: Added. * css3/flexbox/columns-auto-size.html: * css3/flexbox/columns-center-with-margins-and-wrap-expected.html: Added. * css3/flexbox/columns-center-with-margins-and-wrap.html: Added. * css3/flexbox/columns-center-with-margins-expected.html: Added. * css3/flexbox/columns-center-with-margins.html: Added. * css3/flexbox/columns-height-set-via-top-bottom-expected.txt: * css3/flexbox/columns-height-set-via-top-bottom.html: * css3/flexbox/content-height-with-scrollbars.html: * css3/flexbox/cross-axis-scrollbar-expected.html: * css3/flexbox/cross-axis-scrollbar.html: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/csswg/flex-margin-no-collapse.html: * css3/flexbox/definite-cross-sizes-expected.txt: Added. * css3/flexbox/definite-cross-sizes.html: Added. * css3/flexbox/definite-main-size-expected.txt: Added. * css3/flexbox/definite-main-size.html: Added. * css3/flexbox/display-flexbox-set-get-expected.txt: * css3/flexbox/display-flexbox-set-get.html: * css3/flexbox/flex-algorithm-expected.txt: * css3/flexbox/flex-algorithm-min-max-expected.txt: * css3/flexbox/flex-algorithm-min-max.html: * css3/flexbox/flex-algorithm-with-margins-expected.txt: * css3/flexbox/flex-algorithm-with-margins.html: * css3/flexbox/flex-algorithm.html: * css3/flexbox/flex-align-baseline-expected.txt: * css3/flexbox/flex-align-baseline.html: * css3/flexbox/flex-align-column-expected.txt: * css3/flexbox/flex-align-column.html: * css3/flexbox/flex-align-end-expected.txt: * css3/flexbox/flex-align-end.html: * css3/flexbox/flex-align-max-expected.txt: * css3/flexbox/flex-align-max.html: * css3/flexbox/flex-align-percent-height-expected.txt: * css3/flexbox/flex-align-percent-height.html: * css3/flexbox/flex-align-stretch-expected.txt: * css3/flexbox/flex-align-stretch.html: * css3/flexbox/flex-align-vertical-writing-mode.html: * css3/flexbox/flex-align.html: * css3/flexbox/flex-column-relayout-assert-expected.txt: Added. * css3/flexbox/flex-column-relayout-assert.html: Added. * css3/flexbox/flex-factor-less-than-one-expected.txt: Added. * css3/flexbox/flex-factor-less-than-one.html: Added. * css3/flexbox/flex-flow-2-expected.txt: * css3/flexbox/flex-flow-2.html: * css3/flexbox/flex-flow-auto-margins-expected.txt: * css3/flexbox/flex-flow-auto-margins-no-available-space-assert-expected.txt: Added. * css3/flexbox/flex-flow-auto-margins-no-available-space-assert.html: Added. * css3/flexbox/flex-flow-auto-margins-no-available-space-expected.txt: * css3/flexbox/flex-flow-auto-margins-no-available-space.html: * css3/flexbox/flex-flow-auto-margins.html: * css3/flexbox/flex-flow-border-expected.txt: * css3/flexbox/flex-flow-border.html: * css3/flexbox/flex-flow-expected.txt: * css3/flexbox/flex-flow-initial-expected.txt: * css3/flexbox/flex-flow-initial.html: * css3/flexbox/flex-flow-margins-auto-size-expected.txt: * css3/flexbox/flex-flow-margins-auto-size.html: * css3/flexbox/flex-flow-margins-expected.txt: * css3/flexbox/flex-flow-margins.html: * css3/flexbox/flex-flow-orientations-expected.txt: * css3/flexbox/flex-flow-orientations.html: * css3/flexbox/flex-flow-overflow-expected.txt: * css3/flexbox/flex-flow-overflow.html: * css3/flexbox/flex-flow-padding-expected.txt: * css3/flexbox/flex-flow-padding.html: * css3/flexbox/flex-flow.html: * css3/flexbox/flex-item-child-overflow-expected.txt: * css3/flexbox/flex-item-child-overflow.html: * css3/flexbox/flex-item-contains-strict-expected.txt: Added. * css3/flexbox/flex-item-contains-strict.html: Added. * css3/flexbox/flex-item-firstLine-valid-expected.txt: * css3/flexbox/flex-item-firstLine-valid.html: * css3/flexbox/flex-justify-content-expected.txt: * css3/flexbox/flex-justify-content.html: * css3/flexbox/flex-longhand-parsing-expected.txt: * css3/flexbox/flex-longhand-parsing.html: * css3/flexbox/flex-no-flex-expected.txt: * css3/flexbox/flex-no-flex.html: * css3/flexbox/flex-one-sets-flex-basis-to-zero-px-expected.txt: Added. * css3/flexbox/flex-one-sets-flex-basis-to-zero-px.html: Added. * css3/flexbox/flex-order-expected.html: Added. * css3/flexbox/flex-order-expected.png: Removed. * css3/flexbox/flex-order-expected.txt: Removed. * css3/flexbox/flex-order.html: * css3/flexbox/flex-property-parsing-expected.txt: * css3/flexbox/flex-property-parsing.html: * css3/flexbox/flex-shorthand-flex-basis-middle-expected.txt: Added. * css3/flexbox/flex-shorthand-flex-basis-middle.html: Added. * css3/flexbox/flexbox-baseline.html: * css3/flexbox/flexbox-height-with-overflow-auto-expected.txt: Added. * css3/flexbox/flexbox-height-with-overflow-auto.html: Added. * css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt: * css3/flexbox/flexbox-ignore-container-firstLetter.html: * css3/flexbox/flexbox-ignore-firstLetter-expected.txt: * css3/flexbox/flexbox-ignore-firstLetter.html: * css3/flexbox/flexbox-ignore-firstLine-expected.txt: * css3/flexbox/flexbox-ignore-firstLine.html: * css3/flexbox/flexbox-lines-must-be-stretched-by-default-expected.txt: * css3/flexbox/flexbox-lines-must-be-stretched-by-default.html: * css3/flexbox/flexbox-overflow-auto-expected.html: * css3/flexbox/flexbox-overflow-auto.html: * css3/flexbox/flexbox-with-multi-column-property-expected.html: Added. * css3/flexbox/flexbox-with-multi-column-property.html: Added. * css3/flexbox/flexbox-wordwrap-expected.txt: Added. * css3/flexbox/flexbox-wordwrap.html: Added. * css3/flexbox/flexitem-expected.txt: * css3/flexbox/flexitem-no-margin-collapsing-expected.txt: * css3/flexbox/flexitem-no-margin-collapsing.html: * css3/flexbox/flexitem-percent-height-change-expected.txt: * css3/flexbox/flexitem-percent-height-change.html: * css3/flexbox/flexitem-stretch-image-expected.txt: * css3/flexbox/flexitem-stretch-image.html: * css3/flexbox/flexitem-stretch-range.html: * css3/flexbox/flexitem.html: * css3/flexbox/floated-flexbox-expected.txt: * css3/flexbox/floated-flexbox.html: * css3/flexbox/floated-flexitem.html: * css3/flexbox/inline-flex-crash.html: * css3/flexbox/inline-flex-crash2.html: * css3/flexbox/inline-flex-expected.txt: * css3/flexbox/inline-flex.html: * css3/flexbox/inline-flexbox-ignore-firstLine-expected.txt: * css3/flexbox/inline-flexbox-ignore-firstLine.html: * css3/flexbox/inline-flexbox-wrap-vertically-width-calculation-expected.txt: Added. * css3/flexbox/inline-flexbox-wrap-vertically-width-calculation.html: Added. * css3/flexbox/insert-text-crash.html: * css3/flexbox/intrinsic-min-width-applies-with-fixed-width-expected.txt: * css3/flexbox/intrinsic-min-width-applies-with-fixed-width.html: * css3/flexbox/intrinsic-width-orthogonal-writing-mode-expected.txt: Added. * css3/flexbox/intrinsic-width-orthogonal-writing-mode.html: Added. * css3/flexbox/large-flex-shrink-assert-expected.txt: Added. * css3/flexbox/large-flex-shrink-assert.html: Added. * css3/flexbox/line-wrapping.html: * css3/flexbox/mainAxisExtent-crash-expected.txt: Added. * css3/flexbox/mainAxisExtent-crash.html: Added. * css3/flexbox/max-width-violation-expected.txt: Added. * css3/flexbox/max-width-violation.html: Added. * css3/flexbox/min-size-auto-expected.txt: * css3/flexbox/min-size-auto.html: * css3/flexbox/minimum-size-image-expected.txt: Added. * css3/flexbox/minimum-size-image.html: Added. * css3/flexbox/multiline-align-content-expected.txt: * css3/flexbox/multiline-align-content-horizontal-column-expected.txt: * css3/flexbox/multiline-align-content-horizontal-column.html: * css3/flexbox/multiline-align-content.html: * css3/flexbox/multiline-align-self-expected.txt: * css3/flexbox/multiline-align-self.html: * css3/flexbox/multiline-column-auto-expected.txt: * css3/flexbox/multiline-column-auto.html: * css3/flexbox/multiline-column-overflow-expected.html: Added. * css3/flexbox/multiline-column-overflow.html: Added. * css3/flexbox/multiline-expected.txt: * css3/flexbox/multiline-justify-content-expected.txt: * css3/flexbox/multiline-justify-content.html: * css3/flexbox/multiline-min-max-expected.txt: Added. * css3/flexbox/multiline-min-max.html: Added. * css3/flexbox/multiline-min-preferred-width-expected.txt: * css3/flexbox/multiline-min-preferred-width.html: * css3/flexbox/multiline-reverse-wrap-baseline.html: * css3/flexbox/multiline-reverse-wrap-overflow-expected.txt: * css3/flexbox/multiline-reverse-wrap-overflow.html: * css3/flexbox/multiline-shrink-to-fit-expected.html: * css3/flexbox/multiline-shrink-to-fit.html: * css3/flexbox/multiline.html: * css3/flexbox/negative-flex-rounding-assert.html: * css3/flexbox/negative-margins-assert.html: * css3/flexbox/negative-overflow-expected.txt: * css3/flexbox/negative-overflow.html: * css3/flexbox/nested-flexbox-min-size-auto-expected.txt: Added. * css3/flexbox/nested-flexbox-min-size-auto.html: Added. * css3/flexbox/nested-orthogonal-flexbox-relayout-expected.html: Added. * css3/flexbox/nested-orthogonal-flexbox-relayout.html: Added. * css3/flexbox/nested-stretch-expected.txt: * css3/flexbox/nested-stretch.html: * css3/flexbox/order-painting.html: * css3/flexbox/orthogonal-flex-directions-expected.txt: * css3/flexbox/orthogonal-flex-directions.html: * css3/flexbox/orthogonal-writing-modes-and-intrinsic-sizing-expected.txt: Added. * css3/flexbox/orthogonal-writing-modes-and-intrinsic-sizing.html: Added. * css3/flexbox/overflow-and-padding-expected.txt: Added. * css3/flexbox/overflow-and-padding.html: Added. * css3/flexbox/overflow-auto-dynamic-changes-abspos-expected.html: Added. * css3/flexbox/overflow-auto-dynamic-changes-abspos.html: Added. * css3/flexbox/overflow-auto-dynamic-changes-expected.html: Added. * css3/flexbox/overflow-auto-dynamic-changes.html: Added. * css3/flexbox/overflow-auto-resizes-correctly-expected.txt: Added. * css3/flexbox/overflow-auto-resizes-correctly.html: Added. * css3/flexbox/overflow-keep-scrollpos-expected.txt: * css3/flexbox/overflow-keep-scrollpos.html: * css3/flexbox/percent-height-children-of-alignSelf-stretch-flex-item-expected.txt: Added. * css3/flexbox/percent-height-children-of-alignSelf-stretch-flex-item.html: Added. * css3/flexbox/percent-margins-expected.txt: * css3/flexbox/percent-margins.html: * css3/flexbox/percentage-height-in-abspos-expected.html: Added. * css3/flexbox/percentage-height-in-abspos.html: Added. * css3/flexbox/percentage-height-replaced-element-expected.txt: Added. * css3/flexbox/percentage-height-replaced-element.html: Added. * css3/flexbox/percentage-heights-expected.txt: * css3/flexbox/percentage-heights.html: * css3/flexbox/percentage-max-width-cross-axis-expected.txt: Added. * css3/flexbox/percentage-max-width-cross-axis.html: Added. * css3/flexbox/percentage-sizes-expected.txt: * css3/flexbox/percentage-sizes-quirks-expected.txt: * css3/flexbox/percentage-sizes-quirks.html: * css3/flexbox/percentage-sizes.html: * css3/flexbox/percentage-width-in-abspos-expected.html: Added. * css3/flexbox/percentage-width-in-abspos.html: Added. * css3/flexbox/perpendicular-writing-modes-inside-flex-item-expected.txt: * css3/flexbox/perpendicular-writing-modes-inside-flex-item.html: * css3/flexbox/position-absolute-child-expected.txt: * css3/flexbox/position-absolute-child.html: * css3/flexbox/position-absolute-children-expected.txt: * css3/flexbox/position-absolute-children.html: * css3/flexbox/preferred-widths-expected.txt: * css3/flexbox/preferred-widths-orthogonal.html: * css3/flexbox/preferred-widths.html: * css3/flexbox/relayout-align-items-expected.txt: * css3/flexbox/relayout-align-items.html: * css3/flexbox/relayout-image-load-expected.txt: * css3/flexbox/relayout-image-load.html: * css3/flexbox/relpos-with-percentage-top-expected.txt: Added. * css3/flexbox/relpos-with-percentage-top.html: Added. * css3/flexbox/relpos-with-scrollable-with-abspos-crash-expected.txt: Added. * css3/flexbox/relpos-with-scrollable-with-abspos-crash.html: Added. * css3/flexbox/resize-min-content-flexbox-expected.txt: Added. * css3/flexbox/resize-min-content-flexbox.html: Added. * css3/flexbox/resources/box-orient-button.js: Added. (setFlexDirection): (gebi): (test): * css3/flexbox/scrollbars-auto-expected.html: Added. * css3/flexbox/scrollbars-auto.html: Added. * css3/flexbox/scrollbars-expected.html: Added. * css3/flexbox/scrollbars.html: Added. * css3/flexbox/shrinking-column-flexbox-expected.txt: Added. * css3/flexbox/shrinking-column-flexbox.html: Added. * css3/flexbox/stretch-after-sibling-size-change-expected.txt: * css3/flexbox/stretch-after-sibling-size-change.html: * css3/flexbox/stretch-input-in-column-expected.html: * css3/flexbox/stretch-simplified-layout-expected.txt: * css3/flexbox/stretch-simplified-layout.html: * css3/flexbox/stretch-table-child-expected.txt: Added. * css3/flexbox/stretch-table-child.html: Added. * css3/flexbox/stretched-child-shrink-on-relayout-expected.txt: Added. * css3/flexbox/stretched-child-shrink-on-relayout.html: Added. * css3/flexbox/stretching-orthogonal-flows-expected.html: Added. * css3/flexbox/stretching-orthogonal-flows.html: Added. * css3/flexbox/style-change-expected.txt: * css3/flexbox/style-change.html: * css3/flexbox/text-overflow-on-flexbox-expected.html: Added. * css3/flexbox/text-overflow-on-flexbox.html: Added. * css3/flexbox/true-centering-expected.txt: * css3/flexbox/true-centering.html: * css3/flexbox/undefined-min-width-expected.txt: Added. * css3/flexbox/undefined-min-width.html: Added. * css3/flexbox/vertical-align-do-not-effect-flex-items-expected.html: Added. * css3/flexbox/vertical-align-do-not-effect-flex-items.html: Added. * css3/flexbox/vertical-flexbox-percentage-ignored-expected.html: Added. * css3/flexbox/vertical-flexbox-percentage-ignored.html: Added. * css3/flexbox/whitespace-in-flexitem-expected.html: Added. * css3/flexbox/whitespace-in-flexitem.html: Added. * css3/flexbox/width-change-and-relayout-children-expected.txt: * css3/flexbox/width-change-and-relayout-children.html: * css3/flexbox/wrapping-column-dynamic-changes-expected.txt: Added. * css3/flexbox/wrapping-column-dynamic-changes.html: Added. * css3/flexbox/writing-modes-expected.txt: * css3/flexbox/writing-modes.html: * css3/flexbox/z-index.html: * resources/check-layout-th.js: Added. (checkSubtreeExpectedValues): (checkAttribute): (assert_tolerance): (checkExpectedValues): (window.checkLayout): Canonical link: https://commits.webkit.org/185959@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-28 16:23:15 +00:00
explicit OrderIteratorPopulator(OrderIterator& iterator)
: m_iterator(iterator)
{
m_iterator.m_orderValues.clear();
}
Setting up OrderIterator shouldn't require an extra Vector https://bugs.webkit.org/show_bug.cgi?id=119061 Reviewed by Darin Adler. From Blink r153971 by <jchaffraix@chromium.org> This patches reuse the OrderIterator's Vector. It provides a helper class OrderIteratorPopulator, used for manipulating the Vector directly. Which allows to consolidate the code into a single implementation across flexbox and grid. No new tests, already covered by current tests. * rendering/OrderIterator.cpp: (WebCore::OrderIteratorPopulator::~OrderIteratorPopulator): Reset OrderIterator and call removeDuplicatedOrderValues(). (WebCore::OrderIteratorPopulator::removeDuplicatedOrderValues): Sorts the Vector and removes the duplicated order values. (WebCore::OrderIteratorPopulator::collectChild): Collect order value information from child. (WebCore::OrderIterator::setOrderValues): Deleted. * rendering/OrderIterator.h: (WebCore::OrderIteratorPopulator::OrderIteratorPopulator): Add helper class to manipulate OrderValues Vector. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): Remove unneeded code related to old OrderValues vector. (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins): Populate OrderIterator using collectChild(). (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): Deleted. * rendering/RenderFlexibleBox.h: Rename computeMainAxisPreferredSizes() to prepareOrderIteratorAndMargins(). * rendering/RenderGrid.cpp: (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Populate OrderIterator using collectChild(). Canonical link: https://commits.webkit.org/151329@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-27 07:17:52 +00:00
~OrderIteratorPopulator();
Enable fieldsets to be flexboxes, grids and multicolumn. https://bugs.webkit.org/show_bug.cgi?id=169082 Source/WebCore: Reviewed by Simon Fraser . Added new tests in fast/forms/fieldset. This patch eliminates RenderFieldset and moves the functionality into RenderBlock so that derived classes can also be fieldsets. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: Remove RenderFieldset from the project. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::titleUIElement): Call in to RenderBlock now instead of RenderFieldset. * html/HTMLFieldSetElement.cpp: (WebCore::HTMLFieldSetElement::createElementRenderer): * html/HTMLFieldSetElement.h: The fieldset DOM element now uses RenderElement::createFor to make renderers so that multiple display types can be supported. A special flag has been added that indicates only to make flexbox and block-related renderers (not table display types). * rendering/OrderIterator.cpp: (WebCore::OrderIterator::shouldSkipChild): (WebCore::OrderIteratorPopulator::collectChild): * rendering/OrderIterator.h: Streamline child collection for flexboxes and grids to indicate whether the child should be skipped as a return value from collectChild. Add a shouldSkipChild method that skips both out of flow positioned objects and excluded children like the legends of fieldsets. * rendering/RenderBlock.cpp: (WebCore::RenderBlockRareData::RenderBlockRareData): When the legend is taller than the fieldset's borderBefore(), intrinsic border is added to the CSS border width. This intrinsic border being factored in ensures that the padding and content boxes of fieldsets are correct across any layout system, since the legend is now just treated as part of the border. (WebCore::RenderBlock::computePreferredLogicalWidths): (WebCore::RenderBlock::computeBlockPreferredLogicalWidths): Call the new computePreferredWidthsForExcludedChildren to ensure that excluded children contribute to preferred width in their own way and not as part of a specific layout system. (WebCore::RenderBlock::renderName): Hacked to still return RenderFieldSet for RenderBlockFlow-backed fieldsets for layout test compatibility. (WebCore::RenderBlock::layoutExcludedChildren): Renamed from layoutSpecialExcludedChild to more accurately reflect the fact that multiple excluded children can be included here (e.g., both a multicolumn flow thread and a legend). The RenderBlock base class handles the layout of legends by both placing them and setting the correct intrinsic border before amount on the block. (WebCore::RenderBlock::findFieldsetLegend): Moved from RenderFieldset. (WebCore::RenderBlock::adjustBorderBoxRectForPainting): (WebCore::RenderBlock::paintRectToClipOutFromBorder): These methods are used when painting to shrink the border box as needed to account for the legend and to provide the portion of the border that needs to be clipped out. These methods have been enhanced to properly support all writing modes. (WebCore::RenderBlock::intrinsicBorderForFieldset): (WebCore::RenderBlock::setIntrinsicBorderForFieldset): (WebCore::RenderBlock::borderTop): (WebCore::RenderBlock::borderLeft): (WebCore::RenderBlock::borderBottom): (WebCore::RenderBlock::borderRight): (WebCore::RenderBlock::borderBefore): These methods are overridden for border to ensure that the intrinsic border added by a tall legend is properly factored in. (WebCore::RenderBlock::computePreferredWidthsForExcludedChildren): * rendering/RenderBlock.h: This method computes the preferred widths for legend children in order to ensure that the legend properly grows the width of the fieldset when it is the widest item. (WebCore::RenderBlock::adjustBorderBoxLogicalHeightForBoxSizing): (WebCore::RenderBlock::adjustContentBoxLogicalHeightForBoxSizing): Preserve the behavior of fieldsets in that the available content size includes the space lost accounting for the legend. I don't think this makes much sense, but it matches the behavior of other browsers (and our old behavior). (WebCore::RenderBlock::paintExcludedChildrenInBorder): Method for painting the excluded children that might be present in our border. We only do this if the paint phase is a box decoration painting phase and if the legend isn't self-painting. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::willCreateColumns): Allow fieldsets to create columns now. (WebCore::RenderBlockFlow::layoutBlockChildren): (WebCore::RenderBlockFlow::layoutExcludedChildren): Renamed this method and change it to call the base class to ensure that legends in multicolumn fieldsets get handled properly. (WebCore::RenderBlockFlow::addChild): Patched to make sure legends don't get put into the multicolumn flow thread, as they need to remain outside of it. (WebCore::RenderBlockFlow::layoutSpecialExcludedChild): Deleted. Renamed to layoutExcludedChildren. * rendering/RenderBlockFlow.h: * rendering/RenderBox.cpp: (WebCore::RenderBox::paintBoxDecorations): (WebCore::RenderBox::paintMask): Patched to call the new adjustBorderBoxRectForPainting and paintRectToClipOutFromBorder methods in order to properly shrink the border box rect for painting and to clip out the portion of the border covered by the legend. (WebCore::RenderBox::avoidsFloats): Add fieldsets as avoiding floats. RenderFieldset used to subclass this method to return true, but with its removal, we need to put this in the base class along with legends. * rendering/RenderBox.h: (WebCore::RenderBox::isGridItem): (WebCore::RenderBox::isFlexItem): Patched to exclude legends so that they don't try to size like they are really in the grid or flexbox. (WebCore::RenderBox::adjustBorderBoxRectForPainting): This method is overridden by RenderBLock to handle adjusting fieldset border rects for painting. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintBorder): * rendering/RenderBoxModelObject.h: (WebCore::RenderBoxModelObject::paintRectToClipOutFromBorder): Patched to properly paint fieldsets using the new helpers. * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::FlexBoxIterator::next): (WebCore::RenderDeprecatedFlexibleBox::layoutBlock): (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox): Make sure deprecated flexible boxes lay out their legends properly by calling layoutExcludedChildren. * rendering/RenderElement.cpp: (WebCore::RenderElement::createFor): * rendering/RenderElement.h: Patched to take a flag that limits what renderers can be created so that fieldsets don't make table display types. * rendering/RenderFieldset.cpp: Removed. * rendering/RenderFieldset.h: Removed. Remove RenderFieldset files from the tree. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths): (WebCore::RenderFlexibleBox::firstLineBaseline): (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::layoutFlexItems): (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins): Make sure flexible boxes lay out their legends properly by calling layoutExcludedChildren. Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't part of the flexible box layout. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutBlock): (WebCore::RenderGrid::computeIntrinsicLogicalWidths): (WebCore::RenderGrid::placeItemsOnGrid): (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): (WebCore::RenderGrid::layoutGridItems): Make sure grids lay out their legends properly by calling layoutExcludedChildren. Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't part of the grid's layout. * rendering/RenderMultiColumnFlowThread.cpp: (WebCore::RenderMultiColumnFlowThread::populate): Pull legends back up into the block and don't let them be part of the flow thread. * rendering/RenderMultiColumnSet.cpp: (WebCore::RenderMultiColumnSet::requiresBalancing): Fix an assert to allow legends to exist as siblings of multicolumn sets. * rendering/RenderObject.cpp: (WebCore::RenderObject::isFieldset): Changed to examine the HTML element rather than RenderFieldset. * rendering/RenderObject.h: (WebCore::RenderObject::isExcludedFromNormalLayout): (WebCore::RenderObject::setIsExcludedFromNormalLayout): (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields): RenderObjects now have a new bit that is set for excluded objects like legends, flow threads, placeholders, and ruby text. This bit lets code easily detect that an object is excluded from the layout system and can be skipped. (WebCore::RenderObject::isExcludedAndPlacedInBorder): Helper method for asking if an object is painting inside the border. Used to know we need to factor it into preferred width calculations outside of any one layout system and also to know that we need to paint it when we paint the fieldset's border instead of later (after we might have scrolled or clipped the child painting area). * rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::layoutExcludedChildren): (WebCore::RenderRubyRun::layoutSpecialExcludedChild): Deleted. * rendering/RenderRubyRun.h: Rename layoutSpecialExcludedChild to layoutExcludedChildren. * rendering/RenderTable.cpp: (WebCore::RenderTable::adjustBorderBoxRectForPainting): (WebCore::RenderTable::paintBoxDecorations): (WebCore::RenderTable::paintMask): (WebCore::RenderTable::subtractCaptionRect): Deleted. * rendering/RenderTable.h: Patched tables to share the same border box rect adjustment used by fieldsets when subtracting out captions. This is prep work to allow tables to be fieldsets, but for now I didn't go all the way. * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::paintBoxDecorations): (WebCore::RenderTableCell::paintMask): Make sure table cells adjust their border box rects for painting. Again this is prep work for cells potentially being fieldsets, but not supported yet. * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::layoutExcludedChildren): (WebCore::RenderTextControl::layoutSpecialExcludedChild): Deleted. * rendering/RenderTextControl.h: * rendering/RenderTextControlMultiLine.cpp: (WebCore::RenderTextControlMultiLine::layoutExcludedChildren): (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild): Deleted. * rendering/RenderTextControlMultiLine.h: Renamed the methods for doing the excluded child layout. * rendering/RenderTreeAsText.cpp: (WebCore::RenderTreeAsText::writeRenderObject): Make sure to dump the original fieldset border and not the border with the extra legend stuff in it. LayoutTests: Reviewed by Simon Fraser. * fast/forms/fieldset/abs-pos-child-sizing-expected.html: Added. * fast/forms/fieldset/abs-pos-child-sizing.html: Added. * fast/forms/fieldset/fieldset-deprecated-flexbox-expected.html: Added. * fast/forms/fieldset/fieldset-deprecated-flexbox.html: Added. * fast/forms/fieldset/fieldset-flexbox-expected.html: Added. * fast/forms/fieldset/fieldset-flexbox.html: Added. * fast/forms/fieldset/fieldset-grid-expected.html: Added. * fast/forms/fieldset/fieldset-grid.html: Added. * fast/forms/fieldset/fieldset-multicolumn-expected.html: Added. * fast/forms/fieldset/fieldset-multicolumn.html: Added. * fast/forms/fieldset/fieldset-overflow-auto-expected.html: Added. * fast/forms/fieldset/fieldset-overflow-auto.html: Added. * fast/forms/fieldset/fieldset-overflow-hidden-expected.html: Added. * fast/forms/fieldset/fieldset-overflow-hidden.html: Added. * fast/forms/fieldset/fieldset-positioned-children-expected.html: Added. * fast/forms/fieldset/fieldset-positioned-children.html: Added. * fast/forms/fieldset/fieldset-positioned-legend-expected.html: Added. * fast/forms/fieldset/fieldset-positioned-legend.html: Added. * fast/forms/fieldset/fieldset-self-painting-legend-expected.html: Added. * fast/forms/fieldset/fieldset-self-painting-legend.html: Added. * fast/forms/fieldset/fieldset-writing-modes-expected.html: Added. * fast/forms/fieldset/fieldset-writing-modes.html: Added. Canonical link: https://commits.webkit.org/186219@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-06 18:00:35 +00:00
bool collectChild(const RenderBox&);
Setting up OrderIterator shouldn't require an extra Vector https://bugs.webkit.org/show_bug.cgi?id=119061 Reviewed by Darin Adler. From Blink r153971 by <jchaffraix@chromium.org> This patches reuse the OrderIterator's Vector. It provides a helper class OrderIteratorPopulator, used for manipulating the Vector directly. Which allows to consolidate the code into a single implementation across flexbox and grid. No new tests, already covered by current tests. * rendering/OrderIterator.cpp: (WebCore::OrderIteratorPopulator::~OrderIteratorPopulator): Reset OrderIterator and call removeDuplicatedOrderValues(). (WebCore::OrderIteratorPopulator::removeDuplicatedOrderValues): Sorts the Vector and removes the duplicated order values. (WebCore::OrderIteratorPopulator::collectChild): Collect order value information from child. (WebCore::OrderIterator::setOrderValues): Deleted. * rendering/OrderIterator.h: (WebCore::OrderIteratorPopulator::OrderIteratorPopulator): Add helper class to manipulate OrderValues Vector. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): Remove unneeded code related to old OrderValues vector. (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins): Populate OrderIterator using collectChild(). (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): Deleted. * rendering/RenderFlexibleBox.h: Rename computeMainAxisPreferredSizes() to prepareOrderIteratorAndMargins(). * rendering/RenderGrid.cpp: (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Populate OrderIterator using collectChild(). Canonical link: https://commits.webkit.org/151329@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-27 07:17:52 +00:00
private:
OrderIterator& m_iterator;
};
[CSS Grid Layout] Add support for order inside grid items https://bugs.webkit.org/show_bug.cgi?id=123208 Reviewed by Antti Koivisto. Source/WebCore: Based on Blink r153457 and r153536 by <jchaffraix@chromium.org> Added support for sorting grid items by using -webkit-order property. Used OrderIterator to implement it so it had to be moved out of RenderFlexibleBox to be shared with RenderGrid. Tests: fast/css-grid-layout/grid-item-order-auto-flow-resolution.html fast/css-grid-layout/grid-item-order-paint-order.html * CMakeLists.txt: Added new file. * GNUmakefile.list.am: Ditto. * WebCore.vcxproj/WebCore.vcxproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * rendering/OrderIterator.cpp: Added. Ripped out of RenderFlexibleBox. (WebCore::OrderIterator::OrderIterator): (WebCore::OrderIterator::setOrderValues): Use std::move semantics. (WebCore::OrderIterator::first): Use an integer as iterator. (WebCore::OrderIterator::next): Ditto. (WebCore::OrderIterator::reset): Ditto. * rendering/OrderIterator.h: Added. (WebCore::OrderIterator::currentChild): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::RenderFlexibleBox): (WebCore::RenderFlexibleBox::layoutBlock): * rendering/RenderFlexibleBox.h: * rendering/RenderGrid.cpp: (WebCore::RenderGrid::RenderGrid): (WebCore::RenderGrid::placeItemsOnGrid): (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): (WebCore::RenderGrid::paintChildren): * rendering/RenderGrid.h: LayoutTests: From Blink r153536 by <jchaffraix@chromium.org> Added a couple of tests to verify that we respect the specified order of grid items both in the auto-placement algorithm and in the final painting. * fast/css-grid-layout/grid-item-order-auto-flow-resolution-expected.txt: Added. * fast/css-grid-layout/grid-item-order-auto-flow-resolution.html: Added. * fast/css-grid-layout/grid-item-order-paint-order-expected.html: Added. * fast/css-grid-layout/grid-item-order-paint-order.html: Added. Canonical link: https://commits.webkit.org/141517@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-28 17:35:52 +00:00
} // namespace WebCore