OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 void CompositionEvent::initializeSegments(const Vector<CompositionUnderline>* un
derlines) | 76 void CompositionEvent::initializeSegments(const Vector<CompositionUnderline>* un
derlines) |
77 { | 77 { |
78 m_activeSegmentStart = 0; | 78 m_activeSegmentStart = 0; |
79 m_activeSegmentEnd = m_data.length(); | 79 m_activeSegmentEnd = m_data.length(); |
80 | 80 |
81 if (!underlines || !underlines->size()) { | 81 if (!underlines || !underlines->size()) { |
82 m_segments.append(0); | 82 m_segments.append(0); |
83 return; | 83 return; |
84 } | 84 } |
85 | 85 |
86 for (size_t i = 0; i < underlines->size(); ++i) { | 86 for (const auto& underline : *underlines) { |
87 if (underlines->at(i).thick) { | 87 if (underline.thick) { |
88 m_activeSegmentStart = underlines->at(i).startOffset; | 88 m_activeSegmentStart = underline.startOffset; |
89 m_activeSegmentEnd = underlines->at(i).endOffset; | 89 m_activeSegmentEnd = underline.endOffset; |
90 break; | 90 break; |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 for (size_t i = 0; i < underlines->size(); ++i) | 94 for (const auto& underline : *underlines) |
95 m_segments.append(underlines->at(i).startOffset); | 95 m_segments.append(underline.startOffset); |
96 } | 96 } |
97 | 97 |
98 const AtomicString& CompositionEvent::interfaceName() const | 98 const AtomicString& CompositionEvent::interfaceName() const |
99 { | 99 { |
100 return EventNames::CompositionEvent; | 100 return EventNames::CompositionEvent; |
101 } | 101 } |
102 | 102 |
103 void CompositionEvent::trace(Visitor* visitor) | 103 void CompositionEvent::trace(Visitor* visitor) |
104 { | 104 { |
105 UIEvent::trace(visitor); | 105 UIEvent::trace(visitor); |
106 } | 106 } |
107 | 107 |
108 } // namespace blink | 108 } // namespace blink |
OLD | NEW |