Changeset 283312 in webkit
- Timestamp:
- Sep 30, 2021, 8:26:21 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/inline/inline-box-background-dynamic-expected.html (added)
-
LayoutTests/fast/inline/inline-box-background-dynamic.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp (modified) (3 diffs)
-
Source/WebCore/layout/integration/LayoutIntegrationCoverage.h (modified) (1 diff)
-
Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (modified) (1 diff)
-
Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderInline.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r283311 r283312 1 2021-09-30 Alan Bujtas <zalan@apple.com> 2 3 (REGRESSION r282150) Missing background-color on inline box while hovering 4 https://bugs.webkit.org/show_bug.cgi?id=230977 5 <rdar://problem/83682736> 6 7 Reviewed by Antti Koivisto. 8 9 * fast/inline/inline-box-background-dynamic-expected.html: Added. 10 * fast/inline/inline-box-background-dynamic.html: Added. 11 1 12 2021-09-30 Antti Koivisto <antti@apple.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r283311 r283312 1 2021-09-30 Alan Bujtas <zalan@apple.com> 2 3 (REGRESSION r282150) Missing background-color on inline box while hovering 4 https://bugs.webkit.org/show_bug.cgi?id=230977 5 <rdar://problem/83682736> 6 7 Reviewed by Antti Koivisto. 8 9 Check if the RenderInline is still eligible for the modern line layout codepath after style change. 10 11 Test: fast/inline/inline-box-background-dynamic.html 12 13 * layout/integration/LayoutIntegrationCoverage.cpp: 14 (WebCore::LayoutIntegration::canUseForRenderInlineChild): 15 (WebCore::LayoutIntegration::canUseForChild): 16 (WebCore::LayoutIntegration::canUseForLineLayoutAfterInlineBoxStyleChange): 17 * layout/integration/LayoutIntegrationCoverage.h: 18 * layout/integration/LayoutIntegrationLineLayout.cpp: 19 (WebCore::LayoutIntegration::LineLayout::canUseForAfterInlineBoxStyleChange): 20 * layout/integration/LayoutIntegrationLineLayout.h: 21 * rendering/RenderInline.cpp: 22 (WebCore::RenderInline::styleDidChange): 23 1 24 2021-09-30 Antti Koivisto <antti@apple.com> 2 25 -
trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp
r282874 r283312 474 474 } 475 475 476 static OptionSet<AvoidanceReason> canUseForRenderInlineChild(const RenderInline& renderInline, IncludeReasons includeReasons) 477 { 478 OptionSet<AvoidanceReason> reasons; 479 480 if (renderInline.isSVGInline()) 481 SET_REASON_AND_RETURN_IF_NEEDED(ContentIsSVG, reasons, includeReasons); 482 if (renderInline.isRubyInline() || renderInline.isQuote()) 483 SET_REASON_AND_RETURN_IF_NEEDED(ContentIsRuby, reasons, includeReasons); 484 if (renderInline.requiresLayer()) 485 SET_REASON_AND_RETURN_IF_NEEDED(InlineBoxNeedsLayer, reasons, includeReasons) 486 487 auto& style = renderInline.style(); 488 if (style.boxShadow() || !style.hangingPunctuation().isEmpty()) 489 SET_REASON_AND_RETURN_IF_NEEDED(ChildBoxHasUnsupportedStyle, reasons, includeReasons) 490 if (style.hasBorder() || style.borderImage().hasImage()) 491 SET_REASON_AND_RETURN_IF_NEEDED(InlineBoxHasBorderOrBorderImage, reasons, includeReasons); 492 if (style.hasBackground()) 493 SET_REASON_AND_RETURN_IF_NEEDED(InlineBoxHasBackground, reasons, includeReasons); 494 if (style.hasOutline()) 495 SET_REASON_AND_RETURN_IF_NEEDED(ContentHasOutline, reasons, includeReasons); 496 if (renderInline.isInFlowPositioned()) 497 SET_REASON_AND_RETURN_IF_NEEDED(ChildBoxIsFloatingOrPositioned, reasons, includeReasons); 498 if (renderInline.containingBlock()->style().lineBoxContain() != RenderStyle::initialLineBoxContain()) 499 SET_REASON_AND_RETURN_IF_NEEDED(FlowHasLineBoxContainProperty, reasons, includeReasons); 500 auto fontAndTextReasons = canUseForFontAndText(renderInline, includeReasons); 501 if (fontAndTextReasons) 502 ADD_REASONS_AND_RETURN_IF_NEEDED(fontAndTextReasons, reasons, includeReasons); 503 auto styleReasons = canUseForStyle(style, includeReasons); 504 if (styleReasons) 505 ADD_REASONS_AND_RETURN_IF_NEEDED(styleReasons, reasons, includeReasons); 506 507 return reasons; 508 } 509 476 510 static OptionSet<AvoidanceReason> canUseForChild(const RenderBlockFlow& flow, const RenderObject& child, IncludeReasons includeReasons) 477 511 { … … 544 578 } 545 579 546 if (is<RenderInline>(child)) { 547 auto& renderInline = downcast<RenderInline>(child); 548 if (renderInline.isSVGInline()) 549 SET_REASON_AND_RETURN_IF_NEEDED(ContentIsSVG, reasons, includeReasons); 550 if (renderInline.isRubyInline() || renderInline.isQuote()) 551 SET_REASON_AND_RETURN_IF_NEEDED(ContentIsRuby, reasons, includeReasons); 552 if (renderInline.requiresLayer()) 553 SET_REASON_AND_RETURN_IF_NEEDED(InlineBoxNeedsLayer, reasons, includeReasons) 554 if (flow.fragmentedFlowState() != RenderObject::NotInsideFragmentedFlow) 555 SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonSupportedChild, reasons, includeReasons); 556 557 auto& style = renderInline.style(); 558 if (!isSupportedStyle(style)) 559 SET_REASON_AND_RETURN_IF_NEEDED(ChildBoxHasUnsupportedStyle, reasons, includeReasons) 560 if (style.hasBorder() || style.borderImage().hasImage()) 561 SET_REASON_AND_RETURN_IF_NEEDED(InlineBoxHasBorderOrBorderImage, reasons, includeReasons); 562 if (style.hasBackground()) 563 SET_REASON_AND_RETURN_IF_NEEDED(InlineBoxHasBackground, reasons, includeReasons); 564 if (style.hasOutline()) 565 SET_REASON_AND_RETURN_IF_NEEDED(ContentHasOutline, reasons, includeReasons); 566 if (renderInline.isInFlowPositioned()) 567 SET_REASON_AND_RETURN_IF_NEEDED(ChildBoxIsFloatingOrPositioned, reasons, includeReasons); 568 if (renderInline.containingBlock()->style().lineBoxContain() != RenderStyle::initialLineBoxContain()) 569 SET_REASON_AND_RETURN_IF_NEEDED(FlowHasLineBoxContainProperty, reasons, includeReasons); 570 auto fontAndTextReasons = canUseForFontAndText(downcast<RenderInline>(child), includeReasons); 571 if (fontAndTextReasons) 572 ADD_REASONS_AND_RETURN_IF_NEEDED(fontAndTextReasons, reasons, includeReasons); 573 auto styleReasons = canUseForStyle(style, includeReasons); 574 if (styleReasons) 575 ADD_REASONS_AND_RETURN_IF_NEEDED(styleReasons, reasons, includeReasons); 576 577 return reasons; 578 } 580 if (is<RenderInline>(child)) 581 return canUseForRenderInlineChild(downcast<RenderInline>(child), includeReasons); 579 582 580 583 SET_REASON_AND_RETURN_IF_NEEDED(FlowHasNonSupportedChild, reasons, includeReasons); … … 697 700 } 698 701 702 bool canUseForLineLayoutAfterInlineBoxStyleChange(const RenderInline& renderer, StyleDifference) 703 { 704 return canUseForRenderInlineChild(renderer, IncludeReasons::First).isEmpty(); 705 } 706 699 707 } 700 708 } -
trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.h
r282874 r283312 105 105 bool canUseForLineLayout(const RenderBlockFlow&); 106 106 bool canUseForLineLayoutAfterStyleChange(const RenderBlockFlow&, StyleDifference); 107 bool canUseForLineLayoutAfterInlineBoxStyleChange(const RenderInline&, StyleDifference); 107 108 108 109 enum class IncludeReasons { First , All }; -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp
r283311 r283312 124 124 } 125 125 126 bool LineLayout::canUseForAfterInlineBoxStyleChange(const RenderInline& inlineBox, StyleDifference diff) 127 { 128 ASSERT(isEnabled()); 129 return canUseForLineLayoutAfterInlineBoxStyleChange(inlineBox, diff); 130 } 131 126 132 bool LineLayout::shouldSwitchToLegacyOnInvalidation() const 127 133 { -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h
r283311 r283312 71 71 static bool canUseFor(const RenderBlockFlow&); 72 72 static bool canUseForAfterStyleChange(const RenderBlockFlow&, StyleDifference); 73 static bool canUseForAfterInlineBoxStyleChange(const RenderInline&, StyleDifference); 73 74 74 75 bool shouldSwitchToLegacyOnInvalidation() const; -
trunk/Source/WebCore/rendering/RenderInline.cpp
r282873 r283312 188 188 189 189 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 190 if (auto* lineLayout = LayoutIntegration::LineLayout::containing(*this)) { 191 if (diff >= StyleDifference::Repaint && selfNeedsLayout()) { 192 // FIXME: Add support for partial invalidation. 193 if (auto* container = LayoutIntegration::LineLayout::blockContainer(*this)) 194 container->invalidateLineLayoutPath(); 195 } else 196 lineLayout->updateStyle(*this, *oldStyle); 190 if (diff >= StyleDifference::Repaint) { 191 if (auto* lineLayout = LayoutIntegration::LineLayout::containing(*this)) { 192 auto shouldInvalidateLineLayoutPath = selfNeedsLayout() || !LayoutIntegration::LineLayout::canUseForAfterInlineBoxStyleChange(*this, diff); 193 if (shouldInvalidateLineLayoutPath) 194 lineLayout->flow().invalidateLineLayoutPath(); 195 else 196 lineLayout->updateStyle(*this, *oldStyle); 197 } 197 198 } 198 199 #endif
Note:
See TracChangeset
for help on using the changeset viewer.