@private
()
| 1043 | |
| 1044 | /** @private */ |
| 1045 | applyMediaAttrs_() { |
| 1046 | const props = this.mediaQueryProps_; |
| 1047 | if (!props) { |
| 1048 | return; |
| 1049 | } |
| 1050 | |
| 1051 | props.start(); |
| 1052 | |
| 1053 | // Media query. |
| 1054 | const mediaAttr = this.getAttribute('media') || null; |
| 1055 | const matchesMedia = mediaAttr |
| 1056 | ? props.resolveMatchQuery(mediaAttr) |
| 1057 | : true; |
| 1058 | this.classList.toggle('i-amphtml-hidden-by-media-query', !matchesMedia); |
| 1059 | |
| 1060 | // Sizes. |
| 1061 | const sizesAttr = this.hasAttribute('disable-inline-width') |
| 1062 | ? null |
| 1063 | : this.getAttribute('sizes'); |
| 1064 | if (sizesAttr) { |
| 1065 | setStyle(this, 'width', props.resolveListQuery(sizesAttr)); |
| 1066 | } |
| 1067 | |
| 1068 | // Heights. |
| 1069 | const heightsAttr = |
| 1070 | this.layout_ === Layout_Enum.RESPONSIVE |
| 1071 | ? this.getAttribute('heights') |
| 1072 | : null; |
| 1073 | if (heightsAttr) { |
| 1074 | const sizer = this.getSizer_(); |
| 1075 | if (sizer) { |
| 1076 | setStyle(sizer, 'paddingTop', props.resolveListQuery(heightsAttr)); |
| 1077 | } |
| 1078 | } |
| 1079 | |
| 1080 | props.complete(); |
| 1081 | this.getResource_().requestMeasure(); |
| 1082 | } |
| 1083 | |
| 1084 | /** |
| 1085 | * Applies a size change to the element. |
no test coverage detected