forked from mirrors/gecko-dev
		
	MozReview-Commit-ID: 1KVr5OLKI3 --HG-- rename : testing/web-platform/tests/uievents/ClickFakeEvent.nondocument.html => testing/web-platform/tests/dom/events/Event-dispatch-detached-click.html rename : testing/web-platform/tests/uievents/order-of-events/init-event-while-dispatching.html => testing/web-platform/tests/dom/events/Event-init-while-dispatching.html rename : testing/web-platform/tests/uievents/constructors/constructors.html => testing/web-platform/tests/dom/events/Event-subclasses-constructors.html rename : testing/web-platform/tests/DOM-parsing/createContextualFragment.html => testing/web-platform/tests/domparsing/createContextualFragment.html rename : testing/web-platform/tests/DOM-parsing/innerhtml-01.xhtml => testing/web-platform/tests/domparsing/innerhtml-01.xhtml rename : testing/web-platform/tests/DOM-parsing/innerhtml-03.xhtml => testing/web-platform/tests/domparsing/innerhtml-03.xhtml rename : testing/web-platform/tests/DOM-parsing/innerhtml-04.html => testing/web-platform/tests/domparsing/innerhtml-04.html rename : testing/web-platform/tests/DOM-parsing/innerhtml-05.xhtml => testing/web-platform/tests/domparsing/innerhtml-05.xhtml rename : testing/web-platform/tests/DOM-parsing/innerhtml-07.html => testing/web-platform/tests/domparsing/innerhtml-07.html rename : testing/web-platform/tests/DOM-parsing/insert_adjacent_html.html => testing/web-platform/tests/domparsing/insert_adjacent_html.html rename : testing/web-platform/tests/DOM-parsing/insert_adjacent_html.js => testing/web-platform/tests/domparsing/insert_adjacent_html.js rename : testing/web-platform/tests/DOM-parsing/insert_adjacent_html.xhtml => testing/web-platform/tests/domparsing/insert_adjacent_html.xhtml rename : testing/web-platform/tests/DOM-parsing/outerhtml-01.html => testing/web-platform/tests/domparsing/outerhtml-01.html rename : testing/web-platform/tests/DOM-parsing/outerhtml-02.html => testing/web-platform/tests/domparsing/outerhtml-02.html rename : testing/web-platform/tests/DOM-parsing/xml-serialization.xhtml => testing/web-platform/tests/domparsing/xml-serialization.xhtml
		
			
				
	
	
		
			33 lines
		
	
	
	
		
			1.5 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
	
		
			1.5 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
function testThrowingNoParent(element, desc) {
 | 
						|
  test(function() {
 | 
						|
    assert_throws("NO_MODIFICATION_ALLOWED_ERR",
 | 
						|
      function() { element.insertAdjacentHTML("afterend", "") }
 | 
						|
    );
 | 
						|
    assert_throws("NO_MODIFICATION_ALLOWED_ERR",
 | 
						|
      function() { element.insertAdjacentHTML("beforebegin", "") }
 | 
						|
    );
 | 
						|
    assert_throws("NO_MODIFICATION_ALLOWED_ERR",
 | 
						|
      function() { element.insertAdjacentHTML("afterend", "foo") }
 | 
						|
    );
 | 
						|
    assert_throws("NO_MODIFICATION_ALLOWED_ERR",
 | 
						|
      function() { element.insertAdjacentHTML("beforebegin", "foo") }
 | 
						|
    );
 | 
						|
  }, "When the parent node is " + desc + ", insertAdjacentHTML should throw for beforebegin and afterend (text)");
 | 
						|
  test(function() {
 | 
						|
    assert_throws("NO_MODIFICATION_ALLOWED_ERR",
 | 
						|
      function() { element.insertAdjacentHTML("afterend", "<!-- fail -->") }
 | 
						|
    );
 | 
						|
    assert_throws("NO_MODIFICATION_ALLOWED_ERR",
 | 
						|
      function() { element.insertAdjacentHTML("beforebegin", "<!-- fail -->") }
 | 
						|
    );
 | 
						|
  }, "When the parent node is " + desc + ", insertAdjacentHTML should throw for beforebegin and afterend (comments)");
 | 
						|
  test(function() {
 | 
						|
    assert_throws("NO_MODIFICATION_ALLOWED_ERR",
 | 
						|
      function() { element.insertAdjacentHTML("afterend", "<div></div>") }
 | 
						|
    );
 | 
						|
    assert_throws("NO_MODIFICATION_ALLOWED_ERR",
 | 
						|
      function() { element.insertAdjacentHTML("beforebegin", "<div></div>") }
 | 
						|
    );
 | 
						|
  }, "When the parent node is " + desc + ", insertAdjacentHTML should throw for beforebegin and afterend (elements)");
 | 
						|
}
 | 
						|
 |