Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved. |
| 4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. All rights 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 2953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2964 | 2964 |
| 2965 if (renderText->isWordBreak()) { | 2965 if (renderText->isWordBreak()) { |
| 2966 m_width.commit(); | 2966 m_width.commit(); |
| 2967 m_lineBreak.moveToStartOf(m_current.m_obj); | 2967 m_lineBreak.moveToStartOf(m_current.m_obj); |
| 2968 ASSERT(m_current.m_pos == renderText->textLength()); | 2968 ASSERT(m_current.m_pos == renderText->textLength()); |
| 2969 } | 2969 } |
| 2970 | 2970 |
| 2971 if (m_renderTextInfo.m_text != renderText) { | 2971 if (m_renderTextInfo.m_text != renderText) { |
| 2972 m_renderTextInfo.m_text = renderText; | 2972 m_renderTextInfo.m_text = renderText; |
| 2973 m_renderTextInfo.m_font = &font; | 2973 m_renderTextInfo.m_font = &font; |
| 2974 m_renderTextInfo.m_layout = font.createLayout(renderText, m_width.curren tWidth(), m_collapseWhiteSpace); | 2974 #if OS(MACOSX) |
| 2975 m_renderTextInfo.m_layout = font.createLayout(RenderBlockFlow::construct TextRun(renderText, font, renderText, renderText->style()), renderText->textLeng th(), m_width.currentWidth(), m_collapseWhiteSpace); | |
|
eae
2013/11/12 16:03:22
This looks almost identical to the non-mac code be
| |
| 2976 #else | |
| 2977 m_renderTextInfo.m_layout = nullptr; | |
| 2978 #endif | |
| 2975 m_renderTextInfo.m_lineBreakIterator.resetStringAndReleaseIterator(rende rText->text(), style->locale()); | 2979 m_renderTextInfo.m_lineBreakIterator.resetStringAndReleaseIterator(rende rText->text(), style->locale()); |
| 2976 } else if (m_renderTextInfo.m_layout && m_renderTextInfo.m_font != &font) { | 2980 } else if (m_renderTextInfo.m_layout && m_renderTextInfo.m_font != &font) { |
| 2977 m_renderTextInfo.m_font = &font; | 2981 m_renderTextInfo.m_font = &font; |
| 2978 m_renderTextInfo.m_layout = font.createLayout(renderText, m_width.curren tWidth(), m_collapseWhiteSpace); | 2982 m_renderTextInfo.m_layout = font.createLayout(RenderBlockFlow::construct TextRun(renderText, font, renderText, renderText->style()), renderText->textLeng th(), m_width.currentWidth(), m_collapseWhiteSpace); |
| 2979 } | 2983 } |
| 2980 | 2984 |
| 2981 TextLayout* textLayout = m_renderTextInfo.m_layout.get(); | 2985 TextLayout* textLayout = m_renderTextInfo.m_layout.get(); |
| 2982 | 2986 |
| 2983 // Non-zero only when kerning is enabled and TextLayout isn't used, in which case we measure | 2987 // Non-zero only when kerning is enabled and TextLayout isn't used, in which case we measure |
| 2984 // words with their trailing space, then subtract its width. | 2988 // words with their trailing space, then subtract its width. |
| 2985 float wordTrailingSpaceWidth = (font.typesettingFeatures() & Kerning) && !te xtLayout ? font.width(RenderBlockFlow::constructTextRun(renderText, font, &space , 1, style)) + wordSpacing : 0; | 2989 float wordTrailingSpaceWidth = (font.typesettingFeatures() & Kerning) && !te xtLayout ? font.width(RenderBlockFlow::constructTextRun(renderText, font, &space , 1, style)) + wordSpacing : 0; |
| 2986 | 2990 |
| 2987 UChar lastCharacter = m_renderTextInfo.m_lineBreakIterator.lastCharacter(); | 2991 UChar lastCharacter = m_renderTextInfo.m_lineBreakIterator.lastCharacter(); |
| 2988 UChar secondToLastCharacter = m_renderTextInfo.m_lineBreakIterator.secondToL astCharacter(); | 2992 UChar secondToLastCharacter = m_renderTextInfo.m_lineBreakIterator.secondToL astCharacter(); |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3548 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver ticalPositionCache); | 3552 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver ticalPositionCache); |
| 3549 | 3553 |
| 3550 setLineGridBox(lineGridBox); | 3554 setLineGridBox(lineGridBox); |
| 3551 | 3555 |
| 3552 // FIXME: If any of the characteristics of the box change compared to the ol d one, then we need to do a deep dirtying | 3556 // FIXME: If any of the characteristics of the box change compared to the ol d one, then we need to do a deep dirtying |
| 3553 // (similar to what happens when the page height changes). Ideally, though, we only do this if someone is actually snapping | 3557 // (similar to what happens when the page height changes). Ideally, though, we only do this if someone is actually snapping |
| 3554 // to this grid. | 3558 // to this grid. |
| 3555 } | 3559 } |
| 3556 | 3560 |
| 3557 } | 3561 } |
| OLD | NEW |