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

Side by Side Diff: Source/core/editing/iterators/TextIterator.cpp

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated patch after splitting Created 5 years, 10 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
3 * Copyright (C) 2005 Alexey Proskuryakov. 3 * Copyright (C) 2005 Alexey Proskuryakov.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 828
829 // NOTE: We only do this for a select set of nodes, and fwiw WinIE appears 829 // NOTE: We only do this for a select set of nodes, and fwiw WinIE appears
830 // not to do this at all 830 // not to do this at all
831 if (node->hasTagName(h1Tag) 831 if (node->hasTagName(h1Tag)
832 || node->hasTagName(h2Tag) 832 || node->hasTagName(h2Tag)
833 || node->hasTagName(h3Tag) 833 || node->hasTagName(h3Tag)
834 || node->hasTagName(h4Tag) 834 || node->hasTagName(h4Tag)
835 || node->hasTagName(h5Tag) 835 || node->hasTagName(h5Tag)
836 || node->hasTagName(h6Tag) 836 || node->hasTagName(h6Tag)
837 || node->hasTagName(pTag)) { 837 || node->hasTagName(pTag)) {
838 LayoutStyle* style = r->style(); 838 const LayoutStyle* style = r->style();
839 if (style) { 839 if (style) {
840 int bottomMargin = toRenderBox(r)->collapsedMarginAfter(); 840 int bottomMargin = toRenderBox(r)->collapsedMarginAfter();
841 int fontSize = style->fontDescription().computedPixelSize(); 841 int fontSize = style->fontDescription().computedPixelSize();
842 if (bottomMargin * 2 >= fontSize) 842 if (bottomMargin * 2 >= fontSize)
843 return true; 843 return true;
844 } 844 }
845 } 845 }
846 846
847 return false; 847 return false;
848 } 848 }
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1178 return createPlainText(it); 1178 return createPlainText(it);
1179 } 1179 }
1180 1180
1181 String plainText(const Position& start, const Position& end, TextIteratorBehavio rFlags behavior) 1181 String plainText(const Position& start, const Position& end, TextIteratorBehavio rFlags behavior)
1182 { 1182 {
1183 TextIterator it(start, end, behavior); 1183 TextIterator it(start, end, behavior);
1184 return createPlainText(it); 1184 return createPlainText(it);
1185 } 1185 }
1186 1186
1187 } 1187 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698