Changeset 236468 in webkit


Ignore:
Timestamp:
Sep 25, 2018 11:59:38 AM (6 years ago)
Author:
Wenson Hsieh
Message:

[iOS] Fix the open source iOS 12 build after r236445
https://bugs.webkit.org/show_bug.cgi?id=189953

Reviewed by Alex Christensen.

Source/WebCore:

Remove soft-linking macros from several sources in WebCore, and instead import UIKitSoftLink from PAL. This
allows different WebCore sources to soft-link UIKit (and its classes and symbols) without reimplementing
WebCore::UIKitLibrary.

  • editing/cocoa/FontAttributesCocoa.mm:
  • editing/cocoa/FontShadowCocoa.mm:

(WebCore::FontShadow::createShadow const):

  • platform/graphics/cocoa/ColorCocoa.mm:

(WebCore::platformColor):

  • platform/ios/PlatformScreenIOS.mm:

(WebCore::screenIsMonochrome):
(WebCore::screenHasInvertedColors):
(WebCore::screenSize):
(WebCore::availableScreenSize):
(WebCore::screenScaleFactor):

Source/WebCore/PAL:

Introduce a single UIKit soft-linking header in PAL.

  • PAL.xcodeproj/project.pbxproj:
  • pal/ios/UIKitSoftLink.h: Copied from Source/WebCore/platform/graphics/cocoa/ColorCocoa.mm.
  • pal/ios/UIKitSoftLink.mm: Copied from Source/WebCore/platform/graphics/cocoa/ColorCocoa.mm.
Location:
trunk/Source/WebCore
Files:
1 added
7 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r236466 r236468  
     12018-09-25  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [iOS] Fix the open source iOS 12 build after r236445
     4        https://bugs.webkit.org/show_bug.cgi?id=189953
     5
     6        Reviewed by Alex Christensen.
     7
     8        Remove soft-linking macros from several sources in WebCore, and instead import UIKitSoftLink from PAL. This
     9        allows different WebCore sources to soft-link UIKit (and its classes and symbols) without reimplementing
     10        WebCore::UIKitLibrary.
     11
     12        * editing/cocoa/FontAttributesCocoa.mm:
     13        * editing/cocoa/FontShadowCocoa.mm:
     14        (WebCore::FontShadow::createShadow const):
     15        * platform/graphics/cocoa/ColorCocoa.mm:
     16        (WebCore::platformColor):
     17        * platform/ios/PlatformScreenIOS.mm:
     18        (WebCore::screenIsMonochrome):
     19        (WebCore::screenHasInvertedColors):
     20        (WebCore::screenSize):
     21        (WebCore::availableScreenSize):
     22        (WebCore::screenScaleFactor):
     23
    1242018-09-25  Thibault Saunier  <tsaunier@igalia.com>
    225
  • trunk/Source/WebCore/PAL/ChangeLog

    r236445 r236468  
     12018-09-25  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [iOS] Fix the open source iOS 12 build after r236445
     4        https://bugs.webkit.org/show_bug.cgi?id=189953
     5
     6        Reviewed by Alex Christensen.
     7
     8        Introduce a single UIKit soft-linking header in PAL.
     9
     10        * PAL.xcodeproj/project.pbxproj:
     11        * pal/ios/UIKitSoftLink.h: Copied from Source/WebCore/platform/graphics/cocoa/ColorCocoa.mm.
     12        * pal/ios/UIKitSoftLink.mm: Copied from Source/WebCore/platform/graphics/cocoa/ColorCocoa.mm.
     13
    1142018-09-24  Wenson Hsieh  <wenson_hsieh@apple.com>
    215
  • trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj

    r236303 r236468  
    109109                1CCEE4F720D8743F0047B097 /* NSAppearanceSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CCEE4F620D8743F0047B097 /* NSAppearanceSPI.h */; };
    110110                2D02E93C2056FAA700A13797 /* AudioToolboxSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */; };
     111                2E1342CC215AA10A007199D2 /* UIKitSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E1342CA215AA10A007199D2 /* UIKitSoftLink.h */; };
     112                2E1342CD215AA10A007199D2 /* UIKitSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E1342CB215AA10A007199D2 /* UIKitSoftLink.mm */; };
    111113                31308B1420A21705003FB929 /* SystemPreviewSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 31308B1320A21705003FB929 /* SystemPreviewSPI.h */; };
    112114                570AB8F120AE2E8D00B8BE87 /* SecKeyProxySPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 570AB8F020AE2E8D00B8BE87 /* SecKeyProxySPI.h */; };
     
    261263                1CCEE4F620D8743F0047B097 /* NSAppearanceSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSAppearanceSPI.h; sourceTree = "<group>"; };
    262264                2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioToolboxSPI.h; sourceTree = "<group>"; };
     265                2E1342CA215AA10A007199D2 /* UIKitSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIKitSoftLink.h; path = ios/UIKitSoftLink.h; sourceTree = "<group>"; };
     266                2E1342CB215AA10A007199D2 /* UIKitSoftLink.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = UIKitSoftLink.mm; path = ios/UIKitSoftLink.mm; sourceTree = "<group>"; };
    263267                31308B1320A21705003FB929 /* SystemPreviewSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SystemPreviewSPI.h; sourceTree = "<group>"; };
    264268                37119A7820CCB5FF002C6DC9 /* WebKitTargetConditionals.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WebKitTargetConditionals.xcconfig; sourceTree = "<group>"; };
     
    505509                                1C4876DE1F8D831300CCEEBD /* cocoa */,
    506510                                1C09D0511E31C41200725F18 /* crypto */,
     511                                2E87C06E215A993100D6CD32 /* ios */,
    507512                                0C2DA0651F33CA3300DBC317 /* spi */,
    508513                                A3788E9F1F05B7CE00679425 /* system */,
     
    558563                        );
    559564                        path = cocoa;
     565                        sourceTree = "<group>";
     566                };
     567                2E87C06E215A993100D6CD32 /* ios */ = {
     568                        isa = PBXGroup;
     569                        children = (
     570                                2E1342CA215AA10A007199D2 /* UIKitSoftLink.h */,
     571                                2E1342CB215AA10A007199D2 /* UIKitSoftLink.mm */,
     572                        );
     573                        name = ios;
    560574                        sourceTree = "<group>";
    561575                };
     
    738752                                A3AB6E641F3D217F009C14B1 /* SystemSleepListenerMac.h in Headers */,
    739753                                0C7785A11F45130F00F4EBB6 /* TUCallSPI.h in Headers */,
     754                                2E1342CC215AA10A007199D2 /* UIKitSoftLink.h in Headers */,
    740755                                0C5AF9221F43A4C7002EAC02 /* UIKitSPI.h in Headers */,
    741756                                0C2DA1471F3BEB4900DBC317 /* URLFormattingSPI.h in Headers */,
     
    848863                                A3AB6E571F3D1DDB009C14B1 /* SystemSleepListener.cpp in Sources */,
    849864                                A3AB6E651F3D217F009C14B1 /* SystemSleepListenerMac.mm in Sources */,
     865                                2E1342CD215AA10A007199D2 /* UIKitSoftLink.mm in Sources */,
    850866                                A10826FA1F576292004772AC /* WebPanel.mm in Sources */,
    851867                        );
  • trunk/Source/WebCore/PAL/pal/ios/UIKitSoftLink.h

    r236467 r236468  
    2424 */
    2525
    26 #import "config.h"
    27 #import "ColorCocoa.h"
    28 
    29 #import "ColorMac.h"
    30 #import <wtf/SoftLinking.h>
    31 
    32 #if PLATFORM(IOS)
    33 #import <pal/spi/ios/UIKitSPI.h>
    34 
    35 SOFT_LINK_FRAMEWORK_FOR_SOURCE(WebCore, UIKit)
    36 SOFT_LINK_CLASS_FOR_SOURCE(WebCore, UIKit, UIColor)
    37 #endif
    38 
    39 namespace WebCore {
    40 
    41 #if USE(APPKIT)
    42 
    43 NSColor *platformColor(const Color& color)
    44 {
    45     return nsColor(color);
    46 }
    47 
    48 #endif
     26#pragma once
    4927
    5028#if PLATFORM(IOS)
    5129
    52 UIColor *platformColor(const Color& color)
    53 {
    54     return [get_UIKit_UIColorClass() _disambiguated_due_to_CIImage_colorWithCGColor:cachedCGColor(color)];
    55 }
     30#import <pal/spi/ios/UIKitSPI.h>
     31#import <wtf/SoftLinking.h>
     32
     33SOFT_LINK_FRAMEWORK_FOR_HEADER(PAL, UIKit)
     34
     35SOFT_LINK_CLASS_FOR_HEADER(PAL, UIKit, NSShadow)
     36SOFT_LINK_CLASS_FOR_HEADER(PAL, UIKit, UIApplication)
     37SOFT_LINK_CLASS_FOR_HEADER(PAL, UIKit, UIScreen)
     38SOFT_LINK_CLASS_FOR_HEADER(PAL, UIKit, UIColor)
     39SOFT_LINK_FUNCTION_FOR_HEADER(PAL, UIKit, UIAccessibilityIsGrayscaleEnabled, BOOL, (void), ())
     40SOFT_LINK_FUNCTION_FOR_HEADER(PAL, UIKit, UIAccessibilityIsInvertColorsEnabled, BOOL, (void), ())
    5641
    5742#endif
    58 
    59 } // namespace WebCore
  • trunk/Source/WebCore/PAL/pal/ios/UIKitSoftLink.mm

    r236467 r236468  
    2424 */
    2525
    26 #import "config.h"
    27 #import "ColorCocoa.h"
    28 
    29 #import "ColorMac.h"
    30 #import <wtf/SoftLinking.h>
    31 
    32 #if PLATFORM(IOS)
    33 #import <pal/spi/ios/UIKitSPI.h>
    34 
    35 SOFT_LINK_FRAMEWORK_FOR_SOURCE(WebCore, UIKit)
    36 SOFT_LINK_CLASS_FOR_SOURCE(WebCore, UIKit, UIColor)
    37 #endif
    38 
    39 namespace WebCore {
    40 
    41 #if USE(APPKIT)
    42 
    43 NSColor *platformColor(const Color& color)
    44 {
    45     return nsColor(color);
    46 }
    47 
    48 #endif
     26#include "config.h"
    4927
    5028#if PLATFORM(IOS)
    5129
    52 UIColor *platformColor(const Color& color)
    53 {
    54     return [get_UIKit_UIColorClass() _disambiguated_due_to_CIImage_colorWithCGColor:cachedCGColor(color)];
    55 }
     30#import <pal/spi/ios/UIKitSPI.h>
     31#import <wtf/SoftLinking.h>
     32
     33SOFT_LINK_FRAMEWORK_FOR_SOURCE(PAL, UIKit)
     34
     35SOFT_LINK_CLASS_FOR_SOURCE(PAL, UIKit, NSShadow)
     36SOFT_LINK_CLASS_FOR_SOURCE(PAL, UIKit, UIApplication)
     37SOFT_LINK_CLASS_FOR_SOURCE(PAL, UIKit, UIScreen)
     38SOFT_LINK_CLASS_FOR_SOURCE(PAL, UIKit, UIColor)
     39SOFT_LINK_FUNCTION_FOR_SOURCE(PAL, UIKit, UIAccessibilityIsGrayscaleEnabled, BOOL, (void), ())
     40SOFT_LINK_FUNCTION_FOR_SOURCE(PAL, UIKit, UIAccessibilityIsInvertColorsEnabled, BOOL, (void), ())
    5641
    5742#endif
    58 
    59 } // namespace WebCore
  • trunk/Source/WebCore/editing/cocoa/FontAttributesCocoa.mm

    r236445 r236468  
    2828
    2929#import "ColorCocoa.h"
    30 #import <wtf/SoftLinking.h>
    3130
    3231namespace WebCore {
  • trunk/Source/WebCore/editing/cocoa/FontShadowCocoa.mm

    r236445 r236468  
    3131
    3232#if PLATFORM(IOS)
    33 SOFT_LINK_FRAMEWORK_FOR_SOURCE(WebCore, UIKit)
    34 SOFT_LINK_CLASS_FOR_SOURCE(WebCore, UIKit, NSShadow)
     33#import <pal/ios/UIKitSoftLink.h>
    3534#endif
    3635
     
    4241    auto shadow = adoptNS([NSShadow new]);
    4342#elif PLATFORM(IOS)
    44     auto shadow = adoptNS([get_UIKit_NSShadowClass() new]);
     43    auto shadow = adoptNS([PAL::get_UIKit_NSShadowClass() new]);
    4544#endif
    4645    [shadow setShadowColor:platformColor(color)];
  • trunk/Source/WebCore/platform/graphics/cocoa/ColorCocoa.mm

    r236445 r236468  
    2828
    2929#import "ColorMac.h"
    30 #import <wtf/SoftLinking.h>
    3130
    3231#if PLATFORM(IOS)
     32#import <pal/ios/UIKitSoftLink.h>
    3333#import <pal/spi/ios/UIKitSPI.h>
    34 
    35 SOFT_LINK_FRAMEWORK_FOR_SOURCE(WebCore, UIKit)
    36 SOFT_LINK_CLASS_FOR_SOURCE(WebCore, UIKit, UIColor)
    3734#endif
    3835
     
    5249UIColor *platformColor(const Color& color)
    5350{
    54     return [get_UIKit_UIColorClass() _disambiguated_due_to_CIImage_colorWithCGColor:cachedCGColor(color)];
     51    return [PAL::get_UIKit_UIColorClass() _disambiguated_due_to_CIImage_colorWithCGColor:cachedCGColor(color)];
    5552}
    5653
  • trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm

    r232372 r236468  
    3939#import "WAKWindow.h"
    4040#import "Widget.h"
     41#import <pal/ios/UIKitSoftLink.h>
    4142#import <pal/spi/ios/MobileGestaltSPI.h>
    4243#import <pal/spi/ios/UIKitSPI.h>
    43 #import <wtf/SoftLinking.h>
    44 
    45 SOFT_LINK_FRAMEWORK_FOR_SOURCE(WebCore, UIKit)
    46 SOFT_LINK_CLASS_FOR_SOURCE(WebCore, UIKit, UIApplication)
    47 SOFT_LINK_CLASS_FOR_SOURCE(WebCore, UIKit, UIScreen)
    48 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, UIKit, UIAccessibilityIsGrayscaleEnabled, BOOL, (void), ())
    49 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, UIKit, UIAccessibilityIsInvertColorsEnabled, BOOL, (void), ())
    5044
    5145namespace WebCore {
     
    6559bool screenIsMonochrome(Widget*)
    6660{
    67     return softLinkUIKitUIAccessibilityIsGrayscaleEnabled();
     61    return PAL::softLinkUIKitUIAccessibilityIsGrayscaleEnabled();
    6862}
    6963
    7064bool screenHasInvertedColors()
    7165{
    72     return softLinkUIKitUIAccessibilityIsInvertColorsEnabled();
     66    return PAL::softLinkUIKitUIAccessibilityIsInvertColorsEnabled();
    7367}
    7468
     
    136130FloatSize screenSize()
    137131{
    138     if (deviceHasIPadCapability() && [[get_UIKit_UIApplicationClass() sharedApplication] _isClassic])
     132    if (deviceHasIPadCapability() && [[PAL::get_UIKit_UIApplicationClass() sharedApplication] _isClassic])
    139133        return { 320, 480 };
    140     return FloatSize([[get_UIKit_UIScreenClass() mainScreen] _referenceBounds].size);
     134    return FloatSize([[PAL::get_UIKit_UIScreenClass() mainScreen] _referenceBounds].size);
    141135}
    142136
    143137FloatSize availableScreenSize()
    144138{
    145     if (deviceHasIPadCapability() && [[get_UIKit_UIApplicationClass() sharedApplication] _isClassic])
     139    if (deviceHasIPadCapability() && [[PAL::get_UIKit_UIApplicationClass() sharedApplication] _isClassic])
    146140        return { 320, 480 };
    147     return FloatSize([get_UIKit_UIScreenClass() mainScreen].bounds.size);
     141    return FloatSize([PAL::get_UIKit_UIScreenClass() mainScreen].bounds.size);
    148142}
    149143
     
    160154{
    161155    if (!screen)
    162         screen = [get_UIKit_UIScreenClass() mainScreen];
     156        screen = [PAL::get_UIKit_UIScreenClass() mainScreen];
    163157
    164158    return screen.scale;
Note: See TracChangeset for help on using the changeset viewer.