Closed Bug 1398653 Opened 7 years ago Closed 7 years ago

content property is not reflected when the property is changed by CSSOM

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID
Tracking Status
firefox57 --- affected

People

(Reporter: hiro, Unassigned)

Details

Attachments

(1 file)

Attached file pseudo-change.html
Something like this;

<style>                                                                         
.before::before {                                                               
  content: 'initial';                                                           
  width: 100px; height: 100px;                                                  
  background-color: blue;                                                       
}                                                                               
</style>                                                                        
<div></div>                                                                     
<script>                                                                        
window.addEventListener('load', () => {                                         
  setTimeout(() => {                                                            
    document.querySelector('div').classList.add('before');                      
    setTimeout(() => {                                                          
      document.styleSheets[0].cssRules[0].style.backgroundColor = 'red';        
      document.styleSheets[0].cssRules[0].style.content = 'red';                
    }, 100);                                                                    
  }, 500);                                                                      
});                                                                             
</script>

In this test case, background-color is properly changed, but content property is not reflected at all. 

Neither gecko nor stylo works.

Note that chrome does not change background-color either.
Oops, I was about to file a new bug for this.

Note that setProperty('content', '') (i.e. remove the property) works fine.
I believe this bug is invalid. `red` doesn't seem to be a valid value for content property. If you want the string "red", you should assign `"red"`.
Oh right. Thanks Xidorn! That was good that I did put you in CC. :)
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: