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

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

Issue 1858553002: Refactor StyleVariableData to fallback on root map for performance reasons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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) 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 11 matching lines...) Expand all
22 */ 22 */
23 23
24 #include "core/css/CSSComputedStyleDeclaration.h" 24 #include "core/css/CSSComputedStyleDeclaration.h"
25 25
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/CSSPrimitiveValueMappings.h" 28 #include "core/css/CSSPrimitiveValueMappings.h"
29 #include "core/css/CSSPropertyMetadata.h" 29 #include "core/css/CSSPropertyMetadata.h"
30 #include "core/css/CSSSelector.h" 30 #include "core/css/CSSSelector.h"
31 #include "core/css/CSSValuePool.h" 31 #include "core/css/CSSValuePool.h"
32 #include "core/css/CSSVariableData.h"
32 #include "core/css/ComputedStyleCSSValueMapping.h" 33 #include "core/css/ComputedStyleCSSValueMapping.h"
33 #include "core/css/parser/CSSParser.h" 34 #include "core/css/parser/CSSParser.h"
34 #include "core/css/parser/CSSVariableParser.h" 35 #include "core/css/parser/CSSVariableParser.h"
35 #include "core/css/resolver/StyleResolver.h" 36 #include "core/css/resolver/StyleResolver.h"
36 #include "core/dom/Document.h" 37 #include "core/dom/Document.h"
37 #include "core/dom/ExceptionCode.h" 38 #include "core/dom/ExceptionCode.h"
38 #include "core/dom/PseudoElement.h" 39 #include "core/dom/PseudoElement.h"
39 #include "core/layout/LayoutObject.h" 40 #include "core/layout/LayoutObject.h"
40 #include "core/style/ComputedStyle.h" 41 #include "core/style/ComputedStyle.h"
41 #include "wtf/text/StringBuilder.h" 42 #include "wtf/text/StringBuilder.h"
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 } 528 }
528 529
529 CSSValue* CSSComputedStyleDeclaration::getPropertyCSSValue(AtomicString customPr opertyName) const 530 CSSValue* CSSComputedStyleDeclaration::getPropertyCSSValue(AtomicString customPr opertyName) const
530 { 531 {
531 const ComputedStyle* style = computeComputedStyle(); 532 const ComputedStyle* style = computeComputedStyle();
532 if (!style) 533 if (!style)
533 return nullptr; 534 return nullptr;
534 return ComputedStyleCSSValueMapping::get(customPropertyName, *style); 535 return ComputedStyleCSSValueMapping::get(customPropertyName, *style);
535 } 536 }
536 537
537 const HashMap<AtomicString, RefPtr<CSSVariableData>>* CSSComputedStyleDeclaratio n::getVariables() const 538 std::unique_ptr<HashMap<AtomicString, RefPtr<CSSVariableData>>> CSSComputedStyle Declaration::getVariables() const
538 { 539 {
539 const ComputedStyle* style = computeComputedStyle(); 540 const ComputedStyle* style = computeComputedStyle();
540 if (!style) 541 if (!style)
541 return nullptr; 542 return nullptr;
542 return ComputedStyleCSSValueMapping::getVariables(*style); 543 return ComputedStyleCSSValueMapping::getVariables(*style);
543 } 544 }
544 545
545 CSSValue* CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropertyID propert yID) const 546 CSSValue* CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropertyID propert yID) const
546 { 547 {
547 Node* styledNode = this->styledNode(); 548 Node* styledNode = this->styledNode();
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a re computed, and therefore the '" + getPropertyNameString(id) + "' property is r ead-only."); 704 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a re computed, and therefore the '" + getPropertyNameString(id) + "' property is r ead-only.");
704 } 705 }
705 706
706 DEFINE_TRACE(CSSComputedStyleDeclaration) 707 DEFINE_TRACE(CSSComputedStyleDeclaration)
707 { 708 {
708 visitor->trace(m_node); 709 visitor->trace(m_node);
709 CSSStyleDeclaration::trace(visitor); 710 CSSStyleDeclaration::trace(visitor);
710 } 711 }
711 712
712 } // namespace blink 713 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698