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

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

Issue 975933002: Return reference from styleEngine() accessor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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/layout/LayoutBlock.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 * 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 const LayoutStyle& parentStyle = parent()->styleRef(); 232 const LayoutStyle& parentStyle = parent()->styleRef();
233 LayoutInline* parentLayoutInline = parent()->isLayoutInline() ? toLayoutInli ne(parent()) : 0; 233 LayoutInline* parentLayoutInline = parent()->isLayoutInline() ? toLayoutInli ne(parent()) : 0;
234 bool checkFonts = document().inNoQuirksMode(); 234 bool checkFonts = document().inNoQuirksMode();
235 bool alwaysCreateLineBoxesNew = (parentLayoutInline && parentLayoutInline->a lwaysCreateLineBoxes()) 235 bool alwaysCreateLineBoxesNew = (parentLayoutInline && parentLayoutInline->a lwaysCreateLineBoxes())
236 || (parentLayoutInline && parentStyle.verticalAlign() != BASELINE) 236 || (parentLayoutInline && parentStyle.verticalAlign() != BASELINE)
237 || style()->verticalAlign() != BASELINE 237 || style()->verticalAlign() != BASELINE
238 || style()->textEmphasisMark() != TextEmphasisMarkNone 238 || style()->textEmphasisMark() != TextEmphasisMarkNone
239 || (checkFonts && (!parentStyle.font().fontMetrics().hasIdenticalAscentD escentAndLineGap(style()->font().fontMetrics()) 239 || (checkFonts && (!parentStyle.font().fontMetrics().hasIdenticalAscentD escentAndLineGap(style()->font().fontMetrics())
240 || parentStyle.lineHeight() != style()->lineHeight())); 240 || parentStyle.lineHeight() != style()->lineHeight()));
241 241
242 if (!alwaysCreateLineBoxesNew && checkFonts && document().styleEngine()->use sFirstLineRules()) { 242 if (!alwaysCreateLineBoxesNew && checkFonts && document().styleEngine().uses FirstLineRules()) {
243 // Have to check the first line style as well. 243 // Have to check the first line style as well.
244 const LayoutStyle& firstLineParentStyle = parent()->styleRef(true); 244 const LayoutStyle& firstLineParentStyle = parent()->styleRef(true);
245 const LayoutStyle& childStyle = styleRef(true); 245 const LayoutStyle& childStyle = styleRef(true);
246 alwaysCreateLineBoxesNew = !firstLineParentStyle.font().fontMetrics().ha sIdenticalAscentDescentAndLineGap(childStyle.font().fontMetrics()) 246 alwaysCreateLineBoxesNew = !firstLineParentStyle.font().fontMetrics().ha sIdenticalAscentDescentAndLineGap(childStyle.font().fontMetrics())
247 || childStyle.verticalAlign() != BASELINE 247 || childStyle.verticalAlign() != BASELINE
248 || firstLineParentStyle.lineHeight() != childStyle.lineHeight(); 248 || firstLineParentStyle.lineHeight() != childStyle.lineHeight();
249 } 249 }
250 250
251 if (alwaysCreateLineBoxesNew) { 251 if (alwaysCreateLineBoxesNew) {
252 if (!fullLayout) 252 if (!fullLayout)
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 InlineFlowBox* LayoutInline::createAndAppendInlineFlowBox() 1307 InlineFlowBox* LayoutInline::createAndAppendInlineFlowBox()
1308 { 1308 {
1309 setAlwaysCreateLineBoxes(); 1309 setAlwaysCreateLineBoxes();
1310 InlineFlowBox* flowBox = createInlineFlowBox(); 1310 InlineFlowBox* flowBox = createInlineFlowBox();
1311 m_lineBoxes.appendLineBox(flowBox); 1311 m_lineBoxes.appendLineBox(flowBox);
1312 return flowBox; 1312 return flowBox;
1313 } 1313 }
1314 1314
1315 LayoutUnit LayoutInline::lineHeight(bool firstLine, LineDirectionMode /*directio n*/, LinePositionMode /*linePositionMode*/) const 1315 LayoutUnit LayoutInline::lineHeight(bool firstLine, LineDirectionMode /*directio n*/, LinePositionMode /*linePositionMode*/) const
1316 { 1316 {
1317 if (firstLine && document().styleEngine()->usesFirstLineRules()) { 1317 if (firstLine && document().styleEngine().usesFirstLineRules()) {
1318 const LayoutStyle* s = style(firstLine); 1318 const LayoutStyle* s = style(firstLine);
1319 if (s != style()) 1319 if (s != style())
1320 return s->computedLineHeight(); 1320 return s->computedLineHeight();
1321 } 1321 }
1322 1322
1323 return style()->computedLineHeight(); 1323 return style()->computedLineHeight();
1324 } 1324 }
1325 1325
1326 int LayoutInline::baselinePosition(FontBaseline baselineType, bool firstLine, Li neDirectionMode direction, LinePositionMode linePositionMode) const 1326 int LayoutInline::baselinePosition(FontBaseline baselineType, bool firstLine, Li neDirectionMode direction, LinePositionMode linePositionMode) const
1327 { 1327 {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 } 1456 }
1457 1457
1458 void LayoutInline::invalidateDisplayItemClients(DisplayItemList* displayItemList ) const 1458 void LayoutInline::invalidateDisplayItemClients(DisplayItemList* displayItemList ) const
1459 { 1459 {
1460 LayoutBoxModelObject::invalidateDisplayItemClients(displayItemList); 1460 LayoutBoxModelObject::invalidateDisplayItemClients(displayItemList);
1461 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) 1461 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
1462 displayItemList->invalidate(box->displayItemClient()); 1462 displayItemList->invalidate(box->displayItemClient());
1463 } 1463 }
1464 1464
1465 } // namespace blink 1465 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBlock.cpp ('k') | Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698