Bug 198536 - cssText for content pseudo-elements are missing quotes and invalid
Summary: cssText for content pseudo-elements are missing quotes and invalid
Status: RESOLVED DUPLICATE of bug 118045
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 12
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-06-04 10:22 PDT by Clint Ayres
Modified: 2022-09-26 20:05 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Clint Ayres 2019-06-04 10:22:27 PDT
Steps to reproduce:

// Note, assumes a style tag exists

const style = document.querySelector('style')[0];
style.sheet.insertRule('.test { content: "moo"; }');

// this is incorrect, missing quotes around _moo_
style.sheet.rules[0].cssText === ".test { content: moo; }";

style.sheet.insertRule(style.sheet.rules[0].cssText);

// this is actually correct because the cssText string above is invalid
style.sheet.rules[0].cssText === ".re-test {  }";
Comment 1 Clint Ayres 2019-06-04 10:24:16 PDT
^ last link in the reproduction was incorrect. should be as follows:

// this is actually correct because the cssText string above is invalid
style.sheet.rules[0].cssText === ".test {  }";
Comment 2 Radar WebKit Bug Importer 2019-06-06 10:21:18 PDT
<rdar://problem/51488597>
Comment 3 Karl Dubost 2022-09-26 20:05:23 PDT

*** This bug has been marked as a duplicate of bug 118045 ***