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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlock.cpp

Issue 2272343002: Introduce DragController::hasCaretIn() (Closed)
Patch Set: 2016-08-25T15:59:17 Created 4 years, 3 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 | « third_party/WebKit/Source/core/editing/DragCaretController.cpp ('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) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after
1600 bool LayoutBlock::hasCursorCaret() const 1600 bool LayoutBlock::hasCursorCaret() const
1601 { 1601 {
1602 LocalFrame* frame = this->frame(); 1602 LocalFrame* frame = this->frame();
1603 return frame->selection().caretLayoutObject() == this && (frame->selection() .hasEditableStyle() || caretBrowsingEnabled(frame)); 1603 return frame->selection().caretLayoutObject() == this && (frame->selection() .hasEditableStyle() || caretBrowsingEnabled(frame));
1604 } 1604 }
1605 1605
1606 bool LayoutBlock::hasDragCaret() const 1606 bool LayoutBlock::hasDragCaret() const
1607 { 1607 {
1608 LocalFrame* frame = this->frame(); 1608 LocalFrame* frame = this->frame();
1609 DragCaretController& dragCaretController = frame->page()->dragCaretControlle r(); 1609 DragCaretController& dragCaretController = frame->page()->dragCaretControlle r();
1610 return dragCaretController.caretLayoutObject() == this && (dragCaretControll er.isContentEditable() || caretBrowsingEnabled(frame)); 1610 return dragCaretController.hasCaretIn(*this);
1611 } 1611 }
1612 1612
1613 LayoutRect LayoutBlock::localCaretRect(InlineBox* inlineBox, int caretOffset, La youtUnit* extraWidthToEndOfLine) 1613 LayoutRect LayoutBlock::localCaretRect(InlineBox* inlineBox, int caretOffset, La youtUnit* extraWidthToEndOfLine)
1614 { 1614 {
1615 // Do the normal calculation in most cases. 1615 // Do the normal calculation in most cases.
1616 if ((firstChild() && !firstChild()->isPseudoElement()) || isInlineBoxWrapper ActuallyChild()) 1616 if ((firstChild() && !firstChild()->isPseudoElement()) || isInlineBoxWrapper ActuallyChild())
1617 return LayoutBox::localCaretRect(inlineBox, caretOffset, extraWidthToEnd OfLine); 1617 return LayoutBox::localCaretRect(inlineBox, caretOffset, extraWidthToEnd OfLine);
1618 1618
1619 LayoutRect caretRect = localCaretRectForEmptyElement(size().width(), textInd entOffset()); 1619 LayoutRect caretRect = localCaretRectForEmptyElement(size().width(), textInd entOffset());
1620 1620
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda ntSet->begin(); it != end; ++it) { 1871 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda ntSet->begin(); it != end; ++it) {
1872 LayoutBox* currBox = *it; 1872 LayoutBox* currBox = *it;
1873 ASSERT(!currBox->needsLayout()); 1873 ASSERT(!currBox->needsLayout());
1874 } 1874 }
1875 } 1875 }
1876 } 1876 }
1877 1877
1878 #endif 1878 #endif
1879 1879
1880 } // namespace blink 1880 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/DragCaretController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698