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

Unified Diff: Source/core/rendering/RenderBlock.cpp

Issue 23737004: Paint flex items atomically, like inline-blocks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderFlexibleBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderFlexibleBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698