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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutMenuList.cpp

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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutMenuList.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutMenuList.cpp b/third_party/WebKit/Source/core/layout/LayoutMenuList.cpp
index 1bf8f99383b4750b86423529cb475880d4a7d2ab..76de7672f6fa11cd5ce43a18ecb88cb44087ff18 100644
--- a/third_party/WebKit/Source/core/layout/LayoutMenuList.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutMenuList.cpp
@@ -155,7 +155,9 @@ void LayoutMenuList::styleDidChange(StyleDifference diff,
}
void LayoutMenuList::updateInnerBlockHeight() {
- m_innerBlockHeight = style()->getFontMetrics().height() +
+ const SimpleFontData* fontData = style()->font().primaryFont();
+ DCHECK(fontData);
+ m_innerBlockHeight = (fontData ? fontData->getFontMetrics().height() : 0) +
m_innerBlock->borderAndPaddingHeight();
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutListMarker.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698