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

Commit20e2709

Browse files
committed
Update naming in AAA
1 parentf50fb36 commit20e2709

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

‎src/html5lib/html5parser.py‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ def mainLoop(self):
158158

159159

160160
fortokeninself.normalizedTokens():
161-
#print self.phase.__class__.__name__
162-
#print token
163161
type=token["type"]
164162
iftype==CharactersToken:
165163
self.phase.processCharacters(token)
@@ -1360,26 +1358,28 @@ def endTagFormatting(self, token):
13601358
name=token["name"]
13611359
whileTrue:
13621360
# Step 1 paragraph 1
1363-
afeElement=self.tree.elementInActiveFormattingElements(
1361+
formattingElement=self.tree.elementInActiveFormattingElements(
13641362
token["name"])
1365-
ifnotafeElementor (afeElementinself.tree.openElementsand
1366-
notself.tree.elementInScope(afeElement.name)):
1363+
ifnotformattingElementor (formattingElementin
1364+
self.tree.openElementsand
1365+
notself.tree.elementInScope(
1366+
formattingElement.name)):
13671367
self.parser.parseError("adoption-agency-1.1", {"name":token["name"]})
13681368
return
13691369

13701370
# Step 1 paragraph 2
1371-
elifafeElementnotinself.tree.openElements:
1371+
elifformattingElementnotinself.tree.openElements:
13721372
self.parser.parseError("adoption-agency-1.2", {"name":token["name"]})
1373-
self.tree.activeFormattingElements.remove(afeElement)
1373+
self.tree.activeFormattingElements.remove(formattingElement)
13741374
return
13751375

13761376
# Step 1 paragraph 3
1377-
ifafeElement!=self.tree.openElements[-1]:
1377+
ifformattingElement!=self.tree.openElements[-1]:
13781378
self.parser.parseError("adoption-agency-1.3", {"name":token["name"]})
13791379

13801380
# Step 2
13811381
# Start of the adoption agency algorithm proper
1382-
afeIndex=self.tree.openElements.index(afeElement)
1382+
afeIndex=self.tree.openElements.index(formattingElement)
13831383
furthestBlock=None
13841384
forelementinself.tree.openElements[afeIndex:]:
13851385
if (element.nameTuplein
@@ -1390,7 +1390,7 @@ def endTagFormatting(self, token):
13901390
# Step 3
13911391
iffurthestBlockisNone:
13921392
element=self.tree.openElements.pop()
1393-
whileelement!=afeElement:
1393+
whileelement!=formattingElement:
13941394
element=self.tree.openElements.pop()
13951395
self.tree.activeFormattingElements.remove(element)
13961396
return
@@ -1405,7 +1405,7 @@ def endTagFormatting(self, token):
14051405
# nodes in step 12. We have to ensure that we reinsert nodes after
14061406
# the node before the active formatting element. Note the bookmark
14071407
# can move in step 7.4
1408-
bookmark=self.tree.activeFormattingElements.index(afeElement)
1408+
bookmark=self.tree.activeFormattingElements.index(formattingElement)
14091409

14101410
# Step 6
14111411
lastNode=node=furthestBlock
@@ -1420,7 +1420,7 @@ def endTagFormatting(self, token):
14201420
self.tree.openElements.index(node)-1]
14211421
self.tree.openElements.remove(tmpNode)
14221422
# Step 6.3
1423-
ifnode==afeElement:
1423+
ifnode==formattingElement:
14241424
break
14251425
# Step 6.4
14261426
iflastNode==furthestBlock:
@@ -1437,7 +1437,7 @@ def endTagFormatting(self, token):
14371437
self.tree.openElements.index(node)]=clone
14381438
node=clone
14391439

1440-
# Step7.6
1440+
# Step6.6
14411441
# Remove lastNode from its parents, if any
14421442
iflastNode.parent:
14431443
lastNode.parent.removeChild(lastNode)
@@ -1455,7 +1455,7 @@ def endTagFormatting(self, token):
14551455
commonAncestor.appendChild(lastNode)
14561456

14571457
# Step 8
1458-
clone=afeElement.cloneNode()
1458+
clone=formattingElement.cloneNode()
14591459

14601460
# Step 9
14611461
furthestBlock.reparentChildren(clone)
@@ -1464,11 +1464,11 @@ def endTagFormatting(self, token):
14641464
furthestBlock.appendChild(clone)
14651465

14661466
# Step 11
1467-
self.tree.activeFormattingElements.remove(afeElement)
1467+
self.tree.activeFormattingElements.remove(formattingElement)
14681468
self.tree.activeFormattingElements.insert(bookmark,clone)
14691469

14701470
# Step 12
1471-
self.tree.openElements.remove(afeElement)
1471+
self.tree.openElements.remove(formattingElement)
14721472
self.tree.openElements.insert(
14731473
self.tree.openElements.index(furthestBlock)+1,clone)
14741474

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp