Changeset 58679
- Timestamp:
- 07/05/2024 04:37:41 PM (8 months ago)
- Location:
- trunk/src/wp-includes/html-api
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/html-api/class-wp-html-processor-state.php
r58656 r58679 49 49 50 50 /** 51 * Before HTML insertion mode for full HTML parser. 52 * 53 * @since 6.4.0 54 * 55 * @see https://html.spec.whatwg.org/#the-before-html-insertion-mode 56 * @see WP_HTML_Processor_State::$insertion_mode 57 * 58 * @var string 59 */ 60 const INSERTION_MODE_BEFORE_HTML = 'insertion-mode-before-html'; 61 62 /** 63 * Before head insertion mode for full HTML parser. 64 * 65 * @since 6.7.0 66 * 67 * @see https://html.spec.whatwg.org/#parsing-main-beforehead 68 * @see WP_HTML_Processor_State::$insertion_mode 69 * 70 * @var string 71 */ 72 const INSERTION_MODE_BEFORE_HEAD = 'insertion-mode-before-head'; 73 74 /** 75 * In head insertion mode for full HTML parser. 76 * 77 * @since 6.7.0 78 * 79 * @see https://html.spec.whatwg.org/#parsing-main-inhead 80 * @see WP_HTML_Processor_State::$insertion_mode 81 * 82 * @var string 83 */ 84 const INSERTION_MODE_IN_HEAD = 'insertion-mode-in-head'; 85 86 /** 87 * In head noscript insertion mode for full HTML parser. 88 * 89 * @since 6.7.0 90 * 91 * @see https://html.spec.whatwg.org/#parsing-main-inheadnoscript 92 * @see WP_HTML_Processor_State::$insertion_mode 93 * 94 * @var string 95 */ 96 const INSERTION_MODE_IN_HEAD_NOSCRIPT = 'insertion-mode-in-head-noscript'; 97 98 /** 99 * After head insertion mode for full HTML parser. 100 * 101 * @since 6.7.0 102 * 103 * @see https://html.spec.whatwg.org/#parsing-main-afterhead 104 * @see WP_HTML_Processor_State::$insertion_mode 105 * 106 * @var string 107 */ 108 const INSERTION_MODE_AFTER_HEAD = 'insertion-mode-after-head'; 109 110 /** 51 111 * In body insertion mode for full HTML parser. 52 112 * … … 61 121 62 122 /** 123 * In table insertion mode for full HTML parser. 124 * 125 * @since 6.7.0 126 * 127 * @see https://html.spec.whatwg.org/#parsing-main-intable 128 * @see WP_HTML_Processor_State::$insertion_mode 129 * 130 * @var string 131 */ 132 const INSERTION_MODE_IN_TABLE = 'insertion-mode-in-table'; 133 134 /** 135 * In table text insertion mode for full HTML parser. 136 * 137 * @since 6.7.0 138 * 139 * @see https://html.spec.whatwg.org/#parsing-main-intabletext 140 * @see WP_HTML_Processor_State::$insertion_mode 141 * 142 * @var string 143 */ 144 const INSERTION_MODE_IN_TABLE_TEXT = 'insertion-mode-in-table-text'; 145 146 /** 147 * In caption insertion mode for full HTML parser. 148 * 149 * @since 6.7.0 150 * 151 * @see https://html.spec.whatwg.org/#parsing-main-incaption 152 * @see WP_HTML_Processor_State::$insertion_mode 153 * 154 * @var string 155 */ 156 const INSERTION_MODE_IN_CAPTION = 'insertion-mode-in-caption'; 157 158 /** 159 * In column group insertion mode for full HTML parser. 160 * 161 * @since 6.7.0 162 * 163 * @see https://html.spec.whatwg.org/#parsing-main-incolumngroup 164 * @see WP_HTML_Processor_State::$insertion_mode 165 * 166 * @var string 167 */ 168 const INSERTION_MODE_IN_COLUMN_GROUP = 'insertion-mode-in-column-group'; 169 170 /** 171 * In table body insertion mode for full HTML parser. 172 * 173 * @since 6.7.0 174 * 175 * @see https://html.spec.whatwg.org/#parsing-main-intablebody 176 * @see WP_HTML_Processor_State::$insertion_mode 177 * 178 * @var string 179 */ 180 const INSERTION_MODE_IN_TABLE_BODY = 'insertion-mode-in-table-body'; 181 182 /** 183 * In row insertion mode for full HTML parser. 184 * 185 * @since 6.7.0 186 * 187 * @see https://html.spec.whatwg.org/#parsing-main-inrow 188 * @see WP_HTML_Processor_State::$insertion_mode 189 * 190 * @var string 191 */ 192 const INSERTION_MODE_IN_ROW = 'insertion-mode-in-row'; 193 194 /** 195 * In cell insertion mode for full HTML parser. 196 * 197 * @since 6.7.0 198 * 199 * @see https://html.spec.whatwg.org/#parsing-main-incell 200 * @see WP_HTML_Processor_State::$insertion_mode 201 * 202 * @var string 203 */ 204 const INSERTION_MODE_IN_CELL = 'insertion-mode-in-cell'; 205 206 /** 63 207 * In select insertion mode for full HTML parser. 64 208 * … … 85 229 86 230 /** 87 * In table insertion mode for full HTML parser. 88 * 89 * @since 6.7.0 90 * 91 * @see https://html.spec.whatwg.org/#parsing-main-intable 92 * @see WP_HTML_Processor_State::$insertion_mode 93 * 94 * @var string 95 */ 96 const INSERTION_MODE_IN_TABLE = 'insertion-mode-in-table'; 97 98 /** 99 * In caption insertion mode for full HTML parser. 100 * 101 * @since 6.7.0 102 * 103 * @see https://html.spec.whatwg.org/#parsing-main-incaption 104 * @see WP_HTML_Processor_State::$insertion_mode 105 * 106 * @var string 107 */ 108 const INSERTION_MODE_IN_CAPTION = 'insertion-mode-in-caption'; 109 110 /** 111 * In table body insertion mode for full HTML parser. 112 * 113 * @since 6.7.0 114 * 115 * @see https://html.spec.whatwg.org/#parsing-main-intablebody 116 * @see WP_HTML_Processor_State::$insertion_mode 117 * 118 * @var string 119 */ 120 const INSERTION_MODE_IN_TABLE_BODY = 'insertion-mode-in-table-body'; 121 122 /** 123 * In row insertion mode for full HTML parser. 124 * 125 * @since 6.7.0 126 * 127 * @see https://html.spec.whatwg.org/#parsing-main-inrow 128 * @see WP_HTML_Processor_State::$insertion_mode 129 * 130 * @var string 131 */ 132 const INSERTION_MODE_IN_ROW = 'insertion-mode-in-row'; 133 134 /** 135 * In cell insertion mode for full HTML parser. 136 * 137 * @since 6.7.0 138 * 139 * @see https://html.spec.whatwg.org/#parsing-main-incell 140 * @see WP_HTML_Processor_State::$insertion_mode 141 * 142 * @var string 143 */ 144 const INSERTION_MODE_IN_CELL = 'insertion-mode-in-cell'; 145 146 /** 147 * In column group insertion mode for full HTML parser. 148 * 149 * @since 6.7.0 150 * 151 * @see https://html.spec.whatwg.org/#parsing-main-incolumngroup 152 * @see WP_HTML_Processor_State::$insertion_mode 153 * 154 * @var string 155 */ 156 const INSERTION_MODE_IN_COLUMN_GROUP = 'insertion-mode-in-column-group'; 231 * In template insertion mode for full HTML parser. 232 * 233 * @since 6.7.0 234 * 235 * @see https://html.spec.whatwg.org/#parsing-main-intemplate 236 * @see WP_HTML_Processor_State::$insertion_mode 237 * 238 * @var string 239 */ 240 const INSERTION_MODE_IN_TEMPLATE = 'insertion-mode-in-template'; 241 242 /** 243 * After body insertion mode for full HTML parser. 244 * 245 * @since 6.7.0 246 * 247 * @see https://html.spec.whatwg.org/#parsing-main-afterbody 248 * @see WP_HTML_Processor_State::$insertion_mode 249 * 250 * @var string 251 */ 252 const INSERTION_MODE_AFTER_BODY = 'insertion-mode-after-body'; 157 253 158 254 /** … … 169 265 170 266 /** 171 * In headinsertion mode for full HTML parser.172 * 173 * @since 6.7.0 174 * 175 * @see https://html.spec.whatwg.org/#parsing-main- inhead176 * @see WP_HTML_Processor_State::$insertion_mode 177 * 178 * @var string 179 */ 180 const INSERTION_MODE_ IN_HEAD = 'insertion-mode-in-head';181 182 /** 183 * Before headinsertion mode for full HTML parser.184 * 185 * @since 6.7.0 186 * 187 * @see https://html.spec.whatwg.org/# parsing-main-beforehead188 * @see WP_HTML_Processor_State::$insertion_mode 189 * 190 * @var string 191 */ 192 const INSERTION_MODE_ BEFORE_HEAD = 'insertion-mode-before-head';193 194 /** 195 * After headinsertion mode for full HTML parser.196 * 197 * @since 6.7.0 198 * 199 * @see https://html.spec.whatwg.org/# parsing-main-afterhead200 * @see WP_HTML_Processor_State::$insertion_mode 201 * 202 * @var string 203 */ 204 const INSERTION_MODE_AFTER_ HEAD = 'insertion-mode-after-head';205 206 /** 207 * In templateinsertion mode for full HTML parser.208 * 209 * @since 6.7.0 210 * 211 * @see https://html.spec.whatwg.org/#parsing-main-in template212 * @see WP_HTML_Processor_State::$insertion_mode 213 * 214 * @var string 215 */ 216 const INSERTION_MODE_IN_ TEMPLATE = 'insertion-mode-in-template';267 * After frameset insertion mode for full HTML parser. 268 * 269 * @since 6.7.0 270 * 271 * @see https://html.spec.whatwg.org/#parsing-main-afterframeset 272 * @see WP_HTML_Processor_State::$insertion_mode 273 * 274 * @var string 275 */ 276 const INSERTION_MODE_AFTER_FRAMESET = 'insertion-mode-after-frameset'; 277 278 /** 279 * After after body insertion mode for full HTML parser. 280 * 281 * @since 6.7.0 282 * 283 * @see https://html.spec.whatwg.org/#the-after-after-body-insertion-mode 284 * @see WP_HTML_Processor_State::$insertion_mode 285 * 286 * @var string 287 */ 288 const INSERTION_MODE_AFTER_AFTER_BODY = 'insertion-mode-after-after-body'; 289 290 /** 291 * After after frameset insertion mode for full HTML parser. 292 * 293 * @since 6.7.0 294 * 295 * @see https://html.spec.whatwg.org/#the-after-after-frameset-insertion-mode 296 * @see WP_HTML_Processor_State::$insertion_mode 297 * 298 * @var string 299 */ 300 const INSERTION_MODE_AFTER_AFTER_FRAMESET = 'insertion-mode-after-after-frameset'; 301 302 /** 303 * In foreign content insertion mode for full HTML parser. 304 * 305 * @since 6.7.0 306 * 307 * @see https://html.spec.whatwg.org/#parsing-main-inforeign 308 * @see WP_HTML_Processor_State::$insertion_mode 309 * 310 * @var string 311 */ 312 const INSERTION_MODE_IN_FOREIGN_CONTENT = 'insertion-mode-in-foreign-content'; 217 313 218 314 /** -
trunk/src/wp-includes/html-api/class-wp-html-processor.php
r58677 r58679 755 755 try { 756 756 switch ( $this->state->insertion_mode ) { 757 case WP_HTML_Processor_State::INSERTION_MODE_INITIAL: 758 return $this->step_initial(); 759 760 case WP_HTML_Processor_State::INSERTION_MODE_BEFORE_HTML: 761 return $this->step_before_html(); 762 763 case WP_HTML_Processor_State::INSERTION_MODE_BEFORE_HEAD: 764 return $this->step_before_head(); 765 766 case WP_HTML_Processor_State::INSERTION_MODE_IN_HEAD: 767 return $this->step_in_head(); 768 769 case WP_HTML_Processor_State::INSERTION_MODE_IN_HEAD_NOSCRIPT: 770 return $this->step_in_head_noscript(); 771 772 case WP_HTML_Processor_State::INSERTION_MODE_AFTER_HEAD: 773 return $this->step_after_head(); 774 757 775 case WP_HTML_Processor_State::INSERTION_MODE_IN_BODY: 758 776 return $this->step_in_body(); 759 777 760 case WP_HTML_Processor_State::INSERTION_MODE_IN_HEAD: 761 return $this->step_in_head(); 778 case WP_HTML_Processor_State::INSERTION_MODE_IN_TABLE: 779 return $this->step_in_table(); 780 781 case WP_HTML_Processor_State::INSERTION_MODE_IN_TABLE_TEXT: 782 return $this->step_in_table_text(); 783 784 case WP_HTML_Processor_State::INSERTION_MODE_IN_CAPTION: 785 return $this->step_in_caption(); 786 787 case WP_HTML_Processor_State::INSERTION_MODE_IN_COLUMN_GROUP: 788 return $this->step_in_column_group(); 789 790 case WP_HTML_Processor_State::INSERTION_MODE_IN_TABLE_BODY: 791 return $this->step_in_table_body(); 792 793 case WP_HTML_Processor_State::INSERTION_MODE_IN_ROW: 794 return $this->step_in_row(); 795 796 case WP_HTML_Processor_State::INSERTION_MODE_IN_CELL: 797 return $this->step_in_cell(); 762 798 763 799 case WP_HTML_Processor_State::INSERTION_MODE_IN_SELECT: 764 800 return $this->step_in_select(); 765 801 802 case WP_HTML_Processor_State::INSERTION_MODE_IN_SELECT_IN_TABLE: 803 return $this->step_in_select_in_table(); 804 805 case WP_HTML_Processor_State::INSERTION_MODE_IN_TEMPLATE: 806 return $this->step_in_template(); 807 808 case WP_HTML_Processor_State::INSERTION_MODE_AFTER_BODY: 809 return $this->step_after_body(); 810 811 case WP_HTML_Processor_State::INSERTION_MODE_IN_FRAMESET: 812 return $this->step_in_frameset(); 813 814 case WP_HTML_Processor_State::INSERTION_MODE_AFTER_FRAMESET: 815 return $this->step_after_frameset(); 816 817 case WP_HTML_Processor_State::INSERTION_MODE_AFTER_AFTER_BODY: 818 return $this->step_after_after_body(); 819 820 case WP_HTML_Processor_State::INSERTION_MODE_AFTER_AFTER_FRAMESET: 821 return $this->step_after_after_frameset(); 822 823 case WP_HTML_Processor_State::INSERTION_MODE_IN_FOREIGN_CONTENT: 824 return $this->step_in_foreign_content(); 825 826 // This should be unreachable but PHP doesn't have total type checking on switch. 766 827 default: 767 828 $this->last_error = self::ERROR_UNSUPPORTED; 768 throw new WP_HTML_Unsupported_Exception( " No support for parsing in the '{$this->state->insertion_mode}' state." );829 throw new WP_HTML_Unsupported_Exception( "Found unrecognized insertion mode '{$this->state->insertion_mode}'." ); 769 830 } 770 831 } catch ( WP_HTML_Unsupported_Exception $e ) { … … 869 930 ? count( $this->get_breadcrumbs() ) 870 931 : $this->state->stack_of_open_elements->count(); 932 } 933 934 /** 935 * Parses next element in the 'initial' insertion mode. 936 * 937 * This internal function performs the 'initial' insertion mode 938 * logic for the generalized WP_HTML_Processor::step() function. 939 * 940 * @since 6.7.0 941 * 942 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 943 * 944 * @see https://html.spec.whatwg.org/#the-initial-insertion-mode 945 * @see WP_HTML_Processor::step 946 * 947 * @return bool Whether an element was found. 948 */ 949 private function step_initial() { 950 $this->last_error = self::ERROR_UNSUPPORTED; 951 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 952 } 953 954 /** 955 * Parses next element in the 'before html' insertion mode. 956 * 957 * This internal function performs the 'before html' insertion mode 958 * logic for the generalized WP_HTML_Processor::step() function. 959 * 960 * @since 6.7.0 Stub implementation. 961 * 962 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 963 * 964 * @see https://html.spec.whatwg.org/#the-before-html-insertion-mode 965 * @see WP_HTML_Processor::step 966 * 967 * @return bool Whether an element was found. 968 */ 969 private function step_before_html() { 970 $this->last_error = self::ERROR_UNSUPPORTED; 971 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 972 } 973 974 /** 975 * Parses next element in the 'before head' insertion mode. 976 * 977 * This internal function performs the 'before head' insertion mode 978 * logic for the generalized WP_HTML_Processor::step() function. 979 * 980 * @since 6.7.0 Stub implementation. 981 * 982 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 983 * 984 * @see https://html.spec.whatwg.org/#the-before-head-insertion-mode 985 * @see WP_HTML_Processor::step 986 * 987 * @return bool Whether an element was found. 988 */ 989 private function step_before_head() { 990 $this->last_error = self::ERROR_UNSUPPORTED; 991 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 992 } 993 994 /** 995 * Parses next element in the 'in head' insertion mode. 996 * 997 * This internal function performs the 'in head' insertion mode 998 * logic for the generalized WP_HTML_Processor::step() function. 999 * 1000 * @since 6.7.0 Stub implementation. 1001 * 1002 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 1003 * 1004 * @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inhead 1005 * @see WP_HTML_Processor::step 1006 * 1007 * @return bool Whether an element was found. 1008 */ 1009 private function step_in_head() { 1010 $this->last_error = self::ERROR_UNSUPPORTED; 1011 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 1012 } 1013 1014 /** 1015 * Parses next element in the 'in head noscript' insertion mode. 1016 * 1017 * This internal function performs the 'in head noscript' insertion mode 1018 * logic for the generalized WP_HTML_Processor::step() function. 1019 * 1020 * @since 6.7.0 Stub implementation. 1021 * 1022 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 1023 * 1024 * @see https://html.spec.whatwg.org/#parsing-main-inheadnoscript 1025 * @see WP_HTML_Processor::step 1026 * 1027 * @return bool Whether an element was found. 1028 */ 1029 private function step_in_head_noscript() { 1030 $this->last_error = self::ERROR_UNSUPPORTED; 1031 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 1032 } 1033 1034 /** 1035 * Parses next element in the 'after head' insertion mode. 1036 * 1037 * This internal function performs the 'after head' insertion mode 1038 * logic for the generalized WP_HTML_Processor::step() function. 1039 * 1040 * @since 6.7.0 Stub implementation. 1041 * 1042 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 1043 * 1044 * @see https://html.spec.whatwg.org/#the-after-head-insertion-mode 1045 * @see WP_HTML_Processor::step 1046 * 1047 * @return bool Whether an element was found. 1048 */ 1049 private function step_after_head() { 1050 $this->last_error = self::ERROR_UNSUPPORTED; 1051 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 871 1052 } 872 1053 … … 1495 1676 1496 1677 /** 1497 * Parses next element in the 'in head' insertion mode.1498 * 1499 * This internal function performs the 'in head' insertion mode1678 * Parses next element in the 'in table' insertion mode. 1679 * 1680 * This internal function performs the 'in table' insertion mode 1500 1681 * logic for the generalized WP_HTML_Processor::step() function. 1501 1682 * … … 1504 1685 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 1505 1686 * 1506 * @see https://html.spec.whatwg.org/ multipage/parsing.html#parsing-main-inhead1687 * @see https://html.spec.whatwg.org/#parsing-main-intable 1507 1688 * @see WP_HTML_Processor::step 1508 1689 * 1509 1690 * @return bool Whether an element was found. 1510 1691 */ 1511 private function step_in_head() { 1692 private function step_in_table() { 1693 $this->last_error = self::ERROR_UNSUPPORTED; 1694 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 1695 } 1696 1697 /** 1698 * Parses next element in the 'in table text' insertion mode. 1699 * 1700 * This internal function performs the 'in table text' insertion mode 1701 * logic for the generalized WP_HTML_Processor::step() function. 1702 * 1703 * @since 6.7.0 Stub implementation. 1704 * 1705 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 1706 * 1707 * @see https://html.spec.whatwg.org/#parsing-main-intabletext 1708 * @see WP_HTML_Processor::step 1709 * 1710 * @return bool Whether an element was found. 1711 */ 1712 private function step_in_table_text() { 1713 $this->last_error = self::ERROR_UNSUPPORTED; 1714 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 1715 } 1716 1717 /** 1718 * Parses next element in the 'in caption' insertion mode. 1719 * 1720 * This internal function performs the 'in caption' insertion mode 1721 * logic for the generalized WP_HTML_Processor::step() function. 1722 * 1723 * @since 6.7.0 Stub implementation. 1724 * 1725 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 1726 * 1727 * @see https://html.spec.whatwg.org/#parsing-main-incaption 1728 * @see WP_HTML_Processor::step 1729 * 1730 * @return bool Whether an element was found. 1731 */ 1732 private function step_in_caption() { 1733 $this->last_error = self::ERROR_UNSUPPORTED; 1734 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 1735 } 1736 1737 /** 1738 * Parses next element in the 'in column group' insertion mode. 1739 * 1740 * This internal function performs the 'in column group' insertion mode 1741 * logic for the generalized WP_HTML_Processor::step() function. 1742 * 1743 * @since 6.7.0 Stub implementation. 1744 * 1745 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 1746 * 1747 * @see https://html.spec.whatwg.org/#parsing-main-incolgroup 1748 * @see WP_HTML_Processor::step 1749 * 1750 * @return bool Whether an element was found. 1751 */ 1752 private function step_in_column_group() { 1753 $this->last_error = self::ERROR_UNSUPPORTED; 1754 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 1755 } 1756 1757 /** 1758 * Parses next element in the 'in table body' insertion mode. 1759 * 1760 * This internal function performs the 'in table body' insertion mode 1761 * logic for the generalized WP_HTML_Processor::step() function. 1762 * 1763 * @since 6.7.0 Stub implementation. 1764 * 1765 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 1766 * 1767 * @see https://html.spec.whatwg.org/#parsing-main-intbody 1768 * @see WP_HTML_Processor::step 1769 * 1770 * @return bool Whether an element was found. 1771 */ 1772 private function step_in_table_body() { 1773 $this->last_error = self::ERROR_UNSUPPORTED; 1774 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 1775 } 1776 1777 /** 1778 * Parses next element in the 'in row' insertion mode. 1779 * 1780 * This internal function performs the 'in row' insertion mode 1781 * logic for the generalized WP_HTML_Processor::step() function. 1782 * 1783 * @since 6.7.0 Stub implementation. 1784 * 1785 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 1786 * 1787 * @see https://html.spec.whatwg.org/#parsing-main-intr 1788 * @see WP_HTML_Processor::step 1789 * 1790 * @return bool Whether an element was found. 1791 */ 1792 private function step_in_row() { 1793 $this->last_error = self::ERROR_UNSUPPORTED; 1794 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 1795 } 1796 1797 /** 1798 * Parses next element in the 'in cell' insertion mode. 1799 * 1800 * This internal function performs the 'in cell' insertion mode 1801 * logic for the generalized WP_HTML_Processor::step() function. 1802 * 1803 * @since 6.7.0 Stub implementation. 1804 * 1805 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 1806 * 1807 * @see https://html.spec.whatwg.org/#parsing-main-intd 1808 * @see WP_HTML_Processor::step 1809 * 1810 * @return bool Whether an element was found. 1811 */ 1812 private function step_in_cell() { 1512 1813 $this->last_error = self::ERROR_UNSUPPORTED; 1513 1814 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); … … 1693 1994 */ 1694 1995 return $this->step(); 1996 } 1997 1998 /** 1999 * Parses next element in the 'in select in table' insertion mode. 2000 * 2001 * This internal function performs the 'in select in table' insertion mode 2002 * logic for the generalized WP_HTML_Processor::step() function. 2003 * 2004 * @since 6.7.0 Stub implementation. 2005 * 2006 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 2007 * 2008 * @see https://html.spec.whatwg.org/#parsing-main-inselectintable 2009 * @see WP_HTML_Processor::step 2010 * 2011 * @return bool Whether an element was found. 2012 */ 2013 private function step_in_select_in_table() { 2014 $this->last_error = self::ERROR_UNSUPPORTED; 2015 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 2016 } 2017 2018 /** 2019 * Parses next element in the 'in template' insertion mode. 2020 * 2021 * This internal function performs the 'in template' insertion mode 2022 * logic for the generalized WP_HTML_Processor::step() function. 2023 * 2024 * @since 6.7.0 Stub implementation. 2025 * 2026 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 2027 * 2028 * @see https://html.spec.whatwg.org/#parsing-main-intemplate 2029 * @see WP_HTML_Processor::step 2030 * 2031 * @return bool Whether an element was found. 2032 */ 2033 private function step_in_template() { 2034 $this->last_error = self::ERROR_UNSUPPORTED; 2035 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 2036 } 2037 2038 /** 2039 * Parses next element in the 'after body' insertion mode. 2040 * 2041 * This internal function performs the 'after body' insertion mode 2042 * logic for the generalized WP_HTML_Processor::step() function. 2043 * 2044 * @since 6.7.0 Stub implementation. 2045 * 2046 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 2047 * 2048 * @see https://html.spec.whatwg.org/#parsing-main-afterbody 2049 * @see WP_HTML_Processor::step 2050 * 2051 * @return bool Whether an element was found. 2052 */ 2053 private function step_after_body() { 2054 $this->last_error = self::ERROR_UNSUPPORTED; 2055 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 2056 } 2057 2058 /** 2059 * Parses next element in the 'in frameset' insertion mode. 2060 * 2061 * This internal function performs the 'in frameset' insertion mode 2062 * logic for the generalized WP_HTML_Processor::step() function. 2063 * 2064 * @since 6.7.0 Stub implementation. 2065 * 2066 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 2067 * 2068 * @see https://html.spec.whatwg.org/#parsing-main-inframeset 2069 * @see WP_HTML_Processor::step 2070 * 2071 * @return bool Whether an element was found. 2072 */ 2073 private function step_in_frameset() { 2074 $this->last_error = self::ERROR_UNSUPPORTED; 2075 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 2076 } 2077 2078 /** 2079 * Parses next element in the 'after frameset' insertion mode. 2080 * 2081 * This internal function performs the 'after frameset' insertion mode 2082 * logic for the generalized WP_HTML_Processor::step() function. 2083 * 2084 * @since 6.7.0 Stub implementation. 2085 * 2086 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 2087 * 2088 * @see https://html.spec.whatwg.org/#parsing-main-afterframeset 2089 * @see WP_HTML_Processor::step 2090 * 2091 * @return bool Whether an element was found. 2092 */ 2093 private function step_after_frameset() { 2094 $this->last_error = self::ERROR_UNSUPPORTED; 2095 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 2096 } 2097 2098 /** 2099 * Parses next element in the 'after after body' insertion mode. 2100 * 2101 * This internal function performs the 'after after body' insertion mode 2102 * logic for the generalized WP_HTML_Processor::step() function. 2103 * 2104 * @since 6.7.0 Stub implementation. 2105 * 2106 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 2107 * 2108 * @see https://html.spec.whatwg.org/#the-after-after-body-insertion-mode 2109 * @see WP_HTML_Processor::step 2110 * 2111 * @return bool Whether an element was found. 2112 */ 2113 private function step_after_after_body() { 2114 $this->last_error = self::ERROR_UNSUPPORTED; 2115 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 2116 } 2117 2118 /** 2119 * Parses next element in the 'after after frameset' insertion mode. 2120 * 2121 * This internal function performs the 'after after frameset' insertion mode 2122 * logic for the generalized WP_HTML_Processor::step() function. 2123 * 2124 * @since 6.7.0 Stub implementation. 2125 * 2126 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 2127 * 2128 * @see https://html.spec.whatwg.org/#the-after-after-frameset-insertion-mode 2129 * @see WP_HTML_Processor::step 2130 * 2131 * @return bool Whether an element was found. 2132 */ 2133 private function step_after_after_frameset() { 2134 $this->last_error = self::ERROR_UNSUPPORTED; 2135 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 2136 } 2137 2138 /** 2139 * Parses next element in the 'in foreign content' insertion mode. 2140 * 2141 * This internal function performs the 'in foreign content' insertion mode 2142 * logic for the generalized WP_HTML_Processor::step() function. 2143 * 2144 * @since 6.7.0 Stub implementation. 2145 * 2146 * @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input. 2147 * 2148 * @see https://html.spec.whatwg.org/#parsing-main-inforeign 2149 * @see WP_HTML_Processor::step 2150 * 2151 * @return bool Whether an element was found. 2152 */ 2153 private function step_in_foreign_content() { 2154 $this->last_error = self::ERROR_UNSUPPORTED; 2155 throw new WP_HTML_Unsupported_Exception( "No support for parsing in the '{$this->state->insertion_mode}' state." ); 1695 2156 } 1696 2157
Note: See TracChangeset
for help on using the changeset viewer.