Index: third_party/WebKit/Source/core/layout/LayoutText.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutText.cpp b/third_party/WebKit/Source/core/layout/LayoutText.cpp |
index d34eda4f1c0fff3c89964ec7c5b100b0120097ca..573967a8f8abf3128c93abec98b33c9534f1cfbc 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutText.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutText.cpp |
@@ -1957,6 +1957,22 @@ LayoutRect LayoutText::visualOverflowRect() const { |
LayoutUnit logicalHeight = |
lastTextBox()->logicalBottomVisualOverflow() - logicalTop; |
+ // Inflate visual overflow if we have adjusted ascent/descent causing the |
eae
2017/04/07 17:41:57
This is better, thank you. I'm still not convinced
Xianzhu
2017/04/07 18:02:52
What do you think about my previous comment:
https
|
+ // painted glyphs to overflow the layout geometries based on the adjusted |
+ // ascent/descent. |
+ auto inflationForAscent = styleRef(firstTextBox()->isFirstLineStyle()) |
+ .font() |
+ .primaryFont() |
eae
2017/04/07 17:41:57
primaryFont may be null.
Xianzhu
2017/04/07 18:02:53
Done.
Should we have DCHECK(primaryFont) here? I
|
+ ->getFontMetrics() |
+ .visualOverflowInflationForAscent(); |
+ auto inflationForDescent = styleRef(lastTextBox()->isFirstLineStyle()) |
+ .font() |
+ .primaryFont() |
+ ->getFontMetrics() |
+ .visualOverflowInflationForDescent(); |
+ logicalTop -= inflationForAscent; |
+ logicalHeight += inflationForAscent + inflationForDescent; |
+ |
LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight); |
if (!style()->isHorizontalWritingMode()) |
rect = rect.transposedRect(); |