1--TEST--
2CSS Selectors - Quirks mode test
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8require __DIR__ . '/test_utils.inc';
9
10echo "\n=== Document in quirks mode ===\n\n";
11
12$dom = DOM\HTMLDocument::createFromString(<<<HTML
13<html>
14    <div class="HElLoWorLD"/>
15    <div id="hI"/>
16</html>
17HTML, LIBXML_NOERROR);
18
19test_helper($dom, 'div.helloworld');
20test_helper($dom, 'div.HElLoWorLD');
21test_helper($dom, '#hi');
22test_helper($dom, '#hI');
23
24echo "\n=== Document not in quirks mode ===\n\n";
25
26$dom = DOM\HTMLDocument::createFromString(<<<HTML
27<!DOCTYPE html>
28<html>
29    <div class="HElLoWorLD"/>
30    <div id="hI"/>
31</html>
32HTML, LIBXML_NOERROR);
33
34test_helper($dom, 'div.helloworld');
35test_helper($dom, 'div.HElLoWorLD');
36test_helper($dom, '#hi');
37test_helper($dom, '#hI');
38
39?>
40--EXPECT--
41=== Document in quirks mode ===
42
43--- Selector: div.helloworld ---
44<div xmlns="http://www.w3.org/1999/xhtml" class="HElLoWorLD">
45    <div id="hI">
46</div></div>
47--- Selector: div.HElLoWorLD ---
48<div xmlns="http://www.w3.org/1999/xhtml" class="HElLoWorLD">
49    <div id="hI">
50</div></div>
51--- Selector: #hi ---
52<div xmlns="http://www.w3.org/1999/xhtml" id="hI">
53</div>
54--- Selector: #hI ---
55<div xmlns="http://www.w3.org/1999/xhtml" id="hI">
56</div>
57
58=== Document not in quirks mode ===
59
60--- Selector: div.helloworld ---
61--- Selector: div.HElLoWorLD ---
62<div xmlns="http://www.w3.org/1999/xhtml" class="HElLoWorLD">
63    <div id="hI">
64</div></div>
65--- Selector: #hi ---
66--- Selector: #hI ---
67<div xmlns="http://www.w3.org/1999/xhtml" id="hI">
68</div>
69