|
@@ 2857-2881 (lines=25) @@
|
| 2854 |
|
case 'menu': |
| 2855 |
|
case 'ol': |
| 2856 |
|
case 'pre': |
| 2857 |
|
case 'ul': |
| 2858 |
|
/* If the stack of open elements has an element in scope |
| 2859 |
|
with the same tag name as that of the token, then generate |
| 2860 |
|
implied end tags. */ |
| 2861 |
|
if ($this->elementInScope($token['name'])) { |
| 2862 |
|
$this->generateImpliedEndTags(); |
| 2863 |
|
|
| 2864 |
|
/* Now, if the current node is not an element with |
| 2865 |
|
the same tag name as that of the token, then this |
| 2866 |
|
is a parse error. */ |
| 2867 |
|
// w/e |
| 2868 |
|
|
| 2869 |
|
/* If the stack of open elements has an element in |
| 2870 |
|
scope with the same tag name as that of the token, |
| 2871 |
|
then pop elements from this stack until an element |
| 2872 |
|
with that tag name has been popped from the stack. */ |
| 2873 |
|
for ($n = count($this->stack) - 1; $n >= 0; $n--) { |
| 2874 |
|
if ($this->stack[$n]->nodeName === $token['name']) { |
| 2875 |
|
$n = -1; |
| 2876 |
|
} |
| 2877 |
|
|
| 2878 |
|
array_pop($this->stack); |
| 2879 |
|
} |
| 2880 |
|
} |
| 2881 |
|
break; |
| 2882 |
|
|
| 2883 |
|
/* An end tag whose tag name is "form" */ |
| 2884 |
|
case 'form': |
|
@@ 2938-2962 (lines=25) @@
|
| 2935 |
|
/* An end tag whose tag name is "dd", "dt", or "li" */ |
| 2936 |
|
case 'dd': |
| 2937 |
|
case 'dt': |
| 2938 |
|
case 'li': |
| 2939 |
|
/* If the stack of open elements has an element in scope |
| 2940 |
|
whose tag name matches the tag name of the token, then |
| 2941 |
|
generate implied end tags, except for elements with the |
| 2942 |
|
same tag name as the token. */ |
| 2943 |
|
if ($this->elementInScope($token['name'])) { |
| 2944 |
|
$this->generateImpliedEndTags(array($token['name'])); |
| 2945 |
|
|
| 2946 |
|
/* If the current node is not an element with the same |
| 2947 |
|
tag name as the token, then this is a parse error. */ |
| 2948 |
|
// w/e |
| 2949 |
|
|
| 2950 |
|
/* If the stack of open elements has an element in scope |
| 2951 |
|
whose tag name matches the tag name of the token, then |
| 2952 |
|
pop elements from this stack until an element with that |
| 2953 |
|
tag name has been popped from the stack. */ |
| 2954 |
|
for ($n = count($this->stack) - 1; $n >= 0; $n--) { |
| 2955 |
|
if ($this->stack[$n]->nodeName === $token['name']) { |
| 2956 |
|
$n = -1; |
| 2957 |
|
} |
| 2958 |
|
|
| 2959 |
|
array_pop($this->stack); |
| 2960 |
|
} |
| 2961 |
|
} |
| 2962 |
|
break; |
| 2963 |
|
|
| 2964 |
|
/* An end tag whose tag name is one of: "h1", "h2", "h3", "h4", |
| 2965 |
|
"h5", "h6" */ |