Skip to content

fix(*): resolving csp violation in core package#2293

Closed
ChronosSF wants to merge 5 commits into
masterfrom
sstoychev/fix-csp-inline-styles
Closed

fix(*): resolving csp violation in core package#2293
ChronosSF wants to merge 5 commits into
masterfrom
sstoychev/fix-csp-inline-styles

Conversation

@ChronosSF

@ChronosSF ChronosSF commented May 28, 2026

Copy link
Copy Markdown
Member

Closes #2292

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code
  • This PR includes API docs for newly added methods/properties
  • This PR includes general feature table updates in the root README.MD
  • This PR contains breaking changes
  • This PR includes behavioral changes and the feature specification has been updated with them

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-measure helper rule to infragistics.ui.shared.css to 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.

Comment thread src/js/modules/infragistics.util.jquery.js
Comment thread src/js/modules/infragistics.util.jquery.js Outdated
Comment thread src/css/structure/modules/infragistics.ui.shared.css
Comment thread src/js/modules/infragistics.util.jquery.js Outdated
ChronosSF and others added 2 commits May 28, 2026 15:05
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 84.601% (+0.003%) from 84.598% — sstoychev/fix-csp-inline-styles into master

fix(loader): add infragistics.ui.shared.css dependency to igScroll, igLayoutManager, and igSplitter

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

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"
],
@ChronosSF ChronosSF closed this May 28, 2026
@ChronosSF ChronosSF deleted the sstoychev/fix-csp-inline-styles branch May 28, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSP Violations under Strict style-src 'self'

4 participants