Skip to content

Commit 4817dc8

Browse files
committed
fix: use the correct property (http://cyberneko.org/html/properties/names/attrs) in case of the error handling for strange attributes
1 parent b978f8e commit 4817dc8

8 files changed

Lines changed: 42 additions & 2 deletions

src/main/java/org/htmlunit/cyberneko/HTMLScanner.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3217,8 +3217,7 @@ protected int scanAttribute(final XMLAttributesImpl attributes, final boolean[]
32173217
empty[0] = fCurrentEntity.skipMarkup(false);
32183218
return SCAN_FALSE;
32193219
}
3220-
// TODO add test and maybe fix me by using fNamesAttrs as second param
3221-
aname = '=' + scanName(false, fNamesElems);
3220+
aname = '=' + scanName(false, fNamesAttrs);
32223221
}
32233222
if (fReportErrors_ && !skippedSpaces) {
32243223
fErrorReporter.reportError("HTML1013", new Object[] {aname});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<input name='button' ='abc' value="detect me">
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(html
2+
(head
3+
)head
4+
(body
5+
(input
6+
ANAME button
7+
A='ABC'
8+
AVALUE detect me
9+
)input
10+
)body
11+
)html
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(html
2+
(head
3+
)head
4+
(body
5+
(input
6+
A='ABC'
7+
ANAME button
8+
AVALUE detect me
9+
)input
10+
)body
11+
)html
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
(input
2+
A='ABC'
3+
ANAME button
4+
AVALUE detect me
5+
)input
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<html><head></head><body><input NAME="button" ='ABC'="" VALUE="detect me" /></body></html>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
startDocument [(1,1,0) (1,1,0) false]
2+
startElement (localpart="html",rawname="html",uri="http://www.w3.org/1999/xhtml") [(-1,-1,-1) (-1,-1,-1) true]
3+
startElement (localpart="head",rawname="head",uri="http://www.w3.org/1999/xhtml") [(-1,-1,-1) (-1,-1,-1) true]
4+
endElement (localpart="head",rawname="head",uri="http://www.w3.org/1999/xhtml") [(-1,-1,-1) (-1,-1,-1) true]
5+
startElement (localpart="body",rawname="body",uri="http://www.w3.org/1999/xhtml") [(-1,-1,-1) (-1,-1,-1) true]
6+
emptyElement (localpart="input",rawname="input") [(1,1,0) (1,47,46) false]
7+
characters '
8+
'[(1,47,46) (2,1,47) false]
9+
endElement (localpart="body",rawname="body",uri="http://www.w3.org/1999/xhtml") [(-1,-1,-1) (-1,-1,-1) true]
10+
endElement (localpart="html",rawname="html",uri="http://www.w3.org/1999/xhtml") [(-1,-1,-1) (-1,-1,-1) true]
11+
endDocument [(2,1,47) (2,1,47) false]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
property http://cyberneko.org/html/properties/names/attrs upper

0 commit comments

Comments
 (0)