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

Side by Side 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: update comment Created 7 years, 3 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/RenderBlock.h ('k') | Source/core/rendering/RenderFlexibleBox.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 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 3091 matching lines...) Expand 10 before | Expand all | Expand 10 after
3102 paintChild(child, paintInfo, paintOffset); 3102 paintChild(child, paintInfo, paintOffset);
3103 } 3103 }
3104 3104
3105 void RenderBlock::paintChild(RenderBox* child, PaintInfo& paintInfo, const Layou tPoint& paintOffset) 3105 void RenderBlock::paintChild(RenderBox* child, PaintInfo& paintInfo, const Layou tPoint& paintOffset)
3106 { 3106 {
3107 LayoutPoint childPoint = flipForWritingModeForChild(child, paintOffset); 3107 LayoutPoint childPoint = flipForWritingModeForChild(child, paintOffset);
3108 if (!child->hasSelfPaintingLayer() && !child->isFloating()) 3108 if (!child->hasSelfPaintingLayer() && !child->isFloating())
3109 child->paint(paintInfo, childPoint); 3109 child->paint(paintInfo, childPoint);
3110 } 3110 }
3111 3111
3112 void RenderBlock::paintChildAsInlineBlock(RenderBox* child, PaintInfo& paintInfo , const LayoutPoint& paintOffset)
3113 {
3114 LayoutPoint childPoint = flipForWritingModeForChild(child, paintOffset);
3115 if (!child->hasSelfPaintingLayer() && !child->isFloating())
3116 paintAsInlineBlock(child, paintInfo, childPoint);
3117 }
3118
3119 void RenderBlock::paintAsInlineBlock(RenderObject* renderer, PaintInfo& paintInf o, const LayoutPoint& childPoint)
3120 {
3121 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Selection)
3122 return;
3123
3124 // Paint all phases atomically, as though the element established its own
3125 // stacking context. (See Appendix E.2, section 7.2.1.4 on
3126 // inline block/table/replaced elements in the CSS2.1 specification.)
3127 // This is also used by other elements (e.g. flex items and grid items).
3128 bool preservePhase = paintInfo.phase == PaintPhaseSelection || paintInfo.pha se == PaintPhaseTextClip;
3129 PaintInfo info(paintInfo);
3130 info.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
3131 renderer->paint(info, childPoint);
3132 if (!preservePhase) {
3133 info.phase = PaintPhaseChildBlockBackgrounds;
3134 renderer->paint(info, childPoint);
3135 info.phase = PaintPhaseFloat;
3136 renderer->paint(info, childPoint);
3137 info.phase = PaintPhaseForeground;
3138 renderer->paint(info, childPoint);
3139 info.phase = PaintPhaseOutline;
3140 renderer->paint(info, childPoint);
3141 }
3142 }
3143
3112 bool RenderBlock::hasCaret(CaretType type) const 3144 bool RenderBlock::hasCaret(CaretType type) const
3113 { 3145 {
3114 // Paint the caret if the FrameSelection says so or if caret browsing is ena bled 3146 // Paint the caret if the FrameSelection says so or if caret browsing is ena bled
3115 bool caretBrowsing = frame()->settings() && frame()->settings()->caretBrowsi ngEnabled(); 3147 bool caretBrowsing = frame()->settings() && frame()->settings()->caretBrowsi ngEnabled();
3116 RenderObject* caretPainter; 3148 RenderObject* caretPainter;
3117 bool isContentEditable; 3149 bool isContentEditable;
3118 if (type == CursorCaret) { 3150 if (type == CursorCaret) {
3119 caretPainter = frame()->selection()->caretRenderer(); 3151 caretPainter = frame()->selection()->caretRenderer();
3120 isContentEditable = frame()->selection()->rendererIsEditable(); 3152 isContentEditable = frame()->selection()->rendererIsEditable();
3121 } else { 3153 } else {
(...skipping 4855 matching lines...) Expand 10 before | Expand all | Expand 10 after
7977 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 8009 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
7978 { 8010 {
7979 showRenderObject(); 8011 showRenderObject();
7980 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 8012 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
7981 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 8013 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
7982 } 8014 }
7983 8015
7984 #endif 8016 #endif
7985 8017
7986 } // namespace WebCore 8018 } // namespace WebCore
OLDNEW
« 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