OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
4 * All rights reserved. | 4 * All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 20 matching lines...) Expand all Loading... |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 StyleResolverState::StyleResolverState( | 33 StyleResolverState::StyleResolverState( |
34 Document& document, | 34 Document& document, |
35 const ElementResolveContext& element_context, | 35 const ElementResolveContext& element_context, |
36 const ComputedStyle* parent_style, | 36 const ComputedStyle* parent_style, |
37 const ComputedStyle* layout_parent_style) | 37 const ComputedStyle* layout_parent_style) |
38 : element_context_(element_context), | 38 : element_context_(element_context), |
39 document_(document), | 39 document_(document), |
40 style_(nullptr), | 40 style_(nullptr), |
41 // TODO(jchaffraix): We should make m_parentStyle const | 41 // TODO(jchaffraix): We should make parent_style_ const |
42 // (https://crbug.com/468152) | 42 // (https://crbug.com/468152) |
43 parent_style_(const_cast<ComputedStyle*>(parent_style)), | 43 parent_style_(const_cast<ComputedStyle*>(parent_style)), |
44 layout_parent_style_(layout_parent_style), | 44 layout_parent_style_(layout_parent_style), |
45 is_animation_interpolation_map_ready_(false), | 45 is_animation_interpolation_map_ready_(false), |
46 is_animating_custom_properties_(false), | 46 is_animating_custom_properties_(false), |
47 apply_property_to_regular_style_(true), | 47 apply_property_to_regular_style_(true), |
48 apply_property_to_visited_link_style_(false), | 48 apply_property_to_visited_link_style_(false), |
49 has_dir_auto_attribute_(false), | 49 has_dir_auto_attribute_(false), |
50 font_builder_(document), | 50 font_builder_(document), |
51 element_style_resources_(document, document.DevicePixelRatio()) { | 51 element_style_resources_(document, document.DevicePixelRatio()) { |
52 DCHECK(!!parent_style_ == !!layout_parent_style_); | 52 DCHECK(!!parent_style_ == !!layout_parent_style_); |
53 | 53 |
54 if (!parent_style_) { | 54 if (!parent_style_) { |
55 // TODO(jchaffraix): We should make m_parentStyle const | 55 // TODO(jchaffraix): We should make parent_style_ const |
56 // (https://crbug.com/468152) | 56 // (https://crbug.com/468152) |
57 parent_style_ = const_cast<ComputedStyle*>(element_context_.ParentStyle()); | 57 parent_style_ = const_cast<ComputedStyle*>(element_context_.ParentStyle()); |
58 } | 58 } |
59 | 59 |
60 if (!layout_parent_style_) | 60 if (!layout_parent_style_) |
61 layout_parent_style_ = element_context_.LayoutParentStyle(); | 61 layout_parent_style_ = element_context_.LayoutParentStyle(); |
62 | 62 |
63 if (!layout_parent_style_) | 63 if (!layout_parent_style_) |
64 layout_parent_style_ = parent_style_; | 64 layout_parent_style_ = parent_style_; |
65 | 65 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 HeapHashMap<CSSPropertyID, Member<const CSSValue>>* map = | 122 HeapHashMap<CSSPropertyID, Member<const CSSValue>>* map = |
123 parsed_properties_for_pending_substitution_cache_.at(&value); | 123 parsed_properties_for_pending_substitution_cache_.at(&value); |
124 if (!map) { | 124 if (!map) { |
125 map = new HeapHashMap<CSSPropertyID, Member<const CSSValue>>; | 125 map = new HeapHashMap<CSSPropertyID, Member<const CSSValue>>; |
126 parsed_properties_for_pending_substitution_cache_.Set(&value, map); | 126 parsed_properties_for_pending_substitution_cache_.Set(&value, map); |
127 } | 127 } |
128 return *map; | 128 return *map; |
129 } | 129 } |
130 | 130 |
131 } // namespace blink | 131 } // namespace blink |
OLD | NEW |