Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 // FIXME: Is it actually possible to try and paint a dirty InlineTextBox? | 73 // FIXME: Is it actually possible to try and paint a dirty InlineTextBox? |
| 74 InlineTextBoxPainter::removeFromTextBlobCache(*this); | 74 InlineTextBoxPainter::removeFromTextBlobCache(*this); |
| 75 | 75 |
| 76 m_len = 0; | 76 m_len = 0; |
| 77 m_start = 0; | 77 m_start = 0; |
| 78 InlineBox::markDirty(); | 78 InlineBox::markDirty(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 LayoutRect InlineTextBox::logicalOverflowRect() const | 81 LayoutRect InlineTextBox::logicalOverflowRect() const |
| 82 { | 82 { |
| 83 if (knownToHaveNoOverflow() || !gTextBoxesWithOverflow) { | 83 if (knownToHaveNoOverflow() || !gTextBoxesWithOverflow) { |
|
leviw_travelin_and_unemployed
2016/05/11 00:49:24
And remove those braces! :)
wkorman
2016/05/15 22:01:03
Done.
| |
| 84 // FIXME: the call to rawValue() below is temporary and should be remove d once the transition | 84 return logicalFrameRect(); |
| 85 // to LayoutUnit-based types is complete (crbug.com/321237). The call to enclosingIntRect() | |
| 86 // should also likely be switched to LayoutUnit pixel-snapping. | |
| 87 return LayoutRect(enclosingIntRect(logicalFrameRect())); | |
| 88 } | 85 } |
| 89 | 86 |
| 90 return gTextBoxesWithOverflow->get(this); | 87 return gTextBoxesWithOverflow->get(this); |
| 91 } | 88 } |
| 92 | 89 |
| 93 void InlineTextBox::setLogicalOverflowRect(const LayoutRect& rect) | 90 void InlineTextBox::setLogicalOverflowRect(const LayoutRect& rect) |
| 94 { | 91 { |
| 95 ASSERT(!knownToHaveNoOverflow()); | 92 ASSERT(!knownToHaveNoOverflow()); |
| 96 if (!gTextBoxesWithOverflow) | 93 if (!gTextBoxesWithOverflow) |
| 97 gTextBoxesWithOverflow = new InlineTextBoxOverflowMap; | 94 gTextBoxesWithOverflow = new InlineTextBoxOverflowMap; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 | 227 |
| 231 StringBuilder charactersWithHyphen; | 228 StringBuilder charactersWithHyphen; |
| 232 bool respectHyphen = ePos == m_len && hasHyphen(); | 229 bool respectHyphen = ePos == m_len && hasHyphen(); |
| 233 TextRun textRun = constructTextRun(styleToUse, font, respectHyphen ? &charac tersWithHyphen : 0); | 230 TextRun textRun = constructTextRun(styleToUse, font, respectHyphen ? &charac tersWithHyphen : 0); |
| 234 | 231 |
| 235 LayoutPoint startingPoint = LayoutPoint(logicalLeft(), selTop); | 232 LayoutPoint startingPoint = LayoutPoint(logicalLeft(), selTop); |
| 236 LayoutRect r; | 233 LayoutRect r; |
| 237 if (sPos || ePos != static_cast<int>(m_len)) { | 234 if (sPos || ePos != static_cast<int>(m_len)) { |
| 238 r = LayoutRect(enclosingIntRect(font.selectionRectForText(textRun, Float Point(startingPoint), selHeight, sPos, ePos))); | 235 r = LayoutRect(enclosingIntRect(font.selectionRectForText(textRun, Float Point(startingPoint), selHeight, sPos, ePos))); |
| 239 } else { // Avoid computing the font width when the entire line box is selec ted as an optimization. | 236 } else { // Avoid computing the font width when the entire line box is selec ted as an optimization. |
| 240 // FIXME: the call to rawValue() below is temporary and should be remove d once the transition | |
| 241 // to LayoutUnit-based types is complete (crbug.com/321237) | |
| 242 r = LayoutRect(enclosingIntRect(LayoutRect(startingPoint, LayoutSize(m_l ogicalWidth, selHeight)))); | 237 r = LayoutRect(enclosingIntRect(LayoutRect(startingPoint, LayoutSize(m_l ogicalWidth, selHeight)))); |
| 243 } | 238 } |
| 244 | 239 |
| 245 LayoutUnit logicalWidth = r.width(); | 240 LayoutUnit logicalWidth = r.width(); |
| 246 if (r.x() > logicalRight()) | 241 if (r.x() > logicalRight()) |
| 247 logicalWidth = LayoutUnit(); | 242 logicalWidth = LayoutUnit(); |
| 248 else if (r.maxX() > logicalRight()) | 243 else if (r.maxX() > logicalRight()) |
| 249 logicalWidth = logicalRight() - r.x(); | 244 logicalWidth = logicalRight() - r.x(); |
| 250 | 245 |
| 251 LayoutPoint topPoint; | 246 LayoutPoint topPoint; |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 626 printedCharacters = fprintf(stderr, "\t%s %p", obj.name(), obj.debugPointer( )); | 621 printedCharacters = fprintf(stderr, "\t%s %p", obj.name(), obj.debugPointer( )); |
| 627 const int layoutObjectCharacterOffset = 75; | 622 const int layoutObjectCharacterOffset = 75; |
| 628 for (; printedCharacters < layoutObjectCharacterOffset; printedCharacters++) | 623 for (; printedCharacters < layoutObjectCharacterOffset; printedCharacters++) |
| 629 fputc(' ', stderr); | 624 fputc(' ', stderr); |
| 630 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata()); | 625 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata()); |
| 631 } | 626 } |
| 632 | 627 |
| 633 #endif | 628 #endif |
| 634 | 629 |
| 635 } // namespace blink | 630 } // namespace blink |
| OLD | NEW |