OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 static void ClientDestroyed(LayoutObject*); | 55 static void ClientDestroyed(LayoutObject*); |
56 | 56 |
57 // Called from all SVG layoutObjects layout() methods. | 57 // Called from all SVG layoutObjects layout() methods. |
58 static void ClientLayoutChanged(LayoutObject*); | 58 static void ClientLayoutChanged(LayoutObject*); |
59 | 59 |
60 // Called from all SVG layoutObjects styleDidChange() methods. | 60 // Called from all SVG layoutObjects styleDidChange() methods. |
61 static void ClientStyleChanged(LayoutObject*, | 61 static void ClientStyleChanged(LayoutObject*, |
62 StyleDifference, | 62 StyleDifference, |
63 const ComputedStyle& new_style); | 63 const ComputedStyle& new_style); |
64 | 64 |
| 65 class TemporaryStyleScope { |
| 66 WTF_MAKE_NONCOPYABLE(TemporaryStyleScope); |
| 67 STACK_ALLOCATED(); |
| 68 |
| 69 public: |
| 70 TemporaryStyleScope(LayoutObject&, |
| 71 const ComputedStyle& original_style, |
| 72 const ComputedStyle& temporary_style); |
| 73 ~TemporaryStyleScope() { SwitchTo(original_style_); } |
| 74 |
| 75 private: |
| 76 void SwitchTo(const ComputedStyle&); |
| 77 |
| 78 LayoutObject& layout_object_; |
| 79 const ComputedStyle& original_style_; |
| 80 const bool styles_are_equal_; |
| 81 }; |
| 82 |
65 private: | 83 private: |
66 void AddResourcesFromLayoutObject(LayoutObject*, const ComputedStyle&); | 84 void AddResourcesFromLayoutObject(LayoutObject*, const ComputedStyle&); |
67 void RemoveResourcesFromLayoutObject(LayoutObject*); | 85 void RemoveResourcesFromLayoutObject(LayoutObject*); |
68 | 86 |
69 typedef HashMap<const LayoutObject*, std::unique_ptr<SVGResources>> CacheMap; | 87 typedef HashMap<const LayoutObject*, std::unique_ptr<SVGResources>> CacheMap; |
70 CacheMap cache_; | 88 CacheMap cache_; |
71 }; | 89 }; |
72 | 90 |
73 } // namespace blink | 91 } // namespace blink |
74 | 92 |
75 #endif | 93 #endif |
OLD | NEW |