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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 2288633002: Recognise variable names when parsing CSS property names (Closed)
Patch Set: fix long var names Created 4 years, 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/DOMWindowCSS.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 15 matching lines...) Expand all
26 #include "bindings/core/v8/ExceptionState.h" 26 #include "bindings/core/v8/ExceptionState.h"
27 #include "core/CSSPropertyNames.h" 27 #include "core/CSSPropertyNames.h"
28 #include "core/css/CSSPrimitiveValue.h" 28 #include "core/css/CSSPrimitiveValue.h"
29 #include "core/css/CSSPrimitiveValueMappings.h" 29 #include "core/css/CSSPrimitiveValueMappings.h"
30 #include "core/css/CSSPropertyIDTemplates.h" 30 #include "core/css/CSSPropertyIDTemplates.h"
31 #include "core/css/CSSPropertyMetadata.h" 31 #include "core/css/CSSPropertyMetadata.h"
32 #include "core/css/CSSSelector.h" 32 #include "core/css/CSSSelector.h"
33 #include "core/css/CSSVariableData.h" 33 #include "core/css/CSSVariableData.h"
34 #include "core/css/ComputedStyleCSSValueMapping.h" 34 #include "core/css/ComputedStyleCSSValueMapping.h"
35 #include "core/css/parser/CSSParser.h" 35 #include "core/css/parser/CSSParser.h"
36 #include "core/css/parser/CSSVariableParser.h"
37 #include "core/css/resolver/StyleResolver.h" 36 #include "core/css/resolver/StyleResolver.h"
38 #include "core/dom/Document.h" 37 #include "core/dom/Document.h"
39 #include "core/dom/ExceptionCode.h" 38 #include "core/dom/ExceptionCode.h"
40 #include "core/dom/PseudoElement.h" 39 #include "core/dom/PseudoElement.h"
41 #include "core/layout/LayoutObject.h" 40 #include "core/layout/LayoutObject.h"
42 #include "core/style/ComputedStyle.h" 41 #include "core/style/ComputedStyle.h"
43 #include "wtf/text/StringBuilder.h" 42 #include "wtf/text/StringBuilder.h"
44 43
45 namespace blink { 44 namespace blink {
46 45
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 } 632 }
634 633
635 CSSRule* CSSComputedStyleDeclaration::parentRule() const 634 CSSRule* CSSComputedStyleDeclaration::parentRule() const
636 { 635 {
637 return nullptr; 636 return nullptr;
638 } 637 }
639 638
640 String CSSComputedStyleDeclaration::getPropertyValue(const String& propertyName) 639 String CSSComputedStyleDeclaration::getPropertyValue(const String& propertyName)
641 { 640 {
642 CSSPropertyID propertyID = cssPropertyID(propertyName); 641 CSSPropertyID propertyID = cssPropertyID(propertyName);
643 if (!propertyID) { 642 if (!propertyID)
644 if (CSSVariableParser::isValidVariableName(propertyName)) { 643 return String();
645 const CSSValue* value = getPropertyCSSValue(AtomicString(propertyNam e)); 644 if (propertyID == CSSPropertyVariable) {
646 if (value) 645 const CSSValue* value = getPropertyCSSValue(AtomicString(propertyName));
647 return value->cssText(); 646 if (value)
648 } 647 return value->cssText();
649 return String(); 648 return String();
650 } 649 }
651 ASSERT(CSSPropertyMetadata::isEnabledProperty(propertyID)); 650 ASSERT(CSSPropertyMetadata::isEnabledProperty(propertyID));
652 return getPropertyValue(propertyID); 651 return getPropertyValue(propertyID);
653 } 652 }
654 653
655 String CSSComputedStyleDeclaration::getPropertyPriority(const String&) 654 String CSSComputedStyleDeclaration::getPropertyPriority(const String&)
656 { 655 {
657 // All computed styles have a priority of not "important". 656 // All computed styles have a priority of not "important".
658 return ""; 657 return "";
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a re computed, and therefore the '" + getPropertyNameString(id) + "' property is r ead-only."); 699 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a re computed, and therefore the '" + getPropertyNameString(id) + "' property is r ead-only.");
701 } 700 }
702 701
703 DEFINE_TRACE(CSSComputedStyleDeclaration) 702 DEFINE_TRACE(CSSComputedStyleDeclaration)
704 { 703 {
705 visitor->trace(m_node); 704 visitor->trace(m_node);
706 CSSStyleDeclaration::trace(visitor); 705 CSSStyleDeclaration::trace(visitor);
707 } 706 }
708 707
709 } // namespace blink 708 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/DOMWindowCSS.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698