gecko-dev/parser/htmlparser
Henri Sivonen 3edc601325 Bug 1402247 - Use encoding_rs for XPCOM string encoding conversions. r=Nika,erahm,froydnj.
Correctness improvements:

 * UTF errors are handled safely per spec instead of dangerously truncating
   strings.

 * There are fewer converter implementations.

Performance improvements:

 * The old code did exact buffer length math, which meant doing UTF math twice
   on each input string (once for length calculation and another time for
   conversion). Exact length math is more complicated when handling errors
   properly, which the old code didn't do. The new code does UTF math on the
   string content only once (when converting) but risks allocating more than
   once. There are heuristics in place to lower the probability of
   reallocation in cases where the double math avoidance isn't enough of a
   saving to absorb an allocation and memcpy.

 * Previously, in UTF-16 <-> UTF-8 conversions, an ASCII prefix was optimized
   but a single non-ASCII code point pessimized the rest of the string. The
   new code tries to get back on the fast ASCII path.

 * UTF-16 to Latin1 conversion guarantees less about handling of out-of-range
   input to eliminate an operation from the inner loop on x86/x86_64.

 * When assigning to a pre-existing string, the new code tries to reuse the
   old buffer instead of first releasing the old buffer and then allocating a
   new one.

 * When reallocating from the new code, the memcpy covers only the data that
   is part of the logical length of the old string instead of memcpying the
   whole capacity. (For old callers old excess memcpy behavior is preserved
   due to bogus callers. See bug 1472113.)

 * UTF-8 strings in XPConnect that are in the Latin1 range are passed to
   SpiderMonkey as Latin1.

New features:

 * Conversion between UTF-8 and Latin1 is added in order to enable faster
   future interop between Rust code (or otherwise UTF-8-using code) and text
   node and SpiderMonkey code that uses Latin1.

MozReview-Commit-ID: JaJuExfILM9
2018-08-14 14:43:42 +03:00
..
tests Bug 1369941: Replace single integers N in fuzzy() and fuzzy-if() with 0-N ranges. r=dholbert 2018-08-09 20:10:21 +00:00
CNavDTD.cpp
CNavDTD.h
CParserContext.cpp Bug 1453795 - Parser/HTML Parser - Initialize member fields in classes/ structures. r=mrbkap 2018-06-14 00:08:27 +03:00
CParserContext.h
moz.build Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium 2017-12-07 22:09:15 +01:00
nsElementTable.cpp Bug 1445983. <bdi> should be an HTMLElement, not HTMLUnknownElement. r=hsivonen 2018-03-16 11:26:09 -04:00
nsElementTable.h Bug 1400777 (part 5) - Clean up nsElementTable.{cpp,h}. r=mrbkap. 2017-09-20 08:32:51 +10:00
nsExpatDriver.cpp Bug 1402247 - Use encoding_rs for XPCOM string encoding conversions. r=Nika,erahm,froydnj. 2018-08-14 14:43:42 +03:00
nsExpatDriver.h Bug 1416980 - Remove nsIExtendedExpatSink. r=erahm. 2017-11-14 17:22:49 +11:00
nsHTMLTagList.h Bug 1445983. <bdi> should be an HTMLElement, not HTMLUnknownElement. r=hsivonen 2018-03-16 11:26:09 -04:00
nsHTMLTags.cpp Bug 1449395 - Remove unnecessary nsStaticAtom.h includes. r=froydnj 2018-03-29 09:08:54 +11:00
nsHTMLTags.h Bug 1449395 - Remove unnecessary nsStaticAtom.h includes. r=froydnj 2018-03-29 09:08:54 +11:00
nsHTMLTokenizer.cpp
nsHTMLTokenizer.h
nsIContentSink.h
nsIDTD.h
nsIExpatSink.idl Bug 1418246 - Return valid columnNumber value in CSP violation events, r=ckerschb 2018-07-05 08:21:04 +02:00
nsIFragmentContentSink.h Bug 1452183 part 1. Stop using nsIDOMDocumentFragment in IDL files. r=mccr8 2018-04-17 21:13:03 -04:00
nsIHTMLContentSink.h
nsIParser.h Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro. 2017-10-03 09:05:19 +11:00
nsITokenizer.h
nsParser.cpp Bug 1453795 - Parser/HTML Parser - Initialize member fields in classes/ structures. r=mrbkap 2018-06-14 00:08:27 +03:00
nsParser.h
nsParserBase.h
nsParserCIID.h Bug 1402769 - Remove unused stuff in and around nsParserModule.cpp. r=mrbkap. 2017-09-05 20:43:30 +10:00
nsParserConstants.h
nsParserModule.cpp Bug 1402769 - Remove unused stuff in and around nsParserModule.cpp. r=mrbkap. 2017-09-05 20:43:30 +10:00
nsParserMsgUtils.cpp
nsParserMsgUtils.h
nsScanner.cpp
nsScanner.h
nsScannerString.cpp
nsScannerString.h Bug 1453795 - Parser/HTML Parser - Initialize member fields in classes/ structures. r=mrbkap 2018-06-14 00:08:27 +03:00