@@ -35,14 +35,6 @@ function isFullyTransparent(color: string): boolean {
3535 return parsed ? parsed . alpha === 0 : false
3636}
3737
38- function isOpaqueWhite ( color : string ) : boolean {
39- if ( ! color ) return false
40- const parsed = cssColorParse ( color )
41- if ( ! parsed ) return false
42- const [ r , g , b , a ] = parsed . values
43- return r === 255 && g === 255 && b === 255 && ( a === undefined || a === 1 )
44- }
45-
4638export default async function * buildTextNodes (
4739 content : string ,
4840 context : LayoutContext
@@ -73,17 +65,13 @@ export default async function* buildTextNodes(
7365 tabSize = 8 ,
7466 letterSpacing,
7567 _inheritedBackgroundClipTextPath,
76- _inheritedBackgroundClipTextHasBackground,
7768 WebkitTextFillColor,
7869 flexShrink,
7970 } = parentStyle
8071
8172 const textFillColor = WebkitTextFillColor as string | undefined
82- const isTransparentText = textFillColor
83- ? isFullyTransparent ( textFillColor )
84- : isFullyTransparent ( parentStyle . color ) ||
85- ( ! ! _inheritedBackgroundClipTextHasBackground &&
86- isOpaqueWhite ( parentStyle . color ) )
73+ const effectiveColor = textFillColor || parentStyle . color
74+ const isTransparentText = isFullyTransparent ( effectiveColor )
8775
8876 const {
8977 words,
@@ -880,7 +868,7 @@ export default async function* buildTextNodes(
880868 // Embed the font as path.
881869 if ( mergedPath ) {
882870 const p =
883- ( ! isFullyTransparent ( parentStyle . color ) || filter ) && opacity !== 0
871+ ( ! isTransparentText || filter ) && opacity !== 0
884872 ? `<g ${ overflowMaskId ? `mask="url(#${ overflowMaskId } )"` : '' } ${
885873 clipPathId ? `clip-path="url(#${ clipPathId } )"` : ''
886874 } >` +
0 commit comments