|
@@ 1060-1094 (lines=35) @@
|
| 1057 |
|
} |
| 1058 |
|
} |
| 1059 |
|
|
| 1060 |
|
private function attributeValueDoubleQuotedState() |
| 1061 |
|
{ |
| 1062 |
|
// Consume the next input character: |
| 1063 |
|
$this->char++; |
| 1064 |
|
$char = $this->character($this->char); |
| 1065 |
|
|
| 1066 |
|
if ($char === '"') { |
| 1067 |
|
/* U+0022 QUOTATION MARK (") |
| 1068 |
|
Switch to the before attribute name state. */ |
| 1069 |
|
$this->state = 'beforeAttributeName'; |
| 1070 |
|
|
| 1071 |
|
} elseif ($char === '&') { |
| 1072 |
|
/* U+0026 AMPERSAND (&) |
| 1073 |
|
Switch to the entity in attribute value state. */ |
| 1074 |
|
$this->entityInAttributeValueState('double'); |
| 1075 |
|
|
| 1076 |
|
} elseif ($this->char === $this->EOF) { |
| 1077 |
|
/* EOF |
| 1078 |
|
Parse error. Emit the current tag token. Reconsume the character |
| 1079 |
|
in the data state. */ |
| 1080 |
|
$this->emitToken($this->token); |
| 1081 |
|
|
| 1082 |
|
$this->char--; |
| 1083 |
|
$this->state = 'data'; |
| 1084 |
|
|
| 1085 |
|
} else { |
| 1086 |
|
/* Anything else |
| 1087 |
|
Append the current input character to the current attribute's value. |
| 1088 |
|
Stay in the attribute value (double-quoted) state. */ |
| 1089 |
|
$last = count($this->token['attr']) - 1; |
| 1090 |
|
$this->token['attr'][$last]['value'] .= $char; |
| 1091 |
|
|
| 1092 |
|
$this->state = 'attributeValueDoubleQuoted'; |
| 1093 |
|
} |
| 1094 |
|
} |
| 1095 |
|
|
| 1096 |
|
private function attributeValueSingleQuotedState() |
| 1097 |
|
{ |
|
@@ 1096-1130 (lines=35) @@
|
| 1093 |
|
} |
| 1094 |
|
} |
| 1095 |
|
|
| 1096 |
|
private function attributeValueSingleQuotedState() |
| 1097 |
|
{ |
| 1098 |
|
// Consume the next input character: |
| 1099 |
|
$this->char++; |
| 1100 |
|
$char = $this->character($this->char); |
| 1101 |
|
|
| 1102 |
|
if ($char === '\'') { |
| 1103 |
|
/* U+0022 QUOTATION MARK (') |
| 1104 |
|
Switch to the before attribute name state. */ |
| 1105 |
|
$this->state = 'beforeAttributeName'; |
| 1106 |
|
|
| 1107 |
|
} elseif ($char === '&') { |
| 1108 |
|
/* U+0026 AMPERSAND (&) |
| 1109 |
|
Switch to the entity in attribute value state. */ |
| 1110 |
|
$this->entityInAttributeValueState('single'); |
| 1111 |
|
|
| 1112 |
|
} elseif ($this->char === $this->EOF) { |
| 1113 |
|
/* EOF |
| 1114 |
|
Parse error. Emit the current tag token. Reconsume the character |
| 1115 |
|
in the data state. */ |
| 1116 |
|
$this->emitToken($this->token); |
| 1117 |
|
|
| 1118 |
|
$this->char--; |
| 1119 |
|
$this->state = 'data'; |
| 1120 |
|
|
| 1121 |
|
} else { |
| 1122 |
|
/* Anything else |
| 1123 |
|
Append the current input character to the current attribute's value. |
| 1124 |
|
Stay in the attribute value (single-quoted) state. */ |
| 1125 |
|
$last = count($this->token['attr']) - 1; |
| 1126 |
|
$this->token['attr'][$last]['value'] .= $char; |
| 1127 |
|
|
| 1128 |
|
$this->state = 'attributeValueSingleQuoted'; |
| 1129 |
|
} |
| 1130 |
|
} |
| 1131 |
|
|
| 1132 |
|
private function attributeValueUnquotedState() |
| 1133 |
|
{ |