testing/web-platform/tests/html/dom/documents/dom-tree-accessors/nameditem-08.html
author Shane Hughes <shughes@mozilla.com>
Sat, 24 Sep 2022 00:00:46 +0000
changeset 636388 50f72898d7b8b88985dc5d7595007b426a46c93e
parent 382605 3a93e822c501a73ca645c0361332560056fa04de
permissions -rw-r--r--
Bug 1789644 - Add a pref toggle for QuickActions, separate from the pref for suggestions. r=mak,daleharvey Change the behavior of the QuickActions provider, so that setting the pref `quickactions.enabled` to false will prevent showing quick action results in all contexts, while setting `suggest.quickactions` to false will only prevent showing quick action results in the default search mode (i.e., quick action results will still appear in the Quick Actions search mode enabled by typing `> ` in the urlbar). Differential Revision: https://phabricator.services.mozilla.com/D157702

<!DOCTYPE html>
<meta charset=utf-8>
<title>Named items: duplicate id attributes for object and img</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/dom.html#dom-document-nameditem">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<div id="test">
<div id=test2></div>
<object id=test2></object>

<div id=test3></div>
<img id=test3 name=non-empty>
</div>
<script>
test(function() {
  var object = document.querySelector("object");
  assert_equals(object.id, "test2");

  assert_true("test2" in document);
  assert_equals(document.test2, object);
}, "If there is a div and object with same id, the object should be returned");

test(function() {
  var img = document.querySelector("img");
  assert_equals(img.id, "test3");

  assert_true("test3" in document);
  assert_equals(document.test3, img);
}, "If there is a div and img with same id, the img should be returned");
</script>