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

Side by Side Diff: Source/core/paint/BlockPainter.cpp

Issue 977113003: Rename renderer() to layoutObject(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 | Annotate | Revision Log
« no previous file with comments | « Source/core/paint/BlockFlowPainter.cpp ('k') | Source/core/paint/BoxPainter.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/paint/BlockPainter.h" 6 #include "core/paint/BlockPainter.h"
7 7
8 #include "core/editing/Caret.h" 8 #include "core/editing/Caret.h"
9 #include "core/editing/FrameSelection.h" 9 #include "core/editing/FrameSelection.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 void BlockPainter::paintChildAsInlineBlock(LayoutBox& child, const PaintInfo& pa intInfo, const LayoutPoint& paintOffset) 119 void BlockPainter::paintChildAsInlineBlock(LayoutBox& child, const PaintInfo& pa intInfo, const LayoutPoint& paintOffset)
120 { 120 {
121 LayoutPoint childPoint = m_layoutBlock.flipForWritingModeForChild(&child, pa intOffset); 121 LayoutPoint childPoint = m_layoutBlock.flipForWritingModeForChild(&child, pa intOffset);
122 if (!child.hasSelfPaintingLayer() && !child.isFloating()) 122 if (!child.hasSelfPaintingLayer() && !child.isFloating())
123 paintAsInlineBlock(child, paintInfo, childPoint); 123 paintAsInlineBlock(child, paintInfo, childPoint);
124 } 124 }
125 125
126 void BlockPainter::paintInlineBox(InlineBox& inlineBox, const PaintInfo& paintIn fo, const LayoutPoint& paintOffset) 126 void BlockPainter::paintInlineBox(InlineBox& inlineBox, const PaintInfo& paintIn fo, const LayoutPoint& paintOffset)
127 { 127 {
128 if (!paintInfo.shouldPaintWithinRoot(&inlineBox.renderer()) || (paintInfo.ph ase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection)) 128 if (!paintInfo.shouldPaintWithinRoot(&inlineBox.layoutObject()) || (paintInf o.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection))
129 return; 129 return;
130 130
131 LayoutPoint childPoint = paintOffset; 131 LayoutPoint childPoint = paintOffset;
132 if (inlineBox.parent()->renderer().style()->isFlippedBlocksWritingMode()) // Faster than calling containingBlock(). 132 if (inlineBox.parent()->layoutObject().style()->isFlippedBlocksWritingMode() ) // Faster than calling containingBlock().
133 childPoint = inlineBox.renderer().containingBlock()->flipForWritingModeF orChild(&toLayoutBox(inlineBox.renderer()), childPoint); 133 childPoint = inlineBox.layoutObject().containingBlock()->flipForWritingM odeForChild(&toLayoutBox(inlineBox.layoutObject()), childPoint);
134 134
135 paintAsInlineBlock(inlineBox.renderer(), paintInfo, childPoint); 135 paintAsInlineBlock(inlineBox.layoutObject(), paintInfo, childPoint);
136 } 136 }
137 137
138 void BlockPainter::paintAsInlineBlock(LayoutObject& renderer, const PaintInfo& p aintInfo, const LayoutPoint& childPoint) 138 void BlockPainter::paintAsInlineBlock(LayoutObject& renderer, const PaintInfo& p aintInfo, const LayoutPoint& childPoint)
139 { 139 {
140 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Selection) 140 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Selection)
141 return; 141 return;
142 142
143 // Paint all phases atomically, as though the element established its own 143 // Paint all phases atomically, as though the element established its own
144 // stacking context. (See Appendix E.2, section 7.2.1.4 on 144 // stacking context. (See Appendix E.2, section 7.2.1.4 on
145 // inline block/table/replaced elements in the CSS2.1 specification.) 145 // inline block/table/replaced elements in the CSS2.1 specification.)
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 paintInfoForChild.phase = newPhase; 474 paintInfoForChild.phase = newPhase;
475 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock); 475 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock);
476 m_layoutBlock.paintChildren(paintInfoForChild, paintOffset); 476 m_layoutBlock.paintChildren(paintInfoForChild, paintOffset);
477 } 477 }
478 } 478 }
479 479
480 void BlockPainter::paintContinuationOutlines(const PaintInfo& info, const Layout Point& paintOffset) 480 void BlockPainter::paintContinuationOutlines(const PaintInfo& info, const Layout Point& paintOffset)
481 { 481 {
482 LayoutInline* inlineCont = m_layoutBlock.inlineElementContinuation(); 482 LayoutInline* inlineCont = m_layoutBlock.inlineElementContinuation();
483 if (inlineCont && inlineCont->style()->hasOutline() && inlineCont->style()-> visibility() == VISIBLE) { 483 if (inlineCont && inlineCont->style()->hasOutline() && inlineCont->style()-> visibility() == VISIBLE) {
484 LayoutInline* inlineRenderer = toLayoutInline(inlineCont->node()->render er()); 484 LayoutInline* inlineRenderer = toLayoutInline(inlineCont->node()->layout Object());
485 LayoutBlock* cb = m_layoutBlock.containingBlock(); 485 LayoutBlock* cb = m_layoutBlock.containingBlock();
486 486
487 bool inlineEnclosedInSelfPaintingLayer = false; 487 bool inlineEnclosedInSelfPaintingLayer = false;
488 for (LayoutBoxModelObject* box = inlineRenderer; box != cb; box = box->p arent()->enclosingBoxModelObject()) { 488 for (LayoutBoxModelObject* box = inlineRenderer; box != cb; box = box->p arent()->enclosingBoxModelObject()) {
489 if (box->hasSelfPaintingLayer()) { 489 if (box->hasSelfPaintingLayer()) {
490 inlineEnclosedInSelfPaintingLayer = true; 490 inlineEnclosedInSelfPaintingLayer = true;
491 break; 491 break;
492 } 492 }
493 } 493 }
494 494
(...skipping 23 matching lines...) Expand all
518 LayoutBlock* block = flow->containingBlock(); 518 LayoutBlock* block = flow->containingBlock();
519 for ( ; block && block != &m_layoutBlock; block = block->containingBlock ()) 519 for ( ; block && block != &m_layoutBlock; block = block->containingBlock ())
520 accumulatedPaintOffset.moveBy(block->location()); 520 accumulatedPaintOffset.moveBy(block->location());
521 ASSERT(block); 521 ASSERT(block);
522 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); 522 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset);
523 } 523 }
524 } 524 }
525 525
526 526
527 } // namespace blink 527 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/BlockFlowPainter.cpp ('k') | Source/core/paint/BoxPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698