Chromium Code Reviews| Index: Source/core/rendering/RenderBlock.cpp |
| diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp |
| index 12adb978621ab50c1bb6014d33240d4d381e6946..d69792a4bb89ee35213483bfdd03ebf70cd8ab6f 100644 |
| --- a/Source/core/rendering/RenderBlock.cpp |
| +++ b/Source/core/rendering/RenderBlock.cpp |
| @@ -3109,6 +3109,37 @@ void RenderBlock::paintChild(RenderBox* child, PaintInfo& paintInfo, const Layou |
| child->paint(paintInfo, childPoint); |
| } |
| +void RenderBlock::paintChildAsInlineBlock(RenderBox* child, PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
| +{ |
| + LayoutPoint childPoint = flipForWritingModeForChild(child, paintOffset); |
| + if (!child->hasSelfPaintingLayer() && !child->isFloating()) |
| + paintAsInlineBlock(child, paintInfo, childPoint); |
| +} |
| + |
| +void RenderBlock::paintAsInlineBlock(RenderObject* renderer, PaintInfo& paintInfo, const LayoutPoint& childPoint) |
| +{ |
| + if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection) |
| + return; |
| + |
| + // Paint all phases of replaced elements atomically, as though the replaced element established its |
|
ojan
2013/08/29 23:46:05
Not sure this comment is still right...it's not ju
cbiesinger
2013/08/30 17:33:50
Updated this comment. I also added a comment to th
|
| + // own stacking context. (See Appendix E.2, section 6.4 on inline block/table elements in the CSS2.1 |
| + // specification.) |
| + bool preservePhase = paintInfo.phase == PaintPhaseSelection || paintInfo.phase == PaintPhaseTextClip; |
| + PaintInfo info(paintInfo); |
| + info.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground; |
| + renderer->paint(info, childPoint); |
| + if (!preservePhase) { |
| + info.phase = PaintPhaseChildBlockBackgrounds; |
| + renderer->paint(info, childPoint); |
| + info.phase = PaintPhaseFloat; |
| + renderer->paint(info, childPoint); |
| + info.phase = PaintPhaseForeground; |
| + renderer->paint(info, childPoint); |
| + info.phase = PaintPhaseOutline; |
| + renderer->paint(info, childPoint); |
| + } |
| +} |
| + |
| bool RenderBlock::hasCaret(CaretType type) const |
| { |
| // Paint the caret if the FrameSelection says so or if caret browsing is enabled |