[webkit-changes] [WebKit/WebKit] 3d10ef: [IFC] Add inline box count to InlineContentCache::...

Alan Baradlay noreply at github.com
Sun Jan 28 13:12:39 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3d10ef21695f69f971dc10f9e72a972a6f35d81d
      https://github.com/WebKit/WebKit/commit/3d10ef21695f69f971dc10f9e72a972a6f35d81d
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2024-01-28 (Sun, 28 Jan 2024)

  Changed paths:
    M Source/WebCore/layout/formattingContexts/inline/InlineContentCache.h
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.h
    M Source/WebCore/layout/formattingContexts/inline/IntrinsicWidthHandler.cpp
    M Source/WebCore/layout/formattingContexts/inline/IntrinsicWidthHandler.h
    M Source/WebCore/layout/formattingContexts/inline/TextOnlySimpleLineBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/TextOnlySimpleLineBuilder.h

  Log Message:
  -----------
  [IFC] Add inline box count to InlineContentCache::InlineItems
https://bugs.webkit.org/show_bug.cgi?id=268227

Reviewed by Antti Koivisto.

This is in preparation for being able to run a range of content through the simple line builder (where the range has text only content e.g. <div><span>this is text content</span></div>

1. Keep track of the number of inline boxes (m_inlineBoxCount)
2. m_isTextAndForcedLineBreakOnlyContent only tracks _content_ type of inline level boxes now (excluding inline boxes, see #1)
3. and it does not track if content needs bidi reordering anymore (we already track that information in m_contentRequiresVisualReordering)
4. Add InlineContentCache::InlineItems::ContentAttributes to hold all these bits.
5. Remove dedicated set functions and pass these bit through InlineContentCache::InlineItems::set/replace.

* Source/WebCore/layout/formattingContexts/inline/InlineContentCache.h:
(WebCore::Layout::InlineContentCache::InlineItems::requiresVisualReordering const):
(WebCore::Layout::InlineContentCache::InlineItems::hasTextAndLineBreakOnlyContent const):
(WebCore::Layout::InlineContentCache::InlineItems::hasInlineBoxes const):
(WebCore::Layout::InlineContentCache::InlineItems::inlineBoxCount const):
(WebCore::Layout::InlineContentCache::InlineItems::set):
(WebCore::Layout::InlineContentCache::InlineItems::replace):
(WebCore::Layout::InlineContentCache::InlineItems::append): Deleted.
(WebCore::Layout::InlineContentCache::InlineItems::clear): Deleted.
(WebCore::Layout::InlineContentCache::InlineItems::setRequiresVisualReordering): Deleted.
(WebCore::Layout::InlineContentCache::InlineItems::setIsNonBidiTextAndForcedLineBreakOnlyContent): Deleted.
(WebCore::Layout::InlineContentCache::InlineItems::isNonBidiTextAndForcedLineBreakOnlyContent const): Deleted.
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout):
(WebCore::Layout::InlineFormattingContext::minimumMaximumContentSize):
(WebCore::Layout::InlineFormattingContext::minimumContentSize):
(WebCore::Layout::InlineFormattingContext::maximumContentSize):
* Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp:
(WebCore::Layout::InlineItemsBuilder::build):
(WebCore::Layout::InlineItemsBuilder::traverseUntilDamaged):
(WebCore::Layout::InlineItemsBuilder::collectInlineItems):
(WebCore::Layout::InlineItemsBuilder::handleTextContent):
(WebCore::Layout::InlineItemsBuilder::handleInlineBoxStart):
(WebCore::Layout::InlineItemsBuilder::handleInlineBoxEnd):
(WebCore::Layout::InlineItemsBuilder::handleInlineLevelBox):
* Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.h:
* Source/WebCore/layout/formattingContexts/inline/IntrinsicWidthHandler.cpp:
(WebCore::Layout::IntrinsicWidthHandler::IntrinsicWidthHandler):
(WebCore::Layout::IntrinsicWidthHandler::minimumContentSize):
(WebCore::Layout::IntrinsicWidthHandler::maximumContentSize):
(WebCore::Layout::IntrinsicWidthHandler::computedIntrinsicWidthForConstraint):
(WebCore::Layout::IntrinsicWidthHandler::simplifiedMaximumWidth):
* Source/WebCore/layout/formattingContexts/inline/IntrinsicWidthHandler.h:
(WebCore::Layout::IntrinsicWidthHandler::inlineItemList const):
* Source/WebCore/layout/formattingContexts/inline/TextOnlySimpleLineBuilder.cpp:
(WebCore::Layout::TextOnlySimpleLineBuilder::isEligibleForSimplifiedTextOnlyInlineLayout):
* Source/WebCore/layout/formattingContexts/inline/TextOnlySimpleLineBuilder.h:

Canonical link: https://commits.webkit.org/273632@main




More information about the webkit-changes mailing list