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

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

Issue 1300823002: Introduce PositionAlgorithm<Strategy>::editingPositionOf() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-18T17:38:11 Created 5 years, 4 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 | « Source/core/editing/spellcheck/SpellChecker.cpp ('k') | Source/core/layout/LayoutObject.cpp » ('j') | 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 1756 matching lines...) Expand 10 before | Expand all | Expand 10 after
1767 1767
1768 return false; 1768 return false;
1769 } 1769 }
1770 1770
1771 Position LayoutBlock::positionForBox(InlineBox *box, bool start) const 1771 Position LayoutBlock::positionForBox(InlineBox *box, bool start) const
1772 { 1772 {
1773 if (!box) 1773 if (!box)
1774 return Position(); 1774 return Position();
1775 1775
1776 if (!box->layoutObject().nonPseudoNode()) 1776 if (!box->layoutObject().nonPseudoNode())
1777 return createLegacyEditingPosition(nonPseudoNode(), start ? caretMinOffs et() : caretMaxOffset()); 1777 return Position::editingPositionOf(nonPseudoNode(), start ? caretMinOffs et() : caretMaxOffset());
1778 1778
1779 if (!box->isInlineTextBox()) 1779 if (!box->isInlineTextBox())
1780 return createLegacyEditingPosition(box->layoutObject().nonPseudoNode(), start ? box->layoutObject().caretMinOffset() : box->layoutObject().caretMaxOffse t()); 1780 return Position::editingPositionOf(box->layoutObject().nonPseudoNode(), start ? box->layoutObject().caretMinOffset() : box->layoutObject().caretMaxOffse t());
1781 1781
1782 InlineTextBox* textBox = toInlineTextBox(box); 1782 InlineTextBox* textBox = toInlineTextBox(box);
1783 return createLegacyEditingPosition(box->layoutObject().nonPseudoNode(), star t ? textBox->start() : textBox->start() + textBox->len()); 1783 return Position::editingPositionOf(box->layoutObject().nonPseudoNode(), star t ? textBox->start() : textBox->start() + textBox->len());
1784 } 1784 }
1785 1785
1786 static inline bool isEditingBoundary(LayoutObject* ancestor, LayoutObject* child ) 1786 static inline bool isEditingBoundary(LayoutObject* ancestor, LayoutObject* child )
1787 { 1787 {
1788 ASSERT(!ancestor || ancestor->nonPseudoNode()); 1788 ASSERT(!ancestor || ancestor->nonPseudoNode());
1789 ASSERT(child && child->nonPseudoNode()); 1789 ASSERT(child && child->nonPseudoNode());
1790 return !ancestor || !ancestor->parent() || (ancestor->hasLayer() && ancestor ->parent()->isLayoutView()) 1790 return !ancestor || !ancestor->parent() || (ancestor->hasLayer() && ancestor ->parent()->isLayoutView())
1791 || ancestor->nonPseudoNode()->hasEditableStyle() == child->nonPseudoNode ()->hasEditableStyle(); 1791 || ancestor->nonPseudoNode()->hasEditableStyle() == child->nonPseudoNode ()->hasEditableStyle();
1792 } 1792 }
1793 1793
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after
2918 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 2918 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
2919 { 2919 {
2920 showLayoutObject(); 2920 showLayoutObject();
2921 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 2921 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
2922 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 2922 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
2923 } 2923 }
2924 2924
2925 #endif 2925 #endif
2926 2926
2927 } // namespace blink 2927 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/spellcheck/SpellChecker.cpp ('k') | Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698