Bug 228593

Summary: [Cocoa|WK1] -[NSAttributeString loadFromHTML...] methods will disable bluetooth route switching
Product: WebKit Reporter: Jer Noble <jer.noble>
Component: New BugsAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: eric.carlson, ews-watchlist, glenn, jean-yves.avenard, peng.liu6, philipj, sam, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
ews-feeder: commit-queue-
Patch
eric.carlson: review+, ews-feeder: commit-queue-
Patch for landing
ews-feeder: commit-queue-
Patch for landing none

Description Jer Noble 2021-07-29 10:54:16 PDT
[Cocoa|WK1] -[NSAttributeString loadFromHTML...] methods will disable bluetooth route switching
Comment 1 Jer Noble 2021-07-29 10:54:33 PDT
<rdar://81160969>
Comment 2 Jer Noble 2021-07-29 11:03:06 PDT
Created attachment 434538 [details]
Patch
Comment 3 Sam Weinig 2021-07-29 11:05:26 PDT
Comment on attachment 434538 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=434538&action=review

> Source/WebCore/platform/audio/ios/AudioSessionIOS.mm:31
> +#import "DeprecatedGlobalSettings.h"

Using DeprecatedGlobalSettings.h from platform/ is a layering violation (DeprecatedGlobalSettings.h is not part of platform/). The pattern to use here is usually to pass the data down from the WebCore layer or via delegation.
Comment 4 Jer Noble 2021-07-29 11:11:37 PDT
(In reply to Sam Weinig from comment #3)
> Comment on attachment 434538 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=434538&action=review
> 
> > Source/WebCore/platform/audio/ios/AudioSessionIOS.mm:31
> > +#import "DeprecatedGlobalSettings.h"
> 
> Using DeprecatedGlobalSettings.h from platform/ is a layering violation
> (DeprecatedGlobalSettings.h is not part of platform/). The pattern to use
> here is usually to pass the data down from the WebCore layer or via
> delegation.

DeprecatedGlobalSettings is used everywhere in platform/. It should probably be moved in there rather than have every use require some kind of delegate push.
Comment 5 Jer Noble 2021-07-29 11:13:13 PDT
(In reply to Jer Noble from comment #4)
> (In reply to Sam Weinig from comment #3)
> > Comment on attachment 434538 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=434538&action=review
> > 
> > > Source/WebCore/platform/audio/ios/AudioSessionIOS.mm:31
> > > +#import "DeprecatedGlobalSettings.h"
> > 
> > Using DeprecatedGlobalSettings.h from platform/ is a layering violation
> > (DeprecatedGlobalSettings.h is not part of platform/). The pattern to use
> > here is usually to pass the data down from the WebCore layer or via
> > delegation.
> 
> DeprecatedGlobalSettings is used everywhere in platform/. It should probably
> be moved in there rather than have every use require some kind of delegate
> push.

In fact, there are 4 uses outside of platform/, and 18 inside platform/.
Comment 6 Jer Noble 2021-07-29 11:23:01 PDT
Filed bug #228594 to track fixing the layering violation (for this code and all other uses).
Comment 7 Jer Noble 2021-07-29 11:51:06 PDT
Created attachment 434550 [details]
Patch
Comment 8 Eric Carlson 2021-07-29 11:57:34 PDT
Comment on attachment 434550 [details]
Patch

r=me once the bots are happy
Comment 9 Jer Noble 2021-07-29 11:57:44 PDT
Created attachment 434551 [details]
Patch
Comment 10 Jer Noble 2021-07-29 12:10:09 PDT
Created attachment 434555 [details]
Patch for landing
Comment 11 Jer Noble 2021-07-29 12:39:52 PDT
Created attachment 434558 [details]
Patch for landing
Comment 12 EWS 2021-07-29 18:51:25 PDT
Committed r280462 (240097@main): <https://commits.webkit.org/240097@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434558 [details].