fix(*): resolving csp violation in core package#2293
Closed
ChronosSF wants to merge 5 commits into
Closed
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to resolve a Content Security Policy (CSP) violation by removing inline style usage from the scrollbar measurement helper elements in the core jQuery utilities, replacing it with a CSS class defined in the shared structure stylesheet.
Changes:
- Updated
$.ig.util.getScrollWidth()/$.ig.util.getScrollHeight()to create a plain<div>and apply a helper CSS class instead of inline styles. - Added the
.ui-ig-scroll-measurehelper rule toinfragistics.ui.shared.cssto preserve the prior measurement behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/js/modules/infragistics.util.jquery.js | Switches scrollbar measurement helpers from inline styles to a CSS class for CSP compliance. |
| src/css/structure/modules/infragistics.ui.shared.css | Introduces .ui-ig-scroll-measure rule used by the updated scrollbar measurement helpers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ll, igLayoutManager, igSplitter
fix(loader): add infragistics.ui.shared.css dependency to igScroll, igLayoutManager, and igSplitter
Comment on lines
1114
to
1116
| $.ig.util.getScrollWidth = function () { | ||
| var el = $('<div style="width: 100px; height: 100px; position: absolute; ' + | ||
| 'top: -10000px; left: -10000px; overflow: scroll"></div>') | ||
| var el = $("<div></div>").addClass("ui-ig-scroll-measure") | ||
| .appendTo($(document.body)), scrollWidth; |
Comment on lines
245
to
+251
| scripts: [ "$path$/modules/infragistics.ui.scroll.js" ], | ||
| locale: [ "$localePath$/infragistics.ui.scroll-$locale$.js" ], | ||
| group: $.ig.loaderClass.locale.miscGroup, | ||
| css: [ "$path$/structure/modules/infragistics.ui.scroll.css" ], | ||
| css: [ | ||
| "$path$/structure/modules/infragistics.ui.shared.css", | ||
| "$path$/structure/modules/infragistics.ui.scroll.css" | ||
| ], |
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2292
Additional information (check all that apply):
Checklist:
README.MD