Title: [229007] releases/WebKitGTK/webkit-2.20/Source/WebCore
Revision
229007
Author
[email protected]
Date
2018-02-26 05:14:20 -0800 (Mon, 26 Feb 2018)

Log Message

Merge r228862 - [RenderTreeBuilder] Move RenderFullScreen::willBeRemoved() mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182947
<rdar://problem/37690848>

Reviewed by Antti Koivisto.

No change in functionality.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::willBeDestroyed):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
* rendering/updating/RenderTreeBuilder.h:
(WebCore::RenderTreeBuilder::fullScreenBuilder):
* rendering/updating/RenderTreeBuilderFullScreen.cpp: Added.
(WebCore::RenderTreeBuilder::FullScreen::FullScreen):
(WebCore::RenderTreeBuilder::FullScreen::cleanupOnRemoval):
* rendering/updating/RenderTreeBuilderFullScreen.h: Added.
* rendering/updating/RenderTreeBuilderMathML.cpp:

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.20/Source/WebCore/ChangeLog (229006 => 229007)


--- releases/WebKitGTK/webkit-2.20/Source/WebCore/ChangeLog	2018-02-26 13:14:10 UTC (rev 229006)
+++ releases/WebKitGTK/webkit-2.20/Source/WebCore/ChangeLog	2018-02-26 13:14:20 UTC (rev 229007)
@@ -1,3 +1,27 @@
+2018-02-21  Zalan Bujtas  <[email protected]>
+
+        [RenderTreeBuilder] Move RenderFullScreen::willBeRemoved() mutation logic to RenderTreeBuilder
+        https://bugs.webkit.org/show_bug.cgi?id=182947
+        <rdar://problem/37690848>
+
+        Reviewed by Antti Koivisto.
+
+        No change in functionality.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * rendering/RenderFullScreen.cpp:
+        (WebCore::RenderFullScreen::willBeDestroyed):
+        * rendering/updating/RenderTreeBuilder.cpp:
+        (WebCore::RenderTreeBuilder::takeChild):
+        * rendering/updating/RenderTreeBuilder.h:
+        (WebCore::RenderTreeBuilder::fullScreenBuilder):
+        * rendering/updating/RenderTreeBuilderFullScreen.cpp: Added.
+        (WebCore::RenderTreeBuilder::FullScreen::FullScreen):
+        (WebCore::RenderTreeBuilder::FullScreen::cleanupOnRemoval):
+        * rendering/updating/RenderTreeBuilderFullScreen.h: Added.
+        * rendering/updating/RenderTreeBuilderMathML.cpp:
+
 2018-02-20  Zalan Bujtas  <[email protected]>
 
         [RenderTreeBuilder] Move RenderListItem::willBeRemoved() mutation logic to RenderTreeBuilder

Modified: releases/WebKitGTK/webkit-2.20/Source/WebCore/Sources.txt (229006 => 229007)


--- releases/WebKitGTK/webkit-2.20/Source/WebCore/Sources.txt	2018-02-26 13:14:10 UTC (rev 229006)
+++ releases/WebKitGTK/webkit-2.20/Source/WebCore/Sources.txt	2018-02-26 13:14:20 UTC (rev 229007)
@@ -2006,6 +2006,7 @@
 rendering/updating/RenderTreeBuilderBlockFlow.cpp
 rendering/updating/RenderTreeBuilderFirstLetter.cpp
 rendering/updating/RenderTreeBuilderFormControls.cpp
+rendering/updating/RenderTreeBuilderFullScreen.cpp
 rendering/updating/RenderTreeBuilderInline.cpp
 rendering/updating/RenderTreeBuilderList.cpp
 rendering/updating/RenderTreeBuilderMathML.cpp

Modified: releases/WebKitGTK/webkit-2.20/Source/WebCore/WebCore.xcodeproj/project.pbxproj (229006 => 229007)


--- releases/WebKitGTK/webkit-2.20/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-02-26 13:14:10 UTC (rev 229006)
+++ releases/WebKitGTK/webkit-2.20/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-02-26 13:14:20 UTC (rev 229007)
@@ -396,6 +396,7 @@
 		1193408A1FEB355D00935F1E /* RenderTreeBuilderRuby.h in Headers */ = {isa = PBXBuildFile; fileRef = 119340881FEB355D00935F1E /* RenderTreeBuilderRuby.h */; };
 		119340971FED715500935F1E /* RenderTreeBuilderFormControls.h in Headers */ = {isa = PBXBuildFile; fileRef = 119340951FED715500935F1E /* RenderTreeBuilderFormControls.h */; };
 		119340A31FEE024000935F1E /* RenderTreeBuilderBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 119340A11FEE024000935F1E /* RenderTreeBuilderBlock.h */; };
+		11CB2789203BA570004A1DC9 /* RenderTreeBuilderFullScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 11CB2787203BA570004A1DC9 /* RenderTreeBuilderFullScreen.h */; };
 		11E067EE1E6246E500162D16 /* SimpleLineLayoutCoverage.h in Headers */ = {isa = PBXBuildFile; fileRef = 11E067ED1E6246E500162D16 /* SimpleLineLayoutCoverage.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1400D7A817136EA70077CE05 /* ScriptWrappableInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 1400D7A717136EA70077CE05 /* ScriptWrappableInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1403B99709EB13AF00797C7F /* DOMWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 1403B99509EB13AF00797C7F /* DOMWindow.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -5629,6 +5630,8 @@
 		11C5F12C2004231E0001AE60 /* RenderTreeBuilderSVG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeBuilderSVG.cpp; sourceTree = "<group>"; };
 		11C5F132200527F80001AE60 /* RenderTreeBuilderMathML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeBuilderMathML.cpp; sourceTree = "<group>"; };
 		11C5F134200527F90001AE60 /* RenderTreeBuilderMathML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderTreeBuilderMathML.h; sourceTree = "<group>"; };
+		11CB2786203BA570004A1DC9 /* RenderTreeBuilderFullScreen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeBuilderFullScreen.cpp; sourceTree = "<group>"; };
+		11CB2787203BA570004A1DC9 /* RenderTreeBuilderFullScreen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderTreeBuilderFullScreen.h; sourceTree = "<group>"; };
 		11E067EB1E62461300162D16 /* SimpleLineLayoutCoverage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayoutCoverage.cpp; sourceTree = "<group>"; };
 		11E067ED1E6246E500162D16 /* SimpleLineLayoutCoverage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutCoverage.h; sourceTree = "<group>"; };
 		1400D7A717136EA70077CE05 /* ScriptWrappableInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptWrappableInlines.h; sourceTree = "<group>"; };
@@ -24804,6 +24807,8 @@
 				E47C39261FE6E0DC00BBBC6B /* RenderTreeBuilderFirstLetter.h */,
 				119340941FED715500935F1E /* RenderTreeBuilderFormControls.cpp */,
 				119340951FED715500935F1E /* RenderTreeBuilderFormControls.h */,
+				11CB2786203BA570004A1DC9 /* RenderTreeBuilderFullScreen.cpp */,
+				11CB2787203BA570004A1DC9 /* RenderTreeBuilderFullScreen.h */,
 				11C5F1162003E7750001AE60 /* RenderTreeBuilderInline.cpp */,
 				11C5F1182003E7760001AE60 /* RenderTreeBuilderInline.h */,
 				E47C392B1FE6E0DF00BBBC6B /* RenderTreeBuilderList.cpp */,
@@ -29268,6 +29273,7 @@
 				119340A31FEE024000935F1E /* RenderTreeBuilderBlock.h in Headers */,
 				E47C39301FE6E0FD00BBBC6B /* RenderTreeBuilderFirstLetter.h in Headers */,
 				119340971FED715500935F1E /* RenderTreeBuilderFormControls.h in Headers */,
+				11CB2789203BA570004A1DC9 /* RenderTreeBuilderFullScreen.h in Headers */,
 				E47C39321FE6E10500BBBC6B /* RenderTreeBuilderList.h in Headers */,
 				E47C39331FE6E10800BBBC6B /* RenderTreeBuilderMultiColumn.h in Headers */,
 				1193408A1FEB355D00935F1E /* RenderTreeBuilderRuby.h in Headers */,

Modified: releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/RenderFullScreen.cpp (229006 => 229007)


--- releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/RenderFullScreen.cpp	2018-02-26 13:14:10 UTC (rev 229006)
+++ releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/RenderFullScreen.cpp	2018-02-26 13:14:20 UTC (rev 229007)
@@ -58,14 +58,9 @@
     setReplaced(false); 
 }
 
-void RenderFullScreen::willBeDestroyed(RenderTreeBuilder& builder)
+RenderFullScreen::~RenderFullScreen()
 {
-    if (m_placeholder) {
-        builder.removeAndDestroy(*m_placeholder);
-        ASSERT(!m_placeholder);
-    }
-
-    RenderFlexibleBox::willBeDestroyed(builder);
+    ASSERT(!m_placeholder);
 }
 
 static RenderStyle createFullScreenStyle()

Modified: releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/RenderFullScreen.h (229006 => 229007)


--- releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/RenderFullScreen.h	2018-02-26 13:14:10 UTC (rev 229006)
+++ releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/RenderFullScreen.h	2018-02-26 13:14:20 UTC (rev 229007)
@@ -34,6 +34,7 @@
     WTF_MAKE_ISO_ALLOCATED(RenderFullScreen);
 public:
     RenderFullScreen(Document&, RenderStyle&&);
+    virtual ~RenderFullScreen();
 
     const char* renderName() const override { return "RenderFullScreen"; }
 
@@ -48,7 +49,6 @@
     
 private:
     bool isRenderFullScreen() const override { return true; }
-    void willBeDestroyed(RenderTreeBuilder&) override;
     bool isFlexibleBoxImpl() const override { return true; }
 
 protected:

Modified: releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp (229006 => 229007)


--- releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp	2018-02-26 13:14:10 UTC (rev 229006)
+++ releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp	2018-02-26 13:14:20 UTC (rev 229007)
@@ -32,6 +32,7 @@
 #include "RenderButton.h"
 #include "RenderCounter.h"
 #include "RenderElement.h"
+#include "RenderFullScreen.h"
 #include "RenderGrid.h"
 #include "RenderLineBreak.h"
 #include "RenderMathMLFenced.h"
@@ -51,6 +52,7 @@
 #include "RenderTreeBuilderBlockFlow.h"
 #include "RenderTreeBuilderFirstLetter.h"
 #include "RenderTreeBuilderFormControls.h"
+#include "RenderTreeBuilderFullScreen.h"
 #include "RenderTreeBuilderInline.h"
 #include "RenderTreeBuilderList.h"
 #include "RenderTreeBuilderMathML.h"
@@ -128,6 +130,9 @@
     , m_inlineBuilder(std::make_unique<Inline>(*this))
     , m_svgBuilder(std::make_unique<SVG>(*this))
     , m_mathMLBuilder(std::make_unique<MathML>(*this))
+#if ENABLE(FULLSCREEN_API)
+    , m_fullScreenBuilder(std::make_unique<FullScreen>(*this))
+#endif
 {
     RELEASE_ASSERT(!s_current || &m_view != &s_current->m_view);
     m_previous = s_current;
@@ -139,10 +144,16 @@
     s_current = m_previous;
 }
 
-void RenderTreeBuilder::removeAndDestroy(RenderObject& child)
+void RenderTreeBuilder::removeAndDestroy(RenderObject& renderer)
 {
-    ASSERT(child.parent());
-    auto toDestroy = takeChild(*child.parent(), child);
+    ASSERT(renderer.parent());
+    auto toDestroy = takeChild(*renderer.parent(), renderer);
+
+#if ENABLE(FULLSCREEN_API)
+    if (is<RenderFullScreen>(renderer))
+        fullScreenBuilder().cleanupOnDestroy(downcast<RenderFullScreen>(renderer));
+#endif
+
     // We need to detach the subtree first so that the descendants don't have
     // access to previous/next sublings at takeChild().
     // FIXME: webkit.org/b/182909.

Modified: releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/updating/RenderTreeBuilder.h (229006 => 229007)


--- releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/updating/RenderTreeBuilder.h	2018-02-26 13:14:10 UTC (rev 229006)
+++ releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/updating/RenderTreeBuilder.h	2018-02-26 13:14:20 UTC (rev 229007)
@@ -91,6 +91,9 @@
     class Inline;
     class SVG;
     class MathML;
+#if ENABLE(FULLSCREEN_API)
+    class FullScreen;
+#endif
 
     FirstLetter& firstLetterBuilder() { return *m_firstLetterBuilder; }
     List& listBuilder() { return *m_listBuilder; }
@@ -103,6 +106,9 @@
     Inline& inlineBuilder() { return *m_inlineBuilder; }
     SVG& svgBuilder() { return *m_svgBuilder; }
     MathML& mathMLBuilder() { return *m_mathMLBuilder; }
+#if ENABLE(FULLSCREEN_API)
+    FullScreen& fullScreenBuilder() { return *m_fullScreenBuilder; }
+#endif
 
     RenderView& m_view;
     RenderTreeBuilder* m_previous { nullptr };
@@ -119,6 +125,9 @@
     std::unique_ptr<Inline> m_inlineBuilder;
     std::unique_ptr<SVG> m_svgBuilder;
     std::unique_ptr<MathML> m_mathMLBuilder;
+#if ENABLE(FULLSCREEN_API)
+    std::unique_ptr<FullScreen> m_fullScreenBuilder;
+#endif
 };
 
 }

Added: releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/updating/RenderTreeBuilderFullScreen.cpp (0 => 229007)


--- releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/updating/RenderTreeBuilderFullScreen.cpp	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/updating/RenderTreeBuilderFullScreen.cpp	2018-02-26 13:14:20 UTC (rev 229007)
@@ -0,0 +1,49 @@
+/*
+ * 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"
+
+#if ENABLE(FULLSCREEN_API)
+#include "RenderTreeBuilderFullScreen.h"
+
+#include "RenderFullScreen.h"
+
+namespace WebCore {
+
+RenderTreeBuilder::FullScreen::FullScreen(RenderTreeBuilder& builder)
+    : m_builder(builder)
+{
+}
+
+void RenderTreeBuilder::FullScreen::cleanupOnDestroy(RenderFullScreen& fullScreenRenderer)
+{
+    if (!fullScreenRenderer.placeholder())
+        return;
+    m_builder.removeAndDestroy(*fullScreenRenderer.placeholder());
+}
+
+}
+
+#endif

Added: releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/updating/RenderTreeBuilderFullScreen.h (0 => 229007)


--- releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/updating/RenderTreeBuilderFullScreen.h	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/updating/RenderTreeBuilderFullScreen.h	2018-02-26 13:14:20 UTC (rev 229007)
@@ -0,0 +1,49 @@
+/*
+ * 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(FULLSCREEN_API)
+
+#include "RenderTreeBuilder.h"
+
+namespace WebCore {
+
+class RenderElement;
+class RenderFullScreen;
+
+class RenderTreeBuilder::FullScreen {
+public:
+    FullScreen(RenderTreeBuilder&);
+
+    void cleanupOnDestroy(RenderFullScreen&);
+
+private:
+    RenderTreeBuilder& m_builder;
+};
+
+}
+
+#endif // ENABLE(FULLSCREEN_API)

Modified: releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/updating/RenderTreeBuilderMathML.cpp (229006 => 229007)


--- releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/updating/RenderTreeBuilderMathML.cpp	2018-02-26 13:14:10 UTC (rev 229006)
+++ releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/updating/RenderTreeBuilderMathML.cpp	2018-02-26 13:14:20 UTC (rev 229007)
@@ -28,6 +28,7 @@
 
 #include "RenderMathMLFenced.h"
 #include "RenderMathMLFencedOperator.h"
+#include "RenderTreeBuilderBlock.h"
 
 namespace WebCore {
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to