OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
10 * | 10 * |
(...skipping 11764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11775 for (unsigned i = 0; i != length; ++i) { | 11775 for (unsigned i = 0; i != length; ++i) { |
11776 CharacterType c = propertyName[i]; | 11776 CharacterType c = propertyName[i]; |
11777 if (c == 0 || c >= 0x7F) | 11777 if (c == 0 || c >= 0x7F) |
11778 return CSSPropertyInvalid; // illegal character | 11778 return CSSPropertyInvalid; // illegal character |
11779 buffer[i] = toASCIILower(c); | 11779 buffer[i] = toASCIILower(c); |
11780 } | 11780 } |
11781 buffer[length] = '\0'; | 11781 buffer[length] = '\0'; |
11782 | 11782 |
11783 const char* name = buffer; | 11783 const char* name = buffer; |
11784 if (buffer[0] == '-') { | 11784 if (buffer[0] == '-') { |
11785 #if ENABLE(LEGACY_CSS_VENDOR_PREFIXES) | |
11786 // If the prefix is -apple- or -khtml-, change it to -webkit-. | |
11787 // This makes the string one character longer. | |
11788 if (RuntimeEnabledFeatures::legacyCSSVendorPrefixesEnabled() | |
11789 && (hasPrefix(buffer, length, "-apple-") || hasPrefix(buffer, length
, "-khtml-"))) { | |
11790 memmove(buffer + 7, buffer + 6, length + 1 - 6); | |
11791 memcpy(buffer, "-webkit", 7); | |
11792 ++length; | |
11793 } | |
11794 #endif | |
11795 #if PLATFORM(IOS) | 11785 #if PLATFORM(IOS) |
11796 cssPropertyNameIOSAliasing(buffer, name, length); | 11786 cssPropertyNameIOSAliasing(buffer, name, length); |
11797 #endif | 11787 #endif |
11798 } | 11788 } |
11799 | 11789 |
11800 const Property* hashTableEntry = findProperty(name, length); | 11790 const Property* hashTableEntry = findProperty(name, length); |
11801 const CSSPropertyID propertyID = hashTableEntry ? static_cast<CSSPropertyID>
(hashTableEntry->id) : CSSPropertyInvalid; | 11791 const CSSPropertyID propertyID = hashTableEntry ? static_cast<CSSPropertyID>
(hashTableEntry->id) : CSSPropertyInvalid; |
11802 | 11792 |
11803 static const int cssPropertyHistogramSize = numCSSProperties; | 11793 static const int cssPropertyHistogramSize = numCSSProperties; |
11804 if (hasPrefix(buffer, length, "-webkit-") && propertyID != CSSPropertyInvali
d) { | 11794 if (hasPrefix(buffer, length, "-webkit-") && propertyID != CSSPropertyInvali
d) { |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12043 { | 12033 { |
12044 // The tokenizer checks for the construct of an+b. | 12034 // The tokenizer checks for the construct of an+b. |
12045 // However, since the {ident} rule precedes the {nth} rule, some of those | 12035 // However, since the {ident} rule precedes the {nth} rule, some of those |
12046 // tokens are identified as string literal. Furthermore we need to accept | 12036 // tokens are identified as string literal. Furthermore we need to accept |
12047 // "odd" and "even" which does not match to an+b. | 12037 // "odd" and "even" which does not match to an+b. |
12048 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") | 12038 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") |
12049 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); | 12039 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); |
12050 } | 12040 } |
12051 | 12041 |
12052 } | 12042 } |
OLD | NEW |