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. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
5 * All rights reserved. | 5 * All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 TextRun InlineTextBox::constructTextRun( | 641 TextRun InlineTextBox::constructTextRun( |
642 const ComputedStyle& style, | 642 const ComputedStyle& style, |
643 StringBuilder* charactersWithHyphen) const { | 643 StringBuilder* charactersWithHyphen) const { |
644 ASSERT(getLineLayoutItem().text()); | 644 ASSERT(getLineLayoutItem().text()); |
645 | 645 |
646 String string = getLineLayoutItem().text(); | 646 String string = getLineLayoutItem().text(); |
647 unsigned startPos = start(); | 647 unsigned startPos = start(); |
648 unsigned length = len(); | 648 unsigned length = len(); |
649 // Ensure |this| is in sync with the corresponding LayoutText. Checking here | 649 // Ensure |this| is in sync with the corresponding LayoutText. Checking here |
650 // has less binary size/perf impact than in StringView(). | 650 // has less binary size/perf impact than in StringView(). |
651 RELEASE_ASSERT(startPos <= string.length() && | 651 CHECK_LE(startPos, string.length()); |
652 length <= string.length() - startPos); | 652 CHECK_LE(length, string.length() - startPos); |
653 return constructTextRun(style, StringView(string, startPos, length), | 653 return constructTextRun(style, StringView(string, startPos, length), |
654 getLineLayoutItem().textLength() - startPos, | 654 getLineLayoutItem().textLength() - startPos, |
655 charactersWithHyphen); | 655 charactersWithHyphen); |
656 } | 656 } |
657 | 657 |
658 TextRun InlineTextBox::constructTextRun( | 658 TextRun InlineTextBox::constructTextRun( |
659 const ComputedStyle& style, | 659 const ComputedStyle& style, |
660 StringView string, | 660 StringView string, |
661 int maximumLength, | 661 int maximumLength, |
662 StringBuilder* charactersWithHyphen) const { | 662 StringBuilder* charactersWithHyphen) const { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 const int layoutObjectCharacterOffset = 75; | 717 const int layoutObjectCharacterOffset = 75; |
718 for (; printedCharacters < layoutObjectCharacterOffset; printedCharacters++) | 718 for (; printedCharacters < layoutObjectCharacterOffset; printedCharacters++) |
719 fputc(' ', stderr); | 719 fputc(' ', stderr); |
720 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), | 720 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), |
721 value.utf8().data()); | 721 value.utf8().data()); |
722 } | 722 } |
723 | 723 |
724 #endif | 724 #endif |
725 | 725 |
726 } // namespace blink | 726 } // namespace blink |
OLD | NEW |