Changeset 276216 in webkit
- Timestamp:
- Apr 17, 2021 6:03:18 PM (15 months ago)
- Location:
- trunk
- Files:
-
- 8 added
- 30 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (2 diffs)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-box/parsing/clear-computed-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-box/parsing/clear-valid-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-box/parsing/float-computed-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-box/parsing/float-valid-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-1-expected.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-1.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-2-expected.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-2.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-3-expected.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-3.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-4-expected.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-4.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-logical/w3c-import.log (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/CSSPrimitiveValueMappings.h (modified) (5 diffs)
-
Source/WebCore/css/CSSValueKeywords.in (modified) (1 diff)
-
Source/WebCore/css/parser/CSSParserFastPaths.cpp (modified) (2 diffs)
-
Source/WebCore/display/css/DisplayStyle.cpp (modified) (1 diff)
-
Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp (modified) (1 diff)
-
Source/WebCore/layout/layouttree/LayoutBox.cpp (modified) (1 diff)
-
Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/ComplexLineLayout.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/FloatingObjects.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderBlock.cpp (modified) (4 diffs)
-
Source/WebCore/rendering/RenderBlockFlow.cpp (modified) (9 diffs)
-
Source/WebCore/rendering/RenderBlockFlow.h (modified) (1 diff)
-
Source/WebCore/rendering/line/BreakingContext.h (modified) (4 diffs)
-
Source/WebCore/rendering/line/LineBreaker.cpp (modified) (1 diff)
-
Source/WebCore/rendering/line/LineBreaker.h (modified) (2 diffs)
-
Source/WebCore/rendering/style/RenderStyle.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/style/RenderStyle.h (modified) (5 diffs)
-
Source/WebCore/rendering/style/RenderStyleConstants.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/style/RenderStyleConstants.h (modified) (4 diffs)
-
Source/WebCore/style/StyleAdjuster.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r276215 r276216 1 2021-04-17 Tim Nguyen <ntim@apple.com> 2 3 Add support for inline-{start/end} values to float & clear properties 4 https://bugs.webkit.org/show_bug.cgi?id=218087 5 6 Reviewed by Antti Koivisto & Zalan Bujtas. 7 8 Imported reftests from: https://github.com/web-platform-tests/wpt/commit/47e7176242e2ca4ca68d6cfe032619ccf44d55a6 9 Enabled: imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear.html 10 11 * TestExpectations: 12 1 13 2021-04-17 Diego Pino Garcia <dpino@igalia.com> 2 14 -
trunk/LayoutTests/TestExpectations
r276208 r276216 2935 2935 imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-OAEP.https.any.html [ Pass Failure ] 2936 2936 imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-OAEP.https.any.worker.html [ Pass Failure ] 2937 2938 webkit.org/b/224104 imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-reftest.html [ ImageOnlyFailure ] 2937 2939 2938 2940 # wpt css-shapes … … 4577 4579 webkit.org/b/214466 imported/w3c/web-platform-tests/css/css-values/ex-unit-004.html [ ImageOnlyFailure ] 4578 4580 webkit.org/b/214466 imported/w3c/web-platform-tests/css/css-shapes/shape-outside/formatting-context/shape-outside-formatting-context.tentative.html [ ImageOnlyFailure ] 4579 webkit.org/b/214466 imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-reftest.html [ ImageOnlyFailure ]4580 4581 webkit.org/b/214466 imported/w3c/web-platform-tests/css/css-display/display-first-line-002.html [ ImageOnlyFailure ] 4581 4582 -
trunk/LayoutTests/imported/w3c/ChangeLog
r276209 r276216 1 2021-04-17 Tim Nguyen <ntim@apple.com> 2 3 Add support for inline-{start/end} values to float & clear properties 4 https://bugs.webkit.org/show_bug.cgi?id=218087 5 6 Reviewed by Antti Koivisto & Zalan Bujtas. 7 8 Imported reftests from: https://github.com/web-platform-tests/wpt/commit/47e7176242e2ca4ca68d6cfe032619ccf44d55a6 9 Enabled: imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear.html 10 11 * web-platform-tests/css/css-box/parsing/clear-computed-expected.txt: 12 * web-platform-tests/css/css-box/parsing/clear-valid-expected.txt: 13 * web-platform-tests/css/css-box/parsing/float-computed-expected.txt: 14 * web-platform-tests/css/css-box/parsing/float-valid-expected.txt: 15 * web-platform-tests/css/css-logical/logical-values-float-clear-1-expected.html: Added. 16 * web-platform-tests/css/css-logical/logical-values-float-clear-1.html: Added. 17 * web-platform-tests/css/css-logical/logical-values-float-clear-2-expected.html: Added. 18 * web-platform-tests/css/css-logical/logical-values-float-clear-2.html: Added. 19 * web-platform-tests/css/css-logical/logical-values-float-clear-3-expected.html: Added. 20 * web-platform-tests/css/css-logical/logical-values-float-clear-3.html: Added. 21 * web-platform-tests/css/css-logical/logical-values-float-clear-4-expected.html: Added. 22 * web-platform-tests/css/css-logical/logical-values-float-clear-4.html: Added. 23 * web-platform-tests/css/css-logical/logical-values-float-clear-expected.txt: 24 * web-platform-tests/css/css-logical/w3c-import.log: 25 1 26 2021-04-17 Tyler Wilcock <twilco.o@protonmail.com> 2 27 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-box/parsing/clear-computed-expected.txt
r267650 r276216 4 4 PASS Property clear value 'right' 5 5 PASS Property clear value 'both' 6 FAIL Property clear value 'inline-start' assert_true: 'inline-start' is a supported value for clear. expected true got false 7 FAIL Property clear value 'inline-end' assert_true: 'inline-end' is a supported value for clear. expected true got false 6 PASS Property clear value 'inline-start' 7 PASS Property clear value 'inline-end' 8 8 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-box/parsing/clear-valid-expected.txt
r267650 r276216 4 4 PASS e.style['clear'] = "right" should set the property value 5 5 PASS e.style['clear'] = "both" should set the property value 6 FAIL e.style['clear'] = "inline-start" should set the property value assert_not_equals: property should be set got disallowed value "" 7 FAIL e.style['clear'] = "inline-end" should set the property value assert_not_equals: property should be set got disallowed value "" 6 PASS e.style['clear'] = "inline-start" should set the property value 7 PASS e.style['clear'] = "inline-end" should set the property value 8 8 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-box/parsing/float-computed-expected.txt
r267650 r276216 3 3 PASS Property float value 'left' 4 4 PASS Property float value 'right' 5 FAIL Property float value 'inline-start' assert_true: 'inline-start' is a supported value for float. expected true got false 6 FAIL Property float value 'inline-end' assert_true: 'inline-end' is a supported value for float. expected true got false 5 PASS Property float value 'inline-start' 6 PASS Property float value 'inline-end' 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-box/parsing/float-valid-expected.txt
r267650 r276216 3 3 PASS e.style['float'] = "right" should set the property value 4 4 PASS e.style['float'] = "none" should set the property value 5 FAIL e.style['float'] = "inline-start" should set the property value assert_not_equals: property should be set got disallowed value "" 6 FAIL e.style['float'] = "inline-end" should set the property value assert_not_equals: property should be set got disallowed value "" 5 PASS e.style['float'] = "inline-start" should set the property value 6 PASS e.style['float'] = "inline-end" should set the property value 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-expected.txt
r264522 r276216 1 1 2 FAIL Test that 'clear: inline-start' is supported. assert_equals: logical values in inline style, clear expected "inline-start" but got "" 3 FAIL Test that 'clear: inline-end' is supported. assert_equals: logical values in inline style, clear expected "inline-end" but got "" 4 FAIL Test that 'float: inline-start' is supported. assert_equals: logical values in inline style, float expected "inline-start" but got "" 5 FAIL Test that 'float: inline-end' is supported. assert_equals: logical values in inline style, float expected "inline-end" but got "" 2 PASS Test that 'clear: inline-start' is supported. 3 PASS Test that 'clear: inline-end' is supported. 4 PASS Test that 'float: inline-start' is supported. 5 PASS Test that 'float: inline-end' is supported. 6 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/w3c-import.log
r264522 r276216 33 33 /LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html 34 34 /LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-size.html 35 /LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-1-expected.html 36 /LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-1.html 37 /LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-2-expected.html 38 /LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-2.html 39 /LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-3-expected.html 40 /LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-3.html 41 /LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-4-expected.html 42 /LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-4.html 35 43 /LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-reftest-expected.html 36 44 /LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-reftest.html -
trunk/Source/WebCore/ChangeLog
r276211 r276216 1 2021-04-17 Tim Nguyen <ntim@apple.com> 2 3 Add support for inline-{start/end} values to float & clear properties 4 https://bugs.webkit.org/show_bug.cgi?id=218087 5 6 Reviewed by Antti Koivisto & Zalan Bujtas. 7 8 Imported reftests from: https://github.com/web-platform-tests/wpt/commit/47e7176242e2ca4ca68d6cfe032619ccf44d55a6 9 Enabled: imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear.html 10 11 Tests: imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-1.html 12 imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-2.html 13 imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-3.html 14 imported/w3c/web-platform-tests/css/css-logical/logical-values-float-clear-4.html 15 16 * css/CSSPrimitiveValueMappings.h: 17 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): 18 (WebCore::CSSPrimitiveValue::operator Clear const): 19 (WebCore::CSSPrimitiveValue::operator Float const): 20 * css/CSSValueKeywords.in: 21 * css/parser/CSSParserFastPaths.cpp: 22 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): 23 * display/css/DisplayStyle.cpp: 24 (WebCore::Display::Style::Style): 25 * layout/integration/LayoutIntegrationBoxTree.cpp: 26 (WebCore::LayoutIntegration::BoxTree::buildTree): 27 * layout/layouttree/LayoutBox.cpp: 28 (WebCore::Layout::Box::isFloatingPositioned const): 29 * layout/layouttree/LayoutTreeBuilder.cpp: 30 (WebCore::Layout::TreeBuilder::createLayoutBox): 31 (WebCore::Layout::TreeBuilder::buildTableStructure): 32 * rendering/ComplexLineLayout.cpp: 33 (WebCore::ComplexLineLayout::layoutRunsAndFloats): 34 (WebCore::ComplexLineLayout::layoutRunsAndFloatsInRange): 35 * rendering/FloatingObjects.cpp: 36 (WebCore::FloatingObject::FloatingObject): 37 * rendering/RenderBlock.cpp: 38 (WebCore::RenderBlock::computeBlockPreferredLogicalWidths const): 39 * rendering/RenderBlockFlow.cpp: 40 (WebCore::RenderBlockFlow::marginOffsetForSelfCollapsingBlock): 41 (WebCore::RenderBlockFlow::marginBeforeEstimateForChild const): 42 (WebCore::RenderBlockFlow::computeLogicalLocationForFloat): 43 (WebCore::RenderBlockFlow::positionNewFloats): 44 (WebCore::RenderBlockFlow::clearFloats): 45 (WebCore::RenderBlockFlow::getClearDelta): 46 (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const): 47 * rendering/RenderBlockFlow.h: 48 * rendering/line/BreakingContext.h: 49 (WebCore::BreakingContext::handleBR): 50 * rendering/line/LineBreaker.cpp: 51 (WebCore::LineBreaker::reset): 52 * rendering/line/LineBreaker.h: 53 (WebCore::LineBreaker::usedClear): 54 * rendering/style/RenderStyle.cpp: 55 (WebCore::RenderStyle::usedClear): 56 (WebCore::RenderStyle::usedFloat): 57 * rendering/style/RenderStyle.h: 58 (WebCore::RenderStyle::isFloating const): 59 (WebCore::RenderStyle::initialFloating): 60 * rendering/style/RenderStyleConstants.cpp: 61 (WebCore::operator<<): 62 * rendering/style/RenderStyleConstants.h: 63 * style/StyleAdjuster.cpp: 64 (WebCore::Style::Adjuster::adjust const): 65 1 66 2021-04-17 Basuke Suzuki <basuke.suzuki@sony.com> 2 67 -
trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h
r272987 r276216 1129 1129 m_value.valueID = CSSValueRight; 1130 1130 break; 1131 case Clear::InlineStart: 1132 m_value.valueID = CSSValueInlineStart; 1133 break; 1134 case Clear::InlineEnd: 1135 m_value.valueID = CSSValueInlineEnd; 1136 break; 1131 1137 case Clear::Both: 1132 1138 m_value.valueID = CSSValueBoth; … … 1146 1152 case CSSValueRight: 1147 1153 return Clear::Right; 1154 case CSSValueInlineStart: 1155 return Clear::InlineStart; 1156 case CSSValueInlineEnd: 1157 return Clear::InlineEnd; 1148 1158 case CSSValueBoth: 1149 1159 return Clear::Both; … … 1581 1591 setPrimitiveUnitType(CSSUnitType::CSS_VALUE_ID); 1582 1592 switch (e) { 1583 case Float::No :1593 case Float::None: 1584 1594 m_value.valueID = CSSValueNone; 1585 1595 break; … … 1589 1599 case Float::Right: 1590 1600 m_value.valueID = CSSValueRight; 1601 break; 1602 case Float::InlineStart: 1603 m_value.valueID = CSSValueInlineStart; 1604 break; 1605 case Float::InlineEnd: 1606 m_value.valueID = CSSValueInlineEnd; 1591 1607 break; 1592 1608 } … … 1602 1618 case CSSValueRight: 1603 1619 return Float::Right; 1620 case CSSValueInlineStart: 1621 return Float::InlineStart; 1622 case CSSValueInlineEnd: 1623 return Float::InlineEnd; 1604 1624 case CSSValueNone: 1605 1625 case CSSValueCenter: // Non-standard CSS value. 1606 return Float::No ;1607 default: 1608 break; 1609 } 1610 1611 ASSERT_NOT_REACHED(); 1612 return Float::No ;1626 return Float::None; 1627 default: 1628 break; 1629 } 1630 1631 ASSERT_NOT_REACHED(); 1632 return Float::None; 1613 1633 } 1614 1634 -
trunk/Source/WebCore/css/CSSValueKeywords.in
r275826 r276216 349 349 distribute 350 350 // 351 // CSS_PROP_CLEAR: 352 // CSS_PROP_FLOAT: 353 // none 354 // left 355 // right 356 inline-start 357 inline-end 358 // 351 359 // CSS_PROP_LIST_STYLE_POSITION: 352 360 // -
trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp
r276152 r276216 620 620 case CSSPropertyCaptionSide: // top | bottom | left | right 621 621 return valueID == CSSValueLeft || valueID == CSSValueRight || valueID == CSSValueTop || valueID == CSSValueBottom; 622 case CSSPropertyClear: // none | left | right | both623 return valueID == CSSValueNone || valueID == CSSValue Left || valueID == CSSValueRight || valueID == CSSValueBoth;622 case CSSPropertyClear: // none | inline-start | inline-end | left | right | both 623 return valueID == CSSValueNone || valueID == CSSValueInlineStart || valueID == CSSValueInlineEnd || valueID == CSSValueLeft || valueID == CSSValueRight || valueID == CSSValueBoth; 624 624 case CSSPropertyClipRule: 625 625 case CSSPropertyFillRule: … … 648 648 case CSSPropertyEmptyCells: // show | hide 649 649 return valueID == CSSValueShow || valueID == CSSValueHide; 650 case CSSPropertyFloat: // left | right | none651 return valueID == CSSValue Left || valueID == CSSValueRight || valueID == CSSValueNone;650 case CSSPropertyFloat: // inline-start | inline-end | left | right | none 651 return valueID == CSSValueInlineStart || valueID == CSSValueInlineEnd || valueID == CSSValueLeft || valueID == CSSValueRight || valueID == CSSValueNone; 652 652 case CSSPropertyImageOrientation: // from-image | none 653 653 return valueID == CSSValueFromImage || valueID == CSSValueNone; -
trunk/Source/WebCore/display/css/DisplayStyle.cpp
r271921 r276216 106 106 107 107 setIsPositioned(style.position() != PositionType::Static); 108 setIsFloating(style.floating() != Float::No );108 setIsFloating(style.floating() != Float::None); 109 109 setHasTransform(style.hasTransform()); 110 110 } -
trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp
r272770 r276216 73 73 if (childRenderer.isLineBreak()) { 74 74 style.setDisplay(DisplayType::Inline); 75 style.setFloating(Float::No );75 style.setFloating(Float::None); 76 76 style.setPosition(PositionType::Static); 77 77 return makeUnique<Layout::LineBreakBox>(downcast<RenderLineBreak>(childRenderer).isWBR(), WTFMove(style)); -
trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp
r272781 r276216 164 164 if (isOutOfFlowPositioned()) 165 165 return false; 166 return m_style.floating() != Float::No ;166 return m_style.floating() != Float::None; 167 167 } 168 168 -
trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp
r273974 r276216 200 200 if (is<RenderLineBreak>(renderer)) { 201 201 clonedStyle.setDisplay(DisplayType::Inline); 202 clonedStyle.setFloating(Float::No );202 clonedStyle.setFloating(Float::None); 203 203 clonedStyle.setPosition(PositionType::Static); 204 204 childLayoutBox = &createLineBreakBox(downcast<RenderLineBreak>(childRenderer).isWBR(), WTFMove(clonedStyle)); … … 305 305 auto tableBoxStyle = RenderStyle::clone(tableRenderer.style()); 306 306 tableBoxStyle.setPosition(PositionType::Static); 307 tableBoxStyle.setFloating(Float::No );307 tableBoxStyle.setFloating(Float::None); 308 308 tableBoxStyle.resetMargin(); 309 309 // FIXME: Figure out where the spec says table width is like box-sizing: border-box; -
trunk/Source/WebCore/rendering/ComplexLineLayout.cpp
r275641 r276216 1360 1360 lastObject = &lastRootBox()->firstLeafDescendant()->renderer(); 1361 1361 if (lastObject->isBR()) { 1362 Clear clear = lastObject->style().clear();1363 if (clear != Clear::None)1362 auto clear = RenderStyle::usedClear(*lastObject); 1363 if (clear != UsedClear::None) 1364 1364 m_flow.clearFloats(clear); 1365 1365 } … … 1505 1505 if (!layoutState.lineInfo().isEmpty()) { 1506 1506 layoutState.lineInfo().setFirstLine(false); 1507 m_flow.clearFloats(lineBreaker. clear());1507 m_flow.clearFloats(lineBreaker.usedClear()); 1508 1508 } 1509 1509 -
trunk/Source/WebCore/rendering/FloatingObjects.cpp
r275668 r276216 58 58 #endif 59 59 { 60 Float type = renderer.style().floating();61 ASSERT(type != Float::No);62 if (type == Float::Left)60 UsedFloat type = RenderStyle::usedFloat(renderer); 61 ASSERT(type != UsedFloat::None); 62 if (type == UsedFloat::Left) 63 63 m_type = FloatLeft; 64 else if (type == Float::Right)64 else if (type == UsedFloat::Right) 65 65 m_type = FloatRight; 66 66 } -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r276182 r276216 2343 2343 if (child->isFloating() || (is<RenderBox>(*child) && downcast<RenderBox>(*child).avoidsFloats())) { 2344 2344 LayoutUnit floatTotalWidth = floatLeftWidth + floatRightWidth; 2345 if (childStyle.clear() == Clear::Left || childStyle.clear() == Clear::Both) { 2345 auto childUsedClear = RenderStyle::usedClear(*child); 2346 if (childUsedClear == UsedClear::Left || childUsedClear == UsedClear::Both) { 2346 2347 maxLogicalWidth = std::max(floatTotalWidth, maxLogicalWidth); 2347 2348 floatLeftWidth = 0; 2348 2349 } 2349 if (child Style.clear() == Clear::Right || childStyle.clear() ==Clear::Both) {2350 if (childUsedClear == UsedClear::Right || childUsedClear == UsedClear::Both) { 2350 2351 maxLogicalWidth = std::max(floatTotalWidth, maxLogicalWidth); 2351 2352 floatRightWidth = 0; … … 2372 2373 LayoutUnit w = childMinPreferredLogicalWidth + margin; 2373 2374 minLogicalWidth = std::max(w, minLogicalWidth); 2374 2375 2375 2376 // IE ignores tables for calculation of nowrap. Makes some sense. 2376 2377 if (nowrap && !child->isTable()) … … 2396 2397 floatLeftWidth = floatRightWidth = 0; 2397 2398 } 2398 2399 2399 2400 if (child->isFloating()) { 2400 if ( childStyle.floating() ==Float::Left)2401 if (RenderStyle::usedFloat(*child) == UsedFloat::Left) 2401 2402 floatLeftWidth += w; 2402 2403 else … … 2404 2405 } else 2405 2406 maxLogicalWidth = std::max(w, maxLogicalWidth); 2406 2407 2407 2408 child = child->nextSibling(); 2408 2409 } -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r276182 r276216 876 876 ASSERT(isSelfCollapsingBlock()); 877 877 RenderBlockFlow* parentBlock = downcast<RenderBlockFlow>(parent()); 878 if (parentBlock && style().clear() !=Clear::None && parentBlock->getClearDelta(*this, logicalHeight()))878 if (parentBlock && RenderStyle::usedClear(*this) != UsedClear::None && parentBlock->getClearDelta(*this, logicalHeight())) 879 879 return marginValuesForChild(*this).positiveMarginBefore(); 880 880 return 0_lu; … … 1312 1312 1313 1313 // Give up if there is clearance on the box, since it probably won't collapse into us. 1314 if (!grandchildBox || grandchildBox->style().clear() !=Clear::None)1314 if (!grandchildBox || RenderStyle::usedClear(*grandchildBox) != UsedClear::None) 1315 1315 return; 1316 1316 … … 2442 2442 } 2443 2443 } 2444 2445 if ( childBox.style().floating() ==Float::Left) {2444 2445 if (RenderStyle::usedFloat(childBox) == UsedFloat::Left) { 2446 2446 LayoutUnit heightRemainingLeft = 1_lu; 2447 2447 LayoutUnit heightRemainingRight = 1_lu; … … 2477 2477 floatLogicalLeft -= logicalWidthForFloat(floatingObject); 2478 2478 } 2479 2479 2480 2480 LayoutUnit childLogicalLeftMargin = style().isLeftToRightDirection() ? marginStartForChild(childBox) : marginEndForChild(childBox); 2481 2481 LayoutUnit childBeforeMargin = marginBeforeForChild(childBox); … … 2567 2567 2568 2568 LayoutRect oldRect = childBox.frameRect(); 2569 2570 if (childBox .style().clear() == Clear::Left || childBox.style().clear() ==Clear::Both)2569 auto childBoxUsedClear = RenderStyle::usedClear(childBox); 2570 if (childBoxUsedClear == UsedClear::Left || childBoxUsedClear == UsedClear::Both) 2571 2571 logicalTop = std::max(lowestFloatLogicalBottom(FloatingObject::FloatLeft), logicalTop); 2572 if (childBox .style().clear() == Clear::Right || childBox.style().clear() ==Clear::Both)2572 if (childBoxUsedClear == UsedClear::Right || childBoxUsedClear == UsedClear::Both) 2573 2573 logicalTop = std::max(lowestFloatLogicalBottom(FloatingObject::FloatRight), logicalTop); 2574 2574 … … 2625 2625 } 2626 2626 2627 void RenderBlockFlow::clearFloats( Clear clear)2627 void RenderBlockFlow::clearFloats(UsedClear usedClear) 2628 2628 { 2629 2629 positionNewFloats(); 2630 2630 // set y position 2631 2631 LayoutUnit newY; 2632 switch ( clear) {2633 case Clear::Left:2632 switch (usedClear) { 2633 case UsedClear::Left: 2634 2634 newY = lowestFloatLogicalBottom(FloatingObject::FloatLeft); 2635 2635 break; 2636 case Clear::Right:2636 case UsedClear::Right: 2637 2637 newY = lowestFloatLogicalBottom(FloatingObject::FloatRight); 2638 2638 break; 2639 case Clear::Both:2639 case UsedClear::Both: 2640 2640 newY = lowestFloatLogicalBottom(); 2641 2641 break; 2642 case Clear::None:2642 case UsedClear::None: 2643 2643 break; 2644 2644 } … … 2893 2893 2894 2894 // At least one float is present. We need to perform the clearance computation. 2895 bool clearSet = child.style().clear() != Clear::None; 2895 UsedClear usedClear = RenderStyle::usedClear(child); 2896 bool clearSet = usedClear != UsedClear::None; 2896 2897 LayoutUnit logicalBottom; 2897 switch ( child.style().clear()) {2898 case Clear::None:2898 switch (usedClear) { 2899 case UsedClear::None: 2899 2900 break; 2900 case Clear::Left:2901 case UsedClear::Left: 2901 2902 logicalBottom = lowestFloatLogicalBottom(FloatingObject::FloatLeft); 2902 2903 break; 2903 case Clear::Right:2904 case UsedClear::Right: 2904 2905 logicalBottom = lowestFloatLogicalBottom(FloatingObject::FloatRight); 2905 2906 break; 2906 case Clear::Both:2907 case UsedClear::Both: 2907 2908 logicalBottom = lowestFloatLogicalBottom(); 2908 2909 break; … … 4230 4231 textIndent = minimumValueForLength(styleToUse.textIndent(), containingBlock->style().logicalWidth().value()); 4231 4232 } 4232 RenderObject* prev Float = 0;4233 RenderObject* previousFloat = 0; 4233 4234 bool isPrevChildInlineFlow = false; 4234 4235 bool shouldBreakLineAfterText = false; … … 4322 4323 childMax += childMaxPreferredLogicalWidth.ceilToFloat(); 4323 4324 4324 bool clearPreviousFloat ;4325 bool clearPreviousFloat = false; 4325 4326 if (child->isFloating()) { 4326 clearPreviousFloat = (prevFloat 4327 && ((prevFloat->style().floating() == Float::Left && (childStyle.clear() == Clear::Left || childStyle.clear() == Clear::Both)) 4328 || (prevFloat->style().floating() == Float::Right && (childStyle.clear() == Clear::Right || childStyle.clear() == Clear::Both)))); 4329 prevFloat = child; 4330 } else 4331 clearPreviousFloat = false; 4327 auto childClearValue = RenderStyle::usedClear(*child); 4328 if (previousFloat) { 4329 auto previousFloatValue = RenderStyle::usedFloat(*previousFloat); 4330 clearPreviousFloat = 4331 (previousFloatValue == UsedFloat::Left && (childClearValue == UsedClear::Left || childClearValue == UsedClear::Both)) 4332 || (previousFloatValue == UsedFloat::Right && (childClearValue == UsedClear::Right || childClearValue == UsedClear::Both)); 4333 } 4334 previousFloat = child; 4335 } 4332 4336 4333 4337 bool canBreakReplacedElement = !child->isImage() || allowImagesToBreak; -
trunk/Source/WebCore/rendering/RenderBlockFlow.h
r275413 r276216 496 496 // Returns true if and only if it has positioned any floats. 497 497 bool positionNewFloats(); 498 void clearFloats( Clear);498 void clearFloats(UsedClear); 499 499 FloatingObjects* floatingObjects() { return m_floatingObjects.get(); } 500 500 -
trunk/Source/WebCore/rendering/line/BreakingContext.h
r276207 r276216 141 141 void increment(); 142 142 143 void handleBR( Clear&);143 void handleBR(UsedClear&); 144 144 void handleOutOfFlowPositioned(Vector<RenderBox*>& positionedObjects); 145 145 void handleFloat(); … … 268 268 } 269 269 270 inline void BreakingContext::handleBR( Clear& clear)270 inline void BreakingContext::handleBR(UsedClear& usedClear) 271 271 { 272 272 if (fitsOnLineOrHangsAtEnd()) { … … 288 288 // need to check for floats to clear - so if we're ignoring spaces, stop ignoring them and add a 289 289 // run for this object. 290 if (m_ignoringSpaces && br.style().clear() !=Clear::None)290 if (m_ignoringSpaces && RenderStyle::usedClear(br) != UsedClear::None) 291 291 m_lineWhitespaceCollapsingState.ensureLineBoxInsideIgnoredSpaces(br); 292 292 // If we were preceded by collapsing space and are in a right-aligned container we need to ensure the space gets … … 297 297 298 298 if (!m_lineInfo.isEmpty()) 299 clear = br.style().clear();299 usedClear = RenderStyle::usedClear(br); 300 300 } 301 301 m_atEnd = true; -
trunk/Source/WebCore/rendering/line/LineBreaker.cpp
r248846 r276216 35 35 m_positionedObjects.clear(); 36 36 m_hyphenated = false; 37 m_clear = Clear::None;37 m_clear = UsedClear::None; 38 38 } 39 39 -
trunk/Source/WebCore/rendering/line/LineBreaker.h
r248528 r276216 56 56 bool lineWasHyphenated() { return m_hyphenated; } 57 57 const Vector<RenderBox*>& positionedObjects() { return m_positionedObjects; } 58 Clear clear() { return m_clear; }58 UsedClear usedClear() { return m_clear; } 59 59 60 60 private: … … 72 72 RenderBlockFlow& m_block; 73 73 bool m_hyphenated; 74 Clear m_clear;74 UsedClear m_clear; 75 75 Vector<RenderBox*> m_positionedObjects; 76 76 }; -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r276182 r276216 37 37 #include "Pagination.h" 38 38 #include "QuotesData.h" 39 #include "RenderBlock.h" 39 40 #include "RenderObject.h" 40 41 #include "RenderTheme.h" … … 2665 2666 } 2666 2667 2668 UsedClear RenderStyle::usedClear(const RenderObject& renderer) 2669 { 2670 auto computedValue = renderer.style().clear(); 2671 switch (computedValue) { 2672 case Clear::None: 2673 return UsedClear::None; 2674 case Clear::Left: 2675 return UsedClear::Left; 2676 case Clear::Right: 2677 return UsedClear::Right; 2678 case Clear::Both: 2679 return UsedClear::Both; 2680 case Clear::InlineStart: 2681 case Clear::InlineEnd: 2682 auto containingBlockDirection = renderer.containingBlock()->style().direction(); 2683 if (containingBlockDirection == TextDirection::RTL) 2684 return computedValue == Clear::InlineStart ? UsedClear::Right : UsedClear::Left; 2685 return computedValue == Clear::InlineStart ? UsedClear::Left : UsedClear::Right; 2686 } 2687 } 2688 2689 UsedFloat RenderStyle::usedFloat(const RenderObject& renderer) 2690 { 2691 auto computedValue = renderer.style().floating(); 2692 switch (computedValue) { 2693 case Float::None: 2694 return UsedFloat::None; 2695 case Float::Left: 2696 return UsedFloat::Left; 2697 case Float::Right: 2698 return UsedFloat::Right; 2699 case Float::InlineStart: 2700 case Float::InlineEnd: 2701 auto containingBlockDirection = renderer.containingBlock()->style().direction(); 2702 if (containingBlockDirection == TextDirection::RTL) 2703 return computedValue == Float::InlineStart ? UsedFloat::Right : UsedFloat::Left; 2704 return computedValue == Float::InlineStart ? UsedFloat::Left : UsedFloat::Right; 2705 } 2706 } 2667 2707 } // namespace WebCore -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r276182 r276216 199 199 void setColumnStylesFromPaginationMode(const Pagination::Mode&); 200 200 201 bool isFloating() const { return static_cast<Float>(m_nonInheritedFlags.floating) != Float::No ; }201 bool isFloating() const { return static_cast<Float>(m_nonInheritedFlags.floating) != Float::None; } 202 202 bool hasMargin() const { return !m_surroundData->margin.isZero(); } 203 203 bool hasBorder() const { return m_surroundData->border.hasBorder(); } … … 261 261 bool hasViewportConstrainedPosition() const { return position() == PositionType::Fixed || position() == PositionType::Sticky; } 262 262 Float floating() const { return static_cast<Float>(m_nonInheritedFlags.floating); } 263 static UsedFloat usedFloat(const RenderObject&); 263 264 264 265 const Length& width() const { return m_boxData->width(); } … … 349 350 350 351 Clear clear() const { return static_cast<Clear>(m_nonInheritedFlags.clear); } 352 static UsedClear usedClear(const RenderObject&); 351 353 TableLayoutType tableLayout() const { return static_cast<TableLayoutType>(m_nonInheritedFlags.tableLayout); } 352 354 … … 1533 1535 static PositionType initialPosition() { return PositionType::Static; } 1534 1536 static VerticalAlign initialVerticalAlign() { return VerticalAlign::Baseline; } 1535 static Float initialFloating() { return Float::No ; }1537 static Float initialFloating() { return Float::None; } 1536 1538 static BreakBetween initialBreakBetween() { return BreakBetween::Auto; } 1537 1539 static BreakInside initialBreakInside() { return BreakInside::Auto; } … … 1870 1872 unsigned overflowY : 3; // Overflow 1871 1873 unsigned verticalAlign : 4; // VerticalAlign 1872 unsigned clear : 2; // Clear1874 unsigned clear : 3; // Clear 1873 1875 unsigned position : 3; // PositionType 1874 1876 unsigned unicodeBidi : 3; // EUnicodeBidi 1875 unsigned floating : 2; // Float1877 unsigned floating : 3; // Float 1876 1878 unsigned tableLayout : 1; // TableLayoutType 1877 1879 -
trunk/Source/WebCore/rendering/style/RenderStyleConstants.cpp
r272987 r276216 281 281 case Clear::Left: ts << "left"; break; 282 282 case Clear::Right: ts << "right"; break; 283 case Clear::InlineStart : ts << "inline-start"; break; 284 case Clear::InlineEnd : ts << "inline-end"; break; 283 285 case Clear::Both: ts << "both"; break; 286 } 287 return ts; 288 } 289 290 TextStream& operator<<(TextStream& ts, UsedClear clear) 291 { 292 switch (clear) { 293 case UsedClear::None: ts << "none"; break; 294 case UsedClear::Left: ts << "left"; break; 295 case UsedClear::Right: ts << "right"; break; 296 case UsedClear::Both: ts << "both"; break; 284 297 } 285 298 return ts; … … 547 560 { 548 561 switch (floating) { 549 case Float::No : ts << "none"; break;562 case Float::None: ts << "none"; break; 550 563 case Float::Left: ts << "left"; break; 551 564 case Float::Right: ts << "right"; break; 565 case Float::InlineStart: ts << "inline-start"; break; 566 case Float::InlineEnd: ts << "inline-end"; break; 567 } 568 return ts; 569 } 570 571 TextStream& operator<<(TextStream& ts, UsedFloat floating) 572 { 573 switch (floating) { 574 case UsedFloat::None: ts << "none"; break; 575 case UsedFloat::Left: ts << "left"; break; 576 case UsedFloat::Right: ts << "right"; break; 552 577 } 553 578 return ts; -
trunk/Source/WebCore/rendering/style/RenderStyleConstants.h
r275199 r276216 238 238 239 239 enum class Float : uint8_t { 240 No ,240 None, 241 241 Left, 242 Right 242 Right, 243 InlineStart, 244 InlineEnd, 245 }; 246 247 enum class UsedFloat : uint8_t { 248 None, 249 Left, 250 Right, 243 251 }; 244 252 … … 288 296 289 297 enum class Clear : uint8_t { 290 None = 0, 291 Left = 1, 292 Right = 2, 293 Both = 3 298 None, 299 Left, 300 Right, 301 InlineStart, 302 InlineEnd, 303 Both 304 }; 305 306 enum class UsedClear : uint8_t { 307 None, 308 Left, 309 Right, 310 Both 294 311 }; 295 312 … … 1237 1254 WTF::TextStream& operator<<(WTF::TextStream&, CaptionSide); 1238 1255 WTF::TextStream& operator<<(WTF::TextStream&, Clear); 1256 WTF::TextStream& operator<<(WTF::TextStream&, UsedClear); 1239 1257 #if ENABLE(DARK_MODE_CSS) 1240 1258 WTF::TextStream& operator<<(WTF::TextStream&, ColorScheme); … … 1261 1279 WTF::TextStream& operator<<(WTF::TextStream&, FlexWrap); 1262 1280 WTF::TextStream& operator<<(WTF::TextStream&, Float); 1281 WTF::TextStream& operator<<(WTF::TextStream&, UsedFloat); 1263 1282 WTF::TextStream& operator<<(WTF::TextStream&, GridAutoFlow); 1264 1283 WTF::TextStream& operator<<(WTF::TextStream&, HangingPunctuation); -
trunk/Source/WebCore/style/StyleAdjuster.cpp
r275410 r276216 257 257 if (m_element->hasTagName(tdTag)) { 258 258 style.setEffectiveDisplay(DisplayType::TableCell); 259 style.setFloating(Float::No );259 style.setFloating(Float::None); 260 260 } else if (is<HTMLTableElement>(*m_element)) 261 261 style.setEffectiveDisplay(style.isDisplayInlineType() ? DisplayType::InlineTable : DisplayType::Table); … … 288 288 if (m_element->hasTagName(rtTag)) { 289 289 style.setPosition(PositionType::Static); 290 style.setFloating(Float::No );290 style.setFloating(Float::None); 291 291 } 292 292 … … 335 335 // "A parent with a grid or flex display value blockifies the box’s display type." 336 336 if (m_parentBoxStyle.isDisplayFlexibleOrGridBox()) { 337 style.setFloating(Float::No );337 style.setFloating(Float::None); 338 338 style.setEffectiveDisplay(equivalentBlockDisplay(style, m_document)); 339 339 }
Note: See TracChangeset
for help on using the changeset viewer.