Bug 1375701 - Atomize class attribute value in the parser in the innerHTML case

Tag #1375
This commit is contained in:
Matt A. Tobin
2020-04-17 06:12:55 -04:00
parent 675dce9472
commit f4a1d0123c
14 changed files with 274 additions and 152 deletions
@@ -798,13 +798,13 @@ public abstract class MetaScanner {
}
if (contentIndex == CONTENT.length && content == null) {
content = Portability.newStringFromBuffer(strBuf, 0, strBufLen
// CPPONLY: , treeBuilder
// CPPONLY: , treeBuilder, false
);
return;
}
if (charsetIndex == CHARSET.length && charset == null) {
charset = Portability.newStringFromBuffer(strBuf, 0, strBufLen
// CPPONLY: , treeBuilder
// CPPONLY: , treeBuilder, false
);
return;
}
@@ -42,7 +42,7 @@ public final class Portability {
}
public static String newStringFromBuffer(@NoLength char[] buf, int offset, int length
// CPPONLY: , TreeBuilder treeBuilder
// CPPONLY: , TreeBuilder treeBuilder, boolean maybeAtomize
) {
return new String(buf, offset, length);
}
@@ -917,7 +917,7 @@ public class Tokenizer implements Locator {
*/
protected String strBufToString() {
String str = Portability.newStringFromBuffer(strBuf, 0, strBufLen
// CPPONLY: , tokenHandler
// CPPONLY: , tokenHandler, !newAttributesEachTime && attributeName == AttributeName.CLASS
);
clearStrBufAfterUse();
return str;
@@ -3337,7 +3337,7 @@ public abstract class TreeBuilder<T> implements TokenHandler,
}
charset = Portability.newStringFromBuffer(buffer, start, end
- start
// CPPONLY: , tb
// CPPONLY: , tb, false
);
}
return charset;