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

Side by Side Diff: third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h

Issue 2416033003: Remove unsafe getFontMetrics methods (Closed)
Patch Set: Address wkroman suggestions Created 4 years, 2 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) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
4 * All right reserved. 4 * All right reserved.
5 * Copyright (C) 2010 Google Inc. All rights reserved. 5 * Copyright (C) 2010 Google Inc. All rights reserved.
6 * Copyright (C) 2013 Adobe Systems Incorporated. 6 * Copyright (C) 2013 Adobe Systems Incorporated.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 (!lineInfo.isEmpty() || !lineInfo.previousLineBrokeCleanly())); 246 (!lineInfo.isEmpty() || !lineInfo.previousLineBrokeCleanly()));
247 } 247 }
248 248
249 inline bool requiresLineBoxForContent(LineLayoutInline flow, 249 inline bool requiresLineBoxForContent(LineLayoutInline flow,
250 const LineInfo& lineInfo) { 250 const LineInfo& lineInfo) {
251 LineLayoutItem parent = flow.parent(); 251 LineLayoutItem parent = flow.parent();
252 if (flow.document().inNoQuirksMode() && 252 if (flow.document().inNoQuirksMode() &&
253 (flow.style(lineInfo.isFirstLine())->lineHeight() != 253 (flow.style(lineInfo.isFirstLine())->lineHeight() !=
254 parent.style(lineInfo.isFirstLine())->lineHeight() || 254 parent.style(lineInfo.isFirstLine())->lineHeight() ||
255 flow.style()->verticalAlign() != parent.style()->verticalAlign() || 255 flow.style()->verticalAlign() != parent.style()->verticalAlign() ||
256 !parent.style() 256 !parent.style()->hasIdenticalAscentDescentAndLineGap(flow.styleRef())))
257 ->font()
258 .getFontMetrics()
259 .hasIdenticalAscentDescentAndLineGap(
260 flow.style()->font().getFontMetrics())))
261 return true; 257 return true;
262 return false; 258 return false;
263 } 259 }
264 260
265 inline bool alwaysRequiresLineBox(LineLayoutItem flow) { 261 inline bool alwaysRequiresLineBox(LineLayoutItem flow) {
266 // FIXME: Right now, we only allow line boxes for inlines that are truly 262 // FIXME: Right now, we only allow line boxes for inlines that are truly
267 // empty. We need to fix this, though, because at the very least, inlines 263 // empty. We need to fix this, though, because at the very least, inlines
268 // containing only ignorable whitespace should should also have line boxes. 264 // containing only ignorable whitespace should should also have line boxes.
269 return isEmptyInline(flow) && 265 return isEmptyInline(flow) &&
270 LineLayoutInline(flow).hasInlineDirectionBordersPaddingOrMargin(); 266 LineLayoutInline(flow).hasInlineDirectionBordersPaddingOrMargin();
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1497 1493
1498 if (style.getTextIndentType() == TextIndentHanging) 1494 if (style.getTextIndentType() == TextIndentHanging)
1499 indentText = indentText == IndentText ? DoNotIndentText : IndentText; 1495 indentText = indentText == IndentText ? DoNotIndentText : IndentText;
1500 1496
1501 return indentText; 1497 return indentText;
1502 } 1498 }
1503 1499
1504 } // namespace blink 1500 } // namespace blink
1505 1501
1506 #endif // BreakingContextInlineHeaders_h 1502 #endif // BreakingContextInlineHeaders_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTextControl.cpp ('k') | third_party/WebKit/Source/core/layout/line/InlineBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698