@override
()
| 153 | |
| 154 | /** @override */ |
| 155 | buildCallback() { |
| 156 | this.sandboxed_ = this.element.hasAttribute('sandboxed'); |
| 157 | this.nodom_ = this.sandboxed_ || this.element.hasAttribute('nodom'); |
| 158 | this.development_ = |
| 159 | this.element.hasAttribute('data-ampdevmode') || |
| 160 | this.element.ownerDocument.documentElement.hasAttribute( |
| 161 | 'data-ampdevmode' |
| 162 | ); |
| 163 | |
| 164 | if (this.development_) { |
| 165 | user().warn( |
| 166 | TAG, |
| 167 | 'JavaScript size and script hash requirements are disabled in development mode.', |
| 168 | this.element |
| 169 | ); |
| 170 | } |
| 171 | |
| 172 | if ( |
| 173 | this.nodom_ && |
| 174 | (this.element.hasAttribute('width') || |
| 175 | this.element.hasAttribute('height') || |
| 176 | this.element.hasAttribute('layout')) |
| 177 | ) { |
| 178 | user().warn( |
| 179 | TAG, |
| 180 | 'Cannot set width, height, or layout of a nodom <amp-script>', |
| 181 | this.element |
| 182 | ); |
| 183 | } |
| 184 | |
| 185 | return getElementServiceForDoc(this.element, TAG, TAG).then((service) => { |
| 186 | this.setService(/** @type {!AmpScriptService} */ (service)); |
| 187 | }); |
| 188 | } |
| 189 | |
| 190 | /** |
| 191 | * @override |
no test coverage detected