Dart, why does using innerHtml to set shadow root content work but appendHtml doesn't?

StackOverflow https://stackoverflow.com//questions/24000995

  •  20-12-2019
  •  | 
  •  

문제

I have made this Gist to show the issue but essentially I have found that using shadowRoot.innerHtml = '...' works but using shadowRoot.appendHtml('...') doesn't work, it causes the console warning Removing disallowed element <STYLE> which I can't explain. Anyone know if this is simple the way it is meant to be or is it specific to Dart?

도움이 되었습니까?

해결책

Removing disallowed element indicates that you need a NodeValidator.

shadowRoot.append(
    new document.body.createFragment('....'), 
    validator: new NodeValidationBuilder().allow(...);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top