1--TEST--
2CSS Selectors - Pseudo classes: disabled/enabled
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8require __DIR__ . '/test_utils.inc';
9
10$dom = DOM\XMLDocument::createFromString(<<<XML
11<html xmlns="http://www.w3.org/1999/xhtml">
12    <button/>
13    <button xmlns="" disabled="disabled"/>
14    <button disabled="disabled"/>
15    <input disabled="disabled"/>
16    <select disabled="disabled"/>
17    <textarea disabled="disabled"/>
18    <optgroup disabled="disabled"/>
19
20    <!-- fieldset rules are complicated -->
21    <fieldset disabled="disabled"/>
22    <fieldset disabled="disabled">
23        <fieldset id="1"/>
24    </fieldset>
25    <fieldset disabled="disabled">
26        <!-- foo -->
27        <legend>
28            <div>
29                <fieldset id="2"/>
30            </div>
31        </legend>
32        <div>
33            <fieldset id="3"/>
34        </div>
35    </fieldset>
36</html>
37XML);
38
39test_helper($dom, '*:disabled');
40test_helper($dom, '*:enabled');
41
42?>
43--EXPECT--
44--- Selector: *:disabled ---
45<button xmlns="http://www.w3.org/1999/xhtml" disabled="disabled"></button>
46<input xmlns="http://www.w3.org/1999/xhtml" disabled="disabled" />
47<select xmlns="http://www.w3.org/1999/xhtml" disabled="disabled"></select>
48<textarea xmlns="http://www.w3.org/1999/xhtml" disabled="disabled"></textarea>
49<optgroup xmlns="http://www.w3.org/1999/xhtml" disabled="disabled"></optgroup>
50<fieldset xmlns="http://www.w3.org/1999/xhtml" disabled="disabled"></fieldset>
51<fieldset xmlns="http://www.w3.org/1999/xhtml" disabled="disabled">
52        <fieldset id="1"></fieldset>
53    </fieldset>
54<fieldset xmlns="http://www.w3.org/1999/xhtml" disabled="disabled">
55        <!-- foo -->
56        <legend>
57            <div>
58                <fieldset id="2"></fieldset>
59            </div>
60        </legend>
61        <div>
62            <fieldset id="3"></fieldset>
63        </div>
64    </fieldset>
65<fieldset xmlns="http://www.w3.org/1999/xhtml" id="3"></fieldset>
66--- Selector: *:enabled ---
67<html xmlns="http://www.w3.org/1999/xhtml">
68    <button></button>
69    <button xmlns="" disabled="disabled"/>
70    <button disabled="disabled"></button>
71    <input disabled="disabled" />
72    <select disabled="disabled"></select>
73    <textarea disabled="disabled"></textarea>
74    <optgroup disabled="disabled"></optgroup>
75
76    <!-- fieldset rules are complicated -->
77    <fieldset disabled="disabled"></fieldset>
78    <fieldset disabled="disabled">
79        <fieldset id="1"></fieldset>
80    </fieldset>
81    <fieldset disabled="disabled">
82        <!-- foo -->
83        <legend>
84            <div>
85                <fieldset id="2"></fieldset>
86            </div>
87        </legend>
88        <div>
89            <fieldset id="3"></fieldset>
90        </div>
91    </fieldset>
92</html>
93<button xmlns="http://www.w3.org/1999/xhtml"></button>
94<button xmlns="" disabled="disabled"/>
95<fieldset xmlns="http://www.w3.org/1999/xhtml" id="1"></fieldset>
96<legend xmlns="http://www.w3.org/1999/xhtml">
97            <div>
98                <fieldset id="2"></fieldset>
99            </div>
100        </legend>
101<div xmlns="http://www.w3.org/1999/xhtml">
102                <fieldset id="2"></fieldset>
103            </div>
104<fieldset xmlns="http://www.w3.org/1999/xhtml" id="2"></fieldset>
105<div xmlns="http://www.w3.org/1999/xhtml">
106            <fieldset id="3"></fieldset>
107        </div>
108