Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
REGRESSION (r264925): run-safari --debug no longer works
https://bugs.webkit.org/show_bug.cgi?id=214947
<rdar://problem/66297850>

Reviewed by Darin Adler.

Removing these APIs in WebKit caused older versions of Safari to
break. We should add back in empty functions to make this work.

No new tests. Manually verified this fix.

* Shared/API/c/WKRenderLayer.cpp: Added.
(WKRenderLayerGetTypeID):
(WKRenderLayerGetRenderer):
(WKRenderLayerCopyRendererName):
(WKRenderLayerCopyElementTagName):
(WKRenderLayerCopyElementID):
(WKRenderLayerGetElementClassNames):
(WKRenderLayerGetAbsoluteBounds):
(WKRenderLayerIsClipping):
(WKRenderLayerIsClipped):
(WKRenderLayerIsReflection):
(WKRenderLayerGetCompositingLayerType):
(WKRenderLayerGetBackingStoreMemoryEstimate):
(WKRenderLayerGetNegativeZOrderList):
(WKRenderLayerGetNormalFlowList):
(WKRenderLayerGetPositiveZOrderList):
(WKRenderLayerGetFrameContentsLayer):
* Shared/API/c/WKRenderLayer.h: Added.
* Shared/API/c/WKRenderObject.cpp: Added.
(WKRenderObjectGetTypeID):
(WKRenderObjectCopyName):
(WKRenderObjectCopyTextSnippet):
(WKRenderObjectGetTextLength):
(WKRenderObjectCopyElementTagName):
(WKRenderObjectCopyElementID):
(WKRenderObjectGetElementClassNames):
(WKRenderObjectGetAbsolutePosition):
(WKRenderObjectGetFrameRect):
(WKRenderObjectGetChildren):
* Shared/API/c/WKRenderObject.h: Added.
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCopyRenderTree):
(WKBundlePageCopyRenderLayerTree):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:


Canonical link: https://commits.webkit.org/227785@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265085 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
kcheney1 committed Jul 30, 2020
1 parent 5d95fb7 commit 21a2c5a
Show file tree
Hide file tree
Showing 9 changed files with 354 additions and 0 deletions.
50 changes: 50 additions & 0 deletions Source/WebKit/ChangeLog
@@ -1,3 +1,53 @@
2020-07-30 Kate Cheney <katherine_cheney@apple.com>

REGRESSION (r264925): run-safari --debug no longer works
https://bugs.webkit.org/show_bug.cgi?id=214947
<rdar://problem/66297850>

Reviewed by Darin Adler.

Removing these APIs in WebKit caused older versions of Safari to
break. We should add back in empty functions to make this work.

No new tests. Manually verified this fix.

* Shared/API/c/WKRenderLayer.cpp: Added.
(WKRenderLayerGetTypeID):
(WKRenderLayerGetRenderer):
(WKRenderLayerCopyRendererName):
(WKRenderLayerCopyElementTagName):
(WKRenderLayerCopyElementID):
(WKRenderLayerGetElementClassNames):
(WKRenderLayerGetAbsoluteBounds):
(WKRenderLayerIsClipping):
(WKRenderLayerIsClipped):
(WKRenderLayerIsReflection):
(WKRenderLayerGetCompositingLayerType):
(WKRenderLayerGetBackingStoreMemoryEstimate):
(WKRenderLayerGetNegativeZOrderList):
(WKRenderLayerGetNormalFlowList):
(WKRenderLayerGetPositiveZOrderList):
(WKRenderLayerGetFrameContentsLayer):
* Shared/API/c/WKRenderLayer.h: Added.
* Shared/API/c/WKRenderObject.cpp: Added.
(WKRenderObjectGetTypeID):
(WKRenderObjectCopyName):
(WKRenderObjectCopyTextSnippet):
(WKRenderObjectGetTextLength):
(WKRenderObjectCopyElementTagName):
(WKRenderObjectCopyElementID):
(WKRenderObjectGetElementClassNames):
(WKRenderObjectGetAbsolutePosition):
(WKRenderObjectGetFrameRect):
(WKRenderObjectGetChildren):
* Shared/API/c/WKRenderObject.h: Added.
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCopyRenderTree):
(WKBundlePageCopyRenderLayerTree):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:

2020-07-30 Darin Adler <darin@apple.com>

Further reduction in the use of live ranges, particularly in headers
Expand Down
95 changes: 95 additions & 0 deletions Source/WebKit/Shared/API/c/WKRenderLayer.cpp
@@ -0,0 +1,95 @@
/*
* Copyright (C) 2012-2020 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 "WKRenderLayer.h"

#include "APIArray.h"
#include "WKAPICast.h"

// These functions should be kept around for compatibility with SafariForWebKitDevelopment.
void WKRenderLayerGetTypeID()
{
}

void WKRenderLayerGetRenderer()
{
}

void WKRenderLayerCopyRendererName()
{
}

void WKRenderLayerCopyElementTagName()
{
}

void WKRenderLayerCopyElementID()
{
}

void WKRenderLayerGetElementClassNames()
{
}

void WKRenderLayerGetAbsoluteBounds()
{
}

void WKRenderLayerIsClipping()
{
}

void WKRenderLayerIsClipped()
{
}

void WKRenderLayerIsReflection()
{
}

void WKRenderLayerGetCompositingLayerType()
{
}

void WKRenderLayerGetBackingStoreMemoryEstimate()
{
}

void WKRenderLayerGetNegativeZOrderList()
{
}

void WKRenderLayerGetNormalFlowList()
{
}

void WKRenderLayerGetPositiveZOrderList()
{
}

void WKRenderLayerGetFrameContentsLayer()
{
}
62 changes: 62 additions & 0 deletions Source/WebKit/Shared/API/c/WKRenderLayer.h
@@ -0,0 +1,62 @@
/*
* Copyright (C) 2012-2020 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 <WebKit/WKBase.h>
#include <WebKit/WKGeometry.h>

#ifdef __cplusplus
extern "C" {
#endif

WK_EXPORT void WKRenderLayerGetTypeID(void);

WK_EXPORT void WKRenderLayerGetRenderer(void);

WK_EXPORT void WKRenderLayerCopyRendererName(void);

WK_EXPORT void WKRenderLayerCopyElementTagName(void);
WK_EXPORT void WKRenderLayerCopyElementID(void);
WK_EXPORT void WKRenderLayerGetElementClassNames(void);

WK_EXPORT void WKRenderLayerGetAbsoluteBounds(void);

WK_EXPORT void WKRenderLayerIsClipping(void);
WK_EXPORT void WKRenderLayerIsClipped(void);
WK_EXPORT void WKRenderLayerIsReflection(void);

WK_EXPORT void WKRenderLayerGetCompositingLayerType(void);
WK_EXPORT void WKRenderLayerGetBackingStoreMemoryEstimate(void);

WK_EXPORT void WKRenderLayerGetNegativeZOrderList(void);
WK_EXPORT void WKRenderLayerGetNormalFlowList(void);
WK_EXPORT void WKRenderLayerGetPositiveZOrderList(void);

WK_EXPORT void WKRenderLayerGetFrameContentsLayer(void);

#ifdef __cplusplus
}
#endif
71 changes: 71 additions & 0 deletions Source/WebKit/Shared/API/c/WKRenderObject.cpp
@@ -0,0 +1,71 @@
/*
* Copyright (C) 2012 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 "WKRenderObject.h"

#include "APIArray.h"
#include "WKAPICast.h"

// These functions should be kept around for compatibility with SafariForWebKitDevelopment.
void WKRenderObjectGetTypeID()
{
}

void WKRenderObjectCopyName()
{
}

void WKRenderObjectCopyTextSnippet()
{
}

void WKRenderObjectGetTextLength()
{
}

void WKRenderObjectCopyElementTagName()
{
}

void WKRenderObjectCopyElementID()
{
}

void WKRenderObjectGetElementClassNames()
{
}

void WKRenderObjectGetAbsolutePosition()
{
}

void WKRenderObjectGetFrameRect()
{
}

void WKRenderObjectGetChildren()
{
}
50 changes: 50 additions & 0 deletions Source/WebKit/Shared/API/c/WKRenderObject.h
@@ -0,0 +1,50 @@
/*
* Copyright (C) 2012 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 <WebKit/WKBase.h>
#include <WebKit/WKGeometry.h>

#ifdef __cplusplus
extern "C" {
#endif

WK_EXPORT void WKRenderObjectGetTypeID(void);

WK_EXPORT void WKRenderObjectCopyName(void);
WK_EXPORT void WKRenderObjectCopyTextSnippet(void);
WK_EXPORT void WKRenderObjectGetTextLength(void);
WK_EXPORT void WKRenderObjectCopyElementTagName(void);
WK_EXPORT void WKRenderObjectCopyElementID(void);
WK_EXPORT void WKRenderObjectGetElementClassNames(void);

WK_EXPORT void WKRenderObjectGetAbsolutePosition(void);
WK_EXPORT void WKRenderObjectGetFrameRect(void);
WK_EXPORT void WKRenderObjectGetChildren(void);

#ifdef __cplusplus
}
#endif
2 changes: 2 additions & 0 deletions Source/WebKit/Sources.txt
Expand Up @@ -206,6 +206,8 @@ Shared/WebPopupItem.cpp
Shared/WebPreferencesDefaultValues.cpp
Shared/WebPreferencesStore.cpp
Shared/WebProcessCreationParameters.cpp
Shared/API/c/WKRenderLayer.cpp
Shared/API/c/WKRenderObject.cpp
Shared/WebTouchEvent.cpp @no-unify
Shared/WebUserContentControllerDataTypes.cpp
Shared/WebWheelEvent.cpp @no-unify
Expand Down
12 changes: 12 additions & 0 deletions Source/WebKit/WebKit.xcodeproj/project.pbxproj
Expand Up @@ -960,6 +960,8 @@
46F9B26323526EF3006FE5FA /* WebBackForwardCacheEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 46F9B26223526ED0006FE5FA /* WebBackForwardCacheEntry.h */; };
4960A3BD23C52AFD00961842 /* WebViewCategory.h in Headers */ = {isa = PBXBuildFile; fileRef = 4960A3BC23C5286400961842 /* WebViewCategory.h */; };
4973DF482422941F00E4C26A /* NavigatingToAppBoundDomain.h in Headers */ = {isa = PBXBuildFile; fileRef = 4973DF472422941F00E4C26A /* NavigatingToAppBoundDomain.h */; };
4990002124D2429C00049CB4 /* WKRenderLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4990001F24D2429C00049CB4 /* WKRenderLayer.h */; settings = {ATTRIBUTES = (Private, ); }; };
4990002424D24C2900049CB4 /* WKRenderObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 4990002324D24C1C00049CB4 /* WKRenderObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
49BCA19223A177660028A836 /* APIResourceLoadStatisticsFirstParty.h in Headers */ = {isa = PBXBuildFile; fileRef = 49BCA19123A177660028A836 /* APIResourceLoadStatisticsFirstParty.h */; };
49BCA19523A18CFD0028A836 /* _WKResourceLoadStatisticsFirstPartyInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 49BCA19023A175490028A836 /* _WKResourceLoadStatisticsFirstPartyInternal.h */; };
49BCA19723A1930D0028A836 /* APIResourceLoadStatisticsThirdParty.h in Headers */ = {isa = PBXBuildFile; fileRef = 49BCA19623A18F620028A836 /* APIResourceLoadStatisticsThirdParty.h */; };
Expand Down Expand Up @@ -3584,6 +3586,10 @@
46F9B26223526ED0006FE5FA /* WebBackForwardCacheEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebBackForwardCacheEntry.h; sourceTree = "<group>"; };
4960A3BC23C5286400961842 /* WebViewCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebViewCategory.h; sourceTree = "<group>"; };
4973DF472422941F00E4C26A /* NavigatingToAppBoundDomain.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NavigatingToAppBoundDomain.h; sourceTree = "<group>"; };
4990001E24D2429C00049CB4 /* WKRenderLayer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WKRenderLayer.cpp; sourceTree = "<group>"; };
4990001F24D2429C00049CB4 /* WKRenderLayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKRenderLayer.h; sourceTree = "<group>"; };
4990002224D24C1C00049CB4 /* WKRenderObject.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WKRenderObject.cpp; sourceTree = "<group>"; };
4990002324D24C1C00049CB4 /* WKRenderObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKRenderObject.h; sourceTree = "<group>"; };
49BCA19023A175490028A836 /* _WKResourceLoadStatisticsFirstPartyInternal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKResourceLoadStatisticsFirstPartyInternal.h; sourceTree = "<group>"; };
49BCA19123A177660028A836 /* APIResourceLoadStatisticsFirstParty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = APIResourceLoadStatisticsFirstParty.h; sourceTree = "<group>"; };
49BCA19623A18F620028A836 /* APIResourceLoadStatisticsThirdParty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = APIResourceLoadStatisticsThirdParty.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -9955,6 +9961,10 @@
A5EFD38B16B0E88C00B2F0E8 /* WKPageVisibilityTypes.h */,
7C135AA6173B0BCA00586AE2 /* WKPluginInformation.cpp */,
7C135AA7173B0BCA00586AE2 /* WKPluginInformation.h */,
4990001E24D2429C00049CB4 /* WKRenderLayer.cpp */,
4990001F24D2429C00049CB4 /* WKRenderLayer.h */,
4990002224D24C1C00049CB4 /* WKRenderObject.cpp */,
4990002324D24C1C00049CB4 /* WKRenderObject.h */,
51CD1C591B3493A900142CA5 /* WKSecurityOriginRef.cpp */,
51CD1C5A1B3493A900142CA5 /* WKSecurityOriginRef.h */,
BC4075E7124FF0270068F20A /* WKSerializedScriptValue.cpp */,
Expand Down Expand Up @@ -11734,6 +11744,8 @@
1AD01BCD1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.h in Headers */,
1A9E329B1822E1CC00F5D04C /* WKRemoteObject.h in Headers */,
1A9E329F1822FEDD00F5D04C /* WKRemoteObjectCoder.h in Headers */,
4990002124D2429C00049CB4 /* WKRenderLayer.h in Headers */,
4990002424D24C2900049CB4 /* WKRenderObject.h in Headers */,
3336763B130C99DC006C9DE2 /* WKResourceCacheManager.h in Headers */,
BC8A501511765F5600757573 /* WKRetainPtr.h in Headers */,
5CA26D81217ABD5B00F97A35 /* WKSafeBrowsingWarning.h in Headers */,
Expand Down

0 comments on commit 21a2c5a

Please sign in to comment.