[LFC] Box invalidation logic should go to dedicated classes.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 May 2018 17:15:22 +0000 (17:15 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 May 2018 17:15:22 +0000 (17:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=185249

Reviewed by Antti Koivisto.

Each formatting context can initiate a different type of invalidation when
style attribute changes in a box.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::FormattingState):
* layout/FormattingState.h:
(WebCore::Layout::FormattingState::isBlockFormattingState const):
(WebCore::Layout::FormattingState::isInlineFormattingState const):
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::styleChanged):
(WebCore::Layout::LayoutContext::markNeedsUpdate):
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::BlockFormattingState):
* layout/blockformatting/BlockFormattingState.h:
* layout/blockformatting/BlockInvalidation.cpp: Copied from Source/WebCore/layout/blockformatting/BlockFormattingState.cpp.
(WebCore::Layout::BlockInvalidation::invalidate):
* layout/blockformatting/BlockInvalidation.h: Copied from Source/WebCore/layout/inlineformatting/InlineFormattingState.h.
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::InlineFormattingState):
* layout/inlineformatting/InlineFormattingState.h:
* layout/inlineformatting/InlineInvalidation.cpp: Copied from Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp.
(WebCore::Layout::InlineInvalidation::invalidate):
* layout/inlineformatting/InlineInvalidation.h: Copied from Source/WebCore/layout/blockformatting/BlockFormattingState.h.

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

15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/layout/FormattingState.cpp
Source/WebCore/layout/FormattingState.h
Source/WebCore/layout/LayoutContext.cpp
Source/WebCore/layout/LayoutContext.h
Source/WebCore/layout/blockformatting/BlockFormattingState.cpp
Source/WebCore/layout/blockformatting/BlockFormattingState.h
Source/WebCore/layout/blockformatting/BlockInvalidation.cpp [new file with mode: 0644]
Source/WebCore/layout/blockformatting/BlockInvalidation.h [new file with mode: 0644]
Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp
Source/WebCore/layout/inlineformatting/InlineFormattingState.h
Source/WebCore/layout/inlineformatting/InlineInvalidation.cpp [new file with mode: 0644]
Source/WebCore/layout/inlineformatting/InlineInvalidation.h [new file with mode: 0644]

index 342e559..84d3e7f 100644 (file)
@@ -1,3 +1,37 @@
+2018-05-03  Zalan Bujtas  <zalan@apple.com>
+
+        [LFC] Box invalidation logic should go to dedicated classes.
+        https://bugs.webkit.org/show_bug.cgi?id=185249
+
+        Reviewed by Antti Koivisto.
+
+        Each formatting context can initiate a different type of invalidation when
+        style attribute changes in a box.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * layout/FormattingState.cpp:
+        (WebCore::Layout::FormattingState::FormattingState):
+        * layout/FormattingState.h:
+        (WebCore::Layout::FormattingState::isBlockFormattingState const):
+        (WebCore::Layout::FormattingState::isInlineFormattingState const):
+        * layout/LayoutContext.cpp:
+        (WebCore::Layout::LayoutContext::styleChanged):
+        (WebCore::Layout::LayoutContext::markNeedsUpdate):
+        * layout/LayoutContext.h:
+        * layout/blockformatting/BlockFormattingState.cpp:
+        (WebCore::Layout::BlockFormattingState::BlockFormattingState):
+        * layout/blockformatting/BlockFormattingState.h:
+        * layout/blockformatting/BlockInvalidation.cpp: Copied from Source/WebCore/layout/blockformatting/BlockFormattingState.cpp.
+        (WebCore::Layout::BlockInvalidation::invalidate):
+        * layout/blockformatting/BlockInvalidation.h: Copied from Source/WebCore/layout/inlineformatting/InlineFormattingState.h.
+        * layout/inlineformatting/InlineFormattingState.cpp:
+        (WebCore::Layout::InlineFormattingState::InlineFormattingState):
+        * layout/inlineformatting/InlineFormattingState.h:
+        * layout/inlineformatting/InlineInvalidation.cpp: Copied from Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp.
+        (WebCore::Layout::InlineInvalidation::invalidate):
+        * layout/inlineformatting/InlineInvalidation.h: Copied from Source/WebCore/layout/blockformatting/BlockFormattingState.h.
+
 2018-05-03  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         WebKit should send fake macOS user agent to docs.google.com
index 73c1351..599b54b 100644 (file)
@@ -1221,9 +1221,11 @@ layout/LayoutContext.cpp
 layout/blockformatting/BlockFormattingContext.cpp
 layout/blockformatting/BlockFormattingState.cpp
 layout/blockformatting/BlockMarginCollapse.cpp
+layout/blockformatting/BlockInvalidation.cpp
 layout/displaytree/DisplayBox.cpp
 layout/inlineformatting/InlineFormattingContext.cpp
 layout/inlineformatting/InlineFormattingState.cpp
+layout/inlineformatting/InlineInvalidation.cpp
 layout/layouttree/LayoutBlockContainer.cpp
 layout/layouttree/LayoutBox.cpp
 layout/layouttree/LayoutContainer.cpp
index 36a443f..bf68d47 100644 (file)
                11100FCA2092868D0081AA6C /* LayoutAncestorIterator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutAncestorIterator.h; sourceTree = "<group>"; };
                11100FD5209514DE0081AA6C /* LayoutTreeBuilder.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutTreeBuilder.cpp; sourceTree = "<group>"; };
                11100FD7209514DF0081AA6C /* LayoutTreeBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutTreeBuilder.h; sourceTree = "<group>"; };
+               1123AFD9209ABB2000736ACC /* BlockInvalidation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BlockInvalidation.h; sourceTree = "<group>"; };
+               1123AFDA209ABB2000736ACC /* BlockInvalidation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = BlockInvalidation.cpp; sourceTree = "<group>"; };
+               1123AFDC209ABBBA00736ACC /* InlineInvalidation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InlineInvalidation.h; sourceTree = "<group>"; };
+               1123AFDD209ABBBA00736ACC /* InlineInvalidation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InlineInvalidation.cpp; sourceTree = "<group>"; };
                112B34D01E60B8A700BB310A /* SimpleLineLayoutPagination.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayoutPagination.cpp; sourceTree = "<group>"; };
                112B34D41E60B98300BB310A /* SimpleLineLayoutPagination.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutPagination.h; sourceTree = "<group>"; };
                113409D7203E038000C66915 /* RenderTreeBuilderContinuation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeBuilderContinuation.cpp; sourceTree = "<group>"; };
                                115CFA6C208AFAB6001E6991 /* BlockFormattingContext.h */,
                                115CFA79208B8D9D001E6991 /* BlockFormattingState.cpp */,
                                115CFA78208B8D9D001E6991 /* BlockFormattingState.h */,
+                               1123AFDA209ABB2000736ACC /* BlockInvalidation.cpp */,
+                               1123AFD9209ABB2000736ACC /* BlockInvalidation.h */,
                                115CFA89208B921A001E6991 /* BlockMarginCollapse.cpp */,
                                115CFA88208B921A001E6991 /* BlockMarginCollapse.h */,
                        );
                                6F7CA3C8208C2B2E002F29AB /* InlineFormattingContext.h */,
                                115CFA7D208B8E10001E6991 /* InlineFormattingState.cpp */,
                                115CFA7C208B8E10001E6991 /* InlineFormattingState.h */,
+                               1123AFDD209ABBBA00736ACC /* InlineInvalidation.cpp */,
+                               1123AFDC209ABBBA00736ACC /* InlineInvalidation.h */,
                        );
                        path = inlineformatting;
                        sourceTree = "<group>";
index ff691a7..6180bd7 100644 (file)
@@ -35,8 +35,9 @@ namespace Layout {
 
 WTF_MAKE_ISO_ALLOCATED_IMPL(FormattingState);
 
-FormattingState::FormattingState(Ref<FloatingState>&& floatingState)
+FormattingState::FormattingState(Ref<FloatingState>&& floatingState, Type type)
     : m_floatingState(WTFMove(floatingState))
+    , m_type(type)
 {
 }
 
index 10c3a42..cf61693 100644 (file)
@@ -35,12 +35,11 @@ namespace WebCore {
 namespace Layout {
 
 class Box;
-class StyleDiff;
+enum class StyleDiff;
 
 class FormattingState {
     WTF_MAKE_ISO_ALLOCATED(FormattingState);
 public:
-    FormattingState(Ref<FloatingState>&&);
     virtual ~FormattingState();
 
     FloatingState& floatingState() const { return m_floatingState; }
@@ -48,10 +47,24 @@ public:
     void markNeedsLayout(const Box&, StyleDiff);
     bool needsLayout(const Box&);
 
+    bool isBlockFormattingState() const { return m_type == Type::Block; }
+    bool isInlineFormattingState() const { return m_type == Type::Inline; }
+
+protected:
+    enum class Type { Block, Inline };
+    FormattingState(Ref<FloatingState>&&, Type);
+
 private:
     Ref<FloatingState> m_floatingState;
+    Type m_type;
 };
 
 }
 }
+
+#define SPECIALIZE_TYPE_TRAITS_LAYOUT_FORMATTING_STATE(ToValueTypeName, predicate) \
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::Layout::ToValueTypeName) \
+    static bool isType(const WebCore::Layout::FormattingState& formattingState) { return formattingState.predicate; } \
+SPECIALIZE_TYPE_TRAITS_END()
+
 #endif
index 9e98ae7..d546f79 100644 (file)
 
 #include "BlockFormattingContext.h"
 #include "BlockFormattingState.h"
+#include "BlockInvalidation.h"
 #include "DisplayBox.h"
 #include "InlineFormattingContext.h"
 #include "InlineFormattingState.h"
+#include "InlineInvalidation.h"
 #include "LayoutBox.h"
 #include "LayoutContainer.h"
 #include <wtf/IsoMallocInlines.h>
@@ -62,6 +64,21 @@ Display::Box& LayoutContext::createDisplayBox(const Box& layoutBox)
     return *displayBoxPtr;
 }
 
+void LayoutContext::styleChanged(const Box& layoutBox, StyleDiff styleDiff)
+{
+    auto& formattingState = formattingStateForBox(layoutBox);
+    if (is<BlockFormattingState>(formattingState))
+        BlockInvalidation::invalidate(layoutBox, styleDiff, *this, downcast<BlockFormattingState>(formattingState));
+    else if (is<InlineFormattingState>(formattingState))
+        InlineInvalidation::invalidate(layoutBox, styleDiff, *this, downcast<InlineFormattingState>(formattingState));
+    else
+        ASSERT_NOT_REACHED();
+}
+
+void LayoutContext::markNeedsUpdate(const Box&, OptionSet<UpdateType>)
+{
+}
+
 FormattingState& LayoutContext::formattingStateForBox(const Box& layoutBox) const
 {
     auto& root = layoutBox.formattingContextRoot();
index 77efa06..07c0a88 100644 (file)
@@ -31,6 +31,7 @@
 #include "FormattingState.h"
 #include "LayoutBox.h"
 #include <wtf/IsoMalloc.h>
+#include <wtf/OptionSet.h>
 
 namespace WebCore {
 
@@ -40,7 +41,7 @@ class Box;
 
 namespace Layout {
 
-class StyleDiff;
+enum class StyleDiff;
 
 // LayoutContext is the entry point for layout. It takes a (formatting root)container which acts as the root of the layout context.
 // LayoutContext::layout() generates the display tree for the root container's subtree (it does not run layout on the root though).
@@ -57,8 +58,16 @@ public:
     Display::Box& createDisplayBox(const Box&);
     Display::Box* displayBoxForLayoutBox(const Box& layoutBox) const { return m_layoutToDisplayBox.get(&layoutBox); }
 
-    void markNeedsLayout(const Box&, StyleDiff);
-    bool needsLayout(const Box&) const;
+    void styleChanged(const Box&, StyleDiff);
+
+    enum class UpdateType {
+        Overflow = 1 << 0,
+        Position = 1 << 1,
+        Size     = 1 << 2,
+        All      = Overflow | Position | Size
+    };
+    void markNeedsUpdate(const Box&, OptionSet<UpdateType>);
+    bool needsUpdate(const Box&) const;
 
     FormattingState& formattingStateForBox(const Box&) const;
     FormattingState& establishedFormattingState(const Box& formattingContextRoot, const FormattingContext&);
index c951eee..7ebbf46 100644 (file)
@@ -36,7 +36,7 @@ namespace Layout {
 WTF_MAKE_ISO_ALLOCATED_IMPL(BlockFormattingState);
 
 BlockFormattingState::BlockFormattingState(Ref<FloatingState>&& floatingState)
-    : FormattingState(WTFMove(floatingState))
+    : FormattingState(WTFMove(floatingState), Type::Block)
 {
 }
 
index 44e5d83..dae1473 100644 (file)
@@ -44,4 +44,7 @@ public:
 
 }
 }
+
+SPECIALIZE_TYPE_TRAITS_LAYOUT_FORMATTING_STATE(BlockFormattingState, isBlockFormattingState())
+
 #endif
diff --git a/Source/WebCore/layout/blockformatting/BlockInvalidation.cpp b/Source/WebCore/layout/blockformatting/BlockInvalidation.cpp
new file mode 100644 (file)
index 0000000..652afab
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2018 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 "BlockInvalidation.h"
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include "BlockFormattingState.h"
+#include "LayoutBox.h"
+#include "LayoutContext.h"
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+namespace Layout {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(BlockInvalidation);
+
+void BlockInvalidation::invalidate(const Box& layoutBox, StyleDiff, LayoutContext& layoutContext, BlockFormattingState&)
+{
+    layoutContext.markNeedsUpdate(layoutBox, LayoutContext::UpdateType::All);
+}
+
+}
+}
+#endif
diff --git a/Source/WebCore/layout/blockformatting/BlockInvalidation.h b/Source/WebCore/layout/blockformatting/BlockInvalidation.h
new file mode 100644 (file)
index 0000000..5ef1436
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2018 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/IsoMalloc.h>
+
+namespace WebCore {
+
+namespace Layout {
+
+class Box;
+class BlockFormattingState;
+class LayoutContext;
+enum class StyleDiff;
+
+// This class implements box invalidation for block formatting context.
+class BlockInvalidation {
+    WTF_MAKE_ISO_ALLOCATED(BlockInvalidation);
+public:
+    static void invalidate(const Box&, StyleDiff, LayoutContext&, BlockFormattingState&);
+};
+
+}
+}
+#endif
index 721d829..a00d5dc 100644 (file)
@@ -36,7 +36,7 @@ namespace Layout {
 WTF_MAKE_ISO_ALLOCATED_IMPL(InlineFormattingState);
 
 InlineFormattingState::InlineFormattingState(Ref<FloatingState>&& floatingState)
-    : FormattingState(WTFMove(floatingState))
+    : FormattingState(WTFMove(floatingState), Type::Inline)
 {
 }
 
index 5623dd9..6aaf747 100644 (file)
@@ -44,4 +44,7 @@ public:
 
 }
 }
+
+SPECIALIZE_TYPE_TRAITS_LAYOUT_FORMATTING_STATE(InlineFormattingState, isInlineFormattingState())
+
 #endif
diff --git a/Source/WebCore/layout/inlineformatting/InlineInvalidation.cpp b/Source/WebCore/layout/inlineformatting/InlineInvalidation.cpp
new file mode 100644 (file)
index 0000000..b18826f
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2018 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 "InlineFormattingState.h"
+#include "LayoutBox.h"
+#include "LayoutContext.h"
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+namespace Layout {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(InlineInvalidation);
+
+void InlineInvalidation::invalidate(const Box& layoutBox, StyleDiff, LayoutContext& layoutContext, InlineFormattingState&)
+{
+    layoutContext.markNeedsUpdate(layoutBox, LayoutContext::UpdateType::All);
+}
+
+}
+}
+#endif
diff --git a/Source/WebCore/layout/inlineformatting/InlineInvalidation.h b/Source/WebCore/layout/inlineformatting/InlineInvalidation.h
new file mode 100644 (file)
index 0000000..257c367
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2018 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/IsoMalloc.h>
+
+namespace WebCore {
+
+namespace Layout {
+
+class Box;
+class InlineFormattingState;
+class LayoutContext;
+enum class StyleDiff;
+
+// This class implements box invalidation for inline formatting context.
+class InlineInvalidation {
+    WTF_MAKE_ISO_ALLOCATED(InlineInvalidation);
+public:
+    static void invalidate(const Box&, StyleDiff, LayoutContext&, InlineFormattingState&);
+};
+
+}
+}
+#endif