WebKit Bugzilla
Attachment 339419 Details for
Bug 185249
: [LFC] Box invalidation logic should go to dedicated classes.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185249-20180503093450.patch (text/plain), 22.00 KB, created by
zalan
on 2018-05-03 09:34:50 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-05-03 09:34:50 PDT
Size:
22.00 KB
patch
obsolete
>Subversion Revision: 231293 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 31c522049281ae589ae8fac2fe30d1b72c547bd8..3d0905dcaeaec9aad26a26b83389468d6c5547fd 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -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-02 Zalan Bujtas <zalan@apple.com> > > [LFC] Implement LayoutContext::createDisplayBox >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index 73c1351580084451bb70f9465d7f8457edc7474b..599b54b0e99ce411d50ab968e85c5cc5b83ffadc 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -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 >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 36a443fb492e2e99a07d4b85f66d2c37c21c4083..bf68d47ec2065e9281e45126b44db6a43cf3f91c 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -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>"; >diff --git a/Source/WebCore/layout/FormattingState.cpp b/Source/WebCore/layout/FormattingState.cpp >index ff691a7036c622fe9b3727f3af4d43482611599b..6180bd7ba41fd55b40a07c0bd1fd50541fb2f9f4 100644 >--- a/Source/WebCore/layout/FormattingState.cpp >+++ b/Source/WebCore/layout/FormattingState.cpp >@@ -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) > { > } > >diff --git a/Source/WebCore/layout/FormattingState.h b/Source/WebCore/layout/FormattingState.h >index 10c3a4278a97244d5587853cef8995c7e6f6fcd6..cf61693dc5d98a233f18508bd2876d25d9ba5de9 100644 >--- a/Source/WebCore/layout/FormattingState.h >+++ b/Source/WebCore/layout/FormattingState.h >@@ -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 >diff --git a/Source/WebCore/layout/LayoutContext.cpp b/Source/WebCore/layout/LayoutContext.cpp >index 9e98ae7f61a2c3aaa3cfae2ce86051b061da57a4..d546f79a6824dae5f507c3a3764a07260486f7e9 100644 >--- a/Source/WebCore/layout/LayoutContext.cpp >+++ b/Source/WebCore/layout/LayoutContext.cpp >@@ -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 @@ 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(); >diff --git a/Source/WebCore/layout/LayoutContext.h b/Source/WebCore/layout/LayoutContext.h >index 77efa06a5d308d84f91bc56b5a42a99129eaedb8..07c0a889398a628f31cb785b2de33cbe91357891 100644 >--- a/Source/WebCore/layout/LayoutContext.h >+++ b/Source/WebCore/layout/LayoutContext.h >@@ -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&); >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingState.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingState.cpp >index c951eee36c901fa0bc6451e27280a15d01708260..7ebbf46a26431c254576cb27cb4a4169a625009a 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingState.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingState.cpp >@@ -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) > { > } > >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingState.h b/Source/WebCore/layout/blockformatting/BlockFormattingState.h >index 44e5d83c5c05a4fb2b17aea39e425b0707c70710..dae14736c6f6dbd70efae1a5d71c2268bd0983fb 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingState.h >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingState.h >@@ -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 >index 0000000000000000000000000000000000000000..652afab51b348ca680af58cf1489ca85e92e88e7 >--- /dev/null >+++ b/Source/WebCore/layout/blockformatting/BlockInvalidation.cpp >@@ -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 >index 0000000000000000000000000000000000000000..5ef1436106dbd546e8a05886ef4293545429e8ce >--- /dev/null >+++ b/Source/WebCore/layout/blockformatting/BlockInvalidation.h >@@ -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 >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp b/Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp >index 721d8294fa8561d0a0382d54935a502ded4c1887..a00d5dccef8f0607f23666e734ce0fc09a2db4c8 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp >@@ -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) > { > } > >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingState.h b/Source/WebCore/layout/inlineformatting/InlineFormattingState.h >index 5623dd98649ec1137bd414ebe0ddb7d10936584e..6aaf7470afd236793aa19ff52f07794ccacab471 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingState.h >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingState.h >@@ -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 >index 0000000000000000000000000000000000000000..b18826fc2cbd5a19960f8d793786e1a06c9ea9f1 >--- /dev/null >+++ b/Source/WebCore/layout/inlineformatting/InlineInvalidation.cpp >@@ -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 >index 0000000000000000000000000000000000000000..257c367be8cd3605691499450d1dff239134d8e9 >--- /dev/null >+++ b/Source/WebCore/layout/inlineformatting/InlineInvalidation.h >@@ -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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185249
:
339407
|
339411
|
339417
| 339419