⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 238472 in webkit


Ignore:
Timestamp:
Nov 24, 2018, 4:37:06 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Remove now unnecessary specialized ListHashSet from InlineItem.h
https://bugs.webkit.org/show_bug.cgi?id=191946

Patch by Sam Weinig <sam@webkit.org> on 2018-11-24
Reviewed by Zalan Bujtas.

Now that ListHashSet supports raw pointer overloads for smart pointers,
we can fix the FIXME in InlineItem.h and remove the specialized ListHashSet
and ListHashSet::find calls.

  • layout/inlineformatting/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):

  • layout/inlineformatting/InlineFormattingContextGeometry.cpp:

(WebCore::Layout::InlineFormattingContext::Geometry::runWidth):

  • layout/inlineformatting/InlineItem.h:

(WebCore::Layout::InlineItemHashFunctions::hash): Deleted.
(WebCore::Layout::InlineItemHashFunctions::equal): Deleted.
(WebCore::Layout::InlineItemHashTranslator::hash): Deleted.
(WebCore::Layout::InlineItemHashTranslator::equal): Deleted.

  • layout/inlineformatting/InlineLineBreaker.cpp:

(WebCore::Layout::InlineLineBreaker::textWidth const):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r238471 r238472  
     12018-11-24  Sam Weinig  <sam@webkit.org>
     2
     3        Remove now unnecessary specialized ListHashSet from InlineItem.h
     4        https://bugs.webkit.org/show_bug.cgi?id=191946
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        Now that ListHashSet supports raw pointer overloads for smart pointers,
     9        we can fix the FIXME in InlineItem.h and remove the specialized ListHashSet
     10        and ListHashSet::find calls.
     11
     12        * layout/inlineformatting/InlineFormattingContext.cpp:
     13        (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
     14        (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
     15        * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
     16        (WebCore::Layout::InlineFormattingContext::Geometry::runWidth):
     17        * layout/inlineformatting/InlineItem.h:
     18        (WebCore::Layout::InlineItemHashFunctions::hash): Deleted.
     19        (WebCore::Layout::InlineItemHashFunctions::equal): Deleted.
     20        (WebCore::Layout::InlineItemHashTranslator::hash): Deleted.
     21        (WebCore::Layout::InlineItemHashTranslator::equal): Deleted.
     22        * layout/inlineformatting/InlineLineBreaker.cpp:
     23        (WebCore::Layout::InlineLineBreaker::textWidth const):
     24
    1252018-11-24  Wenson Hsieh  <wenson_hsieh@apple.com>
    226
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp

    r238460 r238472  
    163163    };
    164164
    165     for (auto iterator = inlineContent.find<const InlineItem&, InlineItemHashTranslator>(inlineRun.inlineItem()); iterator != inlineContent.end() && remaningLength > 0; ++iterator) {
     165    for (auto iterator = inlineContent.find(&inlineRun.inlineItem()); iterator != inlineContent.end() && remaningLength > 0; ++iterator) {
    166166        auto& inlineItem = **iterator;
    167167
     
    490490
    491491        if (lastInlineBoxBeforeContainer) {
    492             auto iterator = inlineContent.find<const InlineItem&, InlineItemHashTranslator>(*lastInlineBoxBeforeContainer);
     492            auto iterator = inlineContent.find(lastInlineBoxBeforeContainer);
    493493            firstDescendantInlineBox = (*++iterator).get();
    494494        } else
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp

    r238463 r238472  
    181181    LayoutUnit width;
    182182    auto startPosition = from;
    183     auto iterator = inlineContent.find<const InlineItem&, InlineItemHashTranslator>(inlineItem);
     183    auto iterator = inlineContent.find(&inlineItem);
    184184    auto inlineItemEnd = inlineContent.end();
    185185    while (length) {
  • trunk/Source/WebCore/layout/inlineformatting/InlineItem.h

    r238401 r238472  
    8484};
    8585
    86 // FIXME: Fix HashSet/ListHashSet to support smart pointer types.
    87 struct InlineItemHashFunctions {
    88     static unsigned hash(const std::unique_ptr<InlineItem>& key) { return PtrHash<InlineItem*>::hash(key.get()); }
    89     static bool equal(const std::unique_ptr<InlineItem>& a, const std::unique_ptr<InlineItem>& b) { return a.get() == b.get(); }
    90 };
    91 
    92 struct InlineItemHashTranslator {
    93     static unsigned hash(const InlineItem& key) { return PtrHash<const InlineItem*>::hash(&key); }
    94     static bool equal(const std::unique_ptr<InlineItem>& a, const InlineItem& b) { return a.get() == &b; }
    95 };
    96 using InlineContent = ListHashSet<std::unique_ptr<InlineItem>, InlineItemHashFunctions>;
     86using InlineContent = ListHashSet<std::unique_ptr<InlineItem>>;
    9787
    9888inline InlineItem::InlineItem(const Box& layoutBox)
  • trunk/Source/WebCore/layout/inlineformatting/InlineLineBreaker.cpp

    r238463 r238472  
    162162    // FIXME: It does not do proper kerning/ligature handling.
    163163    LayoutUnit width;
    164     auto iterator = m_inlineContent.find<const InlineItem&, InlineItemHashTranslator>(inlineItem);
     164    auto iterator = m_inlineContent.find(&inlineItem);
    165165    auto inlineItemEnd = m_inlineContent.end();
    166166    while (length) {
Note: See TracChangeset for help on using the changeset viewer.