Unreviewed build fix for WinCairo port
authorHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Feb 2020 07:37:45 +0000 (07:37 +0000)
committerHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Feb 2020 07:37:45 +0000 (07:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=208112
<rdar://problem/59709701>

> WebCore\layout/inlineformatting/LineLayoutContext.cpp(337): error C2397: conversion from 'size_t' to 'WTF::Optional<unsigned int>' requires a narrowing conversion
> WebCore\layout/inlineformatting/LineLayoutContext.cpp(361): error C2397: conversion from 'size_t' to 'WTF::Optional<unsigned int>' requires a narrowing conversion

* layout/inlineformatting/LineLayoutContext.cpp:
(WebCore::Layout::LineLayoutContext::close): Changed the type of 'trailingInlineItemIndex' from 'auto' to 'unsigned'.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257297 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/layout/inlineformatting/LineLayoutContext.cpp

index 848e2a1..eb53250 100644 (file)
@@ -1,3 +1,15 @@
+2020-02-24  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        Unreviewed build fix for WinCairo port
+        https://bugs.webkit.org/show_bug.cgi?id=208112
+        <rdar://problem/59709701>
+
+        > WebCore\layout/inlineformatting/LineLayoutContext.cpp(337): error C2397: conversion from 'size_t' to 'WTF::Optional<unsigned int>' requires a narrowing conversion
+        > WebCore\layout/inlineformatting/LineLayoutContext.cpp(361): error C2397: conversion from 'size_t' to 'WTF::Optional<unsigned int>' requires a narrowing conversion
+
+        * layout/inlineformatting/LineLayoutContext.cpp:
+        (WebCore::Layout::LineLayoutContext::close): Changed the type of 'trailingInlineItemIndex' from 'auto' to 'unsigned'.
+
 2020-02-23  Darin Adler  <darin@apple.com>
 
         Refactor TextTrackCue to use more traditional design patterns
 2020-02-23  Darin Adler  <darin@apple.com>
 
         Refactor TextTrackCue to use more traditional design patterns
index 04e0389..0e1e811 100644 (file)
@@ -333,7 +333,7 @@ LineLayoutContext::LineContent LineLayoutContext::close(LineBuilder& line, const
             // We didn't manage to add a run or a float at this vertical position.
             return LineContent { { }, { }, WTFMove(m_floats), line.close(), line.lineBox() };
         }
             // We didn't manage to add a run or a float at this vertical position.
             return LineContent { { }, { }, WTFMove(m_floats), line.close(), line.lineBox() };
         }
-        auto trailingInlineItemIndex = layoutRange.start + m_floats.size();
+        unsigned trailingInlineItemIndex = layoutRange.start + m_floats.size();
         return LineContent { trailingInlineItemIndex, { }, WTFMove(m_floats), line.close(), line.lineBox() };
     }
     // Adjust hyphenated line count.
         return LineContent { trailingInlineItemIndex, { }, WTFMove(m_floats), line.close(), line.lineBox() };
     }
     // Adjust hyphenated line count.
@@ -342,7 +342,7 @@ LineLayoutContext::LineContent LineLayoutContext::close(LineBuilder& line, const
     else
         m_successiveHyphenatedLineCount = 0;
     ASSERT(committedInlineItemCount);
     else
         m_successiveHyphenatedLineCount = 0;
     ASSERT(committedInlineItemCount);
-    auto trailingInlineItemIndex = layoutRange.start + committedInlineItemCount + m_floats.size() - 1;
+    unsigned trailingInlineItemIndex = layoutRange.start + committedInlineItemCount + m_floats.size() - 1;
     ASSERT(trailingInlineItemIndex < layoutRange.end);
     auto isLastLineWithInlineContent = [&] {
         if (trailingInlineItemIndex == layoutRange.end - 1)
     ASSERT(trailingInlineItemIndex < layoutRange.end);
     auto isLastLineWithInlineContent = [&] {
         if (trailingInlineItemIndex == layoutRange.end - 1)