Title: [194584] trunk/Source/WebCore
Revision
194584
Author
[email protected]
Date
2016-01-05 08:10:25 -0800 (Tue, 05 Jan 2016)

Log Message

Move StyleChange enum into a separate file
https://bugs.webkit.org/show_bug.cgi?id=152730

Reviewed by Andreas Kling.

Fewer whole-world rebuilds.

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:
* dom/CharacterData.cpp:
* dom/ContainerNode.cpp:
* dom/Document.cpp:
* dom/Document.h:
* dom/Element.cpp:
* dom/Element.h:
* style/StyleChange.h: Added.
* style/StyleResolveTree.cpp:
(WebCore::Style::shouldCreateRenderer):
(WebCore::Style::determineChange): Deleted.
* style/StyleResolveTree.h:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (194583 => 194584)


--- trunk/Source/WebCore/CMakeLists.txt	2016-01-05 13:47:55 UTC (rev 194583)
+++ trunk/Source/WebCore/CMakeLists.txt	2016-01-05 16:10:25 UTC (rev 194584)
@@ -2603,6 +2603,7 @@
 
     style/InlineTextBoxStyle.cpp
     style/RenderTreePosition.cpp
+    style/StyleChange.cpp
     style/StyleFontSizeFunctions.cpp
     style/StyleResolveForDocument.cpp
     style/StyleResolveTree.cpp

Modified: trunk/Source/WebCore/ChangeLog (194583 => 194584)


--- trunk/Source/WebCore/ChangeLog	2016-01-05 13:47:55 UTC (rev 194583)
+++ trunk/Source/WebCore/ChangeLog	2016-01-05 16:10:25 UTC (rev 194584)
@@ -1,3 +1,27 @@
+2016-01-05  Antti Koivisto  <[email protected]>
+
+        Move StyleChange enum into a separate file
+        https://bugs.webkit.org/show_bug.cgi?id=152730
+
+        Reviewed by Andreas Kling.
+
+        Fewer whole-world rebuilds.
+
+        * CMakeLists.txt:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/CharacterData.cpp:
+        * dom/ContainerNode.cpp:
+        * dom/Document.cpp:
+        * dom/Document.h:
+        * dom/Element.cpp:
+        * dom/Element.h:
+        * style/StyleChange.h: Added.
+        * style/StyleResolveTree.cpp:
+        (WebCore::Style::shouldCreateRenderer):
+        (WebCore::Style::determineChange): Deleted.
+        * style/StyleResolveTree.h:
+
 2016-01-04  Zan Dobersek  <[email protected]>
 
         [PerformanceTiming] Don't expose the restrictedKeyMap() HashMap

Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (194583 => 194584)


--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj	2016-01-05 13:47:55 UTC (rev 194583)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj	2016-01-05 16:10:25 UTC (rev 194584)
@@ -19199,6 +19199,7 @@
     <ClCompile Include="..\storage\StorageNamespaceProvider.cpp" />
     <ClCompile Include="..\style\InlineTextBoxStyle.cpp" />
     <ClCompile Include="..\style\RenderTreePosition.cpp" />
+    <ClCompile Include="..\style\StyleChange.cpp" />
     <ClCompile Include="..\style\StyleFontSizeFunctions.cpp" />
     <ClCompile Include="..\style\StyleResolveForDocument.cpp" />
     <ClCompile Include="..\style\StyleResolveTree.cpp" />
@@ -22762,6 +22763,7 @@
     <ClInclude Include="..\storage\StorageNamespaceProvider.h" />
     <ClInclude Include="..\style\InlineTextBoxStyle.h" />
     <ClInclude Include="..\style\RenderTreePosition.h" />
+    <ClInclude Include="..\style\StyleChange.h" />
     <ClInclude Include="..\style\StyleFontSizeFunctions.h" />
     <ClInclude Include="..\style\StyleResolveForDocument.h" />
     <ClInclude Include="..\style\StyleResolveTree.h" />

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (194583 => 194584)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-01-05 13:47:55 UTC (rev 194583)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-01-05 16:10:25 UTC (rev 194584)
@@ -6461,6 +6461,8 @@
 		E38838981BAD145F00D62EE3 /* JSModuleLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38838941BAD145F00D62EE3 /* JSModuleLoader.cpp */; };
 		E38838991BAD145F00D62EE3 /* JSModuleLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = E38838951BAD145F00D62EE3 /* JSModuleLoader.h */; };
 		E401C27517CE53EC00C41A35 /* ElementIteratorAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = E401C27417CE53EC00C41A35 /* ElementIteratorAssertions.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		E401E0A41C3C0B8300F34D10 /* StyleChange.h in Headers */ = {isa = PBXBuildFile; fileRef = E401E0A31C3C0B8300F34D10 /* StyleChange.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		E401E0A61C3C0CF700F34D10 /* StyleChange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E401E0A51C3C0CF700F34D10 /* StyleChange.cpp */; };
 		E424A39E1330DF0100CF6DC9 /* LegacyTileGridTile.h in Headers */ = {isa = PBXBuildFile; fileRef = E424A39D1330DF0100CF6DC9 /* LegacyTileGridTile.h */; };
 		E424A3A01330DF1E00CF6DC9 /* LegacyTileGridTile.mm in Sources */ = {isa = PBXBuildFile; fileRef = E424A39F1330DF1E00CF6DC9 /* LegacyTileGridTile.mm */; };
 		E425A49A18292B840020CFCF /* CollectionIndexCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E425A49918292B840020CFCF /* CollectionIndexCache.h */; };
@@ -14364,6 +14366,8 @@
 		E38838941BAD145F00D62EE3 /* JSModuleLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSModuleLoader.cpp; sourceTree = "<group>"; };
 		E38838951BAD145F00D62EE3 /* JSModuleLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSModuleLoader.h; sourceTree = "<group>"; };
 		E401C27417CE53EC00C41A35 /* ElementIteratorAssertions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementIteratorAssertions.h; sourceTree = "<group>"; };
+		E401E0A31C3C0B8300F34D10 /* StyleChange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleChange.h; sourceTree = "<group>"; };
+		E401E0A51C3C0CF700F34D10 /* StyleChange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleChange.cpp; sourceTree = "<group>"; };
 		E406F3FB1198307D009D59D6 /* ColorData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ColorData.cpp; sourceTree = "<group>"; };
 		E41EA038119836DB00710BC5 /* CSSPropertyNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSPropertyNames.cpp; sourceTree = "<group>"; };
 		E41EA0391198374900710BC5 /* CSSValueKeywords.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSValueKeywords.cpp; sourceTree = "<group>"; };
@@ -23110,6 +23114,8 @@
 				1C0106FF192594DF008A4201 /* InlineTextBoxStyle.h */,
 				5824ABA81AE849C8009074B7 /* RenderTreePosition.cpp */,
 				5824ABA91AE849C8009074B7 /* RenderTreePosition.h */,
+				E401E0A51C3C0CF700F34D10 /* StyleChange.cpp */,
+				E401E0A31C3C0B8300F34D10 /* StyleChange.h */,
 				E4D58EB617B4ED8900CBDCA8 /* StyleFontSizeFunctions.cpp */,
 				E4D58EB717B4ED8900CBDCA8 /* StyleFontSizeFunctions.h */,
 				E4D58EB217B4DBDC00CBDCA8 /* StyleResolveForDocument.cpp */,
@@ -28012,6 +28018,7 @@
 				A5E616741894581F009ADF50 /* WebDebuggerAgent.h in Headers */,
 				FE0D84E910484348001A179E /* WebEvent.h in Headers */,
 				225A16B50D5C11E900090295 /* WebEventRegion.h in Headers */,
+				E401E0A41C3C0B8300F34D10 /* StyleChange.h in Headers */,
 				A19D93471A9FEC7200B46C24 /* WebFilterEvaluatorSPI.h in Headers */,
 				D3F3D36E1A69B7E00059FC2B /* WebGL2RenderingContext.h in Headers */,
 				A7D20F6D107F438B00A80392 /* WebGLActiveInfo.h in Headers */,
@@ -29051,6 +29058,7 @@
 				85526C380AB0A17E000302EA /* DOMNodeIterator.mm in Sources */,
 				85ACAA8E0A9B759C00671E90 /* DOMNodeList.mm in Sources */,
 				856C8AE50A912649005C687B /* DOMObject.mm in Sources */,
+				E401E0A61C3C0CF700F34D10 /* StyleChange.cpp in Sources */,
 				85C7F5D10AAFB8D9004014DD /* DOMOverflowEvent.mm in Sources */,
 				E1284BD51044A01E00EAEB52 /* DOMPageTransitionEvent.mm in Sources */,
 				1ACE53E70A8D18E70022947D /* DOMParser.cpp in Sources */,

Modified: trunk/Source/WebCore/dom/CharacterData.cpp (194583 => 194584)


--- trunk/Source/WebCore/dom/CharacterData.cpp	2016-01-05 13:47:55 UTC (rev 194583)
+++ trunk/Source/WebCore/dom/CharacterData.cpp	2016-01-05 16:10:25 UTC (rev 194584)
@@ -32,6 +32,7 @@
 #include "ProcessingInstruction.h"
 #include "RenderText.h"
 #include "StyleInheritedData.h"
+#include "StyleResolveTree.h"
 #include "TextBreakIterator.h"
 #include <wtf/Ref.h>
 

Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (194583 => 194584)


--- trunk/Source/WebCore/dom/ContainerNode.cpp	2016-01-05 13:47:55 UTC (rev 194583)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp	2016-01-05 16:10:25 UTC (rev 194584)
@@ -54,6 +54,7 @@
 #include "SVGElement.h"
 #include "SVGNames.h"
 #include "SelectorQuery.h"
+#include "StyleResolveTree.h"
 #include "TemplateContentDocumentFragment.h"
 #include <algorithm>
 #include <wtf/CurrentTime.h>

Modified: trunk/Source/WebCore/dom/Document.cpp (194583 => 194584)


--- trunk/Source/WebCore/dom/Document.cpp	2016-01-05 13:47:55 UTC (rev 194583)
+++ trunk/Source/WebCore/dom/Document.cpp	2016-01-05 16:10:25 UTC (rev 194584)
@@ -154,6 +154,7 @@
 #include "ShadowRoot.h"
 #include "StorageEvent.h"
 #include "StyleProperties.h"
+#include "StyleResolveTree.h"
 #include "StyleResolver.h"
 #include "StyleSheetContents.h"
 #include "StyleSheetList.h"

Modified: trunk/Source/WebCore/dom/Document.h (194583 => 194584)


--- trunk/Source/WebCore/dom/Document.h	2016-01-05 13:47:55 UTC (rev 194583)
+++ trunk/Source/WebCore/dom/Document.h	2016-01-05 16:10:25 UTC (rev 194584)
@@ -45,7 +45,7 @@
 #include "RenderPtr.h"
 #include "ScriptExecutionContext.h"
 #include "StringWithDirection.h"
-#include "StyleResolveTree.h"
+#include "StyleChange.h"
 #include "TextResourceDecoder.h"
 #include "Timer.h"
 #include "TreeScope.h"

Modified: trunk/Source/WebCore/dom/Element.cpp (194583 => 194584)


--- trunk/Source/WebCore/dom/Element.cpp	2016-01-05 13:47:55 UTC (rev 194583)
+++ trunk/Source/WebCore/dom/Element.cpp	2016-01-05 16:10:25 UTC (rev 194584)
@@ -77,6 +77,7 @@
 #include "SelectorQuery.h"
 #include "Settings.h"
 #include "StyleProperties.h"
+#include "StyleResolveTree.h"
 #include "StyleResolver.h"
 #include "TextIterator.h"
 #include "VoidCallback.h"

Modified: trunk/Source/WebCore/dom/Element.h (194583 => 194584)


--- trunk/Source/WebCore/dom/Element.h	2016-01-05 13:47:55 UTC (rev 194583)
+++ trunk/Source/WebCore/dom/Element.h	2016-01-05 16:10:25 UTC (rev 194584)
@@ -32,7 +32,7 @@
 #include "RegionOversetState.h"
 #include "ScrollTypes.h"
 #include "SimulatedClickOptions.h"
-#include "StyleResolveTree.h"
+#include "StyleChange.h"
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/html/HTMLFormControlElement.cpp (194583 => 194584)


--- trunk/Source/WebCore/html/HTMLFormControlElement.cpp	2016-01-05 13:47:55 UTC (rev 194583)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.cpp	2016-01-05 16:10:25 UTC (rev 194584)
@@ -38,6 +38,7 @@
 #include "HTMLTextAreaElement.h"
 #include "RenderBox.h"
 #include "RenderTheme.h"
+#include "StyleResolveTree.h"
 #include "ValidationMessage.h"
 #include <wtf/NeverDestroyed.h>
 #include <wtf/Ref.h>

Modified: trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp (194583 => 194584)


--- trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp	2016-01-05 13:47:55 UTC (rev 194583)
+++ trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp	2016-01-05 16:10:25 UTC (rev 194584)
@@ -28,6 +28,7 @@
 #include "RenderWidget.h"
 #include "ShadowRoot.h"
 #include "SVGDocument.h"
+#include "StyleResolveTree.h"
 #include <wtf/Ref.h>
 
 namespace WebCore {

Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp (194583 => 194584)


--- trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp	2016-01-05 13:47:55 UTC (rev 194583)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp	2016-01-05 16:10:25 UTC (rev 194584)
@@ -48,6 +48,7 @@
 #include "SecurityOrigin.h"
 #include "Settings.h"
 #include "ShadowRoot.h"
+#include "StyleResolveTree.h"
 #include "StyleResolver.h"
 #include "SubframeLoader.h"
 #include "TypedElementDescendantIterator.h"

Modified: trunk/Source/WebCore/mathml/MathMLSelectElement.cpp (194583 => 194584)


--- trunk/Source/WebCore/mathml/MathMLSelectElement.cpp	2016-01-05 13:47:55 UTC (rev 194583)
+++ trunk/Source/WebCore/mathml/MathMLSelectElement.cpp	2016-01-05 16:10:25 UTC (rev 194584)
@@ -35,6 +35,7 @@
 #include "RenderMathMLRow.h"
 #include "SVGElement.h"
 #include "SVGNames.h"
+#include "StyleResolveTree.h"
 
 namespace WebCore {
 

Added: trunk/Source/WebCore/style/StyleChange.cpp (0 => 194584)


--- trunk/Source/WebCore/style/StyleChange.cpp	                        (rev 0)
+++ trunk/Source/WebCore/style/StyleChange.cpp	2016-01-05 16:10:25 UTC (rev 194584)
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2013, 2016 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. ``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
+ * 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 "StyleChange.h"
+
+#include "RenderStyle.h"
+
+namespace WebCore {
+namespace Style {
+
+Change determineChange(const RenderStyle& s1, const RenderStyle& s2)
+{
+    if (s1.display() != s2.display())
+        return Detach;
+    if (s1.hasPseudoStyle(FIRST_LETTER) != s2.hasPseudoStyle(FIRST_LETTER))
+        return Detach;
+    // We just detach if a renderer acquires or loses a column-span, since spanning elements
+    // typically won't contain much content.
+    if (s1.columnSpan() != s2.columnSpan())
+        return Detach;
+    if (!s1.contentDataEquivalent(&s2))
+        return Detach;
+    // When text-combine property has been changed, we need to prepare a separate renderer object.
+    // When text-combine is on, we use RenderCombineText, otherwise RenderText.
+    // https://bugs.webkit.org/show_bug.cgi?id=55069
+    if (s1.hasTextCombine() != s2.hasTextCombine())
+        return Detach;
+    // We need to reattach the node, so that it is moved to the correct RenderFlowThread.
+    if (s1.flowThread() != s2.flowThread())
+        return Detach;
+    // When the region thread has changed, we need to prepare a separate render region object.
+    if (s1.regionThread() != s2.regionThread())
+        return Detach;
+    // FIXME: Multicolumn regions not yet supported (http://dev.w3.org/csswg/css-regions/#multi-column-regions)
+    // When the node has region style and changed its multicol style, we have to prepare
+    // a separate render region object.
+    if (s1.hasFlowFrom() && (s1.specifiesColumns() != s2.specifiesColumns()))
+        return Detach;
+
+    if (s1 != s2) {
+        if (s1.inheritedNotEqual(&s2))
+            return Inherit;
+        if (s1.hasExplicitlyInheritedProperties() || s2.hasExplicitlyInheritedProperties())
+            return Inherit;
+
+        return NoInherit;
+    }
+    // If the pseudoStyles have changed, we want any StyleChange that is not NoChange
+    // because setStyle will do the right thing with anything else.
+    if (s1.hasAnyPublicPseudoStyles()) {
+        for (PseudoId pseudoId = FIRST_PUBLIC_PSEUDOID; pseudoId < FIRST_INTERNAL_PSEUDOID; pseudoId = static_cast<PseudoId>(pseudoId + 1)) {
+            if (s1.hasPseudoStyle(pseudoId)) {
+                RenderStyle* ps2 = s2.getCachedPseudoStyle(pseudoId);
+                if (!ps2)
+                    return NoInherit;
+                RenderStyle* ps1 = s1.getCachedPseudoStyle(pseudoId);
+                if (!ps1 || *ps1 != *ps2)
+                    return NoInherit;
+            }
+        }
+    }
+
+    return NoChange;
+}
+
+}
+}

Added: trunk/Source/WebCore/style/StyleChange.h (0 => 194584)


--- trunk/Source/WebCore/style/StyleChange.h	                        (rev 0)
+++ trunk/Source/WebCore/style/StyleChange.h	2016-01-05 16:10:25 UTC (rev 194584)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2013, 2016 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. ``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
+ * 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.
+ */
+
+#ifndef StyleChange_h
+#define StyleChange_h
+
+namespace WebCore {
+
+class RenderStyle;
+
+namespace Style {
+
+enum Change { NoChange, NoInherit, Inherit, Detach, Force };
+
+Change determineChange(const RenderStyle&, const RenderStyle&);
+
+}
+}
+
+#endif

Modified: trunk/Source/WebCore/style/StyleResolveTree.cpp (194583 => 194584)


--- trunk/Source/WebCore/style/StyleResolveTree.cpp	2016-01-05 13:47:55 UTC (rev 194583)
+++ trunk/Source/WebCore/style/StyleResolveTree.cpp	2016-01-05 16:10:25 UTC (rev 194584)
@@ -70,61 +70,6 @@
 static void resolveTextNode(Text&, RenderTreePosition&);
 static void resolveTree(Element&, RenderStyle& inheritedStyle, RenderTreePosition&, Change);
 
-Change determineChange(const RenderStyle& s1, const RenderStyle& s2)
-{
-    if (s1.display() != s2.display())
-        return Detach;
-    if (s1.hasPseudoStyle(FIRST_LETTER) != s2.hasPseudoStyle(FIRST_LETTER))
-        return Detach;
-    // We just detach if a renderer acquires or loses a column-span, since spanning elements
-    // typically won't contain much content.
-    if (s1.columnSpan() != s2.columnSpan())
-        return Detach;
-    if (!s1.contentDataEquivalent(&s2))
-        return Detach;
-    // When text-combine property has been changed, we need to prepare a separate renderer object.
-    // When text-combine is on, we use RenderCombineText, otherwise RenderText.
-    // https://bugs.webkit.org/show_bug.cgi?id=55069
-    if (s1.hasTextCombine() != s2.hasTextCombine())
-        return Detach;
-    // We need to reattach the node, so that it is moved to the correct RenderFlowThread.
-    if (s1.flowThread() != s2.flowThread())
-        return Detach;
-    // When the region thread has changed, we need to prepare a separate render region object.
-    if (s1.regionThread() != s2.regionThread())
-        return Detach;
-    // FIXME: Multicolumn regions not yet supported (http://dev.w3.org/csswg/css-regions/#multi-column-regions)
-    // When the node has region style and changed its multicol style, we have to prepare
-    // a separate render region object.
-    if (s1.hasFlowFrom() && (s1.specifiesColumns() != s2.specifiesColumns()))
-        return Detach;
-
-    if (s1 != s2) {
-        if (s1.inheritedNotEqual(&s2))
-            return Inherit;
-        if (s1.hasExplicitlyInheritedProperties() || s2.hasExplicitlyInheritedProperties())
-            return Inherit;
-
-        return NoInherit;
-    }
-    // If the pseudoStyles have changed, we want any StyleChange that is not NoChange
-    // because setStyle will do the right thing with anything else.
-    if (s1.hasAnyPublicPseudoStyles()) {
-        for (PseudoId pseudoId = FIRST_PUBLIC_PSEUDOID; pseudoId < FIRST_INTERNAL_PSEUDOID; pseudoId = static_cast<PseudoId>(pseudoId + 1)) {
-            if (s1.hasPseudoStyle(pseudoId)) {
-                RenderStyle* ps2 = s2.getCachedPseudoStyle(pseudoId);
-                if (!ps2)
-                    return NoInherit;
-                RenderStyle* ps1 = s1.getCachedPseudoStyle(pseudoId);
-                if (!ps1 || *ps1 != *ps2)
-                    return NoInherit;
-            }
-        }
-    }
-
-    return NoChange;
-}
-
 static bool shouldCreateRenderer(const Element& element, const RenderElement& parentRenderer)
 {
     if (!element.document().shouldCreateRenderers())

Modified: trunk/Source/WebCore/style/StyleResolveTree.h (194583 => 194584)


--- trunk/Source/WebCore/style/StyleResolveTree.h	2016-01-05 13:47:55 UTC (rev 194583)
+++ trunk/Source/WebCore/style/StyleResolveTree.h	2016-01-05 16:10:25 UTC (rev 194584)
@@ -26,6 +26,7 @@
 #ifndef StyleResolveTree_h
 #define StyleResolveTree_h
 
+#include "StyleChange.h"
 #include <functional>
 
 namespace WebCore {
@@ -38,8 +39,6 @@
 
 namespace Style {
 
-enum Change { NoChange, NoInherit, Inherit, Detach, Force };
-
 void resolveTree(Document&, Change);
 
 void detachRenderTree(Element&);
@@ -47,8 +46,6 @@
 
 void updateTextRendererAfterContentChange(Text&, unsigned offsetOfReplacedData, unsigned lengthOfReplacedData);
 
-Change determineChange(const RenderStyle&, const RenderStyle&);
-
 void queuePostResolutionCallback(std::function<void ()>);
 bool postResolutionCallbacksAreSuspended();
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to