| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 Vector<const SimpleFontData*>* usedFonts = nullptr; | 595 Vector<const SimpleFontData*>* usedFonts = nullptr; |
| 596 if (box->isText()) { | 596 if (box->isText()) { |
| 597 GlyphOverflowAndFallbackFontsMap::iterator it = | 597 GlyphOverflowAndFallbackFontsMap::iterator it = |
| 598 textBoxDataMap.find(toInlineTextBox(box)); | 598 textBoxDataMap.find(toInlineTextBox(box)); |
| 599 usedFonts = it == textBoxDataMap.end() ? 0 : &it->value.first; | 599 usedFonts = it == textBoxDataMap.end() ? 0 : &it->value.first; |
| 600 } | 600 } |
| 601 | 601 |
| 602 bool includeLeading = includeLeadingForBox(box); | 602 bool includeLeading = includeLeadingForBox(box); |
| 603 bool setUsedFontWithLeading = false; | 603 bool setUsedFontWithLeading = false; |
| 604 | 604 |
| 605 if (usedFonts && !usedFonts->isEmpty() && (box->getLineLayoutItem() | 605 if (usedFonts && !usedFonts->isEmpty() && |
| 606 .style(isFirstLineStyle()) | 606 (box->getLineLayoutItem() |
| 607 ->lineHeight() | 607 .style(isFirstLineStyle()) |
| 608 .isNegative() && | 608 ->lineHeight() |
| 609 includeLeading)) { | 609 .isNegative() && |
| 610 includeLeading)) { |
| 610 usedFonts->push_back(box->getLineLayoutItem() | 611 usedFonts->push_back(box->getLineLayoutItem() |
| 611 .style(isFirstLineStyle()) | 612 .style(isFirstLineStyle()) |
| 612 ->font() | 613 ->font() |
| 613 .primaryFont()); | 614 .primaryFont()); |
| 614 for (size_t i = 0; i < usedFonts->size(); ++i) { | 615 for (size_t i = 0; i < usedFonts->size(); ++i) { |
| 615 const FontMetrics& fontMetrics = usedFonts->at(i)->getFontMetrics(); | 616 const FontMetrics& fontMetrics = usedFonts->at(i)->getFontMetrics(); |
| 616 int usedFontAscent = fontMetrics.ascent(baselineType()); | 617 int usedFontAscent = fontMetrics.ascent(baselineType()); |
| 617 int usedFontDescent = fontMetrics.descent(baselineType()); | 618 int usedFontDescent = fontMetrics.descent(baselineType()); |
| 618 int halfLeading = (fontMetrics.lineSpacing() - fontMetrics.height()) / 2; | 619 int halfLeading = (fontMetrics.lineSpacing() - fontMetrics.height()) / 2; |
| 619 int usedFontAscentAndLeading = usedFontAscent + halfLeading; | 620 int usedFontAscentAndLeading = usedFontAscent + halfLeading; |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 } | 777 } |
| 777 endBox = nullptr; | 778 endBox = nullptr; |
| 778 return nullptr; | 779 return nullptr; |
| 779 } | 780 } |
| 780 | 781 |
| 781 const char* RootInlineBox::boxName() const { | 782 const char* RootInlineBox::boxName() const { |
| 782 return "RootInlineBox"; | 783 return "RootInlineBox"; |
| 783 } | 784 } |
| 784 | 785 |
| 785 } // namespace blink | 786 } // namespace blink |
| OLD | NEW |