material icon indicating copy to clipboard operation
material copied to clipboard

md-select violates CSP

Open Frank3K opened this issue 10 years ago • 2 comments

The md-select directive violates CSP when an item is clicked and the select closes. Upon closing, there is still some remaining styling form the ink-ripple which is applied when the item is clicked. The following HTML is added to the DOM (new lines added for readability):

<div class="md-text ng-binding">some text value</div>
<div class="md-ripple-container" style="background-color: rgba(0, 0, 0, 0.0980392);">
<div class="md-ripple md-ripple-placed md-ripple-scaled md-ripple-active" style="left: 52px; top: 22px; width: 147.472px; height: 147.472px; border-color: rgb(0, 0, 0); background: rgb(0, 0, 0);">
</div>
</div>

Violating call in select.js.

References #6602, #6691, #6756.

Frank3K avatar Jan 23 '16 11:01 Frank3K

Good catch, looking at the code, it looks like the the ripple container is being copied into the md-select-value element. This doesn't seem to be on purpose since I can't get the copied ripple container to ripple in the md-select-value. So it should be as easy as only copying the .md-text outerHTML instead of the md-option innerHTML.

Emeegeemee avatar Jan 25 '16 02:01 Emeegeemee

Fixed via b707375.

Frank3K avatar Jan 27 '16 22:01 Frank3K