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

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

Issue 693283002: Avoid anchoring to pseudo elements when using logical ordering in a selection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 { 827 {
828 LineBoxContain lineBoxContain = renderer().style()->lineBoxContain(); 828 LineBoxContain lineBoxContain = renderer().style()->lineBoxContain();
829 return (lineBoxContain & LineBoxContainBlock) || (lineBoxContain & LineBoxCo ntainInline) || (lineBoxContain & LineBoxContainFont); 829 return (lineBoxContain & LineBoxContainBlock) || (lineBoxContain & LineBoxCo ntainInline) || (lineBoxContain & LineBoxContainFont);
830 } 830 }
831 831
832 Node* RootInlineBox::getLogicalStartBoxWithNode(InlineBox*& startBox) const 832 Node* RootInlineBox::getLogicalStartBoxWithNode(InlineBox*& startBox) const
833 { 833 {
834 Vector<InlineBox*> leafBoxesInLogicalOrder; 834 Vector<InlineBox*> leafBoxesInLogicalOrder;
835 collectLeafBoxesInLogicalOrder(leafBoxesInLogicalOrder); 835 collectLeafBoxesInLogicalOrder(leafBoxesInLogicalOrder);
836 for (size_t i = 0; i < leafBoxesInLogicalOrder.size(); ++i) { 836 for (size_t i = 0; i < leafBoxesInLogicalOrder.size(); ++i) {
837 if (leafBoxesInLogicalOrder[i]->renderer().node()) { 837 if (leafBoxesInLogicalOrder[i]->renderer().nonPseudoNode()) {
838 startBox = leafBoxesInLogicalOrder[i]; 838 startBox = leafBoxesInLogicalOrder[i];
839 return startBox->renderer().node(); 839 return startBox->renderer().nonPseudoNode();
840 } 840 }
841 } 841 }
842 startBox = 0; 842 startBox = 0;
843 return 0; 843 return 0;
844 } 844 }
845 845
846 Node* RootInlineBox::getLogicalEndBoxWithNode(InlineBox*& endBox) const 846 Node* RootInlineBox::getLogicalEndBoxWithNode(InlineBox*& endBox) const
847 { 847 {
848 Vector<InlineBox*> leafBoxesInLogicalOrder; 848 Vector<InlineBox*> leafBoxesInLogicalOrder;
849 collectLeafBoxesInLogicalOrder(leafBoxesInLogicalOrder); 849 collectLeafBoxesInLogicalOrder(leafBoxesInLogicalOrder);
850 for (size_t i = leafBoxesInLogicalOrder.size(); i > 0; --i) { 850 for (size_t i = leafBoxesInLogicalOrder.size(); i > 0; --i) {
851 if (leafBoxesInLogicalOrder[i - 1]->renderer().node()) { 851 if (leafBoxesInLogicalOrder[i - 1]->renderer().nonPseudoNode()) {
852 endBox = leafBoxesInLogicalOrder[i - 1]; 852 endBox = leafBoxesInLogicalOrder[i - 1];
853 return endBox->renderer().node(); 853 return endBox->renderer().nonPseudoNode();
854 } 854 }
855 } 855 }
856 endBox = 0; 856 endBox = 0;
857 return 0; 857 return 0;
858 } 858 }
859 859
860 #ifndef NDEBUG 860 #ifndef NDEBUG
861 const char* RootInlineBox::boxName() const 861 const char* RootInlineBox::boxName() const
862 { 862 {
863 return "RootInlineBox"; 863 return "RootInlineBox";
864 } 864 }
865 #endif 865 #endif
866 866
867 } // namespace blink 867 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698