| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2  * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 
| 3  * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ | 3  * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ | 
| 4  * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 4  * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 
| 5  * | 5  * | 
| 6  * Redistribution and use in source and binary forms, with or without | 6  * Redistribution and use in source and binary forms, with or without | 
| 7  * modification, are permitted provided that the following conditions | 7  * modification, are permitted provided that the following conditions | 
| 8  * are met: | 8  * are met: | 
| 9  * 1. Redistributions of source code must retain the above copyright | 9  * 1. Redistributions of source code must retain the above copyright | 
| 10  *    notice, this list of conditions and the following disclaimer. | 10  *    notice, this list of conditions and the following disclaimer. | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
| 21  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 21  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 
| 22  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 22  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 
| 23  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 
| 24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 
| 25  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 
| 26  */ | 26  */ | 
| 27 | 27 | 
| 28 #include "config.h" | 28 #include "config.h" | 
| 29 #include "HTMLEntityParser.h" | 29 #include "HTMLEntityParser.h" | 
| 30 | 30 | 
| 31 #include "CharacterReferenceParserInlines.h" |  | 
| 32 #include "HTMLEntitySearch.h" | 31 #include "HTMLEntitySearch.h" | 
| 33 #include "HTMLEntityTable.h" | 32 #include "HTMLEntityTable.h" | 
|  | 33 #include "core/xml/parser/CharacterReferenceParserInlines.h" | 
| 34 #include <wtf/text/StringBuilder.h> | 34 #include <wtf/text/StringBuilder.h> | 
| 35 | 35 | 
| 36 using namespace WTF; | 36 using namespace WTF; | 
| 37 | 37 | 
| 38 namespace WebCore { | 38 namespace WebCore { | 
| 39 | 39 | 
| 40 static const UChar windowsLatin1ExtensionArray[32] = { | 40 static const UChar windowsLatin1ExtensionArray[32] = { | 
| 41     0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, // 80-87 | 41     0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, // 80-87 | 
| 42     0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x008D, 0x017D, 0x008F, // 88-8F | 42     0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x008D, 0x017D, 0x008F, // 88-8F | 
| 43     0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, // 90-97 | 43     0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, // 90-97 | 
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 154     if (!search.isEntityPrefix()) | 154     if (!search.isEntityPrefix()) | 
| 155         return 0; | 155         return 0; | 
| 156 | 156 | 
| 157     size_t numberOfCodePoints = appendUChar32ToUCharArray(search.mostRecentMatch
     ()->firstValue, result); | 157     size_t numberOfCodePoints = appendUChar32ToUCharArray(search.mostRecentMatch
     ()->firstValue, result); | 
| 158     if (!search.mostRecentMatch()->secondValue) | 158     if (!search.mostRecentMatch()->secondValue) | 
| 159         return numberOfCodePoints; | 159         return numberOfCodePoints; | 
| 160     return numberOfCodePoints + appendUChar32ToUCharArray(search.mostRecentMatch
     ()->secondValue, result + numberOfCodePoints); | 160     return numberOfCodePoints + appendUChar32ToUCharArray(search.mostRecentMatch
     ()->secondValue, result + numberOfCodePoints); | 
| 161 } | 161 } | 
| 162 | 162 | 
| 163 } // namespace WebCore | 163 } // namespace WebCore | 
| OLD | NEW | 
|---|