Changeset 256466 in webkit
- Timestamp:
- Feb 12, 2020 12:01:14 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r256463 r256466 1 2020-02-12 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Do not create Display::Boxes for anonymous inline text boxes 4 https://bugs.webkit.org/show_bug.cgi?id=207612 5 <rdar://problem/59374909> 6 7 Reviewed by Antti Koivisto. 8 9 <div>text content</div> : [text content] only needs a Display::Run. 10 <div><span>text content</span></div> [span] needs a Display::Box and [text content] needs a Display::Run. 11 12 * layout/inlineformatting/InlineFormattingContext.cpp: 13 (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine): 14 1 15 2020-02-12 Said Abou-Hallawa <said@apple.com> 2 16 -
trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp
r256437 r256466 462 462 auto& logicalRect = lineRun.logicalRect(); 463 463 auto& layoutBox = lineRun.layoutBox(); 464 auto& displayBox = formattingState.displayBox(layoutBox);465 464 466 465 // Add final display runs to state first. … … 490 489 491 490 if (lineRun.isLineBreak()) { 492 displayBox.setTopLeft(toLayoutPoint(logicalRect.topLeft())); 493 displayBox.setContentBoxWidth(toLayoutUnit(logicalRect.width())); 494 displayBox.setContentBoxHeight(toLayoutUnit(logicalRect.height())); 491 // FIXME: Since <br> and <wbr> runs have associated DOM elements, we might need to construct a display box here. 495 492 continue; 496 493 } … … 501 498 if (layoutBox.isInFlowPositioned()) 502 499 topLeft += geometry().inFlowPositionedPositionOffset(layoutBox, horizontalConstraints); 500 auto& displayBox = formattingState.displayBox(layoutBox); 503 501 displayBox.setTopLeft(toLayoutPoint(topLeft)); 504 502 continue; … … 507 505 // Inline level container start (<span>) 508 506 if (lineRun.isContainerStart()) { 507 auto& displayBox = formattingState.displayBox(layoutBox); 509 508 displayBox.setTopLeft(toLayoutPoint(logicalRect.topLeft())); 510 509 continue; … … 513 512 // Inline level container end (</span>) 514 513 if (lineRun.isContainerEnd()) { 514 auto& displayBox = formattingState.displayBox(layoutBox); 515 515 if (layoutBox.isInFlowPositioned()) { 516 516 auto inflowOffset = geometry().inFlowPositionedPositionOffset(layoutBox, horizontalConstraints); … … 527 527 528 528 if (lineRun.isText()) { 529 // Anonymous inline text boxes do not create display boxes. 529 530 lastTextItemIndex = inlineContent.runs.size() - 1; 530 auto firstRunForLayoutBox = !index || &lineRuns[index - 1].layoutBox() != &layoutBox;531 if (firstRunForLayoutBox) {532 // Setup display box for the associated layout box.533 displayBox.setTopLeft(toLayoutPoint(logicalRect.topLeft()));534 displayBox.setContentBoxWidth(toLayoutUnit(logicalRect.width()));535 displayBox.setContentBoxHeight(toLayoutUnit(logicalRect.height()));536 } else {537 // FIXME fix it for multirun/multiline.538 displayBox.setContentBoxWidth(toLayoutUnit(displayBox.contentBoxWidth() + logicalRect.width()));539 }540 531 continue; 541 532 }
Note: See TracChangeset
for help on using the changeset viewer.