Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit52d6a93

Browse files
author
Edward Z. Yang ext:(%22)
committed
Fix bug in adoption agency algorithm. Effective 100% tests passing.
1 parent73a05b9 commit52d6a93

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

‎library/HTML5/TreeConstructer.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,6 +1647,7 @@ public function emitToken($token, $mode = null) {
16471647

16481648
if($category !==self::PHRASING &&$category !==self::FORMATTING) {
16491649
$furthest_block =$this->stack[$s];
1650+
break;
16501651
}
16511652
}
16521653

@@ -1693,8 +1694,7 @@ public function emitToken($token, $mode = null) {
16931694
the stack of open elements and then go back
16941695
to step 1. */
16951696
if(!in_array($node,$this->a_formatting,true)) {
1696-
unset($this->stack[$n]);
1697-
$this->stack =array_merge($this->stack);
1697+
array_splice($this->stack,$n,1);
16981698

16991699
}else {
17001700
break;
@@ -1783,23 +1783,22 @@ public function emitToken($token, $mode = null) {
17831783
into the list of active formatting elements at the
17841784
position of the aforementioned bookmark. */
17851785
$fe_af_pos =array_search($formatting_element,$this->a_formatting,true);
1786-
unset($this->a_formatting[$fe_af_pos]);
1787-
$this->a_formatting =array_merge($this->a_formatting);
1786+
array_splice($this->a_formatting,$fe_af_pos,1);
17881787

17891788
$af_part1 =array_slice($this->a_formatting,0,$bookmark -1);
1790-
$af_part2 =array_slice($this->a_formatting,$bookmark,count($this->a_formatting));
1789+
$af_part2 =array_slice($this->a_formatting,$bookmark);
17911790
$this->a_formatting =array_merge($af_part1,array($clone),$af_part2);
17921791

17931792
/* 12. Remove the formatting element from the stack
17941793
of open elements, and insert the new element into the stack
17951794
of open elements immediately below the position of the
17961795
furthest block in that stack. */
17971796
$fe_s_pos =array_search($formatting_element,$this->stack,true);
1798-
$fb_s_pos =array_search($furthest_block,$this->stack,true);
1799-
unset($this->stack[$fe_s_pos]);
1797+
array_splice($this->stack,$fe_s_pos,1);
18001798

1801-
$s_part1 =array_slice($this->stack,0,$fb_s_pos);
1802-
$s_part2 =array_slice($this->stack,$fb_s_pos +1,count($this->stack));
1799+
$fb_s_pos =array_search($furthest_block,$this->stack,true);
1800+
$s_part1 =array_slice($this->stack,0,$fb_s_pos +1);
1801+
$s_part2 =array_slice($this->stack,$fb_s_pos +1);
18031802
$this->stack =array_merge($s_part1,array($clone),$s_part2);
18041803

18051804
/* 13. Jump back to step 1 in this series of steps. */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp