<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[282401] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/282401">282401</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2021-09-14 12:31:03 -0700 (Tue, 14 Sep 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[LFC][IFC] Introduce InlineInvalidation/InlineDamage
https://bugs.webkit.org/show_bug.cgi?id=229225
<rdar://problem/82324227>

Reviewed by Antti Koivisto.

This is in preparation for supporting partial inline layout.

The initial implementation is going to only support a single type of damage (content changed, style changed etc) on a single line.
Anything more involved either
1. folds into a full damage type of layout (i.e. no range support) e.g changing multiple images on different lines triggers vertical alignment on all the lines
2. triggers the lowest level type of layout e.g. changing content on the first line while resizing the containing block folds into NeedsContentUpdateAndLineLayout.

* CMakeLists.txt:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/formattingContexts/inline/invalidation/InlineDamage.h: Added.
(WebCore::Layout::InlineDamage::type const):
(WebCore::Layout::InlineDamage::line const):
(WebCore::Layout::InlineDamage::setDamageType):
(WebCore::Layout::InlineDamage::setDamagedLine):
* layout/formattingContexts/inline/invalidation/InlineInvalidation.cpp: Added.
(WebCore::Layout::InlineInvalidation::InlineInvalidation):
(WebCore::Layout::InlineInvalidation::styleChanged):
(WebCore::Layout::InlineInvalidation::textInserted):
(WebCore::Layout::InlineInvalidation::textWillBeRemoved):
(WebCore::Layout::InlineInvalidation::inlineLevelBoxInserted):
(WebCore::Layout::InlineInvalidation::inlineLevelBoxWillBeRemoved):
* layout/formattingContexts/inline/invalidation/InlineInvalidation.h: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreSourcestxt">trunk/Source/WebCore/Sources.txt</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebCore/layout/formattingContexts/inline/invalidation/</li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsinlineinvalidationInlineDamageh">trunk/Source/WebCore/layout/formattingContexts/inline/invalidation/InlineDamage.h</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsinlineinvalidationInlineInvalidationcpp">trunk/Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.cpp</a></li>
<li><a href="#trunkSourceWebCorelayoutformattingContextsinlineinvalidationInlineInvalidationh">trunk/Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (282400 => 282401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt      2021-09-14 19:26:58 UTC (rev 282400)
+++ trunk/Source/WebCore/CMakeLists.txt 2021-09-14 19:31:03 UTC (rev 282401)
</span><span class="lines">@@ -112,6 +112,7 @@
</span><span class="cx">     "${WEBCORE_DIR}/layout/formattingContexts/flex"
</span><span class="cx">     "${WEBCORE_DIR}/layout/floats"
</span><span class="cx">     "${WEBCORE_DIR}/layout/formattingContexts/inline"
</span><ins>+    "${WEBCORE_DIR}/layout/formattingContexts/invalidation"
</ins><span class="cx">     "${WEBCORE_DIR}/layout/formattingContexts/inline/text"
</span><span class="cx">     "${WEBCORE_DIR}/layout/integration"
</span><span class="cx">     "${WEBCORE_DIR}/layout/layouttree"
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (282400 => 282401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-09-14 19:26:58 UTC (rev 282400)
+++ trunk/Source/WebCore/ChangeLog      2021-09-14 19:31:03 UTC (rev 282401)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2021-09-14  Alan Bujtas  <zalan@apple.com>
+
+        [LFC][IFC] Introduce InlineInvalidation/InlineDamage
+        https://bugs.webkit.org/show_bug.cgi?id=229225
+        <rdar://problem/82324227>
+
+        Reviewed by Antti Koivisto.
+
+        This is in preparation for supporting partial inline layout.
+
+        The initial implementation is going to only support a single type of damage (content changed, style changed etc) on a single line.
+        Anything more involved either
+        1. folds into a full damage type of layout (i.e. no range support) e.g changing multiple images on different lines triggers vertical alignment on all the lines
+        2. triggers the lowest level type of layout e.g. changing content on the first line while resizing the containing block folds into NeedsContentUpdateAndLineLayout.
+
+        * CMakeLists.txt:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * layout/formattingContexts/inline/invalidation/InlineDamage.h: Added.
+        (WebCore::Layout::InlineDamage::type const):
+        (WebCore::Layout::InlineDamage::line const):
+        (WebCore::Layout::InlineDamage::setDamageType):
+        (WebCore::Layout::InlineDamage::setDamagedLine):
+        * layout/formattingContexts/inline/invalidation/InlineInvalidation.cpp: Added.
+        (WebCore::Layout::InlineInvalidation::InlineInvalidation):
+        (WebCore::Layout::InlineInvalidation::styleChanged):
+        (WebCore::Layout::InlineInvalidation::textInserted):
+        (WebCore::Layout::InlineInvalidation::textWillBeRemoved):
+        (WebCore::Layout::InlineInvalidation::inlineLevelBoxInserted):
+        (WebCore::Layout::InlineInvalidation::inlineLevelBoxWillBeRemoved):
+        * layout/formattingContexts/inline/invalidation/InlineInvalidation.h: Added.
+
</ins><span class="cx"> 2021-09-14  Myles C. Maxfield  <mmaxfield@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [Cocoa] Migrate to CTFontHasTable() from CTFontCopyAvailableTables()
</span></span></pre></div>
<a id="trunkSourceWebCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Sources.txt (282400 => 282401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Sources.txt 2021-09-14 19:26:58 UTC (rev 282400)
+++ trunk/Source/WebCore/Sources.txt    2021-09-14 19:31:03 UTC (rev 282401)
</span><span class="lines">@@ -1489,6 +1489,7 @@
</span><span class="cx"> layout/formattingContexts/inline/InlineLineBuilder.cpp
</span><span class="cx"> layout/formattingContexts/inline/InlineLineBoxVerticalAligner.cpp
</span><span class="cx"> layout/formattingContexts/inline/InlineTextItem.cpp
</span><ins>+layout/formattingContexts/inline/invalidation/InlineInvalidation.cpp
</ins><span class="cx"> layout/formattingContexts/inline/text/TextUtil.cpp
</span><span class="cx"> layout/integration/LayoutIntegrationBoxTree.cpp
</span><span class="cx"> layout/integration/LayoutIntegrationCoverage.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (282400 => 282401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2021-09-14 19:26:58 UTC (rev 282400)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2021-09-14 19:31:03 UTC (rev 282401)
</span><span class="lines">@@ -391,6 +391,8 @@
</span><span class="cx">          0FFD45AA243C3027000D4BEA /* ScrollingTreeLatchingController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFD45A7243BF257000D4BEA /* ScrollingTreeLatchingController.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          0FFD4D6118651FA300512F6E /* AsyncScrollingCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFD4D5F18651FA300512F6E /* AsyncScrollingCoordinator.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          10FB084B14E15C7E00A3DB98 /* PublicURLManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FB084A14E15C7E00A3DB98 /* PublicURLManager.h */; };
</span><ins>+               111FA1C726F0F30F003B8F16 /* InlineInvalidation.h in Headers */ = {isa = PBXBuildFile; fileRef = 111FA1C526F0F30F003B8F16 /* InlineInvalidation.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               111FA1C826F0F30F003B8F16 /* InlineDamage.h in Headers */ = {isa = PBXBuildFile; fileRef = 111FA1C626F0F30F003B8F16 /* InlineDamage.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">           11310CF220BA4A320065A8D0 /* LayoutTreeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 11100FD7209514DF0081AA6C /* LayoutTreeBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          11310CF320BA4A370065A8D0 /* LayoutReplacedBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 111C615620AD1AE1005B82FA /* LayoutReplacedBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          11310CF420BA4A3D0065A8D0 /* LayoutIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 11100FC72092764C0081AA6C /* LayoutIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -6449,6 +6451,9 @@
</span><span class="cx">          11100FD7209514DF0081AA6C /* LayoutTreeBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutTreeBuilder.h; sourceTree = "<group>"; };
</span><span class="cx">          111C615620AD1AE1005B82FA /* LayoutReplacedBox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutReplacedBox.h; sourceTree = "<group>"; };
</span><span class="cx">          111C615720AD1AE1005B82FA /* LayoutReplacedBox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutReplacedBox.cpp; sourceTree = "<group>"; };
</span><ins>+               111FA1C526F0F30F003B8F16 /* InlineInvalidation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineInvalidation.h; sourceTree = "<group>"; };
+               111FA1C626F0F30F003B8F16 /* InlineDamage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineDamage.h; sourceTree = "<group>"; };
+               111FA1C926F0F438003B8F16 /* InlineInvalidation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InlineInvalidation.cpp; sourceTree = "<group>"; };
</ins><span class="cx">           113409D7203E038000C66915 /* RenderTreeBuilderContinuation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeBuilderContinuation.cpp; sourceTree = "<group>"; };
</span><span class="cx">          113409D8203E038000C66915 /* RenderTreeBuilderContinuation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderTreeBuilderContinuation.h; sourceTree = "<group>"; };
</span><span class="cx">          113D0B4F1F9FDD2B00F611BB /* FrameViewLayoutContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FrameViewLayoutContext.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -18115,6 +18120,16 @@
</span><span class="cx">                  path = css;
</span><span class="cx">                  sourceTree = "<group>";
</span><span class="cx">          };
</span><ins>+               111FA1C326F0F2E6003B8F16 /* invalidation */ = {
+                       isa = PBXGroup;
+                       children = (
+                               111FA1C626F0F30F003B8F16 /* InlineDamage.h */,
+                               111FA1C926F0F438003B8F16 /* InlineInvalidation.cpp */,
+                               111FA1C526F0F30F003B8F16 /* InlineInvalidation.h */,
+                       );
+                       path = invalidation;
+                       sourceTree = "<group>";
+               };
</ins><span class="cx">           115CFA66208AF720001E6991 /* layout */ = {
</span><span class="cx">                  isa = PBXGroup;
</span><span class="cx">                  children = (
</span><span class="lines">@@ -18188,6 +18203,7 @@
</span><span class="cx">          115CFA9A208BC140001E6991 /* inline */ = {
</span><span class="cx">                  isa = PBXGroup;
</span><span class="cx">                  children = (
</span><ins>+                               111FA1C326F0F2E6003B8F16 /* invalidation */,
</ins><span class="cx">                           6FE7DDDD20EC6E8B008B5B4E /* text */,
</span><span class="cx">                          6FE198132178397B00446F08 /* InlineContentBreaker.cpp */,
</span><span class="cx">                          6FE198152178397C00446F08 /* InlineContentBreaker.h */,
</span><span class="lines">@@ -32721,11 +32737,13 @@
</span><span class="cx">                          CD063F831E23FA8900812BE3 /* InitDataRegistry.h in Headers */,
</span><span class="cx">                          E30592641E27A3AD00D57C98 /* InlineClassicScript.h in Headers */,
</span><span class="cx">                          6FE198172178397C00446F08 /* InlineContentBreaker.h in Headers */,
</span><ins>+                               111FA1C826F0F30F003B8F16 /* InlineDamage.h in Headers */,
</ins><span class="cx">                           11513D0326D981E8004D3FAA /* InlineDisplayContentBuilder.h in Headers */,
</span><span class="cx">                          6F7CA3CA208C2B2E002F29AB /* InlineFormattingContext.h in Headers */,
</span><span class="cx">                          47C4D57D26508BCB00C7AB1F /* InlineFormattingGeometry.h in Headers */,
</span><span class="cx">                          6FE636E82647962900F0951E /* InlineFormattingQuirks.h in Headers */,
</span><span class="cx">                          115CFA7E208B8E10001E6991 /* InlineFormattingState.h in Headers */,
</span><ins>+                               111FA1C726F0F30F003B8F16 /* InlineInvalidation.h in Headers */,
</ins><span class="cx">                           6FE7CFA22177EEF2005B1573 /* InlineItem.h in Headers */,
</span><span class="cx">                          BCE789161120D6080060ECE5 /* InlineIterator.h in Headers */,
</span><span class="cx">                          6FAAE71326A2814B00E07502 /* InlineLevelBox.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsinlineinvalidationInlineDamageh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/layout/formattingContexts/inline/invalidation/InlineDamage.h (0 => 282401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/inline/invalidation/InlineDamage.h                                (rev 0)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/invalidation/InlineDamage.h   2021-09-14 19:31:03 UTC (rev 282401)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+namespace Layout {
+
+class InlineDamage {
+    WTF_MAKE_ISO_ALLOCATED_INLINE(InlineDamage);
+public:
+    InlineDamage() = default;
+
+    enum class Type {
+        // Content changed or some style property that drives soft wrap opportunities (e.g. going from white-space: pre to normal).
+        // This tells us to re-process the inline content and run line layout.
+        NeedsContentUpdateAndLineLayout,
+        // Same content but either the constraint or some style that may affect line breaking changed (e.g. font-size or containing block set new horizontal constraint). 
+        NeedsLineLayout,
+        // Line breaking positions are the same, only height related style changed (e.g img's height changes).
+        NeedsVerticalAdjustment,
+        // Line breaking positions are the same, runs may show up at a different horizontal position (e.g. text-align changes).
+        NeedsHorizontalAdjustment 
+    };
+    Type type() const { return m_damageType; }
+    // FIXME: Add support for damage range with multiple, different damage types.
+    std::optional<size_t> line() const { return m_damagedLine; }
+
+private:
+    friend class InlineInvalidation;
+
+    void setDamageType(Type type) { m_damageType = type; }
+    void setDamagedLine(size_t lineIndex) { m_damagedLine = lineIndex; }
+
+    Type m_damageType { Type::NeedsContentUpdateAndLineLayout };
+    std::optional<size_t> m_damagedLine;
+};
+
+}
+}
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsinlineinvalidationInlineInvalidationcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.cpp (0 => 282401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.cpp                                (rev 0)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.cpp   2021-09-14 19:31:03 UTC (rev 282401)
</span><span class="lines">@@ -0,0 +1,83 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InlineInvalidation.h"
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include "InlineDamage.h"
+
+namespace WebCore {
+namespace Layout {
+
+InlineInvalidation::InlineInvalidation(InlineDamage& inlineDamage)
+    : m_inlineDamage(inlineDamage)
+{
+}
+
+void InlineInvalidation::styleChanged(const Box& layoutBox, const RenderStyle& oldStyle)
+{
+    UNUSED_PARAM(layoutBox);
+    UNUSED_PARAM(oldStyle);
+
+    m_inlineDamage.setDamageType(InlineDamage::Type::NeedsContentUpdateAndLineLayout);
+}
+
+void InlineInvalidation::textInserted(const InlineTextBox& textBox, std::optional<size_t> offset, std::optional<size_t> length)
+{
+    UNUSED_PARAM(textBox);
+    UNUSED_PARAM(offset);
+    UNUSED_PARAM(length);
+
+    m_inlineDamage.setDamageType(InlineDamage::Type::NeedsContentUpdateAndLineLayout);
+}
+
+void InlineInvalidation::textWillBeRemoved(const InlineTextBox& textBox, std::optional<size_t> offset, std::optional<size_t> length)
+{
+    UNUSED_PARAM(textBox);
+    UNUSED_PARAM(offset);
+    UNUSED_PARAM(length);
+
+    m_inlineDamage.setDamageType(InlineDamage::Type::NeedsContentUpdateAndLineLayout);
+}
+
+void InlineInvalidation::inlineLevelBoxInserted(const Box& layoutBox)
+{
+    UNUSED_PARAM(layoutBox);
+
+    m_inlineDamage.setDamageType(InlineDamage::Type::NeedsContentUpdateAndLineLayout);
+}
+
+void InlineInvalidation::inlineLevelBoxWillBeRemoved(const Box& layoutBox)
+{
+    UNUSED_PARAM(layoutBox);
+
+    m_inlineDamage.setDamageType(InlineDamage::Type::NeedsContentUpdateAndLineLayout);
+}
+
+}
+}
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorelayoutformattingContextsinlineinvalidationInlineInvalidationh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.h (0 => 282401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.h                          (rev 0)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.h     2021-09-14 19:31:03 UTC (rev 282401)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+namespace WebCore {
+namespace Layout {
+class InlineDamage;
+
+class InlineInvalidation {
+public:
+    InlineInvalidation(InlineDamage&);
+
+    void styleChanged(const Box&, const RenderStyle& oldStyle);
+
+    void textInserted(const InlineTextBox&, std::optional<size_t> offset, std::optional<size_t> length);
+    void textWillBeRemoved(const InlineTextBox&, std::optional<size_t> offset, std::optional<size_t> length);
+
+    void inlineLevelBoxInserted(const Box&);
+    void inlineLevelBoxWillBeRemoved(const Box&);
+
+private:
+    InlineDamage& m_inlineDamage;
+};
+
+}
+}
+#endif
</ins></span></pre>
</div>
</div>

</body>
</html>