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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutVTTCue.cpp

Issue 2261663002: Disallow cast/implicit conversion from LayoutUnit to int/unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Victor Carbune (victor@rosedu.org) 2 * Copyright (C) 2012 Victor Carbune (victor@rosedu.org)
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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 bool switched = false; 206 bool switched = false;
207 207
208 // 14. Horizontal: Let title area be a box that covers all of the video's 208 // 14. Horizontal: Let title area be a box that covers all of the video's
209 // rendering area except for a height of margin at the top of the rendering 209 // rendering area except for a height of margin at the top of the rendering
210 // area and a height of margin at the bottom of the rendering area. 210 // area and a height of margin at the bottom of the rendering area.
211 // Vertical: Let title area be a box that covers all of the video’s 211 // Vertical: Let title area be a box that covers all of the video’s
212 // rendering area except for a width of margin at the left of the rendering 212 // rendering area except for a width of margin at the left of the rendering
213 // area and a width of margin at the right of the rendering area. 213 // area and a width of margin at the right of the rendering area.
214 IntRect titleArea = m_cueBox.containingBlock()->absoluteBoundingBoxRect(); 214 IntRect titleArea = m_cueBox.containingBlock()->absoluteBoundingBoxRect();
215 if (blink::isHorizontalWritingMode(writingMode)) { 215 if (blink::isHorizontalWritingMode(writingMode)) {
216 titleArea.move(0, margin); 216 titleArea.move(0, margin.toInt());
217 titleArea.contract(0, 2 * margin); 217 titleArea.contract(0, (2 * margin).toInt());
218 } else { 218 } else {
219 titleArea.move(margin, 0); 219 titleArea.move(margin.toInt(), 0);
220 titleArea.contract(2 * margin, 0); 220 titleArea.contract((2 * margin).toInt(), 0);
221 } 221 }
222 222
223 // 15. Step loop: If none of the boxes in boxes would overlap any of the 223 // 15. Step loop: If none of the boxes in boxes would overlap any of the
224 // boxes in output, and all of the boxes in output are entirely within the 224 // boxes in output, and all of the boxes in output are entirely within the
225 // title area box, then jump to the step labeled done positioning below. 225 // title area box, then jump to the step labeled done positioning below.
226 while (isOutside(titleArea) || isOverlapping()) { 226 while (isOutside(titleArea) || isOverlapping()) {
227 // 16. Let current position score be the percentage of the area of the 227 // 16. Let current position score be the percentage of the area of the
228 // bounding box of the boxes in boxes that is outside the title area 228 // bounding box of the boxes in boxes that is outside the title area
229 // box. 229 // box.
230 if (!shouldSwitchDirection(firstLineBox, step, margin)) { 230 if (!shouldSwitchDirection(firstLineBox, step, margin)) {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 } 330 }
331 331
332 // http://dev.w3.org/html5/webvtt/#dfn-apply-webvtt-cue-settings - step 13. 332 // http://dev.w3.org/html5/webvtt/#dfn-apply-webvtt-cue-settings - step 13.
333 if (!std::isnan(m_snapToLinesPosition)) 333 if (!std::isnan(m_snapToLinesPosition))
334 SnapToLinesLayouter(*this, controlsRect).layout(); 334 SnapToLinesLayouter(*this, controlsRect).layout();
335 else 335 else
336 repositionCueSnapToLinesNotSet(); 336 repositionCueSnapToLinesNotSet();
337 } 337 }
338 338
339 } // namespace blink 339 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698