OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 | 32 |
33 #include "core/rendering/RenderRuby.h" | 33 #include "core/rendering/RenderRuby.h" |
34 | 34 |
| 35 #include "core/frame/UseCounter.h" |
35 #include "core/rendering/RenderRubyRun.h" | 36 #include "core/rendering/RenderRubyRun.h" |
36 #include "core/rendering/style/RenderStyle.h" | 37 #include "core/rendering/style/RenderStyle.h" |
37 #include "wtf/RefPtr.h" | 38 #include "wtf/RefPtr.h" |
38 | 39 |
39 namespace blink { | 40 namespace blink { |
40 | 41 |
41 //=== generic helper functions to avoid excessive code duplication === | 42 //=== generic helper functions to avoid excessive code duplication === |
42 | 43 |
43 static inline bool isAnonymousRubyInlineBlock(const RenderObject* object) | 44 static inline bool isAnonymousRubyInlineBlock(const RenderObject* object) |
44 { | 45 { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 while (child && !child->isRubyRun()) | 105 while (child && !child->isRubyRun()) |
105 child = child->parent(); | 106 child = child->parent(); |
106 return toRenderRubyRun(child); | 107 return toRenderRubyRun(child); |
107 } | 108 } |
108 | 109 |
109 //=== ruby as inline object === | 110 //=== ruby as inline object === |
110 | 111 |
111 RenderRubyAsInline::RenderRubyAsInline(Element* element) | 112 RenderRubyAsInline::RenderRubyAsInline(Element* element) |
112 : RenderInline(element) | 113 : RenderInline(element) |
113 { | 114 { |
| 115 UseCounter::count(document(), UseCounter::RenderRuby); |
114 } | 116 } |
115 | 117 |
116 RenderRubyAsInline::~RenderRubyAsInline() | 118 RenderRubyAsInline::~RenderRubyAsInline() |
117 { | 119 { |
118 } | 120 } |
119 | 121 |
120 void RenderRubyAsInline::styleDidChange(StyleDifference diff, const RenderStyle*
oldStyle) | 122 void RenderRubyAsInline::styleDidChange(StyleDifference diff, const RenderStyle*
oldStyle) |
121 { | 123 { |
122 RenderInline::styleDidChange(diff, oldStyle); | 124 RenderInline::styleDidChange(diff, oldStyle); |
123 propagateStyleToAnonymousChildren(); | 125 propagateStyleToAnonymousChildren(); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 RenderRubyRun* run = findRubyRunParent(child); | 214 RenderRubyRun* run = findRubyRunParent(child); |
213 ASSERT(run); | 215 ASSERT(run); |
214 run->removeChild(child); | 216 run->removeChild(child); |
215 } | 217 } |
216 | 218 |
217 //=== ruby as block object === | 219 //=== ruby as block object === |
218 | 220 |
219 RenderRubyAsBlock::RenderRubyAsBlock(Element* element) | 221 RenderRubyAsBlock::RenderRubyAsBlock(Element* element) |
220 : RenderBlockFlow(element) | 222 : RenderBlockFlow(element) |
221 { | 223 { |
| 224 UseCounter::count(document(), UseCounter::RenderRuby); |
222 } | 225 } |
223 | 226 |
224 RenderRubyAsBlock::~RenderRubyAsBlock() | 227 RenderRubyAsBlock::~RenderRubyAsBlock() |
225 { | 228 { |
226 } | 229 } |
227 | 230 |
228 void RenderRubyAsBlock::styleDidChange(StyleDifference diff, const RenderStyle*
oldStyle) | 231 void RenderRubyAsBlock::styleDidChange(StyleDifference diff, const RenderStyle*
oldStyle) |
229 { | 232 { |
230 RenderBlockFlow::styleDidChange(diff, oldStyle); | 233 RenderBlockFlow::styleDidChange(diff, oldStyle); |
231 propagateStyleToAnonymousChildren(); | 234 propagateStyleToAnonymousChildren(); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 return; | 319 return; |
317 } | 320 } |
318 | 321 |
319 // Otherwise find the containing run and remove it from there. | 322 // Otherwise find the containing run and remove it from there. |
320 RenderRubyRun* run = findRubyRunParent(child); | 323 RenderRubyRun* run = findRubyRunParent(child); |
321 ASSERT(run); | 324 ASSERT(run); |
322 run->removeChild(child); | 325 run->removeChild(child); |
323 } | 326 } |
324 | 327 |
325 } // namespace blink | 328 } // namespace blink |
OLD | NEW |