Title: [231312] trunk/Source/WebCore
Revision
231312
Author
[email protected]
Date
2018-05-03 10:15:22 -0700 (Thu, 03 May 2018)

Log Message

[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.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (231311 => 231312)


--- trunk/Source/WebCore/ChangeLog	2018-05-03 17:08:25 UTC (rev 231311)
+++ trunk/Source/WebCore/ChangeLog	2018-05-03 17:15:22 UTC (rev 231312)
@@ -1,3 +1,37 @@
+2018-05-03  Zalan Bujtas  <[email protected]>
+
+        [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  <[email protected]>
 
         WebKit should send fake macOS user agent to docs.google.com

Modified: trunk/Source/WebCore/Sources.txt (231311 => 231312)


--- trunk/Source/WebCore/Sources.txt	2018-05-03 17:08:25 UTC (rev 231311)
+++ trunk/Source/WebCore/Sources.txt	2018-05-03 17:15:22 UTC (rev 231312)
@@ -1221,9 +1221,11 @@
 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

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (231311 => 231312)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-05-03 17:08:25 UTC (rev 231311)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-05-03 17:15:22 UTC (rev 231312)
@@ -5721,6 +5721,10 @@
 		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>"; };
@@ -15684,6 +15688,8 @@
 				115CFA6C208AFAB6001E6991 /* BlockFormattingContext.h */,
 				115CFA79208B8D9D001E6991 /* BlockFormattingState.cpp */,
 				115CFA78208B8D9D001E6991 /* BlockFormattingState.h */,
+				1123AFDA209ABB2000736ACC /* BlockInvalidation.cpp */,
+				1123AFD9209ABB2000736ACC /* BlockInvalidation.h */,
 				115CFA89208B921A001E6991 /* BlockMarginCollapse.cpp */,
 				115CFA88208B921A001E6991 /* BlockMarginCollapse.h */,
 			);
@@ -15697,6 +15703,8 @@
 				6F7CA3C8208C2B2E002F29AB /* InlineFormattingContext.h */,
 				115CFA7D208B8E10001E6991 /* InlineFormattingState.cpp */,
 				115CFA7C208B8E10001E6991 /* InlineFormattingState.h */,
+				1123AFDD209ABBBA00736ACC /* InlineInvalidation.cpp */,
+				1123AFDC209ABBBA00736ACC /* InlineInvalidation.h */,
 			);
 			path = inlineformatting;
 			sourceTree = "<group>";

Modified: trunk/Source/WebCore/layout/FormattingState.cpp (231311 => 231312)


--- trunk/Source/WebCore/layout/FormattingState.cpp	2018-05-03 17:08:25 UTC (rev 231311)
+++ trunk/Source/WebCore/layout/FormattingState.cpp	2018-05-03 17:15:22 UTC (rev 231312)
@@ -35,8 +35,9 @@
 
 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)
 {
 }
 

Modified: trunk/Source/WebCore/layout/FormattingState.h (231311 => 231312)


--- trunk/Source/WebCore/layout/FormattingState.h	2018-05-03 17:08:25 UTC (rev 231311)
+++ trunk/Source/WebCore/layout/FormattingState.h	2018-05-03 17:15:22 UTC (rev 231312)
@@ -35,12 +35,11 @@
 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 @@
     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

Modified: trunk/Source/WebCore/layout/LayoutContext.cpp (231311 => 231312)


--- trunk/Source/WebCore/layout/LayoutContext.cpp	2018-05-03 17:08:25 UTC (rev 231311)
+++ trunk/Source/WebCore/layout/LayoutContext.cpp	2018-05-03 17:15:22 UTC (rev 231312)
@@ -30,9 +30,11 @@
 
 #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 @@
     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();

Modified: trunk/Source/WebCore/layout/LayoutContext.h (231311 => 231312)


--- trunk/Source/WebCore/layout/LayoutContext.h	2018-05-03 17:08:25 UTC (rev 231311)
+++ trunk/Source/WebCore/layout/LayoutContext.h	2018-05-03 17:15:22 UTC (rev 231312)
@@ -31,6 +31,7 @@
 #include "FormattingState.h"
 #include "LayoutBox.h"
 #include <wtf/IsoMalloc.h>
+#include <wtf/OptionSet.h>
 
 namespace WebCore {
 
@@ -40,7 +41,7 @@
 
 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,9 +58,17 @@
     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&);
     std::unique_ptr<FormattingContext> formattingContext(const Box& formattingContextRoot);

Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingState.cpp (231311 => 231312)


--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingState.cpp	2018-05-03 17:08:25 UTC (rev 231311)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingState.cpp	2018-05-03 17:15:22 UTC (rev 231312)
@@ -36,7 +36,7 @@
 WTF_MAKE_ISO_ALLOCATED_IMPL(BlockFormattingState);
 
 BlockFormattingState::BlockFormattingState(Ref<FloatingState>&& floatingState)
-    : FormattingState(WTFMove(floatingState))
+    : FormattingState(WTFMove(floatingState), Type::Block)
 {
 }
 

Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingState.h (231311 => 231312)


--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingState.h	2018-05-03 17:08:25 UTC (rev 231311)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingState.h	2018-05-03 17:15:22 UTC (rev 231312)
@@ -44,4 +44,7 @@
 
 }
 }
+
+SPECIALIZE_TYPE_TRAITS_LAYOUT_FORMATTING_STATE(BlockFormattingState, isBlockFormattingState())
+
 #endif

Copied: trunk/Source/WebCore/layout/blockformatting/BlockInvalidation.cpp (from rev 231311, trunk/Source/WebCore/layout/blockformatting/BlockFormattingState.cpp) (0 => 231312)


--- trunk/Source/WebCore/layout/blockformatting/BlockInvalidation.cpp	                        (rev 0)
+++ trunk/Source/WebCore/layout/blockformatting/BlockInvalidation.cpp	2018-05-03 17:15:22 UTC (rev 231312)
@@ -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

Copied: trunk/Source/WebCore/layout/blockformatting/BlockInvalidation.h (from rev 231311, trunk/Source/WebCore/layout/blockformatting/BlockFormattingState.h) (0 => 231312)


--- trunk/Source/WebCore/layout/blockformatting/BlockInvalidation.h	                        (rev 0)
+++ trunk/Source/WebCore/layout/blockformatting/BlockInvalidation.h	2018-05-03 17:15:22 UTC (rev 231312)
@@ -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

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp (231311 => 231312)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp	2018-05-03 17:08:25 UTC (rev 231311)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp	2018-05-03 17:15:22 UTC (rev 231312)
@@ -36,7 +36,7 @@
 WTF_MAKE_ISO_ALLOCATED_IMPL(InlineFormattingState);
 
 InlineFormattingState::InlineFormattingState(Ref<FloatingState>&& floatingState)
-    : FormattingState(WTFMove(floatingState))
+    : FormattingState(WTFMove(floatingState), Type::Inline)
 {
 }
 

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingState.h (231311 => 231312)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingState.h	2018-05-03 17:08:25 UTC (rev 231311)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingState.h	2018-05-03 17:15:22 UTC (rev 231312)
@@ -44,4 +44,7 @@
 
 }
 }
+
+SPECIALIZE_TYPE_TRAITS_LAYOUT_FORMATTING_STATE(InlineFormattingState, isInlineFormattingState())
+
 #endif

Copied: trunk/Source/WebCore/layout/inlineformatting/InlineInvalidation.cpp (from rev 231311, trunk/Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp) (0 => 231312)


--- trunk/Source/WebCore/layout/inlineformatting/InlineInvalidation.cpp	                        (rev 0)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineInvalidation.cpp	2018-05-03 17:15:22 UTC (rev 231312)
@@ -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

Copied: trunk/Source/WebCore/layout/inlineformatting/InlineInvalidation.h (from rev 231311, trunk/Source/WebCore/layout/blockformatting/BlockFormattingState.h) (0 => 231312)


--- trunk/Source/WebCore/layout/inlineformatting/InlineInvalidation.h	                        (rev 0)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineInvalidation.h	2018-05-03 17:15:22 UTC (rev 231312)
@@ -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
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to