| 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 12 matching lines...) Expand all Loading... |
| 23 #include <memory> | 23 #include <memory> |
| 24 #include "core/style/StyleDifference.h" | 24 #include "core/style/StyleDifference.h" |
| 25 #include "platform/wtf/Allocator.h" | 25 #include "platform/wtf/Allocator.h" |
| 26 #include "platform/wtf/HashMap.h" | 26 #include "platform/wtf/HashMap.h" |
| 27 #include "platform/wtf/Noncopyable.h" | 27 #include "platform/wtf/Noncopyable.h" |
| 28 | 28 |
| 29 namespace blink { | 29 namespace blink { |
| 30 | 30 |
| 31 class LayoutObject; | 31 class LayoutObject; |
| 32 class ComputedStyle; | 32 class ComputedStyle; |
| 33 class LayoutSVGResourceContainer; | |
| 34 class SVGResources; | 33 class SVGResources; |
| 35 | 34 |
| 36 class SVGResourcesCache { | 35 class SVGResourcesCache { |
| 37 WTF_MAKE_NONCOPYABLE(SVGResourcesCache); | 36 WTF_MAKE_NONCOPYABLE(SVGResourcesCache); |
| 38 USING_FAST_MALLOC(SVGResourcesCache); | 37 USING_FAST_MALLOC(SVGResourcesCache); |
| 39 | 38 |
| 40 public: | 39 public: |
| 41 SVGResourcesCache(); | 40 SVGResourcesCache(); |
| 42 ~SVGResourcesCache(); | 41 ~SVGResourcesCache(); |
| 43 | 42 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 55 static void ClientDestroyed(LayoutObject*); | 54 static void ClientDestroyed(LayoutObject*); |
| 56 | 55 |
| 57 // Called from all SVG layoutObjects layout() methods. | 56 // Called from all SVG layoutObjects layout() methods. |
| 58 static void ClientLayoutChanged(LayoutObject*); | 57 static void ClientLayoutChanged(LayoutObject*); |
| 59 | 58 |
| 60 // Called from all SVG layoutObjects styleDidChange() methods. | 59 // Called from all SVG layoutObjects styleDidChange() methods. |
| 61 static void ClientStyleChanged(LayoutObject*, | 60 static void ClientStyleChanged(LayoutObject*, |
| 62 StyleDifference, | 61 StyleDifference, |
| 63 const ComputedStyle& new_style); | 62 const ComputedStyle& new_style); |
| 64 | 63 |
| 64 // Called when the target element of a resource referenced by the |
| 65 // LayoutObject may have changed. |
| 66 static void ResourceReferenceChanged(LayoutObject&); |
| 67 |
| 65 class TemporaryStyleScope { | 68 class TemporaryStyleScope { |
| 66 WTF_MAKE_NONCOPYABLE(TemporaryStyleScope); | 69 WTF_MAKE_NONCOPYABLE(TemporaryStyleScope); |
| 67 STACK_ALLOCATED(); | 70 STACK_ALLOCATED(); |
| 68 | 71 |
| 69 public: | 72 public: |
| 70 TemporaryStyleScope(LayoutObject&, | 73 TemporaryStyleScope(LayoutObject&, |
| 71 const ComputedStyle& original_style, | 74 const ComputedStyle& original_style, |
| 72 const ComputedStyle& temporary_style); | 75 const ComputedStyle& temporary_style); |
| 73 ~TemporaryStyleScope() { SwitchTo(original_style_); } | 76 ~TemporaryStyleScope() { SwitchTo(original_style_); } |
| 74 | 77 |
| 75 private: | 78 private: |
| 76 void SwitchTo(const ComputedStyle&); | 79 void SwitchTo(const ComputedStyle&); |
| 77 | 80 |
| 78 LayoutObject& layout_object_; | 81 LayoutObject& layout_object_; |
| 79 const ComputedStyle& original_style_; | 82 const ComputedStyle& original_style_; |
| 80 const bool styles_are_equal_; | 83 const bool styles_are_equal_; |
| 81 }; | 84 }; |
| 82 | 85 |
| 83 private: | 86 private: |
| 84 void AddResourcesFromLayoutObject(LayoutObject*, const ComputedStyle&); | 87 void AddResourcesFromLayoutObject(LayoutObject*, const ComputedStyle&); |
| 85 void RemoveResourcesFromLayoutObject(LayoutObject*); | 88 void RemoveResourcesFromLayoutObject(LayoutObject*); |
| 86 | 89 |
| 87 typedef HashMap<const LayoutObject*, std::unique_ptr<SVGResources>> CacheMap; | 90 typedef HashMap<const LayoutObject*, std::unique_ptr<SVGResources>> CacheMap; |
| 88 CacheMap cache_; | 91 CacheMap cache_; |
| 89 }; | 92 }; |
| 90 | 93 |
| 91 } // namespace blink | 94 } // namespace blink |
| 92 | 95 |
| 93 #endif | 96 #endif |
| OLD | NEW |