| 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 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef LayoutRuby_h | 31 #ifndef LayoutRuby_h |
| 32 #define LayoutRuby_h | 32 #define LayoutRuby_h |
| 33 | 33 |
| 34 #include "core/layout/LayoutBlockFlow.h" | 34 #include "core/layout/LayoutBlockFlow.h" |
| 35 #include "core/layout/LayoutInline.h" | 35 #include "core/layout/LayoutInline.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 // Following the HTML 5 spec, the box object model for a <ruby> element allows s
everal runs of ruby | 39 // Following the HTML 5 spec, the box object model for a <ruby> element allows |
| 40 // several runs of ruby |
| 40 // bases with their respective ruby texts looks as follows: | 41 // bases with their respective ruby texts looks as follows: |
| 41 // | 42 // |
| 42 // 1 LayoutRuby object, corresponding to the whole <ruby> HTML element | 43 // 1 LayoutRuby object, corresponding to the whole <ruby> HTML element |
| 43 // 1+ LayoutRubyRun (anonymous) | 44 // 1+ LayoutRubyRun (anonymous) |
| 44 // 0 or 1 LayoutRubyText - shuffled to the front in order to re-use exi
sting block layouting | 45 // 0 or 1 LayoutRubyText - shuffled to the front in order to re-use |
| 46 // existing block layouting |
| 45 // 0-n inline object(s) | 47 // 0-n inline object(s) |
| 46 // 0 or 1 LayoutRubyBase - contains the inline objects that make up the
ruby base | 48 // 0 or 1 LayoutRubyBase - contains the inline objects that make up the |
| 49 // ruby base |
| 47 // 1-n inline object(s) | 50 // 1-n inline object(s) |
| 48 // | 51 // |
| 49 // Note: <rp> elements are defined as having 'display:none' and thus normally ar
e not assigned a layoutObject. | 52 // Note: <rp> elements are defined as having 'display:none' and thus normally |
| 53 // are not assigned a layoutObject. |
| 50 // | 54 // |
| 51 // Generated :before/:after content is shunted into anonymous inline blocks | 55 // Generated :before/:after content is shunted into anonymous inline blocks |
| 52 | 56 |
| 53 // <ruby> when used as 'display:inline' | 57 // <ruby> when used as 'display:inline' |
| 54 class LayoutRubyAsInline final : public LayoutInline { | 58 class LayoutRubyAsInline final : public LayoutInline { |
| 55 public: | 59 public: |
| 56 LayoutRubyAsInline(Element*); | 60 LayoutRubyAsInline(Element*); |
| 57 ~LayoutRubyAsInline() override; | 61 ~LayoutRubyAsInline() override; |
| 58 | 62 |
| 59 void addChild(LayoutObject* child, | 63 void addChild(LayoutObject* child, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } | 97 } |
| 94 bool createsAnonymousWrapper() const override { return true; } | 98 bool createsAnonymousWrapper() const override { return true; } |
| 95 void removeLeftoverAnonymousBlock(LayoutBlock*) override { | 99 void removeLeftoverAnonymousBlock(LayoutBlock*) override { |
| 96 ASSERT_NOT_REACHED(); | 100 ASSERT_NOT_REACHED(); |
| 97 } | 101 } |
| 98 }; | 102 }; |
| 99 | 103 |
| 100 } // namespace blink | 104 } // namespace blink |
| 101 | 105 |
| 102 #endif // LayoutRuby_h | 106 #endif // LayoutRuby_h |
| OLD | NEW |