Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXInlineTextBox.cpp

Issue 2828013002: Replace DCHECK with DCHECK_EQ and DCHECK_GT as appropriate in modules/accessibility (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013, Google Inc. All rights reserved. 2 * Copyright (C) 2013, 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 return true; 94 return true;
95 } 95 }
96 96
97 void AXInlineTextBox::TextCharacterOffsets(Vector<int>& offsets) const { 97 void AXInlineTextBox::TextCharacterOffsets(Vector<int>& offsets) const {
98 if (!inline_text_box_) 98 if (!inline_text_box_)
99 return; 99 return;
100 100
101 unsigned len = inline_text_box_->Len(); 101 unsigned len = inline_text_box_->Len();
102 Vector<float> widths; 102 Vector<float> widths;
103 inline_text_box_->CharacterWidths(widths); 103 inline_text_box_->CharacterWidths(widths);
104 DCHECK(widths.size() == len); 104 DCHECK_EQ(widths.size(), len);
105 offsets.Resize(len); 105 offsets.Resize(len);
106 106
107 float width_so_far = 0; 107 float width_so_far = 0;
108 for (unsigned i = 0; i < len; i++) { 108 for (unsigned i = 0; i < len; i++) {
109 width_so_far += widths[i]; 109 width_so_far += widths[i];
110 offsets[i] = roundf(width_so_far); 110 offsets[i] = roundf(width_so_far);
111 } 111 }
112 } 112 }
113 113
114 void AXInlineTextBox::GetWordBoundaries(Vector<AXRange>& words) const { 114 void AXInlineTextBox::GetWordBoundaries(Vector<AXRange>& words) const {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 if (previous_on_line) 179 if (previous_on_line)
180 return ax_object_cache_->GetOrCreate(previous_on_line.Get()); 180 return ax_object_cache_->GetOrCreate(previous_on_line.Get());
181 181
182 if (!inline_text_box_->IsFirst()) 182 if (!inline_text_box_->IsFirst())
183 return 0; 183 return 0;
184 184
185 return ParentObject()->PreviousOnLine(); 185 return ParentObject()->PreviousOnLine();
186 } 186 }
187 187
188 } // namespace blink 188 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698