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

Side by Side Diff: Source/core/rendering/line/BreakingContextInlineHeaders.h

Issue 372023002: Abs-positioned objects should move with inline rel-positioned containers when the latter change wid… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderBox.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) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved.
4 * Copyright (C) 2010 Google Inc. All rights reserved. 4 * Copyright (C) 2010 Google Inc. All rights reserved.
5 * Copyright (C) 2013 Adobe Systems Incorporated. 5 * Copyright (C) 2013 Adobe Systems Incorporated.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 if (!shouldCollapseWhiteSpace(it.object()->style(), lineInfo, whitespacePosi tion) || it.object()->isBR()) 193 if (!shouldCollapseWhiteSpace(it.object()->style(), lineInfo, whitespacePosi tion) || it.object()->isBR())
194 return true; 194 return true;
195 195
196 UChar current = it.current(); 196 UChar current = it.current();
197 bool notJustWhitespace = current != ' ' && current != '\t' && current != sof tHyphen && (current != '\n' || it.object()->preservesNewline()); 197 bool notJustWhitespace = current != ' ' && current != '\t' && current != sof tHyphen && (current != '\n' || it.object()->preservesNewline());
198 return notJustWhitespace || isEmptyInline(it.object()); 198 return notJustWhitespace || isEmptyInline(it.object());
199 } 199 }
200 200
201 inline void setStaticPositions(RenderBlockFlow* block, RenderBox* child) 201 inline void setStaticPositions(RenderBlockFlow* block, RenderBox* child)
202 { 202 {
203 ASSERT(child->isOutOfFlowPositioned());
203 // FIXME: The math here is actually not really right. It's a best-guess appr oximation that 204 // FIXME: The math here is actually not really right. It's a best-guess appr oximation that
204 // will work for the common cases 205 // will work for the common cases
205 RenderObject* containerBlock = child->container(); 206 RenderObject* containerBlock = child->container();
206 LayoutUnit blockHeight = block->logicalHeight(); 207 LayoutUnit blockHeight = block->logicalHeight();
207 if (containerBlock->isRenderInline()) { 208 if (containerBlock->isRenderInline()) {
208 // A relative positioned inline encloses us. In this case, we also have to determine our 209 // A relative positioned inline encloses us. In this case, we also have to determine our
209 // position as though we were an inline. Set |staticInlinePosition| and |staticBlockPosition| on the relative positioned 210 // position as though we were an inline. Set |staticInlinePosition| and |staticBlockPosition| on the relative positioned
210 // inline so that we can obtain the value later. 211 // inline so that we can obtain the value later.
211 toRenderInline(containerBlock)->layer()->setStaticInlinePosition(block-> startAlignedOffsetForLine(blockHeight, false)); 212 toRenderInline(containerBlock)->layer()->setStaticInlinePosition(block-> startAlignedOffsetForLine(blockHeight, false));
212 toRenderInline(containerBlock)->layer()->setStaticBlockPosition(blockHei ght); 213 toRenderInline(containerBlock)->layer()->setStaticBlockPosition(blockHei ght);
214
215 // If |child| is a leading or trailing positioned object this is its onl y opportunity to ensure it moves with an inline
216 // container changing width.
217 child->moveWithEdgeOfInlineContainerIfNecessary(child->isHorizontalWriti ngMode());
213 } 218 }
214 block->updateStaticInlinePositionForChild(child, blockHeight); 219 block->updateStaticInlinePositionForChild(child, blockHeight);
215 child->layer()->setStaticBlockPosition(blockHeight); 220 child->layer()->setStaticBlockPosition(blockHeight);
216 } 221 }
217 222
218 // FIXME: The entire concept of the skipTrailingWhitespace function is flawed, s ince we really need to be building 223 // FIXME: The entire concept of the skipTrailingWhitespace function is flawed, s ince we really need to be building
219 // line boxes even for containers that may ultimately collapse away. Otherwise w e'll never get positioned 224 // line boxes even for containers that may ultimately collapse away. Otherwise w e'll never get positioned
220 // elements quite right. In other words, we need to build this function's work i nto the normal line 225 // elements quite right. In other words, we need to build this function's work i nto the normal line
221 // object iteration process. 226 // object iteration process.
222 // NB. this function will insert any floating elements that would otherwise 227 // NB. this function will insert any floating elements that would otherwise
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 907
903 if (style->textIndentType() == TextIndentHanging) 908 if (style->textIndentType() == TextIndentHanging)
904 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In dentText; 909 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In dentText;
905 910
906 return shouldIndentText; 911 return shouldIndentText;
907 } 912 }
908 913
909 } 914 }
910 915
911 #endif // BreakingContextInlineHeaders_h 916 #endif // BreakingContextInlineHeaders_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698