MCPcopy
hub / github.com/ampproject/amphtml / assertLayout_

Method assertLayout_

src/custom-element.js:425–440  ·  view source on GitHub ↗

@private

()

Source from the content-addressed store, hash-verified

423
424 /** @private */
425 assertLayout_() {
426 if (
427 this.layout_ != Layout_Enum.NODISPLAY &&
428 this.impl_ &&
429 !this.impl_.isLayoutSupported(this.layout_)
430 ) {
431 userAssert(
432 this.getAttribute('layout'),
433 'The element did not specify a layout attribute. ' +
434 'Check https://amp.dev/documentation/guides-and-tutorials/' +
435 'develop/style_and_layout/control_layout and the respective ' +
436 'element documentation for details.'
437 );
438 userAssert(false, `Layout not supported: ${this.layout_}`);
439 }
440 }
441
442 /**
443 * Get the priority to build the element.

Callers 1

completeUpgrade_Method · 0.95

Calls 3

userAssertFunction · 0.90
getAttributeMethod · 0.80
isLayoutSupportedMethod · 0.45

Tested by

no test coverage detected