OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 2546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2557 | 2557 |
2558 LayoutRect RenderBoxModelObject::localCaretRectForEmptyElement(LayoutUnit width,
LayoutUnit textIndentOffset) | 2558 LayoutRect RenderBoxModelObject::localCaretRectForEmptyElement(LayoutUnit width,
LayoutUnit textIndentOffset) |
2559 { | 2559 { |
2560 ASSERT(!slowFirstChild()); | 2560 ASSERT(!slowFirstChild()); |
2561 | 2561 |
2562 // FIXME: This does not take into account either :first-line or :first-lette
r | 2562 // FIXME: This does not take into account either :first-line or :first-lette
r |
2563 // However, as soon as some content is entered, the line boxes will be | 2563 // However, as soon as some content is entered, the line boxes will be |
2564 // constructed and this kludge is not called any more. So only the caret siz
e | 2564 // constructed and this kludge is not called any more. So only the caret siz
e |
2565 // of an empty :first-line'd block is wrong. I think we can live with that. | 2565 // of an empty :first-line'd block is wrong. I think we can live with that. |
2566 RenderStyle* currentStyle = firstLineStyle(); | 2566 RenderStyle* currentStyle = firstLineStyle(); |
2567 LayoutUnit height = lineHeight(true, currentStyle->isHorizontalWritingMode()
? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes); | 2567 LayoutUnit height = style()->fontMetrics().height(); |
2568 | 2568 |
2569 enum CaretAlignment { alignLeft, alignRight, alignCenter }; | 2569 enum CaretAlignment { alignLeft, alignRight, alignCenter }; |
2570 | 2570 |
2571 CaretAlignment alignment = alignLeft; | 2571 CaretAlignment alignment = alignLeft; |
2572 | 2572 |
2573 switch (currentStyle->textAlign()) { | 2573 switch (currentStyle->textAlign()) { |
2574 case LEFT: | 2574 case LEFT: |
2575 case WEBKIT_LEFT: | 2575 case WEBKIT_LEFT: |
2576 break; | 2576 break; |
2577 case CENTER: | 2577 case CENTER: |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2727 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); | 2727 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
2728 for (RenderObject* child = startChild; child && child != endChild; ) { | 2728 for (RenderObject* child = startChild; child && child != endChild; ) { |
2729 // Save our next sibling as moveChildTo will clear it. | 2729 // Save our next sibling as moveChildTo will clear it. |
2730 RenderObject* nextSibling = child->nextSibling(); | 2730 RenderObject* nextSibling = child->nextSibling(); |
2731 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); | 2731 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); |
2732 child = nextSibling; | 2732 child = nextSibling; |
2733 } | 2733 } |
2734 } | 2734 } |
2735 | 2735 |
2736 } // namespace WebCore | 2736 } // namespace WebCore |
OLD | NEW |