Changeset 286133 in webkit
- Timestamp:
- Nov 23, 2021, 7:01:01 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/mac/fast/box-shadow/basic-shadows-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp (modified) (5 diffs)
-
Source/WebCore/layout/formattingContexts/inline/InlineRect.h (modified) (2 diffs)
-
Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp (modified) (5 diffs)
-
Source/WebCore/layout/integration/LayoutIntegrationCoverage.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r286131 r286133 1 2021-11-23 Alan Bujtas <zalan@apple.com> 2 3 [IFC][Integration] Inflate ink overflow with box-shadow 4 https://bugs.webkit.org/show_bug.cgi?id=233437 5 6 Reviewed by Antti Koivisto. 7 8 * platform/mac/fast/box-shadow/basic-shadows-expected.txt: 9 1 10 2021-11-23 Adrian Perez de Castro <aperez@igalia.com> 2 11 -
trunk/LayoutTests/platform/mac/fast/box-shadow/basic-shadows-expected.txt
r268520 r286133 8 8 RenderText {#text} at (5,16) size 57x18 9 9 text run at (5,16) width 57: "This text" 10 RenderBR {BR} at (61, 0) size 1x1810 RenderBR {BR} at (61,16) size 1x18 11 11 RenderText {#text} at (0,66) size 77x18 12 12 text run at (0,66) width 77: "should have" 13 RenderBR {BR} at (76, 50) size 1x1813 RenderBR {BR} at (76,66) size 1x18 14 14 RenderText {#text} at (0,116) size 265x18 15 15 text run at (0,116) width 265: "a multi-line shadow with a border-radius." -
trunk/Source/WebCore/ChangeLog
r286129 r286133 1 2021-11-23 Alan Bujtas <zalan@apple.com> 2 3 [IFC][Integration] Inflate ink overflow with box-shadow 4 https://bugs.webkit.org/show_bug.cgi?id=233437 5 6 Reviewed by Antti Koivisto. 7 8 * layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp: 9 (WebCore::Layout::addBoxShadowInkOverflow): 10 (WebCore::Layout::InlineDisplayContentBuilder::createBoxesAndUpdateGeometryForLineContent): 11 * layout/formattingContexts/inline/InlineRect.h: 12 (WebCore::Layout::InlineRect::inflate): 13 * layout/integration/LayoutIntegrationCoverage.cpp: 14 (WebCore::LayoutIntegration::printReason): 15 (WebCore::LayoutIntegration::canUseForRenderInlineChild): 16 (WebCore::LayoutIntegration::canUseForChild): 17 * layout/integration/LayoutIntegrationCoverage.h: 18 1 19 2021-11-23 Said Abou-Hallawa <said@apple.com> 2 20 -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp
r285784 r286133 66 66 collectInkOverflowForInlineBoxes(lineBox, boxes); 67 67 return boxes; 68 } 69 70 static inline void addBoxShadowInkOverflow(const RenderStyle& style, InlineRect& inkOverflow) 71 { 72 auto topBoxShadow = LayoutUnit { }; 73 auto bottomBoxShadow = LayoutUnit { }; 74 style.getBoxShadowBlockDirectionExtent(topBoxShadow, bottomBoxShadow); 75 76 auto leftBoxShadow = LayoutUnit { }; 77 auto rightBoxShadow = LayoutUnit { }; 78 style.getBoxShadowInlineDirectionExtent(leftBoxShadow, rightBoxShadow); 79 inkOverflow.inflate(InlineLayoutUnit { topBoxShadow }, InlineLayoutUnit { rightBoxShadow }, InlineLayoutUnit { bottomBoxShadow }, InlineLayoutUnit { leftBoxShadow }); 68 80 } 69 81 … … 206 218 } 207 219 RELEASE_ASSERT(m_inlineBoxIndexMap.contains(&parentInlineBox)); 208 boxes[m_inlineBoxIndexMap.get(&parentInlineBox)].adjustInkOverflow(borderBoxRect); 220 auto boxInkOverflow = borderBoxRect; 221 addBoxShadowInkOverflow(style, boxInkOverflow); 222 boxes[m_inlineBoxIndexMap.get(&parentInlineBox)].adjustInkOverflow(boxInkOverflow); 209 223 }; 210 224 adjustParentInlineBoxInkOverflow(); … … 217 231 contentRightInVisualOrder += lineRun.logicalWidth(); 218 232 if (lineBox.hasContent()) { 233 auto inkOverflow = [&] { 234 auto inkOverflow = inlineBoxBorderBox; 235 addBoxShadowInkOverflow(style, inkOverflow); 236 return inkOverflow; 237 }; 219 238 // FIXME: It's expected to not have any boxes on empty lines. We should reconsider this. 220 239 m_inlineBoxIndexMap.add(&layoutBox, boxes.size()); … … 223 242 ASSERT(inlineBox.isInlineBox()); 224 243 ASSERT(inlineBox.isFirstBox()); 225 boxes.append({ lineIndex, InlineDisplay::Box::Type::NonRootInlineBox, layoutBox, lineRun.bidiLevel(), inlineBoxBorderBox, in lineBoxBorderBox, { }, { }, inlineBox.hasContent(), isFirstLastBox(inlineBox) });244 boxes.append({ lineIndex, InlineDisplay::Box::Type::NonRootInlineBox, layoutBox, lineRun.bidiLevel(), inlineBoxBorderBox, inkOverflow(), { }, { }, inlineBox.hasContent(), isFirstLastBox(inlineBox) }); 226 245 } 227 246 … … 243 262 } 244 263 m_inlineBoxIndexMap.add(&layoutBox, boxes.size()); 245 246 auto& inlineBox = lineBox.inlineLevelBoxForLayoutBox(layoutBox);247 264 auto inlineBoxBorderBox = displayBoxRect(); 265 266 auto inkOverflow = [&] { 267 auto inkOverflow = inlineBoxBorderBox; 268 addBoxShadowInkOverflow(style, inkOverflow); 269 return inkOverflow; 270 }; 271 248 272 // The content right edge should not include the entire inline box here (including its content and right edge). 249 273 contentRightInVisualOrder += lineRun.logicalWidth(); 274 275 auto& inlineBox = lineBox.inlineLevelBoxForLayoutBox(layoutBox); 250 276 ASSERT(!inlineBox.isFirstBox()); 251 boxes.append({ lineIndex, InlineDisplay::Box::Type::NonRootInlineBox, layoutBox, lineRun.bidiLevel(), inlineBoxBorderBox, in lineBoxBorderBox, { }, { }, inlineBox.hasContent(), isFirstLastBox(inlineBox) });277 boxes.append({ lineIndex, InlineDisplay::Box::Type::NonRootInlineBox, layoutBox, lineRun.bidiLevel(), inlineBoxBorderBox, inkOverflow(), { }, { }, inlineBox.hasContent(), isFirstLastBox(inlineBox) }); 252 278 253 279 auto inlineBoxSize = LayoutSize { LayoutUnit::fromFloatCeil(inlineBoxBorderBox.width()), LayoutUnit::fromFloatCeil(inlineBoxBorderBox.height()) }; -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineRect.h
r281905 r286133 69 69 void expandVerticallyToContain(const InlineRect&); 70 70 void inflate(InlineLayoutUnit); 71 void inflate(InlineLayoutUnit top, InlineLayoutUnit right, InlineLayoutUnit bottom, InlineLayoutUnit left); 71 72 72 73 operator InlineLayoutRect() const; … … 289 290 } 290 291 292 inline void InlineRect::inflate(InlineLayoutUnit top, InlineLayoutUnit right, InlineLayoutUnit bottom, InlineLayoutUnit left) 293 { 294 ASSERT(hasValidGeometry()); 295 m_rect.setX(m_rect.x() - left); 296 m_rect.setY(m_rect.y() - top); 297 m_rect.setWidth(m_rect.width() + left + right); 298 m_rect.setHeight(m_rect.height() + top + bottom); 299 } 300 291 301 inline InlineRect::operator InlineLayoutRect() const 292 302 { -
trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp
r286107 r286133 201 201 stream << "SVG content"; 202 202 break; 203 case AvoidanceReason::ChildBox HasUnsupportedStyle:204 stream << "child box has unsupported style";203 case AvoidanceReason::ChildBoxIsNotInlineBlock: 204 stream << "child box has unsupported display type"; 205 205 break; 206 206 case AvoidanceReason::UnsupportedImageMap: … … 478 478 479 479 auto& style = renderInline.style(); 480 if ( style.boxShadow() ||!style.hangingPunctuation().isEmpty())481 SET_REASON_AND_RETURN_IF_NEEDED( ChildBoxHasUnsupportedStyle, reasons, includeReasons)480 if (!style.hangingPunctuation().isEmpty()) 481 SET_REASON_AND_RETURN_IF_NEEDED(FlowHasHangingPunctuation, reasons, includeReasons) 482 482 #if ENABLE(CSS_BOX_DECORATION_BREAK) 483 483 if (style.boxDecorationBreak() == BoxDecorationBreak::Clone) … … 529 529 } 530 530 531 auto isSupportedStyle = [] (const auto& style) {532 if (style.boxShadow())533 return false;534 if (!style.hangingPunctuation().isEmpty())535 return false;536 return true;537 };538 539 531 if (is<RenderReplaced>(child)) { 540 532 auto& replaced = downcast<RenderReplaced>(child); … … 544 536 if (replaced.isSVGRoot()) 545 537 SET_REASON_AND_RETURN_IF_NEEDED(ContentIsSVG, reasons, includeReasons); 546 547 if (!isSupportedStyle(replaced.style()))548 SET_REASON_AND_RETURN_IF_NEEDED(ChildBoxHasUnsupportedStyle, reasons, includeReasons);549 538 550 539 if (is<RenderImage>(replaced)) { … … 567 556 568 557 auto& style = block.style(); 569 if (! isSupportedStyle(style))570 SET_REASON_AND_RETURN_IF_NEEDED( ChildBoxHasUnsupportedStyle, reasons, includeReasons)558 if (!style.hangingPunctuation().isEmpty()) 559 SET_REASON_AND_RETURN_IF_NEEDED(FlowHasHangingPunctuation, reasons, includeReasons) 571 560 if (style.display() != DisplayType::InlineBlock) 572 SET_REASON_AND_RETURN_IF_NEEDED(ChildBox HasUnsupportedStyle, reasons, includeReasons)561 SET_REASON_AND_RETURN_IF_NEEDED(ChildBoxIsNotInlineBlock, reasons, includeReasons) 573 562 574 563 return reasons; -
trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.h
r284334 r286133 96 96 ChildBoxIsFloatingOrPositioned = 1LLU << 55, 97 97 ContentIsSVG = 1LLU << 56, 98 ChildBox HasUnsupportedStyle= 1LLU << 57,98 ChildBoxIsNotInlineBlock = 1LLU << 57, 99 99 UnsupportedImageMap = 1LLU << 58, 100 100 InlineBoxNeedsLayer = 1LLU << 59,
Note:
See TracChangeset
for help on using the changeset viewer.