void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) { WKRetainPtr<WKStringRef> sourceWK = toWK(source); WKRetainPtr<WKBundleScriptWorldRef> scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld()); WKBundleAddUserStyleSheet(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), scriptWorld.get(), sourceWK.get(), 0, 0, 0, (allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly)); }
void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames) { WKRetainPtr<WKStringRef> sourceWK = toWK(source); WKRetainPtr<WKBundleScriptWorldRef> scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld()); auto& injectedBundle = InjectedBundle::singleton(); WKBundleAddUserStyleSheet(injectedBundle.bundle(), injectedBundle.pageGroup(), scriptWorld.get(), sourceWK.get(), 0, 0, 0, (allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly)); }