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

Side by Side Diff: Source/core/css/CSSParser.cpp

Issue 16358010: [CSS Exclusions] Add CSS parsing support for image URI shape-inside and shape-outside values (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
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 2720 matching lines...) Expand 10 before | Expand all | Expand 10 after
2731 case CSSPropertyWebkitShapeInside: 2731 case CSSPropertyWebkitShapeInside:
2732 case CSSPropertyWebkitShapeOutside: 2732 case CSSPropertyWebkitShapeOutside:
2733 if (!RuntimeEnabledFeatures::cssExclusionsEnabled()) 2733 if (!RuntimeEnabledFeatures::cssExclusionsEnabled())
2734 return false; 2734 return false;
2735 if (id == CSSValueAuto) 2735 if (id == CSSValueAuto)
2736 validPrimitive = true; 2736 validPrimitive = true;
2737 else if (propId == CSSPropertyWebkitShapeInside && id == CSSValueOutside Shape) 2737 else if (propId == CSSPropertyWebkitShapeInside && id == CSSValueOutside Shape)
2738 validPrimitive = true; 2738 validPrimitive = true;
2739 else if (value->unit == CSSParserValue::Function) 2739 else if (value->unit == CSSParserValue::Function)
2740 return parseBasicShape(propId, important); 2740 return parseBasicShape(propId, important);
2741 else if (value->unit == CSSPrimitiveValue::CSS_URI) {
2742 parsedValue = CSSImageValue::create(completeURL(value->string));
2743 m_valueList->next();
2744 }
2741 break; 2745 break;
2742 case CSSPropertyWebkitShapeMargin: 2746 case CSSPropertyWebkitShapeMargin:
2743 case CSSPropertyWebkitShapePadding: 2747 case CSSPropertyWebkitShapePadding:
2744 validPrimitive = (RuntimeEnabledFeatures::cssExclusionsEnabled() && !id && validUnit(value, FLength | FNonNeg)); 2748 validPrimitive = (RuntimeEnabledFeatures::cssExclusionsEnabled() && !id && validUnit(value, FLength | FNonNeg));
2745 break; 2749 break;
2746 case CSSPropertyBorderBottomStyle: 2750 case CSSPropertyBorderBottomStyle:
2747 case CSSPropertyBorderCollapse: 2751 case CSSPropertyBorderCollapse:
2748 case CSSPropertyBorderLeftStyle: 2752 case CSSPropertyBorderLeftStyle:
2749 case CSSPropertyBorderRightStyle: 2753 case CSSPropertyBorderRightStyle:
2750 case CSSPropertyBorderTopStyle: 2754 case CSSPropertyBorderTopStyle:
(...skipping 9003 matching lines...) Expand 10 before | Expand all | Expand 10 after
11754 { 11758 {
11755 // The tokenizer checks for the construct of an+b. 11759 // The tokenizer checks for the construct of an+b.
11756 // However, since the {ident} rule precedes the {nth} rule, some of those 11760 // However, since the {ident} rule precedes the {nth} rule, some of those
11757 // tokens are identified as string literal. Furthermore we need to accept 11761 // tokens are identified as string literal. Furthermore we need to accept
11758 // "odd" and "even" which does not match to an+b. 11762 // "odd" and "even" which does not match to an+b.
11759 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") 11763 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even")
11760 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); 11764 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n");
11761 } 11765 }
11762 11766
11763 } 11767 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698