Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: sky/engine/core/css/parser/CSSPropertyParser.cpp

Issue 893093002: Delete remaining masks dead code. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after
1760 { 1760 {
1761 if (args->size() != 1) 1761 if (args->size() != 1)
1762 return nullptr; 1762 return nullptr;
1763 1763
1764 CSSParserValue* a = args->current(); 1764 CSSParserValue* a = args->current();
1765 1765
1766 if (a->unit != CSSPrimitiveValue::CSS_IDENT) 1766 if (a->unit != CSSPrimitiveValue::CSS_IDENT)
1767 return nullptr; 1767 return nullptr;
1768 1768
1769 String attrName = a->string; 1769 String attrName = a->string;
1770 // CSS allows identifiers with "-" at the start, like "-webkit-mask-image". 1770 // CSS allows identifiers with "-" at the start, like "-webkit-foo".
1771 // But HTML attribute names can't have those characters, and we should not 1771 // But HTML attribute names can't have those characters, and we should not
1772 // even parse them inside attr(). 1772 // even parse them inside attr().
1773 if (attrName[0] == '-') 1773 if (attrName[0] == '-')
1774 return nullptr; 1774 return nullptr;
1775 1775
1776 return cssValuePool().createValue(attrName, CSSPrimitiveValue::CSS_ATTR); 1776 return cssValuePool().createValue(attrName, CSSPrimitiveValue::CSS_ATTR);
1777 } 1777 }
1778 1778
1779 PassRefPtr<CSSValue> CSSPropertyParser::parseBackgroundColor() 1779 PassRefPtr<CSSValue> CSSPropertyParser::parseBackgroundColor()
1780 { 1780 {
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
2220 else if (value->id != CSSValueAuto) { 2220 else if (value->id != CSSValueAuto) {
2221 if (!validUnit(value, FLength | FPercent)) { 2221 if (!validUnit(value, FLength | FPercent)) {
2222 if (!inShorthand()) 2222 if (!inShorthand())
2223 return nullptr; 2223 return nullptr;
2224 // We need to rewind the value list, so that when it is advanced we'll end up back at this value. 2224 // We need to rewind the value list, so that when it is advanced we'll end up back at this value.
2225 m_valueList->previous(); 2225 m_valueList->previous();
2226 } else 2226 } else
2227 parsedValue2 = createPrimitiveNumericValue(value); 2227 parsedValue2 = createPrimitiveNumericValue(value);
2228 } 2228 }
2229 } else if (!parsedValue2 && propId == CSSPropertyWebkitBackgroundSize) { 2229 } else if (!parsedValue2 && propId == CSSPropertyWebkitBackgroundSize) {
2230 // FIXME(sky): Remove webkit-background-size.
2230 // For backwards compatibility we set the second value to the first if i t is omitted. 2231 // For backwards compatibility we set the second value to the first if i t is omitted.
2231 // We only need to do this for -webkit-background-size. It should be saf e to let masks match 2232 // We only need to do this for -webkit-background-size.
2232 // the real property.
2233 parsedValue2 = parsedValue1; 2233 parsedValue2 = parsedValue1;
2234 } 2234 }
2235 2235
2236 if (!parsedValue2) 2236 if (!parsedValue2)
2237 return parsedValue1; 2237 return parsedValue1;
2238 2238
2239 Pair::IdenticalValuesPolicy policy = propId == CSSPropertyWebkitBackgroundSi ze ? 2239 Pair::IdenticalValuesPolicy policy = propId == CSSPropertyWebkitBackgroundSi ze ?
2240 Pair::DropIdenticalValues : Pair::KeepIdenticalValues; 2240 Pair::DropIdenticalValues : Pair::KeepIdenticalValues;
2241 2241
2242 return createPrimitiveValuePair(parsedValue1.release(), parsedValue2.release (), policy); 2242 return createPrimitiveValuePair(parsedValue1.release(), parsedValue2.release (), policy);
(...skipping 2406 matching lines...) Expand 10 before | Expand all | Expand 10 after
4649 } else { 4649 } else {
4650 if (context.allowFinalCommit()) { 4650 if (context.allowFinalCommit()) {
4651 // We're going to successfully parse, but we don't want to consu me this token. 4651 // We're going to successfully parse, but we don't want to consu me this token.
4652 m_valueList->previous(); 4652 m_valueList->previous();
4653 } 4653 }
4654 break; 4654 break;
4655 } 4655 }
4656 } 4656 }
4657 4657
4658 if (context.allowFinalCommit()) { 4658 if (context.allowFinalCommit()) {
4659 // FIXME: For backwards compatibility, -webkit-border-image, -webkit-mas k-box-image and -webkit-box-reflect have to do a fill by default. 4659 // FIXME(sky): Remove this.
4660 // FIXME: What do we do with -webkit-box-reflect and -webkit-mask-box-im age? Probably just have to leave them filling... 4660 // FIXME: For backwards compatibility, -webkit-border-image has to do a fill by default.
4661 if (propId == CSSPropertyWebkitBorderImage) 4661 if (propId == CSSPropertyWebkitBorderImage)
4662 context.commitFill(); 4662 context.commitFill();
4663 4663
4664 // Need to fully commit as a single value. 4664 // Need to fully commit as a single value.
4665 result = context.commitBorderImageSlice(); 4665 result = context.commitBorderImageSlice();
4666 return true; 4666 return true;
4667 } 4667 }
4668 4668
4669 return false; 4669 return false;
4670 } 4670 }
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after
6031 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); 6031 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n");
6032 } 6032 }
6033 6033
6034 bool CSSPropertyParser::isSystemColor(int id) 6034 bool CSSPropertyParser::isSystemColor(int id)
6035 { 6035 {
6036 // FIXME(sky): remove 6036 // FIXME(sky): remove
6037 return false; 6037 return false;
6038 } 6038 }
6039 6039
6040 } // namespace blink 6040 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/css/StylePropertySerializer.cpp ('k') | sky/engine/core/css/resolver/CSSToStyleMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698