Skip to content

Commit

Permalink
Remove disable_replay_inline_css ff
Browse files Browse the repository at this point in the history
  • Loading branch information
amortemousque committed May 21, 2024
1 parent bce53cf commit db80b9b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 35 deletions.
1 change: 0 additions & 1 deletion packages/core/src/tools/experimentalFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// string is an expected feature flag
// eslint-disable-next-line no-restricted-syntax
export enum ExperimentalFeature {
DISABLE_REPLAY_INLINE_CSS = 'disable_replay_inline_css',
WRITABLE_RESOURCE_GRAPHQL = 'writable_resource_graphql',
CUSTOM_VITALS = 'custom_vitals',
TOLERANT_RESOURCE_TIMINGS = 'tolerant_resource_timings',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ExperimentalFeature, isExperimentalFeatureEnabled, isSafari } from '@datadog/browser-core'

import { isSafari } from '@datadog/browser-core'
import { NodePrivacyLevel } from '../../../constants'
import { shouldMaskNode } from '../privacy'
import { getElementInputValue, switchToAbsoluteUrl, getValidTagName } from './serializationUtils'
Expand Down Expand Up @@ -53,7 +52,7 @@ export function serializeAttributes(
if (tagName === 'link') {
const stylesheet = Array.from(doc.styleSheets).find((s) => s.href === (element as HTMLLinkElement).href)
const cssText = getCssRulesString(stylesheet)
if (cssText && stylesheet && !isExperimentalFeatureEnabled(ExperimentalFeature.DISABLE_REPLAY_INLINE_CSS)) {
if (cssText && stylesheet) {
safeAttrs._cssText = cssText
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import {
ExperimentalFeature,
addExperimentalFeatures,
isIE,
noop,
resetExperimentalFeatures,
} from '@datadog/browser-core'

import { isIE, noop } from '@datadog/browser-core'
import type { RumConfiguration } from '@datadog/browser-rum-core'
import { isAdoptedStyleSheetsSupported } from '@datadog/browser-core/test'
import {
Expand Down Expand Up @@ -70,10 +63,6 @@ describe('serializeNodeWithId', () => {
}
})

afterEach(() => {
resetExperimentalFeatures()
})

describe('document serialization', () => {
it('serializes a document', () => {
const document = new DOMParser().parseFromString('<!doctype html><html>foo</html>', 'text/html')
Expand Down Expand Up @@ -634,25 +623,6 @@ describe('serializeNodeWithId', () => {
})
})

it('does not inline external CSS when DISABLE_REPLAY_INLINE_CSS is enabled', () => {
addExperimentalFeatures([ExperimentalFeature.DISABLE_REPLAY_INLINE_CSS])
const linkNode = appendElement(
"<link rel='stylesheet' href='https://datadoghq.com/some/style.css' />",
document.head
)
Object.defineProperty(document, 'styleSheets', {
value: [
{
href: 'https://datadoghq.com/some/style.css',
cssRules: [{ cssText: 'body { width: 100%; }' }],
},
],
configurable: true,
})

expect((serializeNodeWithId(linkNode, DEFAULT_OPTIONS) as ElementNode).attributes._cssText).toBeUndefined()
})

it('does not inline external CSS if the style sheet is behind CORS', () => {
const linkNode = appendElement(
"<link rel='stylesheet' href='https://datadoghq.com/some/style.css' />",
Expand Down

0 comments on commit db80b9b

Please sign in to comment.