diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2023-07-10 18:33:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-10 18:33:05 +0200 |
commit | 65b85031fb5688361c077bc04e641e4b502671e1 (patch) | |
tree | 0f2c86db330f907d8a0757622bd6520e541350a5 /test | |
parent | e24218758bb21bfdc296731d70f3d48ab786e5f5 (diff) | |
download | jquery-65b85031fb5688361c077bc04e641e4b502671e1.tar.gz jquery-65b85031fb5688361c077bc04e641e4b502671e1.zip |
CSS: Make the reliableTrDimensions support test work with Bootstrap CSS
Bootstrap 5 includes the following CSS on the page:
```css
*,
*::before,
*::after {
box-sizing: border-box;
}
```
That threw our `reliableTrDimensions` support test off. This change fixes the
support test and adds a unit test ensuring support test values on a page
including Bootstrap 5 CSS are the same as on a page without it.
Fixes gh-5270
Closes gh-5278
Ref gh-5279
Diffstat (limited to 'test')
-rw-r--r-- | test/data/support/bootstrap.html | 20 | ||||
-rw-r--r-- | test/unit/support.js | 12 |
2 files changed, 32 insertions, 0 deletions
diff --git a/test/data/support/bootstrap.html b/test/data/support/bootstrap.html new file mode 100644 index 000000000..d8e643ac2 --- /dev/null +++ b/test/data/support/bootstrap.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8" /> + <link rel="stylesheet" href="../../../external/bootstrap/bootstrap.min.css" class="stylesheet"> +</head> +<body> +<div> + <script src="../../jquery.js"></script> + <script src="../iframeTest.js"></script> + <script src="getComputedSupport.js"></script> +</div> +<script> + startIframeTest( + getComputedStyle( document.body ), + getComputedSupport( jQuery.support ) + ); +</script> +</body> +</html> diff --git a/test/unit/support.js b/test/unit/support.js index 05e669de3..f9ae2718e 100644 --- a/test/unit/support.js +++ b/test/unit/support.js @@ -54,6 +54,18 @@ testIframe( } ); +testIframe( + "Verify correctness of support tests with bootstrap CSS on the page", + "support/bootstrap.html", + function( assert, jQuery, window, document, bodyStyle, support ) { + assert.expect( 2 ); + assert.strictEqual( bodyStyle.boxSizing, "border-box", + "border-box applied on body by Bootstrap" ); + assert.deepEqual( jQuery.extend( {}, support ), computedSupport, + "Same support properties" ); + } +); + ( function() { var expected, browserKey, userAgent = window.navigator.userAgent, |