Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: Source/core/rendering/RenderBoxModelObject.cpp

Issue 376563003: Default caret size of the empty element should match the font size (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated TestExpectations Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/editing/caret/caret-height-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « LayoutTests/editing/caret/caret-height-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698