mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
CSS: retrieve inline style before computed
- Fixes an issue with getting computed style on detached elements
This commit is contained in:
parent
066bd8681c
commit
c4598da429
@ -10,7 +10,13 @@ define( [
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function curCSS( elem, name, computed ) {
|
function curCSS( elem, name, computed ) {
|
||||||
var width, minWidth, maxWidth, ret, style;
|
var width, minWidth, maxWidth, ret,
|
||||||
|
|
||||||
|
// Support: Firefox 51+
|
||||||
|
// Retrieving style before computed somehow
|
||||||
|
// fixes an issue with getting wrong values
|
||||||
|
// on detached elements
|
||||||
|
style = elem.style;
|
||||||
|
|
||||||
computed = computed || getStyles( elem );
|
computed = computed || getStyles( elem );
|
||||||
|
|
||||||
@ -30,7 +36,6 @@ function curCSS( elem, name, computed ) {
|
|||||||
// This is against the CSSOM draft spec:
|
// This is against the CSSOM draft spec:
|
||||||
// https://drafts.csswg.org/cssom/#resolved-values
|
// https://drafts.csswg.org/cssom/#resolved-values
|
||||||
if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
|
if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
|
||||||
style = elem.style;
|
|
||||||
|
|
||||||
// Remember the original values
|
// Remember the original values
|
||||||
width = style.width;
|
width = style.width;
|
||||||
|
Loading…
Reference in New Issue
Block a user