Diff
Modified: trunk/Source/WebCore/ChangeLog (258842 => 258843)
--- trunk/Source/WebCore/ChangeLog 2020-03-23 14:41:04 UTC (rev 258842)
+++ trunk/Source/WebCore/ChangeLog 2020-03-23 15:25:39 UTC (rev 258843)
@@ -1,3 +1,26 @@
+2020-03-23 Zalan Bujtas <[email protected]>
+
+ [LFC] Remove unused LayoutAncestorIterator class
+ https://bugs.webkit.org/show_bug.cgi?id=209401
+ <rdar://problem/60743144>
+
+ Reviewed by Sam Weinig.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * layout/blockformatting/BlockFormattingContextGeometry.cpp:
+ * layout/displaytree/DisplayPainter.cpp:
+ * layout/layouttree/LayoutAncestorIterator.h: Removed.
+ * layout/layouttree/LayoutChildIterator.h:
+ (WebCore::Layout::LayoutChildIteratorAdapter<T>::last const): Deleted.
+ * layout/layouttree/LayoutIterator.h:
+ (WebCore::Layout::LayoutBoxTraversal::nextSkippingChildren): Deleted.
+ (WebCore::Layout::Traversal::lastChild): Deleted.
+ (WebCore::Layout::Traversal::previousSibling): Deleted.
+ (WebCore::Layout::Traversal::findAncestorOfType): Deleted.
+ (WebCore::Layout::LayoutIterator<T>::traversePreviousSibling): Deleted.
+ (WebCore::Layout::LayoutIterator<T>::traverseAncestor): Deleted.
+ * layout/layouttree/LayoutTreeBuilder.cpp:
+
2020-03-23 Antoine Quint <[email protected]>
[Web Animations] Refactor cancelDeclarativeAnimationsForElement and willDestroyRendererForElement on AnimationTimeline
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (258842 => 258843)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-03-23 14:41:04 UTC (rev 258842)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-03-23 15:25:39 UTC (rev 258843)
@@ -380,7 +380,6 @@
11310CF420BA4A3D0065A8D0 /* LayoutIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 11100FC72092764C0081AA6C /* LayoutIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
11310CF520BA4A4C0065A8D0 /* LayoutDescendantIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 11B042FB20B0E21400828A6B /* LayoutDescendantIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
11310CF620BA4A560065A8D0 /* LayoutChildIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 11100FC920927CBC0081AA6C /* LayoutChildIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 11310CF720BA4A620065A8D0 /* LayoutAncestorIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 11100FCA2092868D0081AA6C /* LayoutAncestorIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
113409DA203E038000C66915 /* RenderTreeBuilderContinuation.h in Headers */ = {isa = PBXBuildFile; fileRef = 113409D8203E038000C66915 /* RenderTreeBuilderContinuation.h */; };
113D0B521F9FDD2B00F611BB /* FrameViewLayoutContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 113D0B501F9FDD2B00F611BB /* FrameViewLayoutContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
115CFA6A208AF7D0001E6991 /* FormattingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 115CFA68208AF7D0001E6991 /* FormattingContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -5992,7 +5991,6 @@
1100FC6E1FDB3C4D00DD961B /* TrailingFloatsRootInlineBox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TrailingFloatsRootInlineBox.cpp; sourceTree = "<group>"; };
11100FC72092764C0081AA6C /* LayoutIterator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutIterator.h; sourceTree = "<group>"; };
11100FC920927CBC0081AA6C /* LayoutChildIterator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutChildIterator.h; sourceTree = "<group>"; };
- 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>"; };
111C615620AD1AE1005B82FA /* LayoutReplacedBox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutReplacedBox.h; sourceTree = "<group>"; };
@@ -16954,7 +16952,6 @@
115CFA90208B9441001E6991 /* layouttree */ = {
isa = PBXGroup;
children = (
- 11100FCA2092868D0081AA6C /* LayoutAncestorIterator.h */,
115CFA96208B952B001E6991 /* LayoutBox.cpp */,
115CFA95208B952B001E6991 /* LayoutBox.h */,
11100FC920927CBC0081AA6C /* LayoutChildIterator.h */,
@@ -31676,7 +31673,6 @@
0FEC120C22BF2CD2004E9D35 /* LayerAncestorClippingStack.h in Headers */,
580371641A66F1D300BAF519 /* LayerFragment.h in Headers */,
7AA3A6A0194B59B6001CBD24 /* LayerPool.h in Headers */,
- 11310CF720BA4A620065A8D0 /* LayoutAncestorIterator.h in Headers */,
115CFA97208B952B001E6991 /* LayoutBox.h in Headers */,
11310CF620BA4A560065A8D0 /* LayoutChildIterator.h in Headers */,
1199FA46208E35A3002358CC /* LayoutContainerBox.h in Headers */,
Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp (258842 => 258843)
--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp 2020-03-23 14:41:04 UTC (rev 258842)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp 2020-03-23 15:25:39 UTC (rev 258843)
@@ -32,7 +32,6 @@
#include "DisplayBox.h"
#include "FormattingContext.h"
#include "InlineFormattingState.h"
-#include "LayoutChildIterator.h"
#include "LayoutContext.h"
#include "LayoutReplacedBox.h"
#include "Logging.h"
Modified: trunk/Source/WebCore/layout/displaytree/DisplayPainter.cpp (258842 => 258843)
--- trunk/Source/WebCore/layout/displaytree/DisplayPainter.cpp 2020-03-23 14:41:04 UTC (rev 258842)
+++ trunk/Source/WebCore/layout/displaytree/DisplayPainter.cpp 2020-03-23 15:25:39 UTC (rev 258843)
@@ -36,7 +36,6 @@
#include "InlineTextItem.h"
#include "IntRect.h"
#include "LayoutContainerBox.h"
-#include "LayoutDescendantIterator.h"
#include "LayoutState.h"
#include "RenderStyle.h"
#include "TextRun.h"
Deleted: trunk/Source/WebCore/layout/layouttree/LayoutAncestorIterator.h (258842 => 258843)
--- trunk/Source/WebCore/layout/layouttree/LayoutAncestorIterator.h 2020-03-23 14:41:04 UTC (rev 258842)
+++ trunk/Source/WebCore/layout/layouttree/LayoutAncestorIterator.h 2020-03-23 15:25:39 UTC (rev 258843)
@@ -1,123 +0,0 @@
-/*
- * 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
-
-#include "LayoutIterator.h"
-
-#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-
-namespace WebCore {
-namespace Layout {
-
-template <typename T>
-class LayoutAncestorIterator : public LayoutIterator<T> {
-public:
- LayoutAncestorIterator();
- explicit LayoutAncestorIterator(const T* current);
- LayoutAncestorIterator& operator++();
-};
-
-template <typename T>
-class LayoutAncestorIteratorAdapter {
-public:
- LayoutAncestorIteratorAdapter(const T* first);
- LayoutAncestorIterator<T> begin() const;
- LayoutAncestorIterator<T> end() const;
- const T* first() const;
-
-private:
- const T* m_first;
-};
-
-template <typename T> LayoutAncestorIteratorAdapter<T> ancestorsOfType(const Box&);
-template <typename T> LayoutAncestorIteratorAdapter<T> lineageOfType(const Box&);
-
-// LayoutAncestorIterator
-
-template <typename T>
-inline LayoutAncestorIterator<T>::LayoutAncestorIterator()
- : LayoutIterator<T>(nullptr)
-{
-}
-
-template <typename T>
-inline LayoutAncestorIterator<T>::LayoutAncestorIterator(const T* current)
- : LayoutIterator<T>(nullptr, current)
-{
-}
-
-template <typename T>
-inline LayoutAncestorIterator<T>& LayoutAncestorIterator<T>::operator++()
-{
- return static_cast<LayoutAncestorIterator<T>&>(LayoutIterator<T>::traverseAncestor());
-}
-
-// LayoutAncestorIteratorAdapter
-
-template <typename T>
-inline LayoutAncestorIteratorAdapter<T>::LayoutAncestorIteratorAdapter(const T* first)
- : m_first(first)
-{
-}
-
-template <typename T>
-inline LayoutAncestorIterator<T> LayoutAncestorIteratorAdapter<T>::begin() const
-{
- return LayoutAncestorIterator<T>(m_first);
-}
-
-template <typename T>
-inline LayoutAncestorIterator<T> LayoutAncestorIteratorAdapter<T>::end() const
-{
- return LayoutAncestorIterator<T>();
-}
-
-template <typename T>
-inline const T* LayoutAncestorIteratorAdapter<T>::first() const
-{
- return m_first;
-}
-
-// Standalone functions
-
-template <typename T>
-inline LayoutAncestorIteratorAdapter<T> ancestorsOfType(const Box& descendant)
-{
- const T* first = Traversal::findAncestorOfType<const T>(descendant);
- return LayoutAncestorIteratorAdapter<T>(first);
-}
-
-template <typename T>
-inline LayoutAncestorIteratorAdapter<T> lineageOfType(const Box& first)
-{
- if (isLayoutBoxOfType<T>(first))
- return LayoutAncestorIteratorAdapter<T>(static_cast<const T*>(&first));
- return ancestorsOfType<T>(first);
-}
-
-}
-}
-#endif
Modified: trunk/Source/WebCore/layout/layouttree/LayoutChildIterator.h (258842 => 258843)
--- trunk/Source/WebCore/layout/layouttree/LayoutChildIterator.h 2020-03-23 14:41:04 UTC (rev 258842)
+++ trunk/Source/WebCore/layout/layouttree/LayoutChildIterator.h 2020-03-23 15:25:39 UTC (rev 258843)
@@ -102,12 +102,6 @@
}
template <typename T>
-inline const T* LayoutChildIteratorAdapter<T>::last() const
-{
- return Traversal::lastChild<T>(m_parent);
-}
-
-template <typename T>
inline LayoutChildIteratorAdapter<T> childrenOfType(const ContainerBox& parent)
{
return LayoutChildIteratorAdapter<T>(parent);
Modified: trunk/Source/WebCore/layout/layouttree/LayoutIterator.h (258842 => 258843)
--- trunk/Source/WebCore/layout/layouttree/LayoutIterator.h 2020-03-23 14:41:04 UTC (rev 258842)
+++ trunk/Source/WebCore/layout/layouttree/LayoutIterator.h 2020-03-23 15:25:39 UTC (rev 258843)
@@ -44,8 +44,6 @@
LayoutIterator& traverseNext();
LayoutIterator& traverseNextSibling();
- LayoutIterator& traversePreviousSibling();
- LayoutIterator& traverseAncestor();
private:
const ContainerBox* m_root;
@@ -97,18 +95,7 @@
return nextAncestorSibling(current, stayWithin);
}
-inline const Box* nextSkippingChildren(Box& current, const ContainerBox* stayWithin)
-{
- if (¤t == stayWithin)
- return nullptr;
-
- if (auto* sibling = current.nextSibling())
- return sibling;
-
- return nextAncestorSibling(current, stayWithin);
}
-
-}
// Traversal helpers
namespace Traversal {
@@ -121,15 +108,6 @@
return static_cast<const T*>(object);
}
-template <typename T, typename U>
-inline const T* lastChild(U& current)
-{
- auto* object = current.lastChild();
- while (object && !isLayoutBoxOfType<T>(*object))
- object = object->previousSibling();
- return static_cast<const T*>(object);
-}
-
template <typename T>
inline const T* nextSibling(const T& current)
{
@@ -140,25 +118,6 @@
}
template <typename T, typename U>
-inline const T* previousSibling(const T& current)
-{
- auto* object = current.previousSibling();
- while (object && !isLayoutBoxOfType<T>(*object))
- object = object->previousSibling();
- return static_cast<const T*>(object);
-}
-
-template <typename T, typename U>
-inline const T* findAncestorOfType(const T& current)
-{
- for (auto* ancestor = current.parent(); ancestor; ancestor = ancestor->parent()) {
- if (isLayoutBoxOfType<T>(*ancestor))
- return static_cast<const T*>(ancestor);
- }
- return nullptr;
-}
-
-template <typename T, typename U>
inline const T* firstWithin(const U& stayWithin)
{
auto* descendant = LayoutBoxTraversal::firstChild(stayWithin);
@@ -211,23 +170,6 @@
}
template <typename T>
-inline LayoutIterator<T>& LayoutIterator<T>::traversePreviousSibling()
-{
- ASSERT(m_current);
- m_current = Traversal::previousSibling<T>(*m_current);
- return *this;
-}
-
-template <typename T>
-inline LayoutIterator<T>& LayoutIterator<T>::traverseAncestor()
-{
- ASSERT(m_current);
- ASSERT(m_current != m_root);
- m_current = Traversal::findAncestorOfType<T>(*m_current);
- return *this;
-}
-
-template <typename T>
inline const T& LayoutIterator<T>::operator*() const
{
ASSERT(m_current);
@@ -256,7 +198,6 @@
}
}
-#include "LayoutAncestorIterator.h"
#include "LayoutChildIterator.h"
#endif
Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (258842 => 258843)
--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp 2020-03-23 14:41:04 UTC (rev 258842)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp 2020-03-23 15:25:39 UTC (rev 258843)
@@ -41,7 +41,6 @@
#include "LayoutChildIterator.h"
#include "LayoutContainerBox.h"
#include "LayoutContext.h"
-#include "LayoutDescendantIterator.h"
#include "LayoutInitialContainingBlock.h"
#include "LayoutInlineTextBox.h"
#include "LayoutLineBreakBox.h"