Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

fix(panel): use class instead of style attribute to fix CSP violation #10321

Merged
merged 1 commit into from Mar 7, 2017

Conversation

Frank3K
Copy link
Contributor

@Frank3K Frank3K commented Jan 28, 2017

Using a style attribute is prohibited when using strict CSP rules. Fixes #10085.

Using a style attribute is prohibited when using strict CSP rules. Fixes angular#10085.
@googlebot googlebot added the cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ label Jan 28, 2017
@Frank3K
Copy link
Contributor Author

Frank3K commented Jan 28, 2017

@ErinCoughlan: could you please review? I have tried adding !important to the rule, but this led to a number of failing tests.

@Frank3K Frank3K changed the title fix(panel): use class instead of style attribute fix(panel): use class instead of style attribute to fix CSP violation Jan 28, 2017
@ErinCoughlan ErinCoughlan self-requested a review January 31, 2017 18:40
@ErinCoughlan ErinCoughlan self-assigned this Jan 31, 2017
Copy link
Contributor

@ErinCoughlan ErinCoughlan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Frank3K Out of curiosity, which tests were failing when you switched to using !important? I think in terms of keeping the functionality the same as previous, it should be used and I'm not sure why it would fail since it's removed when we open the panel.

@Frank3K
Copy link
Contributor Author

Frank3K commented Jan 31, 2017

Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2147 of 2769 (1 FAILED) (skipped 1) (0 Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should update the position of an open panel between two absolute positions FAILED
	Expected 30 to be within 1 of -9999
	@src/components/panel/panel.spec.js:1799:9
	Expected 300 to be within 1 of -9999
	@src/components/panel/panel.spec.js:1813:9
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2148 of 2769 (2 FAILED) (skipped 1) (0 Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should update the position of an open panel between two relative positions FAILED
	Expected 100 to be within 1 of -9999
	@src/components/panel/panel.spec.js:1828:9
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2149 of 2769 (3 FAILED) (skipped 1) (0 Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should update the position of an open panel from an absolute to a relative position FAILED
	Expected 400 to be within 1 of -9999
	@src/components/panel/panel.spec.js:1857:9
	Expected 100 to be within 1 of -9999
	@src/components/panel/panel.spec.js:1868:9
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2150 of 2769 (4 FAILED) (skipped 1) (0 Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should offset the panel horizontally FAILED
	Expected 35 to be within 1 of -10014
	@src/components/panel/panel.spec.js:1889:9
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2151 of 2769 (5 FAILED) (skipped 1) (0 Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should offset the panel horizontally with a function FAILED
	Expected 35 to be within 1 of -10014
	@src/components/panel/panel.spec.js:1917:9
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2152 of 2769 (6 FAILED) (skipped 1) (0 Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should offset the panel horizontally with centering FAILED
	Expected 690 to be within 1 of -9984
	@src/components/panel/panel.spec.js:1939:9
...
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2172 of 2769 (7 FAILED) (skipped 1) (0 Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should absolutely position the panel at center horizontally FAILED
	Expected 675 to be within 1 of -9999
	@src/components/panel/panel.spec.js:2199:9
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2173 of 2769 (8 FAILED) (skipped 1) (0 Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2174 of 2769 (8 FAILED) (skipped 1) (0 Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should absolutely position the panel at center horizontally and vertically FAILED
	Expected 675 to be within 1 of -9999
	@src/components/panel/panel.spec.js:2231:9
...
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2187 of 2769 (9 FAILED) (skipped 1) (0 Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should relatively position the panel should keep the panel within the viewport on repeat openings FAILED
	Expected -9999 to be 8.
	@src/components/panel/panel.spec.js:2507:11
	Expected -9999 to be 8.
	@src/components/panel/panel.spec.js:2516:11
...
Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should relatively position the panel should keep the panel within the viewport on repeat openings FAILED
	Expected -9999 to be 8.
	@src/components/panel/panel.spec.js:2507:11
	Expected -9999 to be 8.
	@src/components/panel/panel.spec.js:2516:11
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2188 of 2769 (10 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2189 of 2769 (10 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2190 of 2769 (10 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2191 of 2769 (10 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2192 of 2769 (10 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2193 of 2769 (10 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should relatively position the panel vertically element outside the left boundry of the viewport FAILED
	Expected -9999 to be 8.
	@src/components/panel/panel.spec.js:2613:11
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2194 of 2769 (11 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2195 of 2769 (11 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should relatively position the panel horizontally offset to the left of an element FAILED
	Expected 100 to be within 1 of -9914
	@src/components/panel/panel.spec.js:2652:11
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2196 of 2769 (12 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should relatively position the panel horizontally right aligned with an element FAILED
	Expected 203 to be within 1 of -9914
	@src/components/panel/panel.spec.js:2666:11
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2197 of 2769 (13 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should relatively position the panel horizontally centered with an element FAILED
	Expected 151.5 to be within 1 of -9956.5
	@src/components/panel/panel.spec.js:2683:11
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2198 of 2769 (14 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should relatively position the panel horizontally left aligned with an element FAILED
	Expected 100 to be within 1 of -9999
	@src/components/panel/panel.spec.js:2697:11
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2199 of 2769 (15 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should relatively position the panel horizontally offset to the right of an element FAILED
	Expected 203 to be within 1 of -9999
	@src/components/panel/panel.spec.js:2711:11
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2200 of 2769 (16 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2201 of 2769 (16 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2202 of 2769 (16 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should relatively position the panel horizontally rtl offset to the right of an element FAILED
	Expected 203 to be within 1 of -9999
	@src/components/panel/panel.spec.js:2773:13
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2203 of 2769 (17 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should relatively position the panel horizontally rtl left aligned with an element FAILED
	Expected 100 to be within 1 of -9999
	@src/components/panel/panel.spec.js:2787:13
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2204 of 2769 (18 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should relatively position the panel horizontally rtl right aligned with an element FAILED
	Expected 203 to be within 1 of -9914
	@src/components/panel/panel.spec.js:2801:13
Firefox 51.0.0 (Ubuntu 0.0.0): Executed 2205 of 2769 (19 FAILED) (skipped 1) (0Firefox 51.0.0 (Ubuntu 0.0.0) $mdPanel positioning logic:  should relatively position the panel horizontally rtl offset to the right of an element FAILED
	Expected 100 to be within 1 of -9914
	@src/components/panel/panel.spec.js:2815:13

Line numbers from panel.spec.js.

Many failing tests have in common that left and / or top are explicitly set.

@ThomasBurleson ThomasBurleson added this to the 1.1.4 milestone Mar 7, 2017
@tinayuangao tinayuangao merged commit 976f557 into angular:master Mar 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants