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

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

Issue 143323014: *** DO NOT LAND *** Attempt to understand Regions complexity Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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/RenderImage.cpp ('k') | Source/core/rendering/RenderLayer.h » ('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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 13 matching lines...) Expand all
24 #include "core/rendering/RenderInline.h" 24 #include "core/rendering/RenderInline.h"
25 25
26 #include "core/dom/FullscreenElementStack.h" 26 #include "core/dom/FullscreenElementStack.h"
27 #include "core/page/Chrome.h" 27 #include "core/page/Chrome.h"
28 #include "core/page/Page.h" 28 #include "core/page/Page.h"
29 #include "core/rendering/GraphicsContextAnnotator.h" 29 #include "core/rendering/GraphicsContextAnnotator.h"
30 #include "core/rendering/HitTestResult.h" 30 #include "core/rendering/HitTestResult.h"
31 #include "core/rendering/InlineTextBox.h" 31 #include "core/rendering/InlineTextBox.h"
32 #include "core/rendering/LayoutRectRecorder.h" 32 #include "core/rendering/LayoutRectRecorder.h"
33 #include "core/rendering/RenderBlock.h" 33 #include "core/rendering/RenderBlock.h"
34 #include "core/rendering/RenderFlowThread.h"
35 #include "core/rendering/RenderFullScreen.h" 34 #include "core/rendering/RenderFullScreen.h"
36 #include "core/rendering/RenderGeometryMap.h" 35 #include "core/rendering/RenderGeometryMap.h"
37 #include "core/rendering/RenderLayer.h" 36 #include "core/rendering/RenderLayer.h"
38 #include "core/rendering/RenderTheme.h" 37 #include "core/rendering/RenderTheme.h"
39 #include "core/rendering/RenderView.h" 38 #include "core/rendering/RenderView.h"
40 #include "core/rendering/style/StyleInheritedData.h" 39 #include "core/rendering/style/StyleInheritedData.h"
41 #include "platform/geometry/FloatQuad.h" 40 #include "platform/geometry/FloatQuad.h"
42 #include "platform/geometry/TransformState.h" 41 #include "platform/geometry/TransformState.h"
43 #include "platform/graphics/GraphicsContext.h" 42 #include "platform/graphics/GraphicsContext.h"
44 43
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 void RenderInline::updateAlwaysCreateLineBoxes(bool fullLayout) 202 void RenderInline::updateAlwaysCreateLineBoxes(bool fullLayout)
204 { 203 {
205 // Once we have been tainted once, just assume it will happen again. This wa y effects like hover highlighting that change the 204 // Once we have been tainted once, just assume it will happen again. This wa y effects like hover highlighting that change the
206 // background color will only cause a layout on the first rollover. 205 // background color will only cause a layout on the first rollover.
207 if (m_alwaysCreateLineBoxes) 206 if (m_alwaysCreateLineBoxes)
208 return; 207 return;
209 208
210 RenderStyle* parentStyle = parent()->style(); 209 RenderStyle* parentStyle = parent()->style();
211 RenderInline* parentRenderInline = parent()->isRenderInline() ? toRenderInli ne(parent()) : 0; 210 RenderInline* parentRenderInline = parent()->isRenderInline() ? toRenderInli ne(parent()) : 0;
212 bool checkFonts = document().inNoQuirksMode(); 211 bool checkFonts = document().inNoQuirksMode();
213 RenderFlowThread* flowThread = flowThreadContainingBlock();
214 bool alwaysCreateLineBoxes = (parentRenderInline && parentRenderInline->alwa ysCreateLineBoxes()) 212 bool alwaysCreateLineBoxes = (parentRenderInline && parentRenderInline->alwa ysCreateLineBoxes())
215 || (parentRenderInline && parentStyle->verticalAlign() != BASELINE) 213 || (parentRenderInline && parentStyle->verticalAlign() != BASELINE)
216 || style()->verticalAlign() != BASELINE 214 || style()->verticalAlign() != BASELINE
217 || style()->textEmphasisMark() != TextEmphasisMarkNone 215 || style()->textEmphasisMark() != TextEmphasisMarkNone
218 || (checkFonts && (!parentStyle->font().fontMetrics().hasIdenticalAscent DescentAndLineGap(style()->font().fontMetrics()) 216 || (checkFonts && (!parentStyle->font().fontMetrics().hasIdenticalAscent DescentAndLineGap(style()->font().fontMetrics())
219 || parentStyle->lineHeight() != style()->lineHeight())) 217 || parentStyle->lineHeight() != style()->lineHeight()));
220 || (flowThread && flowThread->hasRegionsWithStyling());
221 218
222 if (!alwaysCreateLineBoxes && checkFonts && document().styleEngine()->usesFi rstLineRules()) { 219 if (!alwaysCreateLineBoxes && checkFonts && document().styleEngine()->usesFi rstLineRules()) {
223 // Have to check the first line style as well. 220 // Have to check the first line style as well.
224 parentStyle = parent()->style(true); 221 parentStyle = parent()->style(true);
225 RenderStyle* childStyle = style(true); 222 RenderStyle* childStyle = style(true);
226 alwaysCreateLineBoxes = !parentStyle->font().fontMetrics().hasIdenticalA scentDescentAndLineGap(childStyle->font().fontMetrics()) 223 alwaysCreateLineBoxes = !parentStyle->font().fontMetrics().hasIdenticalA scentDescentAndLineGap(childStyle->font().fontMetrics())
227 || childStyle->verticalAlign() != BASELINE 224 || childStyle->verticalAlign() != BASELINE
228 || parentStyle->lineHeight() != childStyle->lineHeight(); 225 || parentStyle->lineHeight() != childStyle->lineHeight();
229 } 226 }
230 227
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 324
328 RenderBoxModelObject::addChild(newChild, beforeChild); 325 RenderBoxModelObject::addChild(newChild, beforeChild);
329 326
330 newChild->setNeedsLayoutAndPrefWidthsRecalc(); 327 newChild->setNeedsLayoutAndPrefWidthsRecalc();
331 } 328 }
332 329
333 RenderInline* RenderInline::clone() const 330 RenderInline* RenderInline::clone() const
334 { 331 {
335 RenderInline* cloneInline = new RenderInline(node()); 332 RenderInline* cloneInline = new RenderInline(node());
336 cloneInline->setStyle(style()); 333 cloneInline->setStyle(style());
337 cloneInline->setFlowThreadState(flowThreadState());
338 return cloneInline; 334 return cloneInline;
339 } 335 }
340 336
341 void RenderInline::splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock, 337 void RenderInline::splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock,
342 RenderBlock* middleBlock, 338 RenderBlock* middleBlock,
343 RenderObject* beforeChild, RenderBoxModelObject* oldCont) 339 RenderObject* beforeChild, RenderBoxModelObject* oldCont)
344 { 340 {
345 // Create a clone of this inline. 341 // Create a clone of this inline.
346 RenderInline* cloneInline = clone(); 342 RenderInline* cloneInline = clone();
347 cloneInline->setContinuation(oldCont); 343 cloneInline->setContinuation(oldCont);
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 if (isInFlowPositioned()) 1122 if (isInFlowPositioned())
1127 offset += offsetForInFlowPosition(); 1123 offset += offsetForInFlowPosition();
1128 1124
1129 container->adjustForColumns(offset, point); 1125 container->adjustForColumns(offset, point);
1130 1126
1131 if (container->hasOverflowClip()) 1127 if (container->hasOverflowClip())
1132 offset -= toRenderBox(container)->scrolledContentOffset(); 1128 offset -= toRenderBox(container)->scrolledContentOffset();
1133 1129
1134 if (offsetDependsOnPoint) { 1130 if (offsetDependsOnPoint) {
1135 *offsetDependsOnPoint = container->hasColumns() 1131 *offsetDependsOnPoint = container->hasColumns()
1136 || (container->isBox() && container->style()->isFlippedBlocksWriting Mode()) 1132 || (container->isBox() && container->style()->isFlippedBlocksWriting Mode());
1137 || container->isRenderFlowThread();
1138 } 1133 }
1139 1134
1140 return offset; 1135 return offset;
1141 } 1136 }
1142 1137
1143 void RenderInline::mapLocalToContainer(const RenderLayerModelObject* repaintCont ainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const 1138 void RenderInline::mapLocalToContainer(const RenderLayerModelObject* repaintCont ainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const
1144 { 1139 {
1145 if (repaintContainer == this) 1140 if (repaintContainer == this)
1146 return; 1141 return;
1147 1142
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 container = this; 1569 container = this;
1575 1570
1576 FloatPoint absPos = container->localToAbsolute(); 1571 FloatPoint absPos = container->localToAbsolute();
1577 region.bounds.setX(absPos.x() + region.bounds.x()); 1572 region.bounds.setX(absPos.x() + region.bounds.x());
1578 region.bounds.setY(absPos.y() + region.bounds.y()); 1573 region.bounds.setY(absPos.y() + region.bounds.y());
1579 1574
1580 regions.append(region); 1575 regions.append(region);
1581 } 1576 }
1582 1577
1583 } // namespace WebCore 1578 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderImage.cpp ('k') | Source/core/rendering/RenderLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698